//coil.geo
//++++++++
//jk 20 jan 04
//Spiral-shaped coil

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//								+
//Parameters                                                    +
//++++++++++                                                    +
 mm=0.001;                                                    //+
 lc = 1*mm;                         //Characteristic length     +
 rsp=10*mm;                         //Radius of spiral          +
 rtub=2*mm;	                    //Radius of tube            +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//Define circle to be extruded

Point(1) = {rsp         , 0	,  0, lc} ;   //center of circle
Point(2) = {rsp+rtub	, 0	,  0, lc} ;
Point(3) = {rsp		, rtub	,  0, lc} ;
Point(4) = {rsp-rtub	,  0	,  0, lc} ;
Point(5) = {rsp		,-rtub	,  0, lc} ;
Circle(1) = {4,1,3};			      //4 arcs
Circle(2) = {3,1,2};
Circle(3) = {2,1,5};
Circle(4) = {5,1,4};

Line Loop(5) = {3,4,1,2};
Plane Surface(6) = {5};

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

//Extrude Surface {6, {0.0,0.0,0.001}, {0,1,0}, {0,0,0}, Pi/8};  //THIS GOES WRONG

Geometry.ExtrudeSplinePoints = 10;
Extrude Surface {6, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG
Extrude Surface {28, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG
Extrude Surface {50, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG
Extrude Surface {72, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG
Extrude Surface {94, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG
Extrude Surface {116, {0.0,0.002,0.0}, {0,1,0}, {0,0,0}, -Pi/2};  //THIS GOES WRONG


