[Gmsh] Problem: extrusion with rotation

Robert Funnell robert.funnell at mcgill.ca
Sat Dec 27 17:38:34 CET 2008


I am trying to create a geometry corresponding to a cylinder which has 
a bend. As shown in the Gmsh code appended below, I am using an 
extrusion with translation, a 2nd extrusion with translation + 
rotation, and a 3rd extrusion with just translation.

The 2nd extrusion begins from the end of the 1st extrusion, as 
intended. However, the final circular surface of the 2nd extrusion 
isn't located at the end of the extrusion, but rather is offset in the 
y and z directions, so the 3rd extrusion doesn't start in the right 
place. (The effect can be seen in the screenshot at 
http://audilab.bmed.mcgill.ca/~funnell/gmsh_bad_extrude.png .)

If I do either translation or rotation alone in the 2nd extrusion, I 
get the results that I expect.

Could someone please explain what I'm doing wrong here?

Thank you.

- Robert

---------------------------------------------

charLen = 0.1;
Point(1) = {0,0,0,charLen};

Point(2) = {1,0,0,charLen};
Point(3) = {0,1,0,charLen};
Point(4) = {-1,0,0,charLen};
Point(5) = {0,-1,0,charLen};

Circle(1) = {2,1,3};
Circle(2) = {3,1,4};
Circle(3) = {4,1,5};
Circle(4) = {5,1,2};

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

extr1[] = Extrude {0,0,20} {
   Surface{6};
};
extr2[] = Extrude { {0,0,5}, {1,0,0} , {0,-1,20} , -Pi/2 } {
   Surface{extr1[0]};
};
Extrude {0,10,0} {
   Surface{extr2[0]};
};