6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh
import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
12 import salome_notebook
14 from SMESH_mechanic
import mesh
as mesh1
15 from SMESH_test1
import mesh
as mesh2
21 smesh.MinDistance(mesh1)
24 smesh.MinDistance(mesh1, id1=10)
29 smesh.MinDistance(mesh1, id1=10, id2=20)
31 mesh1.MinDistance(10, 20)
34 smesh.MinDistance(mesh1, id1=100, isElem1=
True)
36 mesh1.MinDistance(100, isElem1=
True)
39 smesh.MinDistance(mesh1, id1=100, id2=200, isElem1=
True, isElem2=
True)
41 mesh1.MinDistance(100, 200,
True,
True)
44 smesh.MinDistance(mesh1, id1=100, id2=20, isElem1=
True)
46 mesh1.MinDistance(100, 20,
True)
49 smesh.MinDistance(mesh1, mesh2)
52 smesh.MinDistance(mesh1, mesh2, 10, 20)
55 smesh.MinDistance(mesh1, mesh2, 10, 200, isElem2=
True)
7 from salome.geom
import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
10 import SMESH, SALOMEDS
11 from salome.smesh
import smeshBuilder
12 smesh = smeshBuilder.New(salome.myStudy)
13 import salome_notebook
15 from SMESH_mechanic
import mesh
as mesh1
16 from SMESH_test1
import mesh
as mesh2
25 mesh1.BoundingBox([363, 364, 370, 371, 372, 373, 379, 380, 381])
28 mesh1.BoundingBox([363, 364, 370, 371, 372, 373, 379, 380, 381], isElem=
True)
31 smesh.BoundingBox([mesh1, mesh2])
7 from salome.geom
import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
10 import SMESH, SALOMEDS
11 from salome.smesh
import smeshBuilder
12 smesh = smeshBuilder.New(salome.myStudy)
15 box = geompy.MakeBoxDXDYDZ(100,100,100)
16 face = geompy.SubShapeAllSorted(box, geompy.ShapeType[
'FACE'])[0]
19 mesh = smesh.Mesh(box)
21 submesh_2d = mesh.Quadrangle()
22 submesh_3d = mesh.Hexahedron()
23 submesh_2d_face = mesh.Triangle(face)
28 group_2d = mesh.Group(face)
32 print "Get basic properties: approach 1 (via measurements tool) ----"
34 measure = smesh.CreateMeasurements()
37 print " length:", measure.Length(mesh.mesh)
38 print " area:", measure.Area(mesh.mesh)
39 print " volume:", measure.Volume(mesh.mesh)
41 print "* for group (2d):"
42 print " length:", measure.Length(group_2d)
43 print " area:", measure.Area(group_2d)
44 print " volume:", measure.Volume(group_2d)
46 print "* for submesh (2d):"
47 print " length:", measure.Length(submesh_2d_face.GetSubMesh())
48 print " area:", measure.Area(submesh_2d_face.GetSubMesh())
49 print " volume:", measure.Volume(submesh_2d_face.GetSubMesh())
53 print "Get basic properties: approach 2 (via smeshBuilder) ----"
56 print " length:", smesh.GetLength(mesh)
57 print " area:", smesh.GetArea(mesh)
58 print " volume:", smesh.GetVolume(mesh)
60 print "* for group (2d):"
61 print " length:", smesh.GetLength(group_2d)
62 print " area:", smesh.GetArea(group_2d)
63 print " volume:", smesh.GetVolume(group_2d)
65 print "* for submesh (2d):"
66 print " length:", smesh.GetLength(submesh_2d_face)
67 print " area:", smesh.GetArea(submesh_2d_face)
68 print " volume:", smesh.GetVolume(submesh_2d_face)
70 print "Get basic properties: approach 3 (via smeshBuilder.Mesh) ----"
73 print " length:", mesh.GetLength()
74 print " area:", mesh.GetArea()
75 print " volume:", mesh.GetVolume()
77 print "* for group (2d): unsupported"
79 print "* for submesh (2d): unsupported"