[Gmsh] Proper way to make a volume from a line-loop

Christophe Geuzaine cgeuzaine at ulg.ac.be
Fri Aug 19 18:40:11 CEST 2016


> On 10 Aug 2016, at 23:24, Brian Drawert <brian at drawert.net> wrote:
> 
> Hi all,
> I am having trouble with something that is probably quite simple.  I hope this community can help.  I have a 1D shape, and I need to rotate it to make a 3D volume. I start by defining the points along the arc, connect them with their mirror image across the y/z=0 axis, then extrude by rotating.  This gives me the proper shape, but not a volume mesh.  Can anyone help?
> 

The volume generated this way is "twisted" - extrude e.g. with an angle < Pi to see what I mean.

You should build half the surface, and extrude that. Beware that you should extrude by angles < Pi. This gives e.g.

p1 = newp;
Point(p1) = {0, 0, 0, 0.05};
p2 = newp;
Point(p2) = {0.25, 0.5, 0, 0.05};
p3 = newp;
Point(p3) = {0.5, 0.75, 0, 0.05};
p4 = newp;
Point(p4) = {1, 1, 0, 0.05};
p5 = newp;
Point(p5) = {2, 1, 0, 0.05};
p6 = newp;
Point(p6) = {2, 0, 0, 0.05};
l1 = newl;
Line(l1) = {p1, p2};
l2 = newl;
Line(l2) = {p2, p3};
l3 = newl;
Line(l3) = {p3, p4};
l4 = newl;
Line(l4) = {p4, p5};
l5 = newl;
Line(l5) = {p5, p6};
l6 = newl;
Line(l6) = {p1, p6};
ll7 = newll;
Line Loop(ll7) = {l2, l3, l4, l5, -l6, l1};
s1 = news;
Plane Surface(s1) = {ll7};
ex1[] = Extrude{{1,0,0}, {0,0,0}, 2*Pi/3}{Surface{s1};};
ex2[] = Extrude{{1,0,0}, {0,0,0}, 2*Pi/3}{Surface{ex1[0]};};
ex3[] = Extrude{{1,0,0}, {0,0,0}, 2*Pi/3}{Surface{ex2[0]};};




> Thanks in advance!
> Brian
> 
> 
> // Gmsh code here:
> p1 = newp;
> Point(p1) = {0, 0, 0, 0.05};
> p2 = newp;
> Point(p2) = {0.25, 0.5, 0, 0.05};
> p3 = newp;
> Point(p3) = {0.5, 0.75, 0, 0.05};
> p4 = newp;
> Point(p4) = {1, 1, 0, 0.05};
> p5 = newp;
> Point(p5) = {2, 1, 0, 0.05};
> p6 = newp;
> Point(p6) = {2, 0, 0, 0.05};
> p7 = newp;
> Point(p7) = {2, -1, 0, 0.05};
> p8 = newp;
> Point(p8) = {1, -1, 0, 0.05};
> p9 = newp;
> Point(p9) = {0.5, -0.75, 0, 0.05};
> p10 = newp;
> Point(p10) = {0.25, -0.5, 0, 0.05};
> l1 = newl;
> Line(l1) = {p1, p2};
> l2 = newl;
> Line(l2) = {p2, p3};
> l3 = newl;
> Line(l3) = {p3, p4};
> l4 = newl;
> Line(l4) = {p4, p5};
> l5 = newl;
> Line(l5) = {p5, p6};
> l6 = newl;
> Line(l6) = {p6, p7};
> l7 = newl;
> Line(l7) = {p7, p8};
> l8 = newl;
> Line(l8) = {p8, p9};
> l9 = newl;
> Line(l9) = {p9, p10};
> l10 = newl;
> Line(l10) = {p10, p1};
> ll1 = newll;
> Line Loop(ll1) = {l1,l2,l3,l4,l5,l6,l7,l8,l9,l10};
> surf1 = news;
> Plane Surface(surf1) = {ll1};
> ex1[] = Extrude{{0,0,0}, {1,0,0}, {0,0,0}, Pi}{Surface{surf1};};
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

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

Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info




More information about the gmsh mailing list