TestMeasurementDistance.py
TestMeasurementRadius.py
TestMeasurementAngle.py
+ TestMeasurementAngle3Points.py
TestFusionFaces.py
Test1379.py
Test1922.py
TestBooleanCut_Wire_Wire.py
TestBooleanCut_WireCompound_WireCompound.py
TestBooleanSmash_Face_Face.py
+ TestBooleanSmash_SubSolid_Solid.py
TestBooleanFuse_SimpleMode.py
TestBooleanFuse_RemoveEdges.py
TestBooleanCommon_Vertex_Vertex.py
TestBooleanCommon_Wire_Wire.py
TestBooleanCommon_WireCompound_WireCompound.py
TestBooleanCommon_Face_Face.py
+ TestBooleanCommon_Face_Plane.py
TestBooleanCommon_FaceCompound_FaceCompound.py
TestBooleanCommon_Shell_Shell.py
TestBooleanCommon_ShellCompound_ShellCompound.py
TestBooleanCommon_SolidCompound_Face.py
TestBooleanCommon_SolidCompound_Shell.py
TestBooleanCommon_SolidCompound_SolidCompound.py
+ TestBooleanCommon_SubCompound_Solid.py
+ TestBooleanCommon_SubSolid_Solid.py
TestBooleanCommon_CompSolid_Face.py
TestBooleanCommon_CompSolid_Shell.py
TestBooleanCommon_CompSolid_CompSolid.py
}
}
- if ((anObjects.empty() && aCompSolidsObjects.empty())
+ if ((anObjects.empty() && aCompSolidsObjects.empty() && aCompoundObjects.empty())
|| (!isSimpleMode && aTools.empty() && aPlanes.empty())) {
std::string aFeatureError = "Error: Not enough objects for boolean operation.";
setError(aFeatureError);
data()->addAttribute(FeaturesPlugin_MultiRotation::NB_COPIES_ANGULAR_ID(),
ModelAPI_AttributeInteger::typeId());
- /*data()->addAttribute(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID(),
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+ data()->addAttribute(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID(),
ModelAPI_AttributeString::typeId());
data()->addAttribute(FeaturesPlugin_MultiRotation::STEP_RADIAL_ID(),
ModelAPI_AttributeDouble::typeId());
data()->addAttribute(FeaturesPlugin_MultiRotation::NB_COPIES_RADIAL_ID(),
- ModelAPI_AttributeInteger::typeId());*/
+ ModelAPI_AttributeInteger::typeId());
+#endif
}
//=================================================================================================
void FeaturesPlugin_MultiRotation::execute()
{
- /*std::string useRadialDir = string(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID())->value();
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+ std::string useRadialDir = string(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID())->value();
if (useRadialDir.empty()) {
performRotation1D();
} else {
performRotation2D();
- }*/
+ }
+#else
performRotation1D();
+#endif
}
//=================================================================================================
}
//=================================================================================================
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
void FeaturesPlugin_MultiRotation::performRotation2D()
{
// Getting objects.
++anIndex;
}
}
+#endif
//=================================================================================================
void FeaturesPlugin_MultiRotation::loadNamingDS(
/// Perform the multi rotation in one direction.
void performRotation1D();
- /// Perform the multi totation in two directions.
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+ /// Perform the multi rotation in two directions.
void performRotation2D();
void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
+#endif
void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
--- /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"))
+SketchLine_1 = Sketch_1.addLine(32.87583448774056, -21.97399556638079, -28.86536213173501, -21.97399556638079)
+SketchLine_2 = Sketch_1.addLine(-28.86536213173501, -21.97399556638079, -28.86536213173501, 32.11012709159006)
+SketchLine_3 = Sketch_1.addLine(-28.86536213173501, 32.11012709159006, 32.87583448774056, 32.11012709159006)
+SketchLine_4 = Sketch_1.addLine(32.87583448774056, 32.11012709159006, 32.87583448774056, -21.97399556638079)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 0, False)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_1")])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 0)
+
+assert(model.checkPythonDump())
--- /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"))
+SketchCircle_1 = Sketch_1.addCircle(3.367708126821666, -16.14093028927689, 18.51144913400999)
+SketchCircle_2 = Sketch_1.addCircle(37.37680688568888, 37.3768068856889, 21.5270932014419)
+SketchCircle_3 = Sketch_1.addCircle(-3.554756249974806, 10.65828989222541, 8.503732568675463)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Compound_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3")]
+Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1"), model.selection("SOLID", "Compound_1_1_3")], [model.selection("SOLID", "Box_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [14])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [48])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [96])
+model.testResultsVolumes(Common_1, [15007.623169576811051229014992714])
+
+assert(model.checkPythonDump())
--- /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)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5, True)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], 3, 3, 3)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Partition_1_1_2")], [model.selection("SOLID", "Translation_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [2])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [13])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [56])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [112])
+model.testResultsVolumes(Common_1, [745])
+
+assert(model.checkPythonDump())
--- /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)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5, True)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], 3, 3, 3)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Partition_1_1_2")], [model.selection("SOLID", "Translation_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Smash_1, 1)
+model.testNbSubResults(Smash_1, [3])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.FACE, [28])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.EDGE, [130])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.VERTEX, [260])
+model.testResultsVolumes(Smash_1, [1657])
+
+assert(model.checkPythonDump())