[Gmsh] About Extruted

Eiser, Sebastian sebastian.eiser at k-ai.at
Tue Nov 20 09:29:24 CET 2012


I had to do that for myself the other day. Maybe not the best approach but it seems to work

Point(1) = { 0, 0, 0};
Point(2) = {10, 0, 0};

Line(1)  = {1, 2};
Transfinite Line(1) = 11;

surf[] = Extrude {0,10,0} { Line{1}; Layers{10}; };
vol[] = Extrude {0,0,10} { Surface{surf[1]}; Layers{10}; };

// added code
allLines[] = {};
For k In {0:#vol[]-1} // index 0 contains head surface, index 1 contains volume number, then the remaining surfs
      If (k != 1) // ignore volume number
            allLines[] += Boundary{ Surface{ vol[k]}; }; // add lines of surface to list
      EndIf
EndFor

pts[] = Boundary{ Line{ allLines[]}; }; // now contains corner points multiple times

unique[] = {};
For i In {0:#pts[]-1}
      found=0;
      For l In {0:#unique[]-1} // check if already on list
            If (pts[i] == unique[l])
                  found=1;
            EndIf
      EndFor
      If ( !found )
            Printf("Corner detected %g", pts[i]);
            unique[] += pts[i];
      EndIf
EndFor

Hope this helps,
-S

From: gmsh-bounces at ace20.montefiore.ulg.ac.be [mailto:gmsh-bounces at ace20.montefiore.ulg.ac.be] On Behalf Of Michel Dupront
Sent: Saturday, November 17, 2012 6:21 PM
To: gmsh at geuz.org
Subject: [Gmsh] About Extruted


Hello,

I am building a cube using the "Extrute" command as
shown in the piece of code that follows:

        Point(1) = { 0, 0, 0};
        Point(2) = {10, 0, 0};

        Line(1)  = {1, 2};
        Transfinite Line(1) = 11;

        surf[] = Extrude {0,10,0} { Line{1}; Layers{10}; };
        vol [] = Extrude {0,0,10} { Surface{surf[1]}; Layers{10}; };

The construction starts with the two vertices of index 1 and 2.
Is there a way to get the indices of the other 6 vertices  ?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20121120/8e7c401a/attachment.html>