6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
10 # import initial topology with bad tolerances (more than 1e-07)
11 shape1 = geompy.ImportBREP("my_shape_1.brep")
12 shape2 = geompy.ImportBREP("my_shape_2.brep")
14 geompy.addToStudy(shape1, "Shape 1")
15 geompy.addToStudy(shape2, "Shape 2")
19 part = geompy.MakePartition([shape1, shape2])
23 shape1_lt = geompy.LimitTolerance(shape1, tolerance)
24 shape2_lt = geompy.LimitTolerance(shape2, tolerance)
27 good_shape1 = geompy.ProcessShape(shape1_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"])
28 good_shape2 = geompy.ProcessShape(shape2_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"])
30 geompy.addToStudy(good_shape1, "Shape 1 corrected")
31 geompy.addToStudy(good_shape2, "Shape 2 corrected")
33 # perform partition on corrected shapes
34 part = geompy.MakePartition([good_shape1, good_shape2])
37 geompy.addToStudy(part, "Partition")