[Gmsh] Problem: extrusion with rotation

Christophe Geuzaine cgeuzaine at ulg.ac.be
Sun Dec 28 12:01:10 CET 2008


Robert Funnell wrote:
> 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?
> 

Your rotation looks weird. Here's an example:

charLen = 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 { {1,0,0}, // direction of rotation axis
                     {0,2,20}, // a point on the rotation axis
                     -Pi/2 } { // the rotation angle
    Surface{extr1[0]};
};
Extrude {0,10,0} {
   Surface{extr2[0]};
}




-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine