6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
15 p0 = geompy.MakeVertex(0. , 0. , 0. )
16 pxyz = geompy.MakeVertex(100., 100., 100.)
19 edge = geompy.MakeEdge(p0, pxyz)
22 id_edge = geompy.addToStudy(edge,
"Edge_1")
25 gg.createAndDisplayGO(id_edge)
32 c = geompy.MakeCircle(
None,
None, 100)
35 w = geompy.MakeWire([c], 1e-07)
38 edge = geompy.MakeEdgeWire(w)
41 id_edge = geompy.addToStudy(edge,
"Edge_2")
44 gg.createAndDisplayGO(id_edge)
51 c = geompy.MakeCircle(
None,
None, 100)
54 edge = geompy.MakeEdgeOnCurveByLength(c, 25.0)
57 id_edge = geompy.addToStudy(edge,
"Edge_3")
60 gg.createAndDisplayGO(id_edge)
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. )
13 pz = geompy.MakeVertex(0. , 0. , 100.)
16 vxy = geompy.MakeVector(px, py)
19 arc = geompy.MakeArc(py, pz, px)
22 wire = geompy.MakeWire([vxy, arc])
25 id_wire = geompy.addToStudy(wire,
"Wire")
28 gg.createAndDisplayGO(id_wire)
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.)
15 pxyz = geompy.MakeVertex(100., 100., 100.)
18 vxy = geompy.MakeVector(px, py)
21 arc = geompy.MakeArc(py, pz, px)
24 wire = geompy.MakeWire([vxy, arc])
27 sketcher1 = geompy.MakeSketcher(
"Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
28 [100,0,0, 1,1,1, -1,1,0])
29 sketcher2 = geompy.MakeSketcher(
"Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
30 sketcher3 = geompy.MakeSketcher(
"Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
33 sphere = geompy.MakeSphereR(100)
34 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
35 cut = geompy.MakeCutList(sphere, [box],
True)
38 face1 = geompy.MakeFace(wire, isPlanarFace)
41 face2 = geompy.MakeFaceWires([wire, sketcher1],isPlanarFace)
42 face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
43 face4 = geompy.MakeFaceFromSurface(face1, sketcher1)
46 face5 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(cut, [5]), geompy.GetSubShape(cut, [3]),
47 geompy.GetSubShape(cut, [11]), geompy.GetSubShape(cut, [3]),
48 geompy.GetSubShape(cut, [13]), geompy.GetSubShape(cut, [3])])
51 id_face1 = geompy.addToStudy(face1,
"Face1")
52 id_face2 = geompy.addToStudy(face2,
"Face2")
53 id_face3 = geompy.addToStudy(face3,
"Face3")
54 id_face4 = geompy.addToStudy(face4,
"Face4")
55 id_face5 = geompy.addToStudy(face5,
"Face5")
58 gg.createAndDisplayGO(id_face1)
59 gg.setDisplayMode(id_face1,1)
60 gg.setTransparency(id_face1,0.2)
61 gg.createAndDisplayGO(id_face2)
62 gg.setDisplayMode(id_face2,1)
63 gg.setTransparency(id_face2,0.2)
64 gg.createAndDisplayGO(id_face3)
65 gg.setDisplayMode(id_face3,1)
66 gg.setTransparency(id_face3,0.2)
67 gg.createAndDisplayGO(id_face4)
68 gg.setDisplayMode(id_face4,1)
69 gg.setTransparency(id_face4,0.2)
70 gg.createAndDisplayGO(id_face5)
71 gg.setDisplayMode(id_face5,1)
72 gg.setTransparency(id_face5,0.2)
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 pxyz = geompy.MakeVertex( 5., 5., 40.)
15 sketcher1 = geompy.MakeSketcher(
"Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
16 sketcher2 = geompy.MakeSketcher(
"Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
20 face = geompy.MakeFaces([sketcher1, sketcher2],isPlanarFace)
23 prism = geompy.MakePrism(face, p0, pxyz)
26 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType[
"FACE"])
29 shell = geompy.MakeShell([prism_faces[0], prism_faces[2], prism_faces[3],
30 prism_faces[7], prism_faces[9]])
33 id_shell = geompy.addToStudy(shell,
"Shell")
36 gg.createAndDisplayGO(id_shell)
37 gg.setDisplayMode(id_shell,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 pz = geompy.MakeVertex( 0., 0., 40.)
15 sketcher = geompy.MakeSketcher(
"Sketcher:F -50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW")
18 face = geompy.MakeFace(sketcher,1)
21 prism = geompy.MakePrism(face, p0, pz)
24 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType[
"FACE"])
27 shell = geompy.MakeShell([prism_faces[0], prism_faces[1],
28 prism_faces[3], prism_faces[4],
29 prism_faces[5], prism_faces[2]])
32 solid = geompy.MakeSolid([shell])
35 id_solid = geompy.addToStudy(solid,
"Solid")
38 gg.createAndDisplayGO(id_solid)
39 gg.setDisplayMode(id_solid,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
14 box_translation = geompy.MakeTranslation(box, 200, 0, 0)
17 box_shell = geompy.SubShapeAllSorted(box, geompy.ShapeType[
"SHELL"])[0]
18 box_translation_shell = geompy.SubShapeAllSorted(box_translation, geompy.ShapeType[
"SHELL"])[0]
21 box_faces = geompy.SubShapeAllSorted(box, geompy.ShapeType[
"FACE"])
22 box_translation_faces = geompy.SubShapeAllSorted(box_translation, geompy.ShapeType[
"FACE"])
25 msf_shells_noint = geompy.MakeSolidFromConnectedFaces([box_shell, box_translation_shell],0)
26 msf_shells_int = geompy.MakeSolidFromConnectedFaces([box_shell, box_translation_shell], 1)
29 msf_faces_noint = geompy.MakeSolidFromConnectedFaces(box_faces+box_translation_faces, 0)
30 msf_faces_int = geompy.MakeSolidFromConnectedFaces(box_faces+box_translation_faces, 1)
33 id_solid_shells_noint = geompy.addToStudy(msf_shells_noint,
"Solid_from_shells_no_intersect")
34 id_solid_shells_int = geompy.addToStudy(msf_shells_int,
"Solid_from_shells_intersect")
35 id_solid_faces_noint = geompy.addToStudy(msf_faces_noint,
"Solid_from_faces_no_intersect")
36 id_solid_faces_int = geompy.addToStudy(msf_faces_int,
"Solid_from_faces_intersect")
39 gg.createAndDisplayGO(id_solid_shells_noint)
40 gg.setDisplayMode(id_solid_shells_noint,1)
41 gg.createAndDisplayGO(id_solid_shells_int)
42 gg.setDisplayMode(id_solid_shells_int,1)
43 gg.createAndDisplayGO(id_solid_faces_noint)
44 gg.setDisplayMode(id_solid_faces_noint,1)
45 gg.createAndDisplayGO(id_solid_faces_int)
46 gg.setDisplayMode(id_solid_faces_int,1)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p1 = geompy.MakeVertex( -30., -30., 50.)
12 p2 = geompy.MakeVertex( -60., -60., 30.)
13 p3 = geompy.MakeVertex( -30., -30., 10.)
16 arc = geompy.MakeArc(p1, p2, p3)
17 ShapeListCompound = []
20 S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
21 ShapeListCompound.append(S)
25 compound = geompy.MakeCompound(ShapeListCompound)
28 id_compound = geompy.addToStudy(compound,
"Compound")
31 gg.createAndDisplayGO(id_compound)