[Gmsh] Extrude { extrude-list } Using Wire { expression-list }

Daniel Steinegger daniel.steinegger at students.fhnw.ch
Sun Jun 4 15:45:26 CEST 2017


Hello I'm Daniel an i have the Problem that i wand Extrude a Surface
along a Spline and i don't Know how to manage that. I use the command
Extrude { extrude-list } Using Wire { expression-list } and i get
always a Syntax error. Do you have any example for it ? 

A example code is attached

best regards
Daniel Steinegger
-------------- next part --------------
ID=0.061; //Innendurchmesser
H=0.0105; //Ringhoehe
W=0.0127; //Ringbreite
N=68; //Anzahl Windungen
DD=0.0015; //Drahtdurchmesser


// **** Restliche Parameter *****

PI=3.14159265358979323846264338327950288419716939937;

RI=(ID+DD)/2; 		//Innenradius
RA=(ID+2*H-DD)/2;	//Aussenradius
RK=(W-DD)/2;		//Radius kleiner Kreis
PHASE=-PI/2;		//Pahsenverschiebung
RM=((RA^2+RI^2-2*RK^2)/2)^(0.5); //Mittelradius
PHI=-Acos((RM^2+RK^2-RI^2)/(2*RM*RK));

S=9; //Auflösung

mashLine=0.0001;
mashFace=0.0001;

// **** Beginn Programm ****

// **** Rotations Winkel ****
STEP=30;

OMEGA=S*PI*STEP/180;

x=RM*Cos(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Cos(PHI+OMEGA/N);
y=RM*Sin(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Sin(PHI+OMEGA/N);
z=-RK*Sin(OMEGA-PHASE);

alpha=Atan(-y/x);


//Printf(%f,alpha);


// **** Punkte Berechnen ****


PointList[]={};
For i In {0:360/S:1}
STEP=i;

OMEGA=S*PI*STEP/180;

x=RM*Cos(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Cos(PHI+OMEGA/N);
y=RM*Sin(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Sin(PHI+OMEGA/N);
z=-RK*Sin(OMEGA-PHASE);

x2=x*Cos(alpha) - y*Sin(alpha);
y2=x*Sin(alpha) + y*Cos(alpha);

Point(i) = {x2, y2, z, mashLine};
PointList[]+=i;
EndFor

// **** Spline erstellen ***
Spline(1)=PointList[];



// **** Normalenvektor ****
OMEGA =0;
RVX=-RM*Sin(OMEGA/N)*1/N-RK*Sin(OMEGA-PHASE)*Cos(PHI+OMEGA/N)-RK*Cos(OMEGA-PHASE)*Sin(PHI+OMEGA/N)*1/N;
RVY= RM*Cos(OMEGA/N)*1/N-RK*Sin(OMEGA-PHASE)*Sin(PHI+OMEGA/N)+RK*Cos(OMEGA-PHASE)*Cos(PHI+OMEGA/N)*1/N;
RVZ= -RK*Cos(OMEGA-PHASE);

NORM=Sqrt(RVX^2+RVY^2+RVZ^2);


x1=RVX/NORM*Cos(alpha) - RVY/NORM*Sin(alpha);
y1=RVX/NORM*Sin(alpha) + RVY/NORM*Cos(alpha);
z1=RVZ/NORM;

x=RM*Cos(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Cos(PHI+OMEGA/N);
y=RM*Sin(OMEGA/N)+RK*Cos(OMEGA-PHASE)*Sin(PHI+OMEGA/N);
z=-RK*Sin(OMEGA-PHASE);

x2=x*Cos(alpha) - y*Sin(alpha);
y2=x*Sin(alpha) + y*Cos(alpha);
z2=z;

d=x1*x2+y1*y2+z1*z2;

z3=z2;
x3=(x2+DD/2*y1);
y3=(d-x3*x1-z1*z3)/y1;

length=Sqrt((x3-x2)^2+(y3-y2)^2);

Point(1001) = {x3, y3, z3, mashFace};

d=x1*x2+y1*y2+z1*z2;

z3=z2;
x3=(x2-DD/2*y1);
y3=(d-x3*x1-z1*z3)/y1;

length=Sqrt((x3-x2)^2+(y3-y2)^2);
//Printf("%f",length);

Point(1002) = {x3, y3, z3, mashFace};

d=x1*x2+y1*y2+z1*z2;

Point(1003) = {x2, y2, z2+DD/2, mashFace};
Point(1004) = {x2, y2, z2-DD/2, mashFace};

Circle(2) = {1001, 0, 1003};
Circle(3) = {1003, 0, 1002};
Circle(4) = {1002, 0, 1004};
Circle(5) = {1004, 0, 1001};

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

//Extrude {Surface{7};Layers{90};Recombine;} Using Wire {1};

Extrude {Surface{7};} Using Wire {1};


//Physical Line("lines")=LineList[];
//Physical Point("boundary")={5};
//Physical Point("load")={15};
//Physical Point("startP")={0};
//Physical Point("endP")={20};






More information about the gmsh mailing list