]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/transformation_operations_ex07.py
Salome HOME
Mantis issue 0021934: Delete the internal faces of an object
[modules/geom.git] / doc / salome / examples / transformation_operations_ex07.py
1 # Projection
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8
9 # create a cylindric face and a curve(edge)
10 cylinder = geompy.MakeCylinderRH(100, 300)
11 [face_cyl] = geompy.SubShapes(cylinder, [3])
12
13 p1 = geompy.MakeVertex(200, 0, 100)
14 p2 = geompy.MakeVertex(200, 80, 100)
15 p3 = geompy.MakeVertex(200, 80, 180)
16 p4 = geompy.MakeVertex(130, 80, 180)
17 p5 = geompy.MakeVertex(90, 80, 240)
18
19 curve = geompy.MakeInterpol([p1, p2, p3, p4, p5], False, False)
20
21 # create a new object as projection of the
22 # given curve on the given cylindric face
23 projection = geompy.MakeProjection(curve, face_cyl)
24
25 # add objects in the study
26 geompy.addToStudy(cylinder, "cylinder")
27 geompy.addToStudyInFather(cylinder, face_cyl, "face_cyl")
28 geompy.addToStudy(p1, "p1")
29 geompy.addToStudy(p2, "p2")
30 geompy.addToStudy(p3, "p3")
31 geompy.addToStudy(p4, "p4")
32 geompy.addToStudy(p5, "p5")
33 geompy.addToStudy(curve, "curve")
34 geompy.addToStudy(projection, "projection")