3 \page tui_complex_objs_page Complex Objects
5 \anchor tui_creation_prism
6 <br><h2>Creation of a Prism</h2>
11 gg = salome.ImportComponentGUI("GEOM")
13 # create a vertex and a vector
14 p1 = geompy.MakeVertex( 0., 0., 0.)
15 p2 = geompy.MakeVertex( 100., 0., 0.)
16 p3 = geompy.MakeVertex( 100., 100., 0.)
17 p4 = geompy.MakeVertex( 0., 100., 0.)
18 p5 = geompy.MakeVertex( 0., 0., 60.)
19 p6 = geompy.MakeVertex(-100., 0., 0.)
20 p7 = geompy.MakeVertex(-100.,-100., 0.)
21 p8 = geompy.MakeVertex( 0.,-100., 0.)
23 # create a vector from the given components
24 vector = geompy.MakeVectorDXDYDZ(50., 50., 50.)
26 #create vectors from two points
27 vector1_arc1 = geompy.MakeVector(p1, p2)
28 vector2_arc1 = geompy.MakeVector(p1, p4)
29 vector1_arc2 = geompy.MakeVector(p1, p6)
30 vector2_arc2 = geompy.MakeVector(p1, p8)
32 # create arcs from three points
33 arc1 = geompy.MakeArc(p2, p3, p4)
34 arc2 = geompy.MakeArc(p6, p7, p8)
37 wire1 = geompy.MakeWire([vector1_arc1, arc1, vector2_arc1])
38 wire2 = geompy.MakeWire([vector1_arc2, arc2, vector2_arc2])
42 face1 = geompy.MakeFace(wire1, isPlanarWanted)
43 face2 = geompy.MakeFace(wire2, isPlanarWanted)
46 prism1 = geompy.MakePrism(face2, p1, p5)
47 prism2 = geompy.MakePrismVecH(face1, vector, 50)
49 # add objects in the study
50 id_face1 = geompy.addToStudy(face1,"Face1")
51 id_face2 = geompy.addToStudy(face2,"Face2")
52 id_prism1 = geompy.addToStudy(prism1,"Prism1")
53 id_prism2 = geompy.addToStudy(prism2,"Prism2")
56 gg.createAndDisplayGO(id_face1)
57 gg.setDisplayMode(id_face1,1)
58 gg.createAndDisplayGO(id_face2)
59 gg.setDisplayMode(id_face2,1)
60 gg.createAndDisplayGO(id_prism1)
61 gg.setDisplayMode(id_prism1,1)
62 gg.createAndDisplayGO(id_prism2)
63 gg.setDisplayMode(id_prism2,1)
66 \anchor tui_creation_revolution
67 <br><h2>Creation of a Revolution</h2>
72 gg = salome.ImportComponentGUI("GEOM")
74 # create a vertex and a vector
75 p1 = geompy.MakeVertex( 10., 10., 10.)
76 p2 = geompy.MakeVertex( 15., 15., 50.)
77 p3 = geompy.MakeVertex( 40., 40., 0.)
79 #create vectors from two points
80 vector1 = geompy.MakeVector(p1, p2)
81 vector2 = geompy.MakeVector(p1, p3)
83 # create a vector from the given components
84 vector3 = geompy.MakeVectorDXDYDZ(-20., -20., 100.)
87 wire = geompy.MakeWire([vector1, vector2])
90 revolution = geompy.MakeRevolution(wire, vector3, 2.3)
92 # add objects in the study
93 id_vector3 = geompy.addToStudy(vector3,"Axis")
94 id_wire = geompy.addToStudy(wire,"Wire")
95 id_revolution = geompy.addToStudy(revolution,"Revolution")
97 # display the vector, the wire and the revolution
98 gg.createAndDisplayGO(id_vector3)
99 gg.createAndDisplayGO(id_wire)
100 gg.createAndDisplayGO(id_revolution)
101 gg.setDisplayMode(id_revolution,1)
104 \anchor tui_creation_filling
105 <br><h2>Creation of a Filling</h2>
110 gg = salome.ImportComponentGUI("GEOM")
118 # create a vertex and a vector
119 p1 = geompy.MakeVertex( -30., -30., 50.)
120 p2 = geompy.MakeVertex( -60., -60., 30.)
121 p3 = geompy.MakeVertex( -30., -30., 10.)
123 # create an arc from three points
124 arc = geompy.MakeArc(p1, p2, p3)
125 ShapeListCompound = []
128 S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
129 ShapeListCompound.append(S)
132 compound = geompy.MakeCompound(ShapeListCompound)
135 filling = geompy.MakeFilling(compound, mindeg, maxdeg, tol3d, tol2d, nbiter)
137 # add objects in the study
138 id_compound = geompy.addToStudy(compound,"Compound")
139 id_filling = geompy.addToStudy(filling,"Filling")
141 # display the compound and the filling
142 gg.createAndDisplayGO(id_compound)
143 gg.createAndDisplayGO(id_filling)
144 gg.setDisplayMode(id_filling,1)
147 \anchor tui_creation_pipe
148 <br><h2>Creation of a Pipe</h2>
153 gg = salome.ImportComponentGUI("GEOM")
156 p0 = geompy.MakeVertex(0. , 0. , 0. )
157 px = geompy.MakeVertex(100., 0. , 0. )
158 py = geompy.MakeVertex(0. , 100., 0. )
159 pz = geompy.MakeVertex(0. , 0. , 100.)
160 pxyz = geompy.MakeVertex(100., 100., 100.)
162 # create a vector from two points
163 vxy = geompy.MakeVector(px, py)
165 # create an arc from three points
166 arc = geompy.MakeArc(py, pz, px)
169 wire = geompy.MakeWire([vxy, arc])
172 edge = geompy.MakeEdge(p0, pxyz)
175 pipe = geompy.MakePipe(wire, edge)
177 # add objects in the study
178 id_wire = geompy.addToStudy(wire,"Wire")
179 id_edge = geompy.addToStudy(edge,"Edge")
180 id_pipe = geompy.addToStudy(pipe,"Pipe")
182 # display the wire, the edge (path) and the pipe
183 gg.createAndDisplayGO(id_wire)
184 gg.createAndDisplayGO(id_edge)
185 gg.createAndDisplayGO(id_pipe)
186 gg.setDisplayMode(id_pipe,1)