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)
51 \anchor tui_creation_wire
52 <br><h2>Creation of a Wire</h2>
57 gg = salome.ImportComponentGUI("GEOM")
60 px = geompy.MakeVertex(100., 0. , 0. )
61 py = geompy.MakeVertex(0. , 100., 0. )
62 pz = geompy.MakeVertex(0. , 0. , 100.)
64 # create a vector from two points
65 vxy = geompy.MakeVector(px, py)
67 # create an arc from three points
68 arc = geompy.MakeArc(py, pz, px)
71 wire = geompy.MakeWire([vxy, arc])
73 # add an object in the study
74 id_wire = geompy.addToStudy(wire,"Wire")
77 gg.createAndDisplayGO(id_wire)
80 \anchor tui_creation_face
81 <br><h2>Creation of a Face</h2>
86 gg = salome.ImportComponentGUI("GEOM")
89 p0 = geompy.MakeVertex(0. , 0. , 0. )
90 px = geompy.MakeVertex(100., 0. , 0. )
91 py = geompy.MakeVertex(0. , 100., 0. )
92 pz = geompy.MakeVertex(0. , 0. , 100.)
93 pxyz = geompy.MakeVertex(100., 100., 100.)
95 # create a vector from two points
96 vxy = geompy.MakeVector(px, py)
98 # create an arc from three points
99 arc = geompy.MakeArc(py, pz, px)
102 wire = geompy.MakeWire([vxy, arc])
105 sketcher1 = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
106 [100,0,0, 1,1,1, -1,1,0])
107 sketcher2 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
108 sketcher3 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
111 # create a face from the wire
112 face1 = geompy.MakeFace(wire, isPlanarFace)
114 # create faces from two wires
115 face2 = geompy.MakeFaceWires([wire, sketcher1],isPlanarFace)
116 face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
118 # add objects in the study
119 id_face1 = geompy.addToStudy(face1,"Face1")
120 id_face2 = geompy.addToStudy(face2,"Face2")
121 id_face3 = geompy.addToStudy(face3,"Face3")
124 gg.createAndDisplayGO(id_face1)
125 gg.setDisplayMode(id_face1,1)
126 gg.setTransparency(id_face1,0.2)
127 gg.createAndDisplayGO(id_face2)
128 gg.setDisplayMode(id_face2,1)
129 gg.setTransparency(id_face2,0.2)
130 gg.createAndDisplayGO(id_face3)
131 gg.setDisplayMode(id_face3,1)
132 gg.setTransparency(id_face3,0.2)
135 \anchor tui_creation_shell
136 <br><h2>Creation of a Shell</h2>
141 gg = salome.ImportComponentGUI("GEOM")
144 p0 = geompy.MakeVertex( 0., 0., 0.)
145 pxyz = geompy.MakeVertex( 5., 5., 40.)
148 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
149 sketcher2 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
152 # create a face from two wires
153 face = geompy.MakeFaces([sketcher1, sketcher2],isPlanarFace)
156 prism = geompy.MakePrism(face, p0, pxyz)
158 # explode the prism into faces
159 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
161 # create a shell from a set of faces
162 shell = geompy.MakeShell([prism_faces[0], prism_faces[2], prism_faces[3],
163 prism_faces[7], prism_faces[9]])
165 # add objects in the study
166 id_shell = geompy.addToStudy(shell,"Shell")
169 gg.createAndDisplayGO(id_shell)
170 gg.setDisplayMode(id_shell,1)
173 \anchor tui_creation_solid
174 <br><h2>Creation of a Solid</h2>
179 gg = salome.ImportComponentGUI("GEOM")
182 p0 = geompy.MakeVertex( 0., 0., 0.)
183 pz = geompy.MakeVertex( 0., 0., 40.)
186 sketcher = geompy.MakeSketcher("Sketcher:F -50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW")
188 # create faces from two wires
189 face = geompy.MakeFace(sketcher,1)
192 prism = geompy.MakePrism(face, p0, pz)
194 # explode the prism into faces
195 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
197 # create a shell from a set of faces
198 shell = geompy.MakeShell([prism_faces[0], prism_faces[1],
199 prism_faces[3], prism_faces[4],
200 prism_faces[5], prism_faces[2]])
202 # create a solid, bounded by the given shells
203 solid = geompy.MakeSolid([shell])
205 # add objects in the study
206 id_solid = geompy.addToStudy(solid,"Solid")
209 gg.createAndDisplayGO(id_solid)
210 gg.setDisplayMode(id_solid,1)
213 \anchor tui_creation_compound
214 <br><h2>Creation of a Compound</h2>
219 gg = salome.ImportComponentGUI("GEOM")
221 # create a vertex and a vector
222 p1 = geompy.MakeVertex( -30., -30., 50.)
223 p2 = geompy.MakeVertex( -60., -60., 30.)
224 p3 = geompy.MakeVertex( -30., -30., 10.)
226 # create an arc from three points
227 arc = geompy.MakeArc(p1, p2, p3)
228 ShapeListCompound = []
231 S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
232 ShapeListCompound.append(S)
235 # create a compund of the given shapes
236 compound = geompy.MakeCompound(ShapeListCompound)
238 # add object in the study
239 id_compound = geompy.addToStudy(compound,"Compound")
241 # display the compound
242 gg.createAndDisplayGO(id_compound)
245 \anchor tui_creation_pipetshape
246 <br><h2>Creation of PipeTShape</h2>
251 gg = salome.ImportComponentGUI("GEOM")
253 # create PipeTShape object
254 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
256 # add object in the study
257 id_pipetshape = geompy.addToStudy(pipetshape[0],"PipeTShape")
258 # add groups in the study
259 for g in pipetshape[1:]:
260 geompy.addToStudyInFather(pipetshape[0], g, g.GetName())
262 # Create junction vertices
263 P1 = geompy.MakeVertex(0.0, 0.0, 0.0)
264 P2 = geompy.MakeVertex(400.0, 0.0, 0.0)
265 P3 = geompy.MakeVertex(200.0, 0.0, 200.0)
267 # create PipeTShape object with position
268 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
270 # add object in the study
271 id_pipetshape_position = geompy.addToStudy(pipetshape_position[0],"PipeTShape_position")
272 # add groups in the study
273 for g in pipetshape_position[1:]:
274 geompy.addToStudyInFather(pipetshape_position[0], g, g.GetName())
276 # create PipeTShape with chamfer object
277 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
279 # add object in the study
280 id_pipetshapechamfer = geompy.addToStudy(pipetshapechamfer[0],"PipeTShapeChamfer")
281 # add groups in the study
282 for g in pipetshapechamfer[1:]:
283 geompy.addToStudyInFather(pipetshapechamfer[0], g, g.GetName())
285 # create PipeTShape with chamfer object with position
286 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
288 # add object in the study
289 id_pipetshapechamfer_position = geompy.addToStudy(pipetshapechamfer_position[0],"PipeTShapeChamfer_position")
290 # add groups in the study
291 for g in pipetshapechamfer_position[1:]:
292 geompy.addToStudyInFather(pipetshapechamfer_position[0], g, g.GetName())
294 # create PipeTShape with fillet object
295 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
297 # add object in the study
298 id_pipetshapefillet = geompy.addToStudy(pipetshapefillet[0],"PipeTShapeFillet")
299 # add groups in the study
300 for g in pipetshapefillet[1:]:
301 geompy.addToStudyInFather(pipetshapefillet[0], g, g.GetName())
303 # create PipeTShape with fillet object with position
304 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
306 # add object in the study
307 id_pipetshapefillet_position = geompy.addToStudy(pipetshapefillet_position[0],"PipeTShapeFillet_position")
308 # add groups in the study
309 for g in pipetshapefillet_position[1:]:
310 geompy.addToStudyInFather(pipetshapefillet_position[0], g, g.GetName())
313 # display pipetshapes
314 gg.createAndDisplayGO(id_pipetshape)
315 gg.createAndDisplayGO(id_pipetshape_position)
316 gg.createAndDisplayGO(id_pipetshapechamfer)
317 gg.createAndDisplayGO(id_pipetshapechamfer_position)
318 gg.createAndDisplayGO(id_pipetshapefillet)
319 gg.createAndDisplayGO(id_pipetshapefillet_position)
323 <!--@@ insert new functions before this line @@ do not remove this line @@-->