3 \page tui_advanced_geom_objs_page Advanced Geometrical 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)
261 \anchor tui_creation_pipetshape
262 <br><h2>Creation of PipeTShape</h2>
267 gg = salome.ImportComponentGUI("GEOM")
269 # create PipeTShape object
270 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
272 # add object in the study
273 id_pipetshape = geompy.addToStudy(pipetshape[0],"PipeTShape")
274 # add groups in the study
275 for g in pipetshape[1:]:
276 geompy.addToStudyInFather(pipetshape[0], g, g.GetName())
278 # Create junction vertices
279 P1 = geompy.MakeVertex(0.0, 0.0, 0.0)
280 P2 = geompy.MakeVertex(400.0, 0.0, 0.0)
281 P3 = geompy.MakeVertex(200.0, 0.0, 200.0)
283 # create PipeTShape object with position
284 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
286 # add object in the study
287 id_pipetshape_position = geompy.addToStudy(pipetshape_position[0],"PipeTShape_position")
288 # add groups in the study
289 for g in pipetshape_position[1:]:
290 geompy.addToStudyInFather(pipetshape_position[0], g, g.GetName())
292 # create PipeTShape with chamfer object
293 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
295 # add object in the study
296 id_pipetshapechamfer = geompy.addToStudy(pipetshapechamfer[0],"PipeTShapeChamfer")
297 # add groups in the study
298 for g in pipetshapechamfer[1:]:
299 geompy.addToStudyInFather(pipetshapechamfer[0], g, g.GetName())
301 # create PipeTShape with chamfer object with position
302 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
304 # add object in the study
305 id_pipetshapechamfer_position = geompy.addToStudy(pipetshapechamfer_position[0],"PipeTShapeChamfer_position")
306 # add groups in the study
307 for g in pipetshapechamfer_position[1:]:
308 geompy.addToStudyInFather(pipetshapechamfer_position[0], g, g.GetName())
310 # create PipeTShape with fillet object
311 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
313 # add object in the study
314 id_pipetshapefillet = geompy.addToStudy(pipetshapefillet[0],"PipeTShapeFillet")
315 # add groups in the study
316 for g in pipetshapefillet[1:]:
317 geompy.addToStudyInFather(pipetshapefillet[0], g, g.GetName())
319 # create PipeTShape with fillet object with position
320 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
322 # add object in the study
323 id_pipetshapefillet_position = geompy.addToStudy(pipetshapefillet_position[0],"PipeTShapeFillet_position")
324 # add groups in the study
325 for g in pipetshapefillet_position[1:]:
326 geompy.addToStudyInFather(pipetshapefillet_position[0], g, g.GetName())
329 # display pipetshapes
330 gg.createAndDisplayGO(id_pipetshape)
331 gg.createAndDisplayGO(id_pipetshape_position)
332 gg.createAndDisplayGO(id_pipetshapechamfer)
333 gg.createAndDisplayGO(id_pipetshapechamfer_position)
334 gg.createAndDisplayGO(id_pipetshapefillet)
335 gg.createAndDisplayGO(id_pipetshapefillet_position)
339 <!--@@ insert new functions before this line @@ do not remove this line @@-->