SET(PROJECT_HEADERS
FiltersAPI.h
+ FiltersAPI_Argument.h
FiltersAPI_Feature.h
FiltersAPI_Filter.h
FiltersAPI_Selection.h
)
SET(PROJECT_SOURCES
+ FiltersAPI_Argument.cpp
FiltersAPI_Feature.cpp
FiltersAPI_Filter.cpp
FiltersAPI_Selection.cpp
%shared_ptr(FiltersAPI_Feature)
%shared_ptr(FiltersAPI_Filter)
+// function with named parameters
+%feature("kwargs") addFilter;
+
+
// std::list -> []
%template(FilterList) std::list<std::shared_ptr<FiltersAPI_Filter> >;
+%template(ArgumentList) std::list<FiltersAPI_Argument>;
+
+// fix compilarion error: 'res*' was not declared in this scope
+%typemap(freearg) const std::list<FiltersAPI_Argument> & {}
+
+%typecheck(SWIG_TYPECHECK_POINTER) std::list<FiltersAPI_Argument>, const std::list<FiltersAPI_Argument> & {
+ ModelHighAPI_Selection* temp_selection;
+ std::string* temp_string;
+ int newmem = 0;
+ $1 = 1;
+ if (PySequence_Check($input)) {
+ for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
+ PyObject * item = PySequence_GetItem($input, i);
+ if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
+ if (!temp_selection) {
+ $1 = 0;
+ }
+ } else
+ if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_string, $descriptor(std::string *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
+ if (!temp_string) {
+ $1 = 0;
+ }
+ } else
+ if (!PyUnicode_Check(item))
+ $1 = 0;
+ }
+ }
+}
+
+%typemap(in) const std::list<FiltersAPI_Argument> & (std::list<FiltersAPI_Argument> temp) {
+ ModelHighAPI_Selection* temp_selection;
+ std::string* temp_string;
+ int newmem = 0;
+ if (PySequence_Check($input)) {
+ for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
+ PyObject * item = PySequence_GetItem($input, i);
+ if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
+ if (!temp_selection) {
+ PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Selection or string.");
+ return NULL;
+ }
+ temp.push_back(FiltersAPI_Argument(*temp_selection));
+ if (newmem & SWIG_CAST_NEW_MEMORY) {
+ delete temp_selection;
+ }
+ } else
+ if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_string, $descriptor(std::string*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
+ if (!temp_string) {
+ PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Selection or string.");
+ return NULL;
+ }
+ temp.push_back(FiltersAPI_Argument(*temp_string));
+ if (newmem & SWIG_CAST_NEW_MEMORY) {
+ delete temp_string;
+ }
+ } else
+ if (PyUnicode_Check(item)) {
+ temp.push_back(FiltersAPI_Argument(PyUnicode_AsUTF8(item)));
+ } else {
+ PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Selection or string.");
+ return NULL;
+ }
+ Py_DECREF(item);
+ }
+ $1 = &temp;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Selection or std::string.");
+ return NULL;
+ }
+}
-// function with named parameters
-%feature("kwargs") addFilter;
// all supported interfaces
+%include "FiltersAPI_Argument.h"
%include "FiltersAPI_Feature.h"
%include "FiltersAPI_Filter.h"
%include "FiltersAPI_Selection.h"
--- /dev/null
+// Copyright (C) 2014-2019 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
+//
+
+#include "FiltersAPI_Argument.h"
+
+FiltersAPI_Argument::FiltersAPI_Argument()
+{
+}
+
+FiltersAPI_Argument::FiltersAPI_Argument(const std::string& theValue)
+ : myValue(theValue)
+{
+}
+
+FiltersAPI_Argument::FiltersAPI_Argument(const ModelHighAPI_Selection& theSelection)
+ : mySelection(theSelection)
+{
+}
+
+FiltersAPI_Argument::FiltersAPI_Argument(const AttributeSelectionPtr& theSelection)
+ : mySelectionAttr(theSelection)
+{
+}
+
+FiltersAPI_Argument::~FiltersAPI_Argument()
+{
+}
+
+void FiltersAPI_Argument::dump(ModelHighAPI_Dumper& theDumper) const
+{
+ if (mySelectionAttr)
+ theDumper << mySelectionAttr;
+ else if (mySelection.variantType() == ModelHighAPI_Selection::VT_Empty)
+ theDumper << "\"" << myValue << "\"";
+}
--- /dev/null
+// Copyright (C) 2014-2019 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
+//
+
+#ifndef FILTERSAPI_ARGUMENT_H_
+#define FILTERSAPI_ARGUMENT_H_
+
+#include "FiltersAPI.h"
+
+#include <ModelAPI_AttributeSelection.h>
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+
+/**\class FiltersAPI_Argument
+ * \ingroup CPPHighAPI
+ * \brief Argument of the Filter
+ */
+class FiltersAPI_Argument
+{
+public:
+ FILTERSAPI_EXPORT FiltersAPI_Argument();
+
+ FILTERSAPI_EXPORT
+ FiltersAPI_Argument(const std::string& theValue);
+
+ FILTERSAPI_EXPORT
+ FiltersAPI_Argument(const ModelHighAPI_Selection& theSelection);
+
+ FILTERSAPI_EXPORT
+ FiltersAPI_Argument(const AttributeSelectionPtr& theSelection);
+
+ /// Destructor
+ FILTERSAPI_EXPORT
+ virtual ~FiltersAPI_Argument();
+
+ const std::string& string() const { return myValue; }
+ const ModelHighAPI_Selection& selection() const { return mySelection; }
+
+ /// Dump wrapped feature
+ FILTERSAPI_EXPORT
+ void dump(ModelHighAPI_Dumper& theDumper) const;
+
+private:
+ std::string myValue;
+ ModelHighAPI_Selection mySelection;
+ AttributeSelectionPtr mySelectionAttr;
+};
+
+#endif
{
}
+static void separateArguments(const std::list<FiltersAPI_Argument>& theArguments,
+ std::list<ModelHighAPI_Selection>& theSelections,
+ std::list<std::string>& theTextArgs)
+{
+ std::list<FiltersAPI_Argument>::const_iterator anIt = theArguments.begin();
+ for (; anIt != theArguments.end(); ++anIt) {
+ if (anIt->selection().variantType() != ModelHighAPI_Selection::VT_Empty)
+ theSelections.push_back(anIt->selection());
+ else if (!anIt->string().empty())
+ theTextArgs.push_back(anIt->string());
+ }
+}
+
void FiltersAPI_Feature::setFilters(const std::list<FilterAPIPtr>& theFilters)
{
FiltersFeaturePtr aBase = std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(feature());
aBase->addFilter((*anIt)->name());
aBase->setReversed((*anIt)->name(), (*anIt)->isReversed());
- const std::list<ModelHighAPI_Selection>& anArgs = (*anIt)->arguments();
+ const std::list<FiltersAPI_Argument>& anArgs = (*anIt)->arguments();
if (!anArgs.empty()) {
- // find selectionList argument and fill it
+ // separate selection arguments and strings
+ std::list<ModelHighAPI_Selection> aSelections;
+ std::list<std::string> aTexts;
+ separateArguments(anArgs, aSelections, aTexts);
+
+ // fill arguments of the filter
std::list<AttributePtr> aFilterArgs = aBase->filterArgs((*anIt)->name());
for (std::list<AttributePtr>::iterator aFIt = aFilterArgs.begin();
aFIt != aFilterArgs.end(); ++aFIt) {
AttributeSelectionListPtr aSelList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*aFIt);
if (aSelList)
- fillAttribute(anArgs, aSelList);
+ fillAttribute(aSelections, aSelList);
else {
AttributeSelectionPtr aSelection =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aFIt);
- if (aSelection && anArgs.size() == 1)
- fillAttribute(anArgs.front(), aSelection);
+ if (aSelection && aSelections.size() == 1)
+ fillAttribute(aSelections.front(), aSelection);
+ else {
+ AttributeStringPtr aString =
+ std::dynamic_pointer_cast<ModelAPI_AttributeString>(*aFIt);
+ if (aString && aTexts.size() == 1)
+ fillAttribute(aTexts.front(), aString);
+ }
}
}
}
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeBoolean.h>
#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_AttributeString.h>
#include <ModelHighAPI_Dumper.h>
FiltersAPI_Filter::FiltersAPI_Filter(
const std::string& theName,
const bool theRevertFilter,
- const std::list<ModelHighAPI_Selection>& theArguments)
+ const std::list<FiltersAPI_Argument>& theArguments)
: myName(theName), myReversed(theRevertFilter), myFilterArguments(theArguments)
{
}
anArgIt != theArguments.end(); ++anArgIt) {
AttributeBooleanPtr aBoolAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(*anArgIt);
- if (aBoolAttr)
+ if (aBoolAttr) {
myReversed = aBoolAttr->value();
- else {
- AttributeSelectionListPtr aSelList =
- std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*anArgIt);
- if (aSelList) {
- int aSize = aSelList->size();
- for (int i = 0; i < aSize; ++i) {
- AttributeSelectionPtr aSelection = aSelList->value(i);
- myFilterArguments.push_back(
- ModelHighAPI_Selection(aSelection->context(), aSelection->value()));
- }
+ continue;
+ }
+
+ AttributeSelectionListPtr aSelList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*anArgIt);
+ if (aSelList) {
+ int aSize = aSelList->size();
+ for (int i = 0; i < aSize; ++i) {
+ AttributeSelectionPtr aSelection = aSelList->value(i);
+ myFilterArguments.push_back(FiltersAPI_Argument(aSelection));
}
+ continue;
+ }
+
+ AttributeSelectionPtr aSelection =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*anArgIt);
+ if (aSelection) {
+ myFilterArguments.push_back(FiltersAPI_Argument(aSelection));
+ continue;
+ }
+
+ AttributeStringPtr aString = std::dynamic_pointer_cast<ModelAPI_AttributeString>(*anArgIt);
+ if (aString) {
+ myFilterArguments.push_back(FiltersAPI_Argument(aString->value()));
+ continue;
}
}
}
theDumper << "model.addFilter(name = \"" << myName << "\"";
if (myReversed)
theDumper << ", exclude = " << myReversed;
- if (!myFilterArguments.empty())
- theDumper << ", args = []";
+ if (!myFilterArguments.empty()) {
+ theDumper << ", args = [";
+ bool isFirstArg = true;
+ for (std::list<FiltersAPI_Argument>::const_iterator anIt = myFilterArguments.begin();
+ anIt != myFilterArguments.end(); ++anIt) {
+ if (isFirstArg)
+ isFirstArg = false;
+ else
+ theDumper << ", ";
+ anIt->dump(theDumper);
+ }
+ theDumper << "]";
+ }
theDumper << ")";
}
// ================================================================================================
FilterAPIPtr addFilter(const std::string& name,
const bool exclude,
- const std::list<ModelHighAPI_Selection>& args)
+ const std::list<FiltersAPI_Argument>& args)
{
return FilterAPIPtr(new FiltersAPI_Filter(name, exclude, args));
}
#define FILTERSAPI_FILTER_H_
#include "FiltersAPI.h"
+#include "FiltersAPI_Argument.h"
#include <ModelHighAPI_Dumper.h>
#include <ModelHighAPI_Selection.h>
FiltersAPI_Filter(
const std::string& theName,
const bool theRevertFilter = false,
- const std::list<ModelHighAPI_Selection>& theArguments = std::list<ModelHighAPI_Selection>());
+ const std::list<FiltersAPI_Argument>& theArguments = std::list<FiltersAPI_Argument>());
// Internal constructor based on filter arguments
FILTERSAPI_EXPORT
const std::string& name() const { return myName; }
bool isReversed() const { return myReversed; }
- const std::list<ModelHighAPI_Selection>& arguments() const { return myFilterArguments; }
+ const std::list<FiltersAPI_Argument>& arguments() const { return myFilterArguments; }
/// Dump wrapped feature
FILTERSAPI_EXPORT
private:
std::string myName;
bool myReversed;
- std::list<ModelHighAPI_Selection> myFilterArguments;
+ std::list<FiltersAPI_Argument> myFilterArguments;
};
typedef std::shared_ptr<FiltersAPI_Filter> FilterAPIPtr;
FILTERSAPI_EXPORT FilterAPIPtr
addFilter(const std::string& name = std::string(),
const bool exclude = false,
- const std::list<ModelHighAPI_Selection>& args = std::list<ModelHighAPI_Selection>());
+ const std::list<FiltersAPI_Argument>& args = std::list<FiltersAPI_Argument>());
#endif
#include <ModelHighAPI_swig.h>
#include "FiltersAPI.h"
+ #include "FiltersAPI_Argument.h"
#include "FiltersAPI_Feature.h"
#include "FiltersAPI_Filter.h"
#include "FiltersAPI_Selection.h"
Events
Config
GeomAPI
+ GeomAlgoAPI
)
SET(XML_RESOURCES
${PROJECT_SOURCE_DIR}/src/Config
${PROJECT_SOURCE_DIR}/src/Events
${PROJECT_SOURCE_DIR}/src/GeomAPI
+ ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
${PROJECT_SOURCE_DIR}/src/GeomDataAPI
)
TestFilter_OnPlaneSide_Face.py
TestFilter_OnPlaneSide_Plane.py
TestFilter_OppositeToEdge.py
-# TestFilter_RelativeToSolid_In.py
-# TestFilter_RelativeToSolid_Out.py
-# TestFilter_RelativeToSolid_On.py
-# TestFilter_RelativeToSolid_NotOn.py
-# TestFilter_RelativeToSolid_InAndOn.py
-# TestFilter_RelativeToSolid_OutAndOn.py
+ TestFilter_RelativeToSolid_In.py
+ TestFilter_RelativeToSolid_Out.py
+ TestFilter_RelativeToSolid_On.py
+ TestFilter_RelativeToSolid_NotOn.py
+ TestFilter_RelativeToSolid_InAndOn.py
+ TestFilter_RelativeToSolid_OutAndOn.py
TestFilter_HorizontalFaces.py
TestFilter_VerticalFaces.py
)
#include "FiltersPlugin_RelativeToSolid.h"
+#include <GeomAPI_Solid.h>
+
+#include <GeomAlgoAPI_SolidClassifier.h>
+
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeString.h>
bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape,
const ModelAPI_FiltersArgs& theArgs) const
{
- return false;
+ AttributePtr anAttr = theArgs.argument("Solid");
+ AttributeSelectionPtr aSel = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttr);
+ if (!aSel)
+ return false;
+
+ anAttr = theArgs.argument("Location");
+ AttributeStringPtr aLocAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(anAttr);
+ if (!aLocAttr)
+ return false;
+ std::string aLocString = aLocAttr->value();
+
+ GeomShapePtr aSolidSelected = aSel->value();
+ if (!aSolidSelected && aSel->context())
+ aSolidSelected = aSel->context()->shape();
+ GeomSolidPtr aSolid = aSolidSelected ? aSolidSelected->solid() : GeomSolidPtr();
+ if (!aSolid)
+ return false;
+
+ GeomAlgoAPI_SolidClassifier aClassifier(aSolid, theShape);
+ GeomAlgoAPI_SolidClassifier::State aState = aClassifier.state();
+
+ bool isOK = false;
+ if (aLocString == "in")
+ isOK = aState == GeomAlgoAPI_SolidClassifier::State_IN;
+ else if (aLocString == "out")
+ isOK = aState == GeomAlgoAPI_SolidClassifier::State_OUT;
+ else if (aLocString == "on")
+ isOK = aState == GeomAlgoAPI_SolidClassifier::State_ON;
+ else if (aLocString == "not_on")
+ isOK = !(aState & GeomAlgoAPI_SolidClassifier::State_ON);
+ else if (aLocString == "not_out")
+ isOK = !(aState & GeomAlgoAPI_SolidClassifier::State_OUT);
+ else if (aLocString == "not_in")
+ isOK = !(aState & GeomAlgoAPI_SolidClassifier::State_IN);
+ return isOK;
}
static std::string XMLRepresentation =
" <case id=\"in\" title=\"In\"/>"
" <case id=\"out\" title=\"Out\"/>"
" <case id=\"on\" title=\"On\"/>"
-" <case id=\"noton\" title=\"Not On\"/>"
-" <case id=\"inon\" title=\"In and On\"/>"
-" <case id=\"outon\" title=\"On and Out\"/>"
+" <case id=\"not_on\" title=\"Not On\"/>"
+" <case id=\"not_out\" title=\"In and On\"/>"
+" <case id=\"not_in\" title=\"On and Out\"/>"
" </switch>"
"</filter>";
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "in"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): False,
+ model.selection(Solid2, emptyShape): False,
+ model.selection(Solid3, emptyShape): False,
+ model.selection(Solid4, emptyShape): False,
+ model.selection(Solid5, emptyShape): True,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): False,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): False,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): True,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): False,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): False,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): True,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): False,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_out"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): True,
+ model.selection(Solid2, emptyShape): False,
+ model.selection(Solid3, emptyShape): False,
+ model.selection(Solid4, emptyShape): True,
+ model.selection(Solid5, emptyShape): True,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): True,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): False,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): True,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): True,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): False,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): True,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): True,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): False,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_on"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): False,
+ model.selection(Solid2, emptyShape): True,
+ model.selection(Solid3, emptyShape): False,
+ model.selection(Solid4, emptyShape): False,
+ model.selection(Solid5, emptyShape): True,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): False,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): True,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): True,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): False,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): False,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): True,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): True,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): True,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): True,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): True,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): True,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "on"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): False,
+ model.selection(Solid2, emptyShape): False,
+ model.selection(Solid3, emptyShape): False,
+ model.selection(Solid4, emptyShape): False,
+ model.selection(Solid5, emptyShape): False,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): True,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): False,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): False,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): False,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): False,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): False,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): False,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): False,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "out"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): False,
+ model.selection(Solid2, emptyShape): True,
+ model.selection(Solid3, emptyShape): False,
+ model.selection(Solid4, emptyShape): False,
+ model.selection(Solid5, emptyShape): False,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): False,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): False,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): True,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): False,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): False,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): False,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): False,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): True,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): False,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): False,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): True,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): True,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
--- /dev/null
+# Copyright (C) 2014-2019 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
+#
+
+from SketchAPI import *
+
+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()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchAPI_Line(SketchLine_2).startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+SketchLine_3 = Sketch_1.addLine(0, 32.83768482493814, 29.63380351263586, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchLine_4 = Sketch_1.addLine(29.63380351263586, 0, 62.471488337574, 29.63380351263586)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(62.471488337574, 29.63380351263586, 32.83768482493814, 62.471488337574)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(32.83768482493814, 62.471488337574, 0, 32.83768482493814)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_6.endPoint())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_3.result(), SketchLine_4.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_3.result(), SketchLine_5.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_3.result(), 22, True)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
+SketchLine_7 = Sketch_1.addLine(0, 20, 0, 0)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 0, 20, 0)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f"), model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(28.24714778717828, 31.38901581881253, 10)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchLine_9 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_9.result(), 20, True)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_10.result(), 20, True)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 10, 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 0, 10)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), -10, 20)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 50, 10, 10)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_in"])])
+model.end()
+
+Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
+Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
+Solid3 = Extrusion_2.result().resultSubShapePair()[0]
+Solid4 = Extrusion_3.result().resultSubShapePair()[0]
+Solid5 = Extrusion_4.result().resultSubShapePair()[0]
+Solid6 = Translation_1.result().resultSubShapePair()[0]
+
+from GeomAPI import GeomAPI_Shape
+emptyShape = GeomAPI_Shape()
+
+Reference = {
+ # Solids
+ model.selection(Solid1, emptyShape): False,
+ model.selection(Solid2, emptyShape): True,
+ model.selection(Solid3, emptyShape): True,
+ model.selection(Solid4, emptyShape): False,
+ model.selection(Solid5, emptyShape): False,
+ model.selection(Solid6, emptyShape): False,
+
+ # Faces of solid 1
+ model.selection("FACE", "Extrusion_1_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"): True,
+ model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"): True,
+ # Faces of solid 2
+ model.selection("FACE", "Extrusion_1_2/To_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/From_Face"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8"): True,
+ model.selection("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2"): True,
+ # Faces of solid 3
+ model.selection("FACE", "Extrusion_2_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/From_Face"): True,
+ model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2"): True,
+ # Faces of solid 4
+ model.selection("FACE", "Extrusion_3_1/To_Face"): True,
+ model.selection("FACE", "Extrusion_3_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 5
+ model.selection("FACE", "Extrusion_4_1/To_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/From_Face"): False,
+ model.selection("FACE", "Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2"): False,
+ # Faces of solid 6
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+ model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+
+ # Edges of solid 1
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"): True,
+ # Edges of solid 2
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ # Edges of solid 3
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ model.selection("EDGE", "([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face])([Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face])"): True,
+ # Edges of solid 4
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("EDGE", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face])([Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face])"): False,
+ # Edges of solid 5
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("EDGE", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ model.selection("EDGE", "([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face])([Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face])"): False,
+ # Edges of solid 6
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): False,
+ model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): False,
+ model.selection("EDGE", "([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2])([Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3])"): True,
+
+ # Vertices of solid 1
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"): True,
+ # Vertices of solid 2
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_2/From_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/From_Face]"): True,
+ # Vertices of solid 3
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_2_1/From_Face]"): True,
+ # Vertices of solid 4
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/To_Face]"): True,
+ model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_3_1/From_Face]"): False,
+ # Vertices of solid 5
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/To_Face]"): False,
+ model.selection("VERTEX", "[Extrusion_4_1/Generated_Face&Sketch_2/SketchCircle_1_2][Extrusion_4_1/From_Face]"): False,
+ # Vertices of solid 6
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"): True,
+ model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_3]"): True,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
GeomAlgoAPI_CurveBuilder.h
GeomAlgoAPI_NExplode.h
GeomAlgoAPI_Offset.h
+ GeomAlgoAPI_SolidClassifier.h
)
SET(PROJECT_SOURCES
GeomAlgoAPI_CurveBuilder.cpp
GeomAlgoAPI_NExplode.cpp
GeomAlgoAPI_Offset.cpp
+ GeomAlgoAPI_SolidClassifier.cpp
)
SET(PROJECT_LIBRARIES
--- /dev/null
+// Copyright (C) 2014-2019 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
+//
+
+#include "GeomAlgoAPI_SolidClassifier.h"
+
+#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Shape.h>
+#include <GeomAPI_Solid.h>
+
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+#include <BRepExtrema_DistShapeShape.hxx>
+#include <TopoDS.hxx>
+
+
+static GeomAlgoAPI_SolidClassifier::State stateToState(const TopAbs_State theState)
+{
+ GeomAlgoAPI_SolidClassifier::State aResult;
+ switch (theState)
+ {
+ case TopAbs_IN:
+ aResult = GeomAlgoAPI_SolidClassifier::State_IN;
+ break;
+ case TopAbs_ON:
+ aResult = GeomAlgoAPI_SolidClassifier::State_ON;
+ break;
+ case TopAbs_OUT:
+ aResult = GeomAlgoAPI_SolidClassifier::State_OUT;
+ break;
+ default:
+ aResult = GeomAlgoAPI_SolidClassifier::State_ALL;
+ break;
+ }
+ return aResult;
+}
+
+static GeomAlgoAPI_SolidClassifier::State
+classifyMiddlePoint(BRepClass3d_SolidClassifier& theClassifier,
+ const GeomShapePtr& theShape,
+ const double theTolerance)
+{
+ GeomPointPtr aMiddlePoint = theShape->middlePoint();
+ theClassifier.Perform(aMiddlePoint->impl<gp_Pnt>(), theTolerance);
+ return stateToState(theClassifier.State());
+}
+
+static GeomAlgoAPI_SolidClassifier::State
+classifyVertices(BRepClass3d_SolidClassifier& theClassifier,
+ const GeomShapePtr& theShape,
+ const double theTolerance)
+{
+ GeomAlgoAPI_SolidClassifier::State aResult = GeomAlgoAPI_SolidClassifier::State_UNKNOWN;
+ TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+ for (TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
+ anExp.More() && aResult != GeomAlgoAPI_SolidClassifier::State_ALL;
+ anExp.Next()) {
+ TopoDS_Vertex aCurV = TopoDS::Vertex(anExp.Current());
+ theClassifier.Perform(BRep_Tool::Pnt(aCurV), theTolerance);
+ aResult |= stateToState(theClassifier.State());
+ }
+ return aResult;
+}
+
+static GeomAlgoAPI_SolidClassifier::State
+classifyVicinityOnEdge(BRepClass3d_SolidClassifier& theClassifier,
+ const TopoDS_Edge& theEdge,
+ const double theParameter,
+ const double theTolerance)
+{
+ // coefficient to step out of the vicinity of theParameter
+ static const double THE_STEP_COEFF = 2.0;
+
+ BRepAdaptor_Curve aCurve(theEdge);
+ double aParStep = aCurve.Resolution(theTolerance) * THE_STEP_COEFF;
+ double aParams[2] = { theParameter - aParStep, theParameter + aParStep };
+
+ GeomAlgoAPI_SolidClassifier::State aResult = GeomAlgoAPI_SolidClassifier::State_UNKNOWN;
+ for (double* anIt = std::begin(aParams); anIt != std::end(aParams); ++anIt) {
+ if (*anIt < aCurve.FirstParameter())
+ *anIt = aCurve.FirstParameter();
+ else if (*anIt > aCurve.LastParameter())
+ *anIt = aCurve.LastParameter();
+
+ gp_Pnt aPnt = aCurve.Value(*anIt);
+ theClassifier.Perform(aPnt, theTolerance);
+ aResult |= stateToState(theClassifier.State());
+ }
+ return aResult;
+}
+
+static GeomAlgoAPI_SolidClassifier::State
+classifyVicinityOnFace(BRepClass3d_SolidClassifier& theClassifier,
+ const TopoDS_Face& theFace,
+ const double theU,
+ const double theV,
+ const double theTolerance)
+{
+ // coefficient to step out of the vicinity of parameters
+ static const double THE_STEP_COEFF = 2.0;
+
+ BRepAdaptor_Surface aSurf(theFace);
+ double aStepU = aSurf.UResolution(theTolerance) * THE_STEP_COEFF;
+ double aStepV = aSurf.VResolution(theTolerance) * THE_STEP_COEFF;
+ double aParamsU[3] = { theU - aStepU, theU, theU + aStepU };
+ double aParamsV[3] = { theV - aStepV, theV, theV + aStepV };
+ for (double* aU = std::begin(aParamsU); aU != std::end(aParamsU); ++aU) {
+ if (*aU < aSurf.FirstUParameter())
+ *aU = aSurf.FirstUParameter();
+ else if (*aU > aSurf.LastUParameter())
+ *aU = aSurf.LastUParameter();
+ }
+ for (double* aV = std::begin(aParamsV); aV != std::end(aParamsV); ++aV) {
+ if (*aV < aSurf.FirstVParameter())
+ *aV = aSurf.FirstVParameter();
+ else if (*aV > aSurf.LastVParameter())
+ *aV = aSurf.LastVParameter();
+ }
+
+ GeomAlgoAPI_SolidClassifier::State aResult = GeomAlgoAPI_SolidClassifier::State_UNKNOWN;
+ for (double* aU = std::begin(aParamsU); aU != std::end(aParamsU); ++aU)
+ for (double* aV = std::begin(aParamsV); aV != std::end(aParamsV); ++aV) {
+ gp_Pnt aPnt = aSurf.Value(*aU, *aV);
+ theClassifier.Perform(aPnt, theTolerance);
+ aResult |= stateToState(theClassifier.State());
+ }
+ return aResult;
+}
+
+static GeomAlgoAPI_SolidClassifier::State
+classifyByDistance(BRepClass3d_SolidClassifier& theClassifier,
+ const GeomShapePtr& theSolid,
+ const GeomShapePtr& theShape,
+ const double theTolerance)
+{
+ GeomAlgoAPI_SolidClassifier::State aResult = GeomAlgoAPI_SolidClassifier::State_UNKNOWN;
+
+ const TopoDS_Shape& aSolid = theSolid->impl<TopoDS_Shape>();
+ const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
+ for (TopExp_Explorer anExp(aSolid, TopAbs_SHELL); anExp.More(); anExp.Next()) {
+ // compare distance from the shape to the solid's shells
+ BRepExtrema_DistShapeShape aDistance(anExp.Current(), aShape);
+ if (aDistance.Perform() && aDistance.Value() < theTolerance) {
+ aResult |= GeomAlgoAPI_SolidClassifier::State_ON;
+ // classify vicinity of intersection points
+ for (int sol = 1; sol <= aDistance.NbSolution(); ++sol) {
+ if (aDistance.SupportTypeShape2(sol) == BRepExtrema_IsOnEdge) {
+ TopoDS_Edge anEdge = TopoDS::Edge(aDistance.SupportOnShape2(sol));
+ double aParOnEdge;
+ aDistance.ParOnEdgeS2(sol, aParOnEdge);
+
+ aResult |= classifyVicinityOnEdge(theClassifier, anEdge, aParOnEdge, theTolerance);
+ }
+ else if (aDistance.SupportTypeShape2(sol) == BRepExtrema_IsInFace) {
+ TopoDS_Face aFace = TopoDS::Face(aDistance.SupportOnShape2(sol));
+ double aParU, aParV;
+ aDistance.ParOnFaceS2(sol, aParU, aParV);
+
+ aResult |= classifyVicinityOnFace(theClassifier, aFace, aParU, aParV, theTolerance);
+ }
+ }
+ }
+ }
+ return aResult;
+}
+
+
+//==================================================================================================
+GeomAlgoAPI_SolidClassifier::GeomAlgoAPI_SolidClassifier(const GeomSolidPtr theSolid,
+ const GeomShapePtr theShape,
+ const double theTolerance)
+ : myState(State_UNKNOWN)
+{
+ if (!theSolid || !theShape)
+ return;
+
+ BRepClass3d_SolidClassifier aClassifierAlgo(theSolid->impl<TopoDS_Shape>());
+
+ myState = classifyMiddlePoint(aClassifierAlgo, theShape, theTolerance);
+ if (!theShape->isVertex())
+ myState |= classifyVertices(aClassifierAlgo, theShape, theTolerance);
+ myState |= classifyByDistance(aClassifierAlgo, theSolid, theShape, theTolerance);
+
+ if (myState == State_ALL)
+ myState = State_UNKNOWN;
+}
--- /dev/null
+// Copyright (C) 2014-2019 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
+//
+
+#ifndef GeomAlgoAPI_SolidClassifier_H_
+#define GeomAlgoAPI_SolidClassifier_H_
+
+#include <GeomAlgoAPI.h>
+
+#include <memory>
+
+class GeomAPI_Shape;
+class GeomAPI_Solid;
+
+/// \class GeomAlgoAPI_SolidClassifier
+/// \ingroup DataAlgo
+/// \brief Classify shape according to the given solid.
+class GeomAlgoAPI_SolidClassifier
+{
+public:
+ typedef int State;
+
+ static const State State_UNKNOWN = 0x0;
+ static const State State_IN = 0x1;
+ static const State State_ON = 0x2;
+ static const State State_OUT = 0x4;
+ static const State State_ALL = State_IN & State_ON & State_OUT;
+
+public:
+ /// \brief Perform classification of the shape according to the solid.
+ /// \param[in] theSolid the base solid
+ /// \param[in] theShape the shape to classify
+ /// \param[in] theTolerance comparison tolrence
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_SolidClassifier(const std::shared_ptr<GeomAPI_Solid> theSolid,
+ const std::shared_ptr<GeomAPI_Shape> theShape,
+ const double theTolerance = 1.e-7);
+
+ /// \return Classification result.
+ State state() const { return myState; }
+
+private:
+ State myState;
+};
+
+#endif
// std::pair -> []
%template(ResultSubShapePair) std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >;
+%template(StringsPair) std::pair<std::string, std::string>;
// fix compilarion error: 'res*' was not declared in this scope
aFiltersFactory = ModelAPI_Session.get().filters()
for sel, res in theShapesList.items():
needUndo = False
+ shapeName = ""
+ shapeType = "UNKNOWN"
if sel.variantType() == ModelHighAPI_Selection.VT_ResultSubShapePair:
shape = sel.resultSubShapePair()[1]
if shape.isNull():
shape = sel.resultSubShapePair()[0].shape()
+ shapeName = sel.name()
+ shapeType = shape.shapeTypeStr()
else:
needUndo = True
theModel.begin()
subShapeFeature = createSubShape(thePartDoc, theModel, sel)
theModel.end()
shape = subShapeFeature.results()[0].resultSubShapePair()[0].shape()
- assert(aFiltersFactory.isValid(theFilter.feature(), shape) == res)
+ shapeType = sel.typeSubShapeNamePair()[0]
+ shapeName = sel.typeSubShapeNamePair()[1]
+ assert aFiltersFactory.isValid(theFilter.feature(), shape) == res, "Filter result for {} \"{}\" incorrect. Expected {}.".format(shapeType, shapeName, res)
if needUndo:
theModel.undo()