mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-12 00:29:17 +05:00
29 lines
518 B
Python
29 lines
518 B
Python
# Construction of a Mesh
|
|
|
|
import geompy
|
|
import smesh
|
|
|
|
# create a box
|
|
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
|
|
idbox = geompy.addToStudy(box, "box")
|
|
|
|
# create a mesh
|
|
tetra = smesh.Mesh(box, "MeshBox")
|
|
|
|
algo1D = tetra.Segment()
|
|
algo1D.NumberOfSegments(7)
|
|
|
|
algo2D = tetra.Triangle()
|
|
algo2D.MaxElementArea(800.)
|
|
|
|
algo3D = tetra.Tetrahedron()
|
|
algo3D.MaxElementVolume(900.)
|
|
|
|
# compute the mesh
|
|
ret = tetra.Compute()
|
|
if ret == 0:
|
|
print "problem when computing the mesh"
|
|
else:
|
|
print "mesh computed"
|
|
pass
|