5 from salome.geom
import geomBuilder
6 geompy = geomBuilder.New(salome.myStudy)
9 box1 = geompy.MakeBox(0, 0, 0, 100, 100, 100)
10 box2 = geompy.MakeBox(20, 20, -20, 80, 80, 120)
11 cut = geompy.MakeCut(box1, box2)
12 sid = geompy.addToStudy(cut,
"Shape")
15 faces = geompy.SubShapeAllSortedCentres(cut, geompy.ShapeType[
"FACE"])
18 for fi
in range(len(faces)):
19 fid = geompy.addToStudyInFather(cut, faces[fi],
"Face %d" % (fi+1))
20 isSuccess, closedWires, openWires = geompy.GetFreeBoundary(faces[fi])
22 print "Check free boudaries in face %d: OK" % (fi+1)
23 print "-- Nb of closed boundaries = %d" % len(closedWires)
24 for wi
in range(len(closedWires)):
25 wid = geompy.addToStudyInFather(faces[fi], closedWires[wi],
"Closed wire %d" % (wi+1))
27 print "-- Nb of open boundaries = %d" % len(openWires)
28 for wi
in range(len(openWires)):
29 wid = geompy.addToStudyInFather(faces[fi], openWires[wi],
"Open wire %d" % (wi+1))
33 print "Check free boudaries in face %d: KO" % (fi+1)