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)
13 cylinder = geompy.MakeCone(p1, v, 30, 20, 20)
16 cone = geompy.MakeCone(p1, v, 70, 40, 60)
19 cut = geompy.MakeCut(cone, cylinder)
21 # get faces as sub-shapes
23 faces = geompy.SubShapeAllSortedCentres(cut, geompy.ShapeType["FACE"])
24 f_2 = geompy.GetSubShapeID(cut, faces[0])
26 # remove one face from the shape
27 cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
29 # suppress the specified wire
30 result = geompy.GetFreeFacesIDs(cut_without_f_2)
31 print "A number of free faces is ", len(result)
33 # add objects in the study
34 all_faces = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["FACE"])
35 for face in all_faces :
36 sub_shape_id = geompy.GetSubShapeID(cut_without_f_2, face)
37 if result.count(sub_shape_id) > 0 :
38 face_name = "Free face %d"%(sub_shape_id)
39 geompy.addToStudy(face, face_name)
41 # in this example all faces from cut_without_f_2 are free
42 id_cut_without_f_2 = geompy.addToStudy(cut_without_f_2, "Cut without f_2")
45 gg.createAndDisplayGO(id_cut_without_f_2)
46 gg.setDisplayMode(id_cut_without_f_2,1)