6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p0 = geompy.MakeVertex(15, 25, 35)
12 p70 = geompy.MakeVertex(70, 70, 70)
15 box1 = geompy.MakeBoxDXDYDZ(10, 20, 30)
16 box2 = geompy.MakeBox(10,20,30, 15,25,35)
17 box3 = geompy.MakeBoxTwoPnt(p0, p70)
20 id_box1 = geompy.addToStudy(box1,
"Box1")
21 id_box2 = geompy.addToStudy(box2,
"Box2")
22 id_box3 = geompy.addToStudy(box3,
"Box3")
25 gg.createAndDisplayGO(id_box1)
26 gg.setDisplayMode(id_box1,1)
27 gg.createAndDisplayGO(id_box2)
28 gg.setDisplayMode(id_box2,1)
29 gg.createAndDisplayGO(id_box3)
30 gg.setDisplayMode(id_box3,1)
8 from salome.geom
import geomBuilder
9 geompy = geomBuilder.New(salome.myStudy)
11 gg = salome.ImportComponentGUI(
"GEOM")
14 p1 = geompy.MakeVertex(25, 35, 45)
15 p2 = geompy.MakeVertex(70, 70, 70)
16 v = geompy.MakeVector(p1, p2)
22 angle1 = 45. * math.pi / 180.
23 angle2 = 210. * math.pi / 180.
25 cylinder1 = geompy.MakeCylinder(p1, v, radius1, height)
27 cylinder2 = geompy.MakeCylinderRH(radius2, height)
29 cylinder3 = geompy.MakeCylinderA(p1, v, radius1, height, angle1)
30 geompy.TranslateDXDYDZ(cylinder3, 80., 0., 0.)
32 cylinder4 = geompy.MakeCylinderRHA(radius2, height, angle2)
33 geompy.TranslateDXDYDZ(cylinder4, 80., 0., 0.)
36 id_cylinder1 = geompy.addToStudy(cylinder1,
"Cylinder1")
37 id_cylinder2 = geompy.addToStudy(cylinder2,
"Cylinder2")
38 id_cylinder3 = geompy.addToStudy(cylinder3,
"Cylinder3")
39 id_cylinder4 = geompy.addToStudy(cylinder4,
"Cylinder4")
42 gg.createAndDisplayGO(id_cylinder1)
43 gg.setDisplayMode(id_cylinder1,1)
44 gg.createAndDisplayGO(id_cylinder2)
45 gg.setDisplayMode(id_cylinder2,1)
46 gg.createAndDisplayGO(id_cylinder3)
47 gg.setDisplayMode(id_cylinder3,1)
48 gg.createAndDisplayGO(id_cylinder4)
49 gg.setDisplayMode(id_cylinder4,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p = geompy.MakeVertex(55, 45, 25)
15 sphere1 = geompy.MakeSpherePntR(p, radius1)
17 sphere2 = geompy.MakeSphere(0, 0, 45, radius2)
19 sphere3 = geompy.MakeSphereR(radius3)
22 id_sphere1 = geompy.addToStudy(sphere1,
"Sphere1")
23 id_sphere2 = geompy.addToStudy(sphere2,
"Sphere2")
24 id_sphere3 = geompy.addToStudy(sphere3,
"Sphere3")
27 gg.createAndDisplayGO(id_sphere1)
28 gg.setDisplayMode(id_sphere1,1)
29 gg.createAndDisplayGO(id_sphere2)
30 gg.setDisplayMode(id_sphere2,1)
31 gg.createAndDisplayGO(id_sphere3)
32 gg.setDisplayMode(id_sphere3,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p1 = geompy.MakeVertex(35, 40, 45)
12 p2 = geompy.MakeVertex(35, 45, 70)
13 v = geompy.MakeVector(p1, p2)
16 torus1 = geompy.MakeTorus(p1, v, 20, 10)
17 torus2 = geompy.MakeTorusRR(30, 15)
20 id_torus1 = geompy.addToStudy(torus1,
"Torus1")
21 id_torus2 = geompy.addToStudy(torus2,
"Torus2")
24 gg.createAndDisplayGO(id_torus1)
25 gg.setDisplayMode(id_torus1,1)
26 gg.createAndDisplayGO(id_torus2)
27 gg.setDisplayMode(id_torus2,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p1 = geompy.MakeVertex(35, 35, 0)
12 p2 = geompy.MakeVertex(35, 35, 70)
13 v = geompy.MakeVector(p1, p2)
16 cone1 = geompy.MakeCone(p1, v, 17, 1, 20)
17 cone2 = geompy.MakeConeR1R2H(30, 10, 30)
20 id_cone1 = geompy.addToStudy(cone1,
"Cone1")
21 id_cone2 = geompy.addToStudy(cone2,
"Cone2")
24 gg.createAndDisplayGO(id_cone1)
25 gg.setDisplayMode(id_cone1,1)
26 gg.createAndDisplayGO(id_cone2)
27 gg.setDisplayMode(id_cone2,1)
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 px = geompy.MakeVertex(100., 0. , 0. )
13 py = geompy.MakeVertex(0. , 100., 0. )
14 pz = geompy.MakeVertex(0. , 0. , 100.)
17 vxy = geompy.MakeVector(px, py)
20 disk1 = geompy.MakeDiskR(100, 1)
23 disk2 = geompy.MakeDiskPntVecR(pz, vxy, 30)
26 disk3 = geompy.MakeDiskThreePnt(p0, px, py)
29 id_vxy = geompy.addToStudy(vxy,
"Vector")
30 id_disk1 = geompy.addToStudy(disk1,
"Disk1")
31 id_disk2 = geompy.addToStudy(disk2,
"Disk2")
32 id_disk3 = geompy.addToStudy(disk3,
"Disk3")
35 gg.createAndDisplayGO(id_vxy)
36 gg.createAndDisplayGO(id_disk1)
37 gg.createAndDisplayGO(id_disk2)
38 gg.createAndDisplayGO(id_disk3)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 px = geompy.MakeVertex(100., 0. , 0. )
12 py = geompy.MakeVertex(0. , 100., 0. )
15 vxy = geompy.MakeVector(px, py)
18 face1 = geompy.MakeFaceHW(100, 100, 1)
21 face2 = geompy.MakeFaceObjHW(vxy, 50, 150)
24 face3 = geompy.MakeFaceObjHW(face2, 150, 50)
27 id_face1 = geompy.addToStudy(face1,
"Face1")
28 id_face2 = geompy.addToStudy(face2,
"Face2")
29 id_face3 = geompy.addToStudy(face3,
"Face3")
32 gg.createAndDisplayGO(id_face1)
33 gg.createAndDisplayGO(id_face2)
34 gg.createAndDisplayGO(id_face3)