3 from salome.geom import geomBuilder
4 geompy = geomBuilder.New(salome.myStudy)
5 from salome.smesh import smeshBuilder
6 smesh = smeshBuilder.New(salome.myStudy)
9 box = geompy.MakeBoxDXDYDZ( 100, 100, 100 )
10 tool = geompy.MakeTranslation( box, 50, 0, 10 )
11 axis = geompy.MakeVector( geompy.MakeVertex( 100, 0, 100 ),geompy.MakeVertex( 100, 10, 100 ),)
12 tool = geompy.Rotate( tool, axis, math.pi * 25 / 180. )
13 shape = geompy.MakeCut( box, tool )
14 cyl = geompy.MakeCylinder( geompy.MakeVertex( -10,5, 95 ), geompy.MakeVectorDXDYDZ(1,0,0), 2, 90)
15 shape = geompy.MakeCut( shape, cyl )
16 tool = geompy.MakeBoxTwoPnt( geompy.MakeVertex( -10, 2, 15 ), geompy.MakeVertex( 90, 5, 16 ))
17 shape = geompy.MakeCut( shape, tool, theName="shape" )
19 # Parameters of Adaptive hypothesis. minSize and maxSize are such that they do not limit
20 # size of segments because size of geometrical features lies within [2.-100.] range, hence
21 # size of segments is defined by deflection parameter and size of geometrical features only.
26 mesh = smesh.Mesh( shape )
27 mesh.Segment().Adaptive( minSize, maxSize, deflection )
28 mesh.Triangle().MaxElementArea( 300 )