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: [email protected]
[mailto:[email protected]] On Behalf Of Michel Dupront
Sent: Saturday, November 17, 2012 6:21 PM
To: [email protected]
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
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh