3 \page tui_topological_geom_objs_page Topological Objects
5 \anchor tui_creation_edge
6 <br><h2>Creation of an Edge</h2>
11 gg = salome.ImportComponentGUI("GEOM")
14 # create edge by two points
18 p0 = geompy.MakeVertex(0. , 0. , 0. )
19 pxyz = geompy.MakeVertex(100., 100., 100.)
22 edge = geompy.MakeEdge(p0, pxyz)
24 # add object in the study
25 id_edge = geompy.addToStudy(edge,"Edge_1")
28 gg.createAndDisplayGO(id_edge)
31 # create edge from wire
35 c = geompy.MakeCircle(None, None, 100)
38 w = geompy.MakeWire([c], 1e-07)
40 # create an edge from wire
41 edge = geompy.MakeEdgeWire(w)
43 # add object in the study
44 id_edge = geompy.addToStudy(edge,"Edge_2")
47 gg.createAndDisplayGO(id_edge)
50 # create edge from existing curve and a length
54 c = geompy.MakeCircle(None, None, 100)
56 # create an edge of length 25.0 from the circle
57 edge = geompy.MakeEdgeOnCurveByLength(c, 25.0)
59 # add object in the study
60 id_edge = geompy.addToStudy(edge,"Edge_3")
63 gg.createAndDisplayGO(id_edge)
67 \anchor tui_creation_wire
68 <br><h2>Creation of a Wire</h2>
73 gg = salome.ImportComponentGUI("GEOM")
76 px = geompy.MakeVertex(100., 0. , 0. )
77 py = geompy.MakeVertex(0. , 100., 0. )
78 pz = geompy.MakeVertex(0. , 0. , 100.)
80 # create a vector from two points
81 vxy = geompy.MakeVector(px, py)
83 # create an arc from three points
84 arc = geompy.MakeArc(py, pz, px)
87 wire = geompy.MakeWire([vxy, arc])
89 # add an object in the study
90 id_wire = geompy.addToStudy(wire,"Wire")
93 gg.createAndDisplayGO(id_wire)
96 \anchor tui_creation_face
97 <br><h2>Creation of a Face</h2>
102 gg = salome.ImportComponentGUI("GEOM")
105 p0 = geompy.MakeVertex(0. , 0. , 0. )
106 px = geompy.MakeVertex(100., 0. , 0. )
107 py = geompy.MakeVertex(0. , 100., 0. )
108 pz = geompy.MakeVertex(0. , 0. , 100.)
109 pxyz = geompy.MakeVertex(100., 100., 100.)
111 # create a vector from two points
112 vxy = geompy.MakeVector(px, py)
114 # create an arc from three points
115 arc = geompy.MakeArc(py, pz, px)
118 wire = geompy.MakeWire([vxy, arc])
121 sketcher1 = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
122 [100,0,0, 1,1,1, -1,1,0])
123 sketcher2 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
124 sketcher3 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
127 # create a face from the wire
128 face1 = geompy.MakeFace(wire, isPlanarFace)
130 # create faces from two wires
131 face2 = geompy.MakeFaceWires([wire, sketcher1],isPlanarFace)
132 face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
134 # add objects in the study
135 id_face1 = geompy.addToStudy(face1,"Face1")
136 id_face2 = geompy.addToStudy(face2,"Face2")
137 id_face3 = geompy.addToStudy(face3,"Face3")
140 gg.createAndDisplayGO(id_face1)
141 gg.setDisplayMode(id_face1,1)
142 gg.setTransparency(id_face1,0.2)
143 gg.createAndDisplayGO(id_face2)
144 gg.setDisplayMode(id_face2,1)
145 gg.setTransparency(id_face2,0.2)
146 gg.createAndDisplayGO(id_face3)
147 gg.setDisplayMode(id_face3,1)
148 gg.setTransparency(id_face3,0.2)
151 \anchor tui_creation_shell
152 <br><h2>Creation of a Shell</h2>
157 gg = salome.ImportComponentGUI("GEOM")
160 p0 = geompy.MakeVertex( 0., 0., 0.)
161 pxyz = geompy.MakeVertex( 5., 5., 40.)
164 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
165 sketcher2 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
168 # create a face from two wires
169 face = geompy.MakeFaces([sketcher1, sketcher2],isPlanarFace)
172 prism = geompy.MakePrism(face, p0, pxyz)
174 # explode the prism into faces
175 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
177 # create a shell from a set of faces
178 shell = geompy.MakeShell([prism_faces[0], prism_faces[2], prism_faces[3],
179 prism_faces[7], prism_faces[9]])
181 # add objects in the study
182 id_shell = geompy.addToStudy(shell,"Shell")
185 gg.createAndDisplayGO(id_shell)
186 gg.setDisplayMode(id_shell,1)
189 \anchor tui_creation_solid
190 <br><h2>Creation of a Solid</h2>
195 gg = salome.ImportComponentGUI("GEOM")
198 p0 = geompy.MakeVertex( 0., 0., 0.)
199 pz = geompy.MakeVertex( 0., 0., 40.)
202 sketcher = geompy.MakeSketcher("Sketcher:F -50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW")
204 # create faces from two wires
205 face = geompy.MakeFace(sketcher,1)
208 prism = geompy.MakePrism(face, p0, pz)
210 # explode the prism into faces
211 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
213 # create a shell from a set of faces
214 shell = geompy.MakeShell([prism_faces[0], prism_faces[1],
215 prism_faces[3], prism_faces[4],
216 prism_faces[5], prism_faces[2]])
218 # create a solid, bounded by the given shells
219 solid = geompy.MakeSolid([shell])
221 # add objects in the study
222 id_solid = geompy.addToStudy(solid,"Solid")
225 gg.createAndDisplayGO(id_solid)
226 gg.setDisplayMode(id_solid,1)
229 \anchor tui_creation_compound
230 <br><h2>Creation of a Compound</h2>
235 gg = salome.ImportComponentGUI("GEOM")
237 # create a vertex and a vector
238 p1 = geompy.MakeVertex( -30., -30., 50.)
239 p2 = geompy.MakeVertex( -60., -60., 30.)
240 p3 = geompy.MakeVertex( -30., -30., 10.)
242 # create an arc from three points
243 arc = geompy.MakeArc(p1, p2, p3)
244 ShapeListCompound = []
247 S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
248 ShapeListCompound.append(S)
251 # create a compund of the given shapes
252 compound = geompy.MakeCompound(ShapeListCompound)
254 # add object in the study
255 id_compound = geompy.addToStudy(compound,"Compound")
257 # display the compound
258 gg.createAndDisplayGO(id_compound)