mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-13 17:48:34 +05:00
32 lines
491 B
Python
32 lines
491 B
Python
|
import sys
|
||
|
sys.path.append("/opt/netgen/lib")
|
||
|
|
||
|
from libmesh.meshing import *
|
||
|
from libcsg.csg import *
|
||
|
|
||
|
|
||
|
geo = CSGeometry("shaft.geo")
|
||
|
geo.ntlo
|
||
|
|
||
|
|
||
|
param = MeshingParameters()
|
||
|
m1 = GenerateMesh (geo, param)
|
||
|
|
||
|
els = [ i for i in m1.Elements3D() ]
|
||
|
for i in els:
|
||
|
print (i.vertices)
|
||
|
|
||
|
m1.Save("pymesh.vol")
|
||
|
|
||
|
# mesh = Mesh()
|
||
|
# mesh.Load ("shaft.vol.gz")
|
||
|
# els = mesh.Elements3D()
|
||
|
|
||
|
|
||
|
#cnt = 0
|
||
|
# for el in mesh.Elements3D():
|
||
|
# print ("el ", cnt, " has vertices " , el.vertices)
|
||
|
# cnt = cnt+1
|
||
|
|
||
|
|