5 gg = salome.ImportComponentGUI("GEOM")
7 # create a vertex and a vector
8 p1 = geompy.MakeVertex(35, 35, 0)
9 p2 = geompy.MakeVertex(35, 35, 50)
10 v = geompy.MakeVector(p1, p2)
15 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
18 cone = geompy.MakeCone(p1, v, 70, 0, 80)
21 cut = geompy.MakeCut(cone, cylinder)
23 # get faces as sub-shapes
25 faces = geompy.SubShapeAllSortedCentres(cut, geompy.ShapeType["FACE"])
26 f_2 = geompy.GetSubShapeID(cut, faces[2])
28 # remove one face from the shape
29 cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
31 # get wires as sub-shapes
33 wires = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["WIRE"])
34 w_0 = geompy.GetSubShapeID(cut_without_f_2, wires[0])
36 # suppress the selected wire
37 result = geompy.SuppressHoles(cut_without_f_2, [w_0])
39 # add objects in the study
40 id_cut = geompy.addToStudy(cut, "Cut")
41 id_cut_without_f_2 = geompy.addToStudy(cut_without_f_2, "Cut without f_2")
42 id_result = geompy.addToStudy(result, "Result")
45 gg.createAndDisplayGO(id_cut)
46 gg.setDisplayMode(id_cut,1)
47 gg.createAndDisplayGO(id_cut_without_f_2)
48 gg.setDisplayMode(id_cut_without_f_2,1)
49 gg.createAndDisplayGO(id_result)
50 gg.setDisplayMode(id_result,1)