TestBooleanSmash.py
TestBooleanFill.py
TestBooleanFillWithPlane.py
+ TestBooleanFill_ErrorMsg.py
TestMultiBoolean.py
TestSerialBoolean.py
TestBoolean_ErrorMsg.py
TestFillSolidCompFace.py
TestFillSolidShell.py
TestFillSolidCompShell.py
+ TestFillCompsolidPlane.py
TestPartition2Faces.py
TestPartition2Solids.py
TestPartition2Wires.py
TestBooleanCut_Wire_Face.py
TestBooleanCut_Wire_Wire.py
TestBooleanCut_WireCompound_WireCompound.py
+ TestBooleanCut_Compound_Solid.py
+ TestBooleanCut_ErrorMsg.py
TestBooleanSmash_Face_Face.py
TestBooleanSmash_SubSolid_Solid.py
+ TestBooleanSmash_CompSolid_Solid.py
TestBooleanSmash_ErrorMsg.py
TestBooleanFuse_SimpleMode.py
TestBooleanFuse_RemoveEdges.py
TestBooleanFuse_ShellCompound_ShellCompound.py
TestBooleanFuse_Solid_Solid.py
TestBooleanFuse_SolidCompound_SolidCompound.py
+ TestBooleanFuse_CompSolid_Face.py
TestBooleanFuse_CompSolid_CompSolid.py
TestBooleanFuse_CompSolidCompound_CompSolidCompound.py
TestFillet.py
Part_1_doc.removeFeature(Common_1.feature())
model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Common_1 = Part_1_doc.addFeature("Common")
+Common_1.execute()
+assert(Common_1.error() != "")
+aSession.finishOperation()
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 20)
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Translation_1_1")])
+Box_3 = model.addBox(Part_1_doc, 20, 6, 20)
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], -5, 2, -5)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1")], [model.selection("SOLID", "Translation_2_1")])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [3])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.FACE, [18])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.EDGE, [72])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [144])
+model.testResultsVolumes(Cut_1, [1400])
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Cut_1 = aPart.addFeature("Cut")
+Cut_1.execute()
+assert(Cut_1.error() != "")
+aSession.finishOperation()
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Fill_1 = aPart.addFeature("Fill")
+Fill_1.execute()
+assert(Fill_1.error() != "")
+aSession.finishOperation()
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(52.27216563767099, 0, 18.66006927176168)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+SketchCircle_2 = Sketch_1.addCircle(79.68333887668101, 0, 24.16077154338278)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
+SketchLine_2 = Sketch_2.addLine(73.13136007081269, -14.25937060400964, 2.118687665902372, -14.25937060400964)
+SketchLine_3 = Sketch_2.addLine(2.118687665902372, -14.25937060400964, 2.118687665902372, 26.70061277610758)
+SketchLine_4 = Sketch_2.addLine(2.118687665902372, 26.70061277610758, 73.13136007081269, 26.70061277610758)
+SketchLine_5 = Sketch_2.addLine(73.13136007081269, 26.70061277610758, 73.13136007081269, -14.25937060400964)
+SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_2.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_3.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_5.result())
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r")])
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], [model.selection("FACE", "Face_1_1")])
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [2])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [4])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [16])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [32])
+model.testResultsVolumes(Fuse_1, [785.398163397447774514148477465])
+
+Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("FACE", "Fuse_1_1_1")])
+assert(Fuse_2.feature().error() != "")
+
+model.end()
assert(Fuse_1.feature().error() != "")
Part_1_doc.removeFeature(Fuse_1.feature())
model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Fuse_1 = Part_1_doc.addFeature("Fuse")
+Fuse_1.execute()
+assert(Fuse_1.error() != "")
+aSession.finishOperation()
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-0.820365148699405, 7.40718257641344, 6.028904154999336)
+SketchCircle_2 = Sketch_1.addCircle(10.62009910116713, 13.94078752172051, 10.99163472554975)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("SOLID", "Box_1_1")])
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Smash_1, 1)
+model.testNbSubResults(Smash_1, [4])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.SOLID, [4])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.FACE, [28])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.EDGE, [120])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.VERTEX, [240])
+model.testResultsVolumes(Smash_1, [4980.404017506245509139262139797])
Part_1_doc.removeFeature(Smash_1.feature())
model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Smash_1 = Part_1_doc.addFeature("Smash")
+Smash_1.execute()
+assert(Smash_1.error() != "")
+aSession.finishOperation()
--- /dev/null
+## Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(11.92861402549826, 0, 16.05621803603458)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+SketchCircle_2 = Sketch_1.addCircle(37.8779560884558, 0, 17.74637067763095)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/XOZ")])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [5])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [5])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [25])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [90])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [180])
+model.testResultsVolumes(Fill_1, [16831.622023411000554915517568588])
aMeasurement = Part_1_doc.addFeature("Measurement")
aMeasurement.string("MeasureKind").setValue("Length")
aMeasurement.selection("edge_for_length").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
-assert(featureToPresentation(aMeasurement).getAISObject(None) is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
aSession.finishOperation()
aSession.startOperation()
aMeasurement.string("MeasureKind").setValue("Distance")
aMeasurement.selection("distance_from").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_StartVertex")
aMeasurement.selection("distance_to").selectSubShape("EDGE", "Sketch_1/SketchLine_2")
-assert(featureToPresentation(aMeasurement).getAISObject(None) is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
aSession.finishOperation()
aSession.startOperation()
aMeasurement = Part_1_doc.addFeature("Measurement")
aMeasurement.string("MeasureKind").setValue("Radius")
aMeasurement.selection("circular").selectSubShape("EDGE", "Sketch_1/SketchArc_1_2")
-assert(featureToPresentation(aMeasurement).getAISObject(None) is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
aSession.finishOperation()
aSession.startOperation()
aMeasurement.string("MeasureKind").setValue("Angle")
aMeasurement.selection("angle_from").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
aMeasurement.selection("angle_to").selectSubShape("EDGE", "Sketch_1/SketchLine_2")
-assert(featureToPresentation(aMeasurement).getAISObject(None) is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
aSession.finishOperation()
aSession.startOperation()
aMeasurement.selection("angle_point_1").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_StartVertex")
aMeasurement.selection("angle_point_2").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_EndVertex")
aMeasurement.selection("angle_point_3").selectSubShape("VERTEX", "Sketch_1/SketchLine_2_EndVertex")
-assert(featureToPresentation(aMeasurement).getAISObject(None) is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
aSession.finishOperation()
Part_1_doc.removeFeature(Partition_1.feature())
model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Partition_1 = Part_1_doc.addFeature("Partition")
+Partition_1.execute()
+assert(Partition_1.error() != "")
+aSession.finishOperation()