Salome HOME
Synchronize adm files
[modules/geom.git] / doc / salome / examples / complex_objs_ex04.py
1 # Creation of a Pipe
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9
10 # create vertices
11 p0   = geompy.MakeVertex(0.  , 0.  , 0.  )
12 px   = geompy.MakeVertex(100., 0.  , 0.  )
13 py   = geompy.MakeVertex(0.  , 100., 0.  )
14 pz   = geompy.MakeVertex(0.  , 0.  , 100.)
15 pxyz = geompy.MakeVertex(100., 100., 100.)
16
17 # create a vector from two points
18 vxy = geompy.MakeVector(px, py)
19
20 # create an arc from three points
21 arc = geompy.MakeArc(py, pz, px)
22
23 # create a wire
24 wire = geompy.MakeWire([vxy, arc])
25
26 # create an edge
27 edge = geompy.MakeEdge(p0, pxyz)
28
29 # create a pipe
30 pipe = geompy.MakePipe(wire, edge)
31
32 # add objects in the study
33 id_wire = geompy.addToStudy(wire,"Wire")
34 id_edge = geompy.addToStudy(edge,"Edge")
35 id_pipe = geompy.addToStudy(pipe,"Pipe")
36
37 # display the wire, the edge (path) and the pipe
38 gg.createAndDisplayGO(id_wire)
39 gg.createAndDisplayGO(id_edge)
40 gg.createAndDisplayGO(id_pipe)
41 gg.setDisplayMode(id_pipe,1)