2013-02-12 20:37:44 +06:00
|
|
|
# Maximum Element Area
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a face
|
|
|
|
px = geompy.MakeVertex(100., 0. , 0. )
|
|
|
|
py = geompy.MakeVertex(0. , 100., 0. )
|
|
|
|
pz = geompy.MakeVertex(0. , 0. , 100.)
|
|
|
|
|
|
|
|
vxy = geompy.MakeVector(px, py)
|
|
|
|
arc = geompy.MakeArc(py, pz, px)
|
|
|
|
wire = geompy.MakeWire([vxy, arc])
|
|
|
|
|
|
|
|
isPlanarFace = 1
|
|
|
|
face = geompy.MakeFace(wire, isPlanarFace)
|
|
|
|
|
|
|
|
# add the face in the study
|
|
|
|
id_face = geompy.addToStudy(face, "Face to be meshed")
|
|
|
|
|
|
|
|
# create a mesh
|
|
|
|
tria_mesh = smesh.Mesh(face, "Face : triangulation")
|
|
|
|
|
|
|
|
# define 1D meshing:
|
|
|
|
algo = tria_mesh.Segment()
|
|
|
|
algo.NumberOfSegments(20)
|
|
|
|
|
|
|
|
# define 2D meshing:
|
|
|
|
|
|
|
|
# assign triangulation algorithm
|
|
|
|
algo = tria_mesh.Triangle()
|
|
|
|
|
2016-03-17 23:47:21 +05:00
|
|
|
# assign "Max Element Area" hypothesis
|
2013-02-12 20:37:44 +06:00
|
|
|
algo.MaxElementArea(100)
|
|
|
|
|
|
|
|
# compute the mesh
|
|
|
|
tria_mesh.Compute()
|