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 p0 = geompy.MakeVertex(0. , 0. , 0. )
15 pxyz = geompy.MakeVertex(100., 100., 100.)
18 edge = geompy.MakeEdge(p0, pxyz)
20 # add object in the study
21 id_edge = geompy.addToStudy(edge,"Edge")
24 gg.createAndDisplayGO(id_edge)
27 \anchor tui_creation_wire
28 <br><h2>Creation of a Wire</h2>
33 gg = salome.ImportComponentGUI("GEOM")
36 px = geompy.MakeVertex(100., 0. , 0. )
37 py = geompy.MakeVertex(0. , 100., 0. )
38 pz = geompy.MakeVertex(0. , 0. , 100.)
40 # create a vector from two points
41 vxy = geompy.MakeVector(px, py)
43 # create an arc from three points
44 arc = geompy.MakeArc(py, pz, px)
47 wire = geompy.MakeWire([vxy, arc])
49 # add an object in the study
50 id_wire = geompy.addToStudy(wire,"Wire")
53 gg.createAndDisplayGO(id_wire)
56 \anchor tui_creation_face
57 <br><h2>Creation of a Face</h2>
62 gg = salome.ImportComponentGUI("GEOM")
65 p0 = geompy.MakeVertex(0. , 0. , 0. )
66 px = geompy.MakeVertex(100., 0. , 0. )
67 py = geompy.MakeVertex(0. , 100., 0. )
68 pz = geompy.MakeVertex(0. , 0. , 100.)
69 pxyz = geompy.MakeVertex(100., 100., 100.)
71 # create a vector from two points
72 vxy = geompy.MakeVector(px, py)
74 # create an arc from three points
75 arc = geompy.MakeArc(py, pz, px)
78 wire = geompy.MakeWire([vxy, arc])
81 sketcher1 = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
82 [100,0,0, 1,1,1, -1,1,0])
83 sketcher2 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
84 sketcher3 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
87 # create a face from the wire
88 face1 = geompy.MakeFace(wire, isPlanarFace)
90 # create faces from two wires
91 face2 = geompy.MakeFaceWires([wire, sketcher1],isPlanarFace)
92 face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
94 # add objects in the study
95 id_face1 = geompy.addToStudy(face1,"Face1")
96 id_face2 = geompy.addToStudy(face2,"Face2")
97 id_face3 = geompy.addToStudy(face3,"Face3")
100 gg.createAndDisplayGO(id_face1)
101 gg.setDisplayMode(id_face1,1)
102 gg.setTransparency(id_face1,0.2)
103 gg.createAndDisplayGO(id_face2)
104 gg.setDisplayMode(id_face2,1)
105 gg.setTransparency(id_face2,0.2)
106 gg.createAndDisplayGO(id_face3)
107 gg.setDisplayMode(id_face3,1)
108 gg.setTransparency(id_face3,0.2)
111 \anchor tui_creation_shell
112 <br><h2>Creation of a Shell</h2>
117 gg = salome.ImportComponentGUI("GEOM")
120 p0 = geompy.MakeVertex( 0., 0., 0.)
121 pxyz = geompy.MakeVertex( 5., 5., 40.)
124 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
125 sketcher2 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
128 # create a face from two wires
129 face = geompy.MakeFaces([sketcher1, sketcher2],isPlanarFace)
132 prism = geompy.MakePrism(face, p0, pxyz)
134 # explode the prism into faces
135 prism_faces = geompy.SubShapeAllSorted(prism, geompy.ShapeType["FACE"])
137 # create a shell from a set of faces
138 shell = geompy.MakeShell([prism_faces[0], prism_faces[2], prism_faces[3],
139 prism_faces[7], prism_faces[9]])
141 # add objects in the study
142 id_shell = geompy.addToStudy(shell,"Shell")
145 gg.createAndDisplayGO(id_shell)
146 gg.setDisplayMode(id_shell,1)
149 \anchor tui_creation_solid
150 <br><h2>Creation of a Solid</h2>
155 gg = salome.ImportComponentGUI("GEOM")
158 p0 = geompy.MakeVertex( 0., 0., 0.)
159 pz = geompy.MakeVertex( 0., 0., 40.)
162 sketcher = geompy.MakeSketcher("Sketcher:F -50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW")
164 # create faces from two wires
165 face = geompy.MakeFace(sketcher,1)
168 prism = geompy.MakePrism(face, p0, pz)
170 # explode the prism into faces
171 prism_faces = geompy.SubShapeAllSorted(prism, geompy.ShapeType["FACE"])
173 # create a shell from a set of faces
174 shell = geompy.MakeShell([prism_faces[0], prism_faces[1],
175 prism_faces[3], prism_faces[4],
176 prism_faces[5], prism_faces[2]])
178 # create a solid, bounded by the given shells
179 solid = geompy.MakeSolid([shell])
181 # add objects in the study
182 id_solid = geompy.addToStudy(solid,"Solid")
185 gg.createAndDisplayGO(id_solid)
186 gg.setDisplayMode(id_solid,1)
189 \anchor tui_creation_compound
190 <br><h2>Creation of a Compound</h2>
195 gg = salome.ImportComponentGUI("GEOM")
197 # create a vertex and a vector
198 p1 = geompy.MakeVertex( -30., -30., 50.)
199 p2 = geompy.MakeVertex( -60., -60., 30.)
200 p3 = geompy.MakeVertex( -30., -30., 10.)
202 # create an arc from three points
203 arc = geompy.MakeArc(p1, p2, p3)
204 ShapeListCompound = []
207 S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
208 ShapeListCompound.append(S)
211 # create a compund of the given shapes
212 compound = geompy.MakeCompound(ShapeListCompound)
214 # add object in the study
215 id_compound = geompy.addToStudy(compound,"Compound")
217 # display the compound
218 gg.createAndDisplayGO(id_compound)
221 \anchor tui_creation_pipetshape
222 <br><h2>Creation of PipeTShape</h2>
227 gg = salome.ImportComponentGUI("GEOM")
229 # create PipeTShape object
230 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
232 # add object in the study
233 id_pipetshape = geompy.addToStudy(pipetshape[0],"PipeTShape")
234 # add groups in the study
235 for g in pipetshape[1:]:
236 geompy.addToStudyInFather(pipetshape[0], g, g.GetName())
238 # Create junction vertices
239 P1 = geompy.MakeVertex(0.0, 0.0, 0.0)
240 P2 = geompy.MakeVertex(400.0, 0.0, 0.0)
241 P3 = geompy.MakeVertex(200.0, 0.0, 200.0)
243 # create PipeTShape object with position
244 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
246 # add object in the study
247 id_pipetshape_position = geompy.addToStudy(pipetshape_position[0],"PipeTShape_position")
248 # add groups in the study
249 for g in pipetshape_position[1:]:
250 geompy.addToStudyInFather(pipetshape_position[0], g, g.GetName())
252 # create PipeTShape with chamfer object
253 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
255 # add object in the study
256 id_pipetshapechamfer = geompy.addToStudy(pipetshapechamfer[0],"PipeTShapeChamfer")
257 # add groups in the study
258 for g in pipetshapechamfer[1:]:
259 geompy.addToStudyInFather(pipetshapechamfer[0], g, g.GetName())
261 # create PipeTShape with chamfer object with position
262 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
264 # add object in the study
265 id_pipetshapechamfer_position = geompy.addToStudy(pipetshapechamfer_position[0],"PipeTShapeChamfer_position")
266 # add groups in the study
267 for g in pipetshapechamfer_position[1:]:
268 geompy.addToStudyInFather(pipetshapechamfer_position[0], g, g.GetName())
270 # create PipeTShape with fillet object
271 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
273 # add object in the study
274 id_pipetshapefillet = geompy.addToStudy(pipetshapefillet[0],"PipeTShapeFillet")
275 # add groups in the study
276 for g in pipetshapefillet[1:]:
277 geompy.addToStudyInFather(pipetshapefillet[0], g, g.GetName())
279 # create PipeTShape with fillet object with position
280 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
282 # add object in the study
283 id_pipetshapefillet_position = geompy.addToStudy(pipetshapefillet_position[0],"PipeTShapeFillet_position")
284 # add groups in the study
285 for g in pipetshapefillet_position[1:]:
286 geompy.addToStudyInFather(pipetshapefillet_position[0], g, g.GetName())
289 # display pipetshapes
290 gg.createAndDisplayGO(id_pipetshape)
291 gg.createAndDisplayGO(id_pipetshape_position)
292 gg.createAndDisplayGO(id_pipetshapechamfer)
293 gg.createAndDisplayGO(id_pipetshapechamfer_position)
294 gg.createAndDisplayGO(id_pipetshapefillet)
295 gg.createAndDisplayGO(id_pipetshapefillet_position)
299 <!--@@ insert new functions before this line @@ do not remove this line @@-->