6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p0 = geompy.MakeVertex( 0., 0., 0.)
12 p200 = geompy.MakeVertex(200., 200., 200.)
13 pz = geompy.MakeVertex( 0., 0., 100.)
16 vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.)
19 box = geompy.MakeBoxTwoPnt(p0, p200)
23 plane = geompy.MakePlane(pz, vxyz, trimsize)
26 partition = geompy.MakePartition([box], [plane])
29 id_box = geompy.addToStudy(box,
"Box")
30 id_plane = geompy.addToStudy(plane,
"Plane")
31 id_partition = geompy.addToStudy(partition,
"Partition")
34 gg.createAndDisplayGO(id_box)
35 gg.setDisplayMode(id_box,1)
36 gg.createAndDisplayGO(id_plane)
37 gg.setDisplayMode(id_plane,1)
38 gg.createAndDisplayGO(id_partition)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p0 = geompy.MakeVertex( 0., 0., 0.)
12 p200 = geompy.MakeVertex(200., 200., 200.)
15 box = geompy.MakeBoxTwoPnt(p0, p200)
20 meshingdeflection = 0.01
21 archimede = geompy.Archimede(box, weight, waterdensity, meshingdeflection)
24 id_box = geompy.addToStudy(box,
"Box")
25 id_archimede = geompy.addToStudy(archimede,
"Archimede")
28 gg.createAndDisplayGO(id_box)
29 gg.setDisplayMode(id_box,1)
30 gg.createAndDisplayGO(id_archimede)
31 gg.setDisplayMode(id_archimede,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
11 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
12 cyl = geompy.MakeCylinderRH(100, 300)
15 vec = geompy.MakeVectorDXDYDZ(100, 50, 0)
16 tra = geompy.MakeTranslationVector(box, vec)
19 partition1 = geompy.MakePartition([box, cyl])
20 partition2 = geompy.MakePartition([box], [cyl])
21 partition3 = geompy.MakePartition([box], [tra])
24 box.SetColor(SALOMEDS.Color(1,0,0))
25 cyl.SetColor(SALOMEDS.Color(0,1,0))
28 geompy.addToStudy(box,
"Box")
29 geompy.addToStudy(cyl,
"Cylinder")
30 geompy.addToStudy(vec,
"Vector")
31 geompy.addToStudy(tra,
"Translation")
32 geompy.addToStudy(partition1,
"Partition_1")
33 geompy.addToStudy(partition2,
"Partition_2")
34 geompy.addToStudy(partition3,
"Partition_3")
40 geompy.RestoreSubShapes(partition1)
42 geompy.RestoreSubShapes(partition2, [], GEOM.FSM_GetInPlace)
46 geompy.RestoreSubShapes(partition3, [tra], GEOM.FSM_GetInPlaceByHistory)
53 geompy.RestoreSubShapes(tra, [], GEOM.FSM_Transformed,
True)
56 partition4 = geompy.MakePartition([box, tra])
57 geompy.addToStudy(partition4,
"Partition_4",
True, [],
58 GEOM.FSM_GetInPlaceByHistory,
False)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
11 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
12 p = geompy.MakeVertex(100, 100, 100)
13 v1 = geompy.MakeVectorDXDYDZ(1, 1, 0)
14 v2 = geompy.MakeVectorDXDYDZ(1, -1, 0)
15 pln1 = geompy.MakePlane(p, v1, 2000)
16 pln2 = geompy.MakePlane(p, v2, 2000)
17 partition = geompy.MakePartition([box], [pln1, pln2])
20 solids = geompy.SubShapeAllSorted(partition, geompy.ShapeType[
'SOLID'])
24 pF_T = geompy.GetSharedShapesMulti(partition, geompy.ShapeType[
'FACE'])
26 pF_F = geompy.GetSharedShapesMulti(partition, geompy.ShapeType[
'FACE'],
False)
28 pE_T = geompy.GetSharedShapesMulti(partition, geompy.ShapeType[
'EDGE'])
30 pE_F = geompy.GetSharedShapesMulti(partition, geompy.ShapeType[
'EDGE'],
False)
34 sF_T = geompy.GetSharedShapesMulti(solids, geompy.ShapeType[
'FACE'])
36 sF_F = geompy.GetSharedShapesMulti(solids, geompy.ShapeType[
'FACE'],
False)
38 sE_T = geompy.GetSharedShapesMulti(solids, geompy.ShapeType[
'EDGE'])
40 sE_F = geompy.GetSharedShapesMulti(solids, geompy.ShapeType[
'EDGE'],
False)