]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/complex_objs_ex05.py
Salome HOME
724810c580b21871424995de86282d7b47a56957
[modules/geom.git] / doc / salome / examples / complex_objs_ex05.py
1 # Creation of a PipeWithDifferentSections
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
8 edges = geompy.SubShapeAll(Wire_1, geompy.ShapeType["EDGE"])
9 vertices = geompy.SubShapeAll(Wire_1, geompy.ShapeType["VERTEX"])
10
11 # create sections
12 circles=[]
13 circles.append(geompy.MakeCircle(vertices[0], edges[0], 20))
14 circles.append(geompy.MakeCircle(vertices[1], edges[0], 40))
15 circles.append(geompy.MakeCircle(vertices[2], edges[2], 30))
16 circles.append(geompy.MakeCircle(vertices[3], edges[2], 20))
17
18 # create pipe
19 Pipe = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
20
21 # add objects in the study
22 geompy.addToStudy(circles[0], "circles1")
23 geompy.addToStudy(circles[1], "circles2")
24 geompy.addToStudy(circles[2], "circles3")
25 geompy.addToStudy(circles[3], "circles4")
26 id_wire = geompy.addToStudy(Wire_1, "Path")
27 id_pipe = geompy.addToStudy(Pipe, "Pipe")
28
29 # display the wire(path) and the pipe
30 gg.createAndDisplayGO(id_wire)
31 gg.createAndDisplayGO(id_pipe)
32 gg.setDisplayMode(id_pipe,1)