6 gg = salome.ImportComponentGUI("GEOM")
8 # create a vertex and a vector
9 p1 = geompy.MakeVertex(35, 35, 0)
10 p2 = geompy.MakeVertex(35, 35, 50)
11 v = geompy.MakeVector(p1, p2)
16 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
19 cone = geompy.MakeCone(p1, v, 70, 0, 80)
22 cut = geompy.MakeCut(cone, cylinder)
24 # 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 edges as sub-shapes
32 edges = geompy.SubShapeAllSortedCentres(faces[2], geompy.ShapeType["EDGE"])
33 edge = geompy.GetInPlace(cut_without_f_2, edges[0], True)
34 e_2 = geompy.GetSubShapeID(cut_without_f_2, edge)
36 # suppress a hole using the selected edge
37 result = geompy.SuppressHoles(cut_without_f_2, [e_2])
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)