//==================================================================================================
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects)
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
fillAttribute(theMainObjects, mymainObjects);
+ fillAttribute(theFuzzy, myfuzzyValue);
execute(false);
}
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects)
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
+ fillAttribute(theFuzzy, myfuzzyValue);
execute(false);
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanCommon::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyValue);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_BooleanCommon::setAdvancedMode(const bool theMode)
{
aBase->selectionList(FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanCommon::TOOL_LIST_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_BooleanCommon::FUZZY_PARAM_ID())->value();
theDumper << "(" << aDocName << ", " << anObjects;
theDumper << ", " << aTools;
}
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
aFeature->data()->setVersion("");
BooleanCommonPtr aCommon;
if (theToolObjects.empty())
- aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects));
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, fuzzyParam));
else
- aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects));
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects, fuzzyParam));
return aCommon;
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Integer;
class ModelHighAPI_Selection;
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects);
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects);
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_BooleanCommon();
- INTERFACE_3(FeaturesPlugin_BooleanCommon::ID(),
+ INTERFACE_4(FeaturesPlugin_BooleanCommon::ID(),
creationMethod, FeaturesPlugin_BooleanCommon::CREATION_METHOD(),
ModelAPI_AttributeString, /** Creation method */,
mainObjects, FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID(),
ModelAPI_AttributeSelectionList, /** Main objects */,
toolObjects, FeaturesPlugin_BooleanCommon::TOOL_LIST_ID(),
- ModelAPI_AttributeSelectionList, /** Tool objects*/)
+ ModelAPI_AttributeSelectionList, /** Tool objects*/,
+ fuzzyValue, FeaturesPlugin_BooleanCommon::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter*/)
/// Set main objects.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Set mode.
FEATURESAPI_EXPORT
void setAdvancedMode(const bool theMode);
const std::shared_ptr<ModelAPI_Document>& part,
const std::list<ModelHighAPI_Selection>& objects,
const std::list<ModelHighAPI_Selection>& tools = std::list<ModelHighAPI_Selection>(),
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_BooleanCommon_H_
FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects)
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute(false);
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanCut::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_BooleanCut::dump(ModelHighAPI_Dumper& theDumper) const
{
aBase->selectionList(FeaturesPlugin_BooleanCut::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanCut::TOOL_LIST_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_BooleanCut::FUZZY_PARAM_ID())->value();
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
BooleanCutPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCut::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return BooleanCutPtr(new FeaturesAPI_BooleanCut(aFeature,
- theMainObjects,
- theToolObjects));
+ return BooleanCutPtr(new FeaturesAPI_BooleanCut(aFeature, theMainObjects, theToolObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Integer;
class ModelHighAPI_Selection;
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects);
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_BooleanCut();
- INTERFACE_2(FeaturesPlugin_BooleanCut::ID(),
+ INTERFACE_3(FeaturesPlugin_BooleanCut::ID(),
mainObjects, FeaturesPlugin_BooleanCut::OBJECT_LIST_ID(),
ModelAPI_AttributeSelectionList, /** Main objects */,
toolObjects, FeaturesPlugin_BooleanCut::TOOL_LIST_ID(),
- ModelAPI_AttributeSelectionList, /** Tool objects*/)
+ ModelAPI_AttributeSelectionList, /** Tool objects*/,
+ fuzzyParam, FeaturesPlugin_BooleanCut::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Set main objects.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
BooleanCutPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_BooleanCut_H_
FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects)
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute(false);
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanFill::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_BooleanFill::dump(ModelHighAPI_Dumper& theDumper) const
{
aBase->selectionList(FeaturesPlugin_BooleanFill::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanFill::TOOL_LIST_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_BooleanFill::FUZZY_PARAM_ID())->value();
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
BooleanFillPtr addSplit(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFill::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature, theMainObjects, theToolObjects));
+ return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature, theMainObjects, theToolObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Integer;
class ModelHighAPI_Selection;
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFill(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects);
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_BooleanFill();
- INTERFACE_2(FeaturesPlugin_BooleanFill::ID(),
+ INTERFACE_3(FeaturesPlugin_BooleanFill::ID(),
mainObjects, FeaturesPlugin_BooleanFill::OBJECT_LIST_ID(),
ModelAPI_AttributeSelectionList, /** Main objects */,
toolObjects, FeaturesPlugin_BooleanFill::TOOL_LIST_ID(),
- ModelAPI_AttributeSelectionList, /** Tool objects*/)
+ ModelAPI_AttributeSelectionList, /** Tool objects*/,
+ fuzzyParam, FeaturesPlugin_BooleanFill::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Set main objects.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
BooleanFillPtr addSplit(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_BooleanFill_H_
FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const bool theRemoveEdges)
+ const bool theRemoveEdges,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theRemoveEdges, myremoveEdges);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute(false);
}
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
- const bool theRemoveEdges)
+ const bool theRemoveEdges,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
fillAttribute(theRemoveEdges, myremoveEdges);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute(false);
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_BooleanFuse::setAdvancedMode(const bool theMode)
{
aBase->selectionList(FeaturesPlugin_BooleanFuse::TOOL_LIST_ID());
AttributeBooleanPtr aRemoveEdges =
aBase->boolean(FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_BooleanFuse::FUZZY_PARAM_ID())->value();
theDumper << "(" << aDocName << ", " << anObjects;
theDumper << ", removeEdges = True";
}
+ if (aFuzzy != 1.e-8) {
+ theDumper << ", fuzzyParam = " << aFuzzy;
+ }
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::pair<std::list<ModelHighAPI_Selection>, bool>& theToolObjects,
const bool theRemoveEdges,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
BooleanFusePtr aFuse;
if (theToolObjects.first.empty())
- aFuse.reset(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, aRemoveEdges));
+ aFuse.reset(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, aRemoveEdges, fuzzyParam));
else {
aFuse.reset(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, theToolObjects.first,
- aRemoveEdges));
+ aRemoveEdges, fuzzyParam));
}
return aFuse;
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Integer;
class ModelHighAPI_Selection;
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const bool theRemoveEdges = false);
+ const bool theRemoveEdges = false,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
- const bool theRemoveEdges = false);
+ const bool theRemoveEdges = false,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_BooleanFuse();
- INTERFACE_4(FeaturesPlugin_BooleanFuse::ID(),
+ INTERFACE_5(FeaturesPlugin_BooleanFuse::ID(),
creationMethod, FeaturesPlugin_BooleanFuse::CREATION_METHOD(),
ModelAPI_AttributeString, /** Creation method */,
mainObjects, FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID(),
toolObjects, FeaturesPlugin_BooleanFuse::TOOL_LIST_ID(),
ModelAPI_AttributeSelectionList, /** Tool objects*/,
removeEdges, FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID(),
- ModelAPI_AttributeBoolean, /** Remove edges */)
+ ModelAPI_AttributeBoolean, /** Remove edges */,
+ fuzzyParam, FeaturesPlugin_BooleanFuse::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Set main objects.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setRemoveEdges(const bool theRemoveEdges);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Set mode.
FEATURESAPI_EXPORT
void setAdvancedMode(const bool theMode);
const std::list<ModelHighAPI_Selection>& objects,
const std::pair<std::list<ModelHighAPI_Selection>, bool>& tools = DUMMY_TOOLS,
const bool removeEdges = false,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_BooleanFuse_H_
FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects)
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute(false);
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanSmash::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const
{
aBase->selectionList(FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanSmash::TOOL_LIST_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_BooleanSmash::FUZZY_PARAM_ID())->value();
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanSmash::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature, theMainObjects, theToolObjects));
+ return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature, theMainObjects, theToolObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Integer;
class ModelHighAPI_Selection;
FEATURESAPI_EXPORT
FeaturesAPI_BooleanSmash(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects);
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_BooleanSmash();
- INTERFACE_2(FeaturesPlugin_BooleanSmash::ID(),
+ INTERFACE_3(FeaturesPlugin_BooleanSmash::ID(),
mainObjects, FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID(),
ModelAPI_AttributeSelectionList, /** Main objects */,
toolObjects, FeaturesPlugin_BooleanSmash::TOOL_LIST_ID(),
- ModelAPI_AttributeSelectionList, /** Tool objects*/)
+ ModelAPI_AttributeSelectionList, /** Tool objects*/,
+ fuzzyParam, FeaturesPlugin_BooleanSmash::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Set main objects.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_BooleanSmash_H_
//==================================================================================================
FeaturesAPI_Intersection::FeaturesAPI_Intersection(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theObjects)
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(theObjects, myobjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
execute();
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_Intersection::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const
{
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_Intersection::FUZZY_PARAM_ID())->value();
theDumper << aBase << " = model.addIntersection(" << aDocName << ", " << anAttrObjects;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
//==================================================================================================
IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Intersection::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return IntersectionPtr(new FeaturesAPI_Intersection(aFeature, theObjects));
+ return IntersectionPtr(new FeaturesAPI_Intersection(aFeature, theObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Dumper;
class ModelHighAPI_Selection;
/// Constructor with values.
FEATURESAPI_EXPORT
explicit FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theObjects);
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const ModelHighAPI_Double& aFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_Intersection();
- INTERFACE_1(FeaturesPlugin_Intersection::ID(),
+ INTERFACE_2(FeaturesPlugin_Intersection::ID(),
objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(),
- ModelAPI_AttributeSelectionList, /** Objects */)
+ ModelAPI_AttributeSelectionList, /** Objects */,
+ fuzzyParam, FeaturesPlugin_Intersection::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Modify objects attribute of the feature.
FEATURESAPI_EXPORT
void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
FEATURESAPI_EXPORT
IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& part,
const std::list<ModelHighAPI_Selection>& objects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_Intersection_H_
//==================================================================================================
FeaturesAPI_Partition::FeaturesAPI_Partition(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- setBase(theBaseObjects);
+ fillAttribute(theBaseObjects, mybaseObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
+ execute();
}
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_Partition::setFuzzy(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_Partition::dump(ModelHighAPI_Dumper& theDumper) const
{
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_Partition::FUZZY_PARAM_ID())->value();
theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
//==================================================================================================
PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Partition::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects));
+ return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Dumper;
class ModelHighAPI_Selection;
/// Constructor with values.
FEATURESAPI_EXPORT
explicit FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects);
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_Partition();
- INTERFACE_1(FeaturesPlugin_Partition::ID(),
+ INTERFACE_2(FeaturesPlugin_Partition::ID(),
baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(),
- ModelAPI_AttributeSelectionList, /** Base objects */)
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ fuzzyParam, FeaturesPlugin_Partition::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+ /// Modify fuzzy parameter attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setFuzzy(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
FEATURESAPI_EXPORT
PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_Partition_H_
//================================================================================================
FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- setBase(theBaseObjects);
+ fillAttribute(theBaseObjects, mybaseObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
}
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_Union::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const
{
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_Union::FUZZY_PARAM_ID())->value();
theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
//==================================================================================================
UnionPtr addUnion(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Union::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects));
+ return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects, fuzzyParam));
}
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Double.h>
class ModelHighAPI_Dumper;
class ModelHighAPI_Selection;
/// Constructor with values.
FEATURESAPI_EXPORT
explicit FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects);
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_Union();
- INTERFACE_1(FeaturesPlugin_Union::ID(),
+ INTERFACE_2(FeaturesPlugin_Union::ID(),
baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(),
- ModelAPI_AttributeSelectionList, /** Base objects */)
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ fuzzyParam, FeaturesPlugin_Union::FUZZY_PARAM_ID(),
+ ModelAPI_AttributeDouble, /** Fuzzy parameter */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+ /// Set fuzzy parameter.
+ FEATURESAPI_EXPORT
+ void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
FEATURESAPI_EXPORT
UnionPtr addUnion(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
const bool keepSubResults = false);
#endif // FeaturesAPI_Union_H_
#include <ModelAPI_Data.h>
#include <ModelAPI_Document.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_ResultBody.h>
//=================================================================================================
void FeaturesPlugin_Boolean::initAttributes()
{
- AttributeSelectionListPtr aSelection =
- std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
- FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+ data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- aSelection = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
- FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+ data()->addAttribute(FeaturesPlugin_Boolean::FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID());
document()->createBody(data(), theResultIndex);
ModelAPI_Tools::loadModifiedShapes(aResultBody,
- theObjects,
- theTools,
- theMakeShapeList,
- theResultShape);
+ theObjects,
+ theTools,
+ theMakeShapeList,
+ theResultShape);
setResult(aResultBody, theResultIndex++);
// merge algorithms
return MY_TOOL_LIST_ID;
}
+ /// Attribute name of fuzzy parameter.
+ inline static const std::string& FUZZY_PARAM_ID()
+ {
+ static const std::string MY_FUZZY_PARAM_ID("fuzzy_param");
+ return MY_FUZZY_PARAM_ID;
+ }
+
/// \return boolean operation type.
FEATURESPLUGIN_EXPORT OperationType operationType();
#include "FeaturesPlugin_BooleanCommon.h"
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeString.h>
#include <GeomAlgoAPI_CompoundBuilder.h>
#include <GeomAlgoAPI_Tools.h>
+
//==================================================================================================
FeaturesPlugin_BooleanCommon::FeaturesPlugin_BooleanCommon()
: FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_COMMON)
data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
return;
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
// version of COMMON feature
const std::string aCommonVersion = data()->version();
std::shared_ptr<GeomAlgoAPI_Boolean> aCommonAlgo(
new GeomAlgoAPI_Boolean(aShape,
*anObjectsIt,
- GeomAlgoAPI_Tools::BOOL_COMMON));
+ GeomAlgoAPI_Tools::BOOL_COMMON,
+ aFuzzy));
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCommonAlgo, getKind(), anError)) {
setError(anError);
ListOfShape anObjectList = anObjects.objects();
ListOfShape aToolsList;
ModelAPI_Tools::loadModifiedShapes(aResultBody,
- anObjectList,
- aToolsList,
- aMakeShapeList,
- aShape);
+ anObjectList,
+ aToolsList,
+ aMakeShapeList,
+ aShape);
GeomShapePtr aBaseShape = anObjectList.front();
anObjectList.pop_front();
setResult(aResultBody, aResultIndex);
// Compound handling
isOk = processCompound(GeomAlgoAPI_Tools::BOOL_COMMON,
anObjects, aParent, aTools.objects(),
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
// Compsolid handling
isOk = processCompsolid(GeomAlgoAPI_Tools::BOOL_COMMON,
anObjects, aParent, aTools.objects(), ListOfShape(),
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
// process object as is
isOk = processObject(GeomAlgoAPI_Tools::BOOL_COMMON,
anObject, aTools.objects(), aPlanes,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
if (!aResultCompound)
aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList,
- aTools.objects(),
- aResultCompound);
+ aTools.objects(),
+ aResultCompound);
// remove the rest results if there were produced in the previous pass
removeResults(aResultIndex);
return MY_CREATION_METHOD_ID;
}
- /// Attribute name of main objects.
- inline static const std::string& OBJECT_LIST_ID()
- {
- static const std::string MY_OBJECT_LIST_ID("main_objects");
- return MY_OBJECT_LIST_ID;
- }
-
- /// Attribute name of tool objects.
- inline static const std::string& TOOL_LIST_ID()
- {
- static const std::string MY_TOOL_LIST_ID("tool_objects");
- return MY_TOOL_LIST_ID;
- }
-
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
#include "FeaturesPlugin_BooleanCut.h"
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Tools.h>
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_ShapeIterator.h>
+
//==================================================================================================
FeaturesPlugin_BooleanCut::FeaturesPlugin_BooleanCut()
: FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_CUT)
keepUnusedSubsOfCompound(GeomShapePtr(), anObjects, aTools, aMakeShapeList);
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
// For solids cut each object with all tools.
bool isOk = true;
for (GeomAPI_ShapeHierarchy::iterator anObjectsIt = anObjects.begin();
// Compound handling
isOk = processCompound(GeomAlgoAPI_Tools::BOOL_CUT,
anObjects, aParent, aTools.objects(),
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
// Compsolid handling
isOk = processCompsolid(GeomAlgoAPI_Tools::BOOL_CUT,
anObjects, aParent, aTools.objects(), ListOfShape(),
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
// process object as is
isOk = processObject(GeomAlgoAPI_Tools::BOOL_CUT,
anObject, aTools.objects(), aPlanes,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
if (!aResultCompound)
aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList,
- aTools.objects(),
- aResultCompound);
+ aTools.objects(),
+ aResultCompound);
// remove the rest results if there were produced in the previous pass
removeResults(aResultIndex);
#include "FeaturesPlugin_BooleanFill.h"
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Tools.h>
#include <algorithm>
#include <map>
+
//=================================================================================================
FeaturesPlugin_BooleanFill::FeaturesPlugin_BooleanFill()
: FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_FILL)
keepUnusedSubsOfCompound(GeomShapePtr(), anObjects, aTools, aMakeShapeList);
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
// For solids cut each object with all tools.
bool isOk = true;
for (GeomAPI_ShapeHierarchy::iterator anObjectsIt = anObjects.begin();
// compsolid handling
isOk = processCompsolid(GeomAlgoAPI_Tools::BOOL_PARTITION,
anObjects, aParent, aTools.objects(), aPlanes,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
} else {
// process object as is
isOk = processObject(GeomAlgoAPI_Tools::BOOL_PARTITION,
anObject, aTools.objects(), aPlanes,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
if (!aResultCompound)
aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList,
- aTools.objects(),
- aResultCompound);
+ aTools.objects(),
+ aResultCompound);
// remove the rest results if there were produced in the previous pass
removeResults(aResultIndex);
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeString.h>
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_ShapeIterator.h>
+
+//==================================================================================================
static void explodeCompound(const GeomShapePtr& theShape, ListOfShape& theResult)
{
if (theShape->shapeType() == GeomAPI_Shape::COMPOUND) {
data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
data()->addAttribute(REMOVE_INTERSECTION_EDGES_ID(), ModelAPI_AttributeBoolean::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID());
return;
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
// version of FUSE feature
const std::string aFuseVersion = data()->version();
GeomShapePtr aCuttedEdgesAndFaces;
if (!anEdgesAndFaces.empty()) {
std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces,
- anOriginalShapes, GeomAlgoAPI_Tools::BOOL_CUT));
+ anOriginalShapes, GeomAlgoAPI_Tools::BOOL_CUT, aFuzzy));
if (aCutAlgo->isDone()) {
aCuttedEdgesAndFaces = aCutAlgo->shape();
aMakeShapeList->appendAlgo(aCutAlgo);
ListOfShape aOneObjectList;
aOneObjectList.push_back(*anIt);
std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(
- new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT));
+ new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT, aFuzzy));
if (GeomAlgoAPI_ShapeTools::area(aCutAlgo->shape()) > 1.e-27) {
aSolidsToFuse.push_back(aCutAlgo->shape());
} else if ((anObjects.size() + aTools.size()) > 1) {
std::shared_ptr<GeomAlgoAPI_Boolean> aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects,
aTools,
- GeomAlgoAPI_Tools::BOOL_FUSE));
+ GeomAlgoAPI_Tools::BOOL_FUSE,
+ aFuzzy));
// Checking that the algorithm worked properly.
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFuseAlgo, getKind(), anError)) {
aShapesToAdd.push_back(aShape);
}
std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
- new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true, aFuzzy));
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFillerAlgo, getKind(), anError)) {
setError(anError);
return;
#include "FeaturesPlugin_BooleanSmash.h"
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Tools.h>
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_ShapeIterator.h>
+
//==================================================================================================
FeaturesPlugin_BooleanSmash::FeaturesPlugin_BooleanSmash()
: FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_SMASH)
data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
}
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
if (!aShapesToAdd.empty()) {
// Cut objects with not used solids.
std::shared_ptr<GeomAlgoAPI_Boolean> anObjectsCutAlgo(
new GeomAlgoAPI_Boolean(aShapesToSmash,
aShapesToAdd,
- GeomAlgoAPI_Tools::BOOL_CUT));
+ GeomAlgoAPI_Tools::BOOL_CUT,
+ aFuzzy));
if (GeomAlgoAPI_ShapeTools::area(anObjectsCutAlgo->shape()) > 1.e-27) {
aShapesToSmash.clear();
std::shared_ptr<GeomAlgoAPI_Boolean> aToolsCutAlgo(
new GeomAlgoAPI_Boolean(aTools,
aShapesToAdd,
- GeomAlgoAPI_Tools::BOOL_CUT));
+ GeomAlgoAPI_Tools::BOOL_CUT,
+ aFuzzy));
if (GeomAlgoAPI_ShapeTools::area(aToolsCutAlgo->shape()) > 1.e-27) {
aTools.clear();
std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(
new GeomAlgoAPI_Boolean(aShapesToSmash,
aTools,
- GeomAlgoAPI_Tools::BOOL_CUT));
+ GeomAlgoAPI_Tools::BOOL_CUT,
+ aFuzzy));
// Checking that the algorithm worked properly.
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
}
else {
std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
- new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true, aFuzzy));
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFillerAlgo, getKind(), anError)) {
setError(anError);
return;
#include <ModelAPI_Document.h>
#include <ModelAPI_BodyBuilder.h>
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Tools.h>
#include <sstream>
+
static const std::string INTERSECTION_VERSION_1("v9.5");
//=================================================================================================
AttributePtr anObjectsAttr = data()->addAttribute(OBJECT_LIST_ID(),
ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
initVersion(INTERSECTION_VERSION_1, anObjectsAttr, AttributePtr());
}
return;
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
int aResultIndex = 0;
// Create result.
const ListOfShape& anObjects = anObjectsHierarchy.objects();
- GeomMakeShapePtr anIntersectionAlgo(new GeomAlgoAPI_Intersection(anObjects));
+ GeomMakeShapePtr anIntersectionAlgo(new GeomAlgoAPI_Intersection(anObjects, aFuzzy));
// Checking that the algorithm worked properly.
std::string anError;
return MY_OBJECT_LIST_ID;
}
+ /// Attribute name of fuzzy parameter.
+ inline static const std::string& FUZZY_PARAM_ID()
+ {
+ static const std::string MY_FUZZY_PARAM_ID("fuzzy_param");
+ return MY_FUZZY_PARAM_ID;
+ }
+
/// Returns the kind of a feature.
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
#include "FeaturesPlugin_Partition.h"
#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_AttributeSelectionList.h>
void FeaturesPlugin_Partition::initAttributes()
{
data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
+
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
}
return;
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
ListOfShape aBaseObjects = anObjects.objects();
aBaseObjects.insert(aBaseObjects.end(), aPlanes.begin(), aPlanes.end());
// cut unused solids of composolids from the objects of partition
ListOfShape aTargetObjects, anUnusedSubs;
std::string aError;
- if (!cutSubs(anObjects, aTargetObjects, anUnusedSubs, aMakeShapeList, aError)) {
+ if (!cutSubs(anObjects, aTargetObjects, anUnusedSubs, aFuzzy, aMakeShapeList, aError)) {
setError(aError);
return;
}
// perform partition first time to split target solids by planes
std::shared_ptr<GeomAlgoAPI_Partition> aPartitionAlgo(
- new GeomAlgoAPI_Partition(aTargetObjects, aPlanes));
+ new GeomAlgoAPI_Partition(aTargetObjects, aPlanes, aFuzzy));
// Checking that the algorithm worked properly.
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPartitionAlgo, getKind(), aError)) {
//=================================================================================================
-
static bool cutSubs(ListOfShape& theSubsToCut,
const ListOfShape& theTools,
+ const double theFuzzy,
std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
std::string& theError)
{
// cut from current list of solids
std::shared_ptr<GeomAlgoAPI_MakeShape> aCutAlgo(
- new GeomAlgoAPI_Boolean(theSubsToCut, theTools, GeomAlgoAPI_Tools::BOOL_CUT));
+ new GeomAlgoAPI_Boolean(theSubsToCut, theTools, GeomAlgoAPI_Tools::BOOL_CUT, theFuzzy));
if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, "", theError))
return false;
theMakeShapeList->appendAlgo(aCutAlgo);
return true;
}
+//=================================================================================================
bool FeaturesPlugin_Partition::cutSubs(
GeomAPI_ShapeHierarchy& theHierarchy,
ListOfShape& theUsed,
ListOfShape& theNotUsed,
+ const double theFuzzy,
std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
std::string& theError)
{
else
aUsed.push_back(*anIt);
- isOk = ::cutSubs(aUsed, aToolsForUsed, theMakeShapeList, theError)
- && ::cutSubs(aNotUsed, aToolsForUnused, theMakeShapeList, theError);
+ isOk = ::cutSubs(aUsed, aToolsForUsed, theFuzzy, theMakeShapeList, theError)
+ && ::cutSubs(aNotUsed, aToolsForUnused, theFuzzy, theMakeShapeList, theError);
if (isOk) {
theUsed.insert(theUsed.end(), aUsed.begin(), aUsed.end());
theNotUsed.insert(theNotUsed.end(), aNotUsed.begin(), aNotUsed.end());
return MY_BASE_OBJECTS_ID;
}
+ /// Attribute name of fuzzy parameter.
+ inline static const std::string& FUZZY_PARAM_ID()
+ {
+ static const std::string MY_FUZZY_PARAM_ID("fuzzy_param");
+ return MY_FUZZY_PARAM_ID;
+ }
+
/// \return the kind of a feature.
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
bool cutSubs(GeomAPI_ShapeHierarchy& theHierarchy,
ListOfShape& theUsed,
ListOfShape& theNotUsed,
+ const double theFuzzy,
std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
std::string& theError);
};
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_ShapeIterator.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_Tools.h>
+
//=================================================================================================
FeaturesPlugin_Union::FeaturesPlugin_Union()
{
void FeaturesPlugin_Union::initAttributes()
{
data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
+
+ data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
+ // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
+ // that the internal algorithms should use their default fuzzy value, if none was specified
+ // by the user.
+ real(FUZZY_PARAM_ID())->setValue(1.e-8);
+
initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
}
return;
}
+ // Getting fuzzy parameter.
+ // Used as additional tolerance to eliminate tiny results.
+ double aFuzzy = real(FUZZY_PARAM_ID())->value();
+
std::string anError;
int aResultIndex = 0;
std::vector<ModelAPI_Tools::ResultBaseAlgo> aResultBaseAlgoList;
// compsolid handling
isOk = processCompsolid(GeomAlgoAPI_Tools::BOOL_FUSE,
anObjects, aParent, anEmptyList, anEmptyList,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
} else {
// process object as is
isOk = processObject(GeomAlgoAPI_Tools::BOOL_FUSE,
anObject, anEmptyList, anEmptyList,
+ aFuzzy,
aResultIndex, aResultBaseAlgoList, aResultShapesList,
aResultCompound);
}
return MY_BASE_OBJECTS_ID;
}
+ /// Attribute name of fuzzy parameter.
+ inline static const std::string& FUZZY_PARAM_ID()
+ {
+ static const std::string MY_FUZZY_PARAM_ID("fuzzy_param");
+ return MY_FUZZY_PARAM_ID;
+ }
+
/// \return the kind of a feature.
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
#include <algorithm>
#include <map>
+
+//=================================================================================================
static void performBoolean(const GeomAlgoAPI_Tools::BOPType theBooleanType,
GeomMakeShapePtr& theBooleanAlgo,
const ListOfShape& theObjects,
- const ListOfShape& theTools)
+ const ListOfShape& theTools,
+ const double theFuzzy)
{
if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
theBooleanAlgo.reset(new GeomAlgoAPI_Partition(theObjects, theTools));
ListOfShape anObjects = theObjects;
ListOfShape aTools;
aTools.splice(aTools.begin(), anObjects, anObjects.begin());
- theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(anObjects, aTools, theBooleanType));
+ theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(anObjects, aTools, theBooleanType, theFuzzy));
}
}
else
- theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(theObjects, theTools, theBooleanType));
+ theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(theObjects, theTools, theBooleanType, theFuzzy));
}
}
const GeomShapePtr& theObject,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
aToolsWithPlanes.insert(aToolsWithPlanes.end(), aPlanesCopy.begin(), aPlanesCopy.end());
if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
- aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes));
+ aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes, theFuzzy));
else
aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
aToolsWithPlanes,
- theBooleanType));
+ theBooleanType,
+ theFuzzy));
// Checking that the algorithm worked properly.
std::string anError;
const GeomShapePtr& theCompsolid,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
aToolsWithPlanes.insert(aToolsWithPlanes.end(), aPlanesCopy.begin(), aPlanesCopy.end());
std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
- performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationSolids, aToolsWithPlanes);
+ performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationSolids, aToolsWithPlanes, theFuzzy);
// Checking that the algorithm worked properly.
std::string anError;
ListOfShape aShapesToAdd = aNotUsedSolids;
aShapesToAdd.push_back(aBoolAlgo->shape());
std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
- new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true, theFuzzy));
if (!aFillerAlgo->isDone()) {
std::string aFeatureError = "Error: PaveFiller algorithm failed.";
setError(aFeatureError);
GeomAPI_ShapeHierarchy& theCompoundHierarchy,
const GeomShapePtr& theCompound,
const ListOfShape& theTools,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
- performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationShapes, theTools);
+ performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationShapes, theTools, theFuzzy);
// Checking that the algorithm worked properly.
std::string anError;
const GeomShapePtr& theObject,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
const GeomShapePtr& theCompsolid,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
GeomAPI_ShapeHierarchy& theCompoundHierarchy,
const GeomShapePtr& theCompound,
const ListOfShape& theTools,
+ const double theFuzzy,
int& theResultIndex,
std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
<translation>Objets outils</translation>
</message>
</context>
+ <context>
+ <name>Common:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<context>
<name>Model_Data</name>
<message>
<translation>Objets outils</translation>
</message>
</context>
+ <context>
+ <name>Cut:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Split -->
<context>
<translation>Objets outils</translation>
</message>
</context>
+ <context>
+ <name>Fuse:fuzzy_param</name>
+ <message>
+ <source>Fuzzy Parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- FusionFaces -->
<context>
<translation>Sélectionner des objets.</translation>
</message>
</context>
+ <context>
+ <name>Intersection:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Partition -->
<context>
<translation>Sélectionner des objets pour le partitionnement.</translation>
</message>
</context>
+ <context>
+ <name>Partition:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Pipe -->
<context>
<translation>Objets outils</translation>
</message>
</context>
+ <context>
+ <name>Smash:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Split -->
<context>
<translation>Objets outils</translation>
</message>
</context>
+ <context>
+ <name>Split:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Union -->
<context>
<translation>Sélectionner les solides pour la réunion.</translation>
</message>
</context>
+ <context>
+ <name>Union:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<!-- Validators -->
<translation>La forme sélectionnée est du mauvais type.</translation>
</message>
</context>
+ <context>
+ <name>Boolean:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Paramètre flou</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Tolérance supplémentaire pour éliminer les petits résultats.</translation>
+ </message>
+ </context>
<context>
<name>Boolean:GeomValidators_BooleanArguments</name>
<message>
<message>
<source>Error: Empty shape.</source>
<translation>Выбранные вспомогательные объекты невалидны.</translation>
- </message>
+ </message>
<message>
<source>Error: Local selection not allowed.</source>
<translation>Локальная селекция запрещена.</translation>
<translation>Выбраныне вспомогательные объекты имеют недопустимый тип.</translation>
</message>
</context>
+ <context>
+ <name>Boolean:fuzzy_param</name>
+ <message>
+ <source>Fuzzy parameter</source>
+ <translation>Нечеткий параметр</translation>
+ </message>
+ <message>
+ <source>Additional tolerance to eliminate tiny result.</source>
+ <translation>Дополнительный допуск для устранения крошечного результата.</translation>
+ </message>
+ </context>
<context>
<name>Boolean:GeomValidators_BooleanArguments</name>
<message>
--- /dev/null
+# Copyright (C) 2014-2022 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 salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+aShapeTypes = {
+ GeomAPI_Shape.SOLID: "GeomAPI_Shape.SOLID",
+ GeomAPI_Shape.FACE: "GeomAPI_Shape.FACE",
+ GeomAPI_Shape.EDGE: "GeomAPI_Shape.EDGE",
+ GeomAPI_Shape.VERTEX: "GeomAPI_Shape.VERTEX"}
+
+def testNbUniqueSubShapes(theFeature, theShapeType, theExpectedNbSubShapes):
+ """ Tests number of unique feature sub-shapes of passed type for each result.
+ :param theFeature: feature to test.
+ :param theShapeType: shape type of sub-shapes to test.
+ :param theExpectedNbSubShapes: list of sub-shapes numbers. Size of list should be equal to len(theFeature.results()).
+ """
+ aResults = theFeature.feature().results()
+ aNbResults = len(aResults)
+ aListSize = len(theExpectedNbSubShapes)
+ assert (aNbResults == aListSize), "Number of results: {} not equal to list size: {}.".format(aNbResults, aListSize)
+ for anIndex in range(0, aNbResults):
+ aNbResultSubShapes = 0
+ anExpectedNbSubShapes = theExpectedNbSubShapes[anIndex]
+ aNbResultSubShapes = aResults[anIndex].shape().subShapes(theShapeType, True).size()
+ assert (aNbResultSubShapes == anExpectedNbSubShapes), "Number of sub-shapes of type {} for result[{}]: {}. Expected: {}.".format(aShapeTypes[theShapeType], anIndex, aNbResultSubShapes, anExpectedNbSubShapes)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Param_fuzzy = model.addParameter(Part_1_doc, "fuzzy", '1e-06')
+
+### Create Sphere
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 5)
+
+### Create Point
+Point_2 = model.addPoint(Part_1_doc, 9.999995, 0, 0)
+
+### Create Sphere
+Sphere_2 = model.addSphere(Part_1_doc, model.selection("VERTEX", "Point_1"), 5)
+
+### Create Common
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Sphere_2_1"), model.selection("SOLID", "Sphere_1_1")], fuzzyParam = "fuzzy", keepSubResults = True)
+model.do()
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [0])
+testNbUniqueSubShapes(Common_1, GeomAPI_Shape.SOLID, [1])
+testNbUniqueSubShapes(Common_1, GeomAPI_Shape.FACE, [3])
+testNbUniqueSubShapes(Common_1, GeomAPI_Shape.EDGE, [3])
+testNbUniqueSubShapes(Common_1, GeomAPI_Shape.VERTEX, [2])
+
+### Set a higher fuzzy value
+Param_fuzzy.setValue(1.e-5)
+model.do()
+
+model.end()
+
+model.testNbResults(Common_1, 0)
+
+model.end()
--- /dev/null
+# Copyright (C) 2014-2022 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 salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+aShapeTypes = {
+ GeomAPI_Shape.SOLID: "GeomAPI_Shape.SOLID",
+ GeomAPI_Shape.FACE: "GeomAPI_Shape.FACE",
+ GeomAPI_Shape.EDGE: "GeomAPI_Shape.EDGE",
+ GeomAPI_Shape.VERTEX: "GeomAPI_Shape.VERTEX"}
+
+def testNbUniqueSubShapes(theFeature, theShapeType, theExpectedNbSubShapes):
+ """ Tests number of unique feature sub-shapes of passed type for each result.
+ :param theFeature: feature to test.
+ :param theShapeType: shape type of sub-shapes to test.
+ :param theExpectedNbSubShapes: list of sub-shapes numbers. Size of list should be equal to len(theFeature.results()).
+ """
+ aResults = theFeature.feature().results()
+ aNbResults = len(aResults)
+ aListSize = len(theExpectedNbSubShapes)
+ assert (aNbResults == aListSize), "Number of results: {} not equal to list size: {}.".format(aNbResults, aListSize)
+ for anIndex in range(0, aNbResults):
+ aNbResultSubShapes = 0
+ anExpectedNbSubShapes = theExpectedNbSubShapes[anIndex]
+ aNbResultSubShapes = aResults[anIndex].shape().subShapes(theShapeType, True).size()
+ assert (aNbResultSubShapes == anExpectedNbSubShapes), "Number of sub-shapes of type {} for result[{}]: {}. Expected: {}.".format(aShapeTypes[theShapeType], anIndex, aNbResultSubShapes, anExpectedNbSubShapes)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Param_offset = model.addParameter(Part_1_doc, "offset", '5e-5')
+Param_fuzzy = model.addParameter(Part_1_doc, "fuzzy", '1e-05')
+
+### Create Point
+Point_2 = model.addPoint(Part_1_doc, "offset", "5", "5")
+
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Box_1.result().setColor(255, 0, 0)
+
+### Create Cylinder
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("EDGE", "PartSet/OX"), 6, 13)
+Cylinder_1.result().setColor(255, 255, 0)
+Cylinder_1.result().setTransparency(0.6)
+
+### Create Cut
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SOLID", "Cylinder_1_1")], fuzzyParam = "fuzzy", keepSubResults = True)
+model.do()
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [0])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.SOLID, [1])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.FACE, [14])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.EDGE, [36])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Cut_1, [49.093623770546])
+
+### Set a higher fuzzy value
+Param_fuzzy.setValue(5.e-5)
+model.do()
+
+model.end()
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [4])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.SOLID, [4])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.FACE, [20])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.EDGE, [36])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Cut_1, [49.088834629314])
--- /dev/null
+# Copyright (C) 2014-2022 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 salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+aShapeTypes = {
+ GeomAPI_Shape.SOLID: "GeomAPI_Shape.SOLID",
+ GeomAPI_Shape.FACE: "GeomAPI_Shape.FACE",
+ GeomAPI_Shape.EDGE: "GeomAPI_Shape.EDGE",
+ GeomAPI_Shape.VERTEX: "GeomAPI_Shape.VERTEX"}
+
+def testNbUniqueSubShapes(theFeature, theShapeType, theExpectedNbSubShapes):
+ """ Tests number of unique feature sub-shapes of passed type for each result.
+ :param theFeature: feature to test.
+ :param theShapeType: shape type of sub-shapes to test.
+ :param theExpectedNbSubShapes: list of sub-shapes numbers. Size of list should be equal to len(theFeature.results()).
+ """
+ aResults = theFeature.feature().results()
+ aNbResults = len(aResults)
+ aListSize = len(theExpectedNbSubShapes)
+ assert (aNbResults == aListSize), "Number of results: {} not equal to list size: {}.".format(aNbResults, aListSize)
+ for anIndex in range(0, aNbResults):
+ aNbResultSubShapes = 0
+ anExpectedNbSubShapes = theExpectedNbSubShapes[anIndex]
+ aNbResultSubShapes = aResults[anIndex].shape().subShapes(theShapeType, True).size()
+ assert (aNbResultSubShapes == anExpectedNbSubShapes), "Number of sub-shapes of type {} for result[{}]: {}. Expected: {}.".format(aShapeTypes[theShapeType], anIndex, aNbResultSubShapes, anExpectedNbSubShapes)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Param_fuzzy = model.addParameter(Part_1_doc, "fuzzy", '1e-07')
+
+### Create Point
+Point_2 = model.addPoint(Part_1_doc, 5, 9.9999, 0)
+
+### Create Point
+Point_3 = model.addPoint(Part_1_doc, 10, 10, 0)
+
+### Create Sketch
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(5, 0, 0, 0)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchPoint_1.result())
+SketchLine_2 = Sketch_1.addLine(0, 0, 0, 9.9999)
+SketchLine_3 = Sketch_1.addLine(0, 9.9999, 5, 9.9999)
+SketchLine_4 = Sketch_1.addLine(5, 9.9999, 5, 0)
+Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+Sketch_1.setHorizontal(SketchLine_1.result())
+Sketch_1.setVertical(SketchLine_2.result())
+Sketch_1.setHorizontal(SketchLine_3.result())
+Sketch_1.setVertical(SketchLine_4.result())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchPoint_2.result())
+SketchProjection_3 = Sketch_1.addProjection(model.selection("VERTEX", "Point_2"), False)
+SketchPoint_3 = SketchProjection_3.createdFeature()
+model.do()
+
+### Create Sketch
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_5 = Sketch_2.addLine(10, 0, 0, 0)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_4 = SketchProjection_4.createdFeature()
+Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchPoint_4.result())
+SketchLine_6 = Sketch_2.addLine(0, 0, 0, 10)
+SketchLine_7 = Sketch_2.addLine(0, 10, 10, 10)
+SketchLine_8 = Sketch_2.addLine(10, 10, 10, 0)
+Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+Sketch_2.setHorizontal(SketchLine_5.result())
+Sketch_2.setVertical(SketchLine_6.result())
+Sketch_2.setHorizontal(SketchLine_7.result())
+Sketch_2.setVertical(SketchLine_8.result())
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Point_2"), False)
+SketchPoint_5 = SketchProjection_5.createdFeature()
+Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_5.result())
+model.do()
+
+### Create Face
+Face_1 = model.addFace(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")])
+Face_1.result().setColor(255, 0, 0)
+
+### Create Face
+Face_2 = model.addFace(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")])
+Face_2.result().setColor(0, 255, 0)
+
+### Create Cut
+Cut_1 = model.addCut(Part_1_doc, [model.selection("FACE", "Face_2_1")], [model.selection("FACE", "Face_1_1")], fuzzyParam = "fuzzy", keepSubResults = True)
+model.do()
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [0])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.FACE, [1])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.EDGE, [6])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [6])
+
+### Set a higher fuzzy value
+Param_fuzzy.setValue(1.e-4)
+model.do()
+
+model.end()
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [0])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.FACE, [1])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.EDGE, [4])
+testNbUniqueSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [4])
--- /dev/null
+# Copyright (C) 2014-2022 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 salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+aShapeTypes = {
+ GeomAPI_Shape.SOLID: "GeomAPI_Shape.SOLID",
+ GeomAPI_Shape.FACE: "GeomAPI_Shape.FACE",
+ GeomAPI_Shape.EDGE: "GeomAPI_Shape.EDGE",
+ GeomAPI_Shape.VERTEX: "GeomAPI_Shape.VERTEX"}
+
+def testNbUniqueSubShapes(theFeature, theShapeType, theExpectedNbSubShapes):
+ """ Tests number of unique feature sub-shapes of passed type for each result.
+ :param theFeature: feature to test.
+ :param theShapeType: shape type of sub-shapes to test.
+ :param theExpectedNbSubShapes: list of sub-shapes numbers. Size of list should be equal to len(theFeature.results()).
+ """
+ aResults = theFeature.feature().results()
+ aNbResults = len(aResults)
+ aListSize = len(theExpectedNbSubShapes)
+ assert (aNbResults == aListSize), "Number of results: {} not equal to list size: {}.".format(aNbResults, aListSize)
+ for anIndex in range(0, aNbResults):
+ aNbResultSubShapes = 0
+ anExpectedNbSubShapes = theExpectedNbSubShapes[anIndex]
+ aNbResultSubShapes = aResults[anIndex].shape().subShapes(theShapeType, True).size()
+ assert (aNbResultSubShapes == anExpectedNbSubShapes), "Number of sub-shapes of type {} for result[{}]: {}. Expected: {}.".format(aShapeTypes[theShapeType], anIndex, aNbResultSubShapes, anExpectedNbSubShapes)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Param_fuzzy = model.addParameter(Part_1_doc, "fuzzy", '1e-07')
+
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Point_3 = model.addPoint(Part_1_doc, 20, 10.0001, 10.0001)
+
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+### Create Box
+Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"))
+
+### Create Fuse
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")], fuzzyParam = "fuzzy", keepSubResults = True)
+model.do()
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [0])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.FACE, [11])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [24])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [15])
+model.testResultsVolumes(Fuse_1, [2000.02000010])
+
+### Set a higher fuzzy value
+Param_fuzzy.setValue(1.e-4)
+model.do()
+
+model.end()
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [0])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.FACE, [10])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [20])
+testNbUniqueSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [12])
+model.testResultsVolumes(Fuse_1, [2000.02166677])
</multi_selector>
</box>
</toolbox>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="FeaturesPlugin_ValidatorBooleanCommonArguments"
parameters="main_objects,tool_objects"/>
</source>
</multi_selector>
</box>
</toolbox>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<boolvalue id="remove_intersection_edges"
label="Remove intersection edges"
tooltip="Remove intersection edges if they laying on the same surface"
<validator id="PartSet_DifferentObjects"/>
<validator id="FeaturesPlugin_ValidatorBooleanSmashSelection"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
</source>
<validator id="PartSet_DifferentObjects"/>
<validator id="FeaturesPlugin_ValidatorBooleanSelection"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
</source>
<validator id="PartSet_DifferentObjects"/>
<validator id="FeaturesPlugin_ValidatorBooleanSelection"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-5"
+ default="1.e-5">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
<validator id="GeomValidators_NotSelfIntersected" parameters="main_objects,tool_objects"/>
</source>
| |union.icon| | 3 (SOLIDs from COMPSOLID) | --- |
| :ref:`featureUnion` | | |
+-------------------------+---------------------------+-------------------------+
+
+The fuzzy parameter of each boolean operation is used as an additional tolerance to eliminate tiny results.
+
+*Note*: If a value is given, which is smaller than the lowest meaningful tolerance of 1.e-7, the boolean operation
+will use the default internal fuzzy parameter.
- **Objects** contains a list of objects selected in the Object Browser or in the Viewer.
If a subshape that belongs to a compsolid/compound was selected, other shapes of this compsolid/compound will be ignored.
+- **Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
- **See preview** button shows a result of the operation.
**TUI Command**:
-.. py:function:: model.addCommon(Part_doc, objects)
+.. py:function:: model.addCommon(Part_doc, objects, fuzzy)
:param part: The current part object
:param list: A list of objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object
Result
other objects (to avoid self-intersection) and added to the result.
- **Tools** contains a list of objects selected in the Object Browser or in the Viewer, which will be intersected with tool objects.
If a subshape that belongs to a compsolid/compound was selected, other shapes of this compsolid/compound will be ignored.
+- **Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
- **See preview** button shows a result of the operation.
Any kind of shape is supported as an object or a tool of Common. Moreover, constructions planes can be selected as tools.
**TUI Command**:
-.. py:function:: model.addCommon(Part_doc, objects, tools)
+.. py:function:: model.addCommon(Part_doc, objects, tools, fuzzy)
:param part: The current part object
:param list: A list of objects.
:param list: A list of tools.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object
Result
- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will cut main objects.
Any kind of shape can be selected, including subshapes of compsolids/compounds.
Non-selected subshapes from compsolids/compounds will be ignored.
+- **Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
- **See preview** button shows a result of the operation.
The minimal dimension of Tool Objects should be not less than the maximal dimension of Main Objects.
**TUI Command**:
-.. py:function:: model.addCut(Part_doc, mainObjects, toolObjects)
+.. py:function:: model.addCut(Part_doc, mainObjects, toolObjects, fuzzy)
:param part: The current part object
:param list: A list of main objects.
:param list: A list of tool objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object
Result
- **Objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be fused to a single result.
If a subshape that belongs to a compsolid/compound was selected, other shapes of this compsolid/compound will cut the fuse shape then will be joined to the result.
- **Remove intersection edges** - if enabled, edges that lie on the same surface will be removed.
+- **Fuzzy Parameter** - defines the additional tolerance value used to eliminate tiny results.
- **See preview** - button shows a result of the operation.
**TUI Command**:
-.. py:function:: model.addFuse(Part_doc, objects, isRemoveEdges)
+.. py:function:: model.addFuse(Part_doc, objects, isRemoveEdges, fuzzyParam)
:param part: The current part object.
:param list: A list of objects.
:param boolean: Remove edges flag (optional).
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object.
Result
- **Tools** - contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
If a subshape that belongs to a compsolid/compound was selected, other shapes of this compsolid/compound will be ignored.
- **Remove intersection edges** - if enabled, edges that lie on the same surface will be removed.
+- **Fuzzy Parameter** - defines the additional tolerance value used to eliminate tiny results.
- **See preview** - button shows a result of the operation.
**TUI Command**:
-.. py:function:: model.addFuse(Part_doc, objects, tools, isRemoveEdges)
+.. py:function:: model.addFuse(Part_doc, objects, tools, isRemoveEdges, fuzzyParam)
:param part: The current part object.
:param list: A list of objects.
:param list: A list of tools.
:param boolean: Remove edges flag (optional).
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object.
Result
**Intersection operation**
-**Objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be intersected.
+**Objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be intersected.
-All intersected objects should be 1- or 2-dimensional (edges, faces, shells). However, it is allowed to select 3-dimensional objects, but only their shells will be taken into operation.
+**Fuzzy Parameter** - defines the additional tolerance value used to eliminate tiny results.
+
+All intersected objects should be 1- or 2-dimensional (edges, faces, shells). However, it is allowed to select
+3-dimensional objects, but only their shells will be taken into operation.
**TUI Command**:
-.. py:function:: model.addIntersection(Part_doc, Objects)
+.. py:function:: model.addIntersection(Part_doc, Objects, fuzzy)
:param part: The current part object.
:param list: A list of objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object.
Result
**Partition operation**
-**Base Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be partitioned. Constuction planes are allowed too if at least one non-construction entity is selected.
+**Base Objects** contains a list of objects selected in the Object Browser or in the Viewer,
+which will be partitioned. Constuction planes are allowed too if at least one non-construction
+entity is selected.
+
+**Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
**TUI Command**:
-.. py:function:: model.addPartition(Part_doc, objects)
+.. py:function:: model.addPartition(Part_doc, objects, fuzzy)
:param part: The current part object.
:param object: A list of objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Created object.
Result
other objects (to avoid self intersection) and added to the result.
- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be smashed into main objects.
If a subshape that belongs to a compsolid/compound was selected, other shapes of this compsolid/compound will be ignored.
+- **Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
- **See preview** button shows a result of the operation.
Main objects and Tools objects should have the same dimension. There are supported 2-dimensional (face) or 3-dimensional (solid, compsolid) arguments.
**TUI Command**:
-.. py:function:: model.addSmash(Part_doc, mainObjects, toolObjects)
+.. py:function:: model.addSmash(Part_doc, mainObjects, toolObjects, fuzzy)
:param part: The current part object.
:param list: A list of main objects.
:param list: A list of tool objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Rotated object.
Result
- **Main Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be cut and splitted by tool objects.
- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will cut and split the main objects. Construction planes may be selected too.
+- **Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
- **See preview** button shows a result of the operation.
**TUI Command**:
-.. py:function:: model.addSplit(Part_doc, mainObjects, toolObjects)
+.. py:function:: model.addSplit(Part_doc, mainObjects, toolObjects, fuzzy)
:param part: The current part object.
:param list: A list of main objects.
:param list: A list of tool objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Result object.
Result
Here it is necessary to select some objects. Only faces with shared edges or solids with shared faces are allowed for selection.
+**Fuzzy Parameter** defines the additional tolerance value used to eliminate tiny results.
+
**Apply** button creates a union shape.
**Cancel** button cancels the operation.
**TUI Command**:
-.. py:function:: model.addUnion(Part_doc, objects)
+.. py:function:: model.addUnion(Part_doc, objects, fuzzy)
:param part: The current part object.
:param objects: A list of objects.
+ :param real: Additional tolerance used to eliminate tiny results (optional).
:return: Result object.
Result
<validator id="PartSet_DifferentObjects"/>
<validator id="FeaturesPlugin_IntersectionSelection"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
</source>
clear_in_neutral_point="false">
<validator id="FeaturesPlugin_ValidatorPartitionSelection" parameters="Plane"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="GeomValidators_MinObjectsSelected" parameters="base_objects,1"/>
</source>
Test23885.py
TestNormalToFace.py
TestLoft.py
+ TestBooleanCut_Fuzzy_1.py
+ TestBooleanCut_Fuzzy_2.py
+ TestBooleanFuse_Fuzzy.py
+ TestBooleanCommon_Fuzzy.py
)
SET(TEST_NAMES_SEQ
concealment="true">
<validator id="FeaturesPlugin_ValidatorUnionSelection"/>
</multi_selector>
+ <groupbox>
+ <doublevalue id="fuzzy_param"
+ label="Fuzzy parameter"
+ tooltip="Additional tolerance to eliminate tiny result."
+ min="1.e-7"
+ max="10"
+ step="1.e-7"
+ default="1.e-7">
+ <validator id="GeomValidators_Positive"/>
+ </doublevalue>
+ </groupbox>
<validator id="GeomValidators_MinObjectsSelected" parameters="base_objects,2"/>
<validator id="FeaturesPlugin_ValidatorUnionArguments"/>
</source>
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
+
//=================================================================================================
GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
const GeomShapePtr theTool,
- const GeomAlgoAPI_Tools::BOPType theOperationType)
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy/*= 1.e-8*/)
{
ListOfShape aListWithObject, aListWithTool;
aListWithObject.push_back(theObject);
aListWithTool.push_back(theTool);
- build(aListWithObject, aListWithTool, theOperationType);
+ build(aListWithObject, aListWithTool, theOperationType, theFuzzy);
}
//=================================================================================================
GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType)
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy/*= 1.e-8*/)
{
ListOfShape aListWithObject;
aListWithObject.push_back(theObject);
- build(aListWithObject, theTools, theOperationType);
+ build(aListWithObject, theTools, theOperationType, theFuzzy);
}
//=================================================================================================
GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType)
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy/*= 1.e-8*/)
{
- build(theObjects, theTools, theOperationType);
+ build(theObjects, theTools, theOperationType, theFuzzy);
}
//=================================================================================================
void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType)
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy)
{
- if(theObjects.empty() || theTools.empty()) {
+ if (theObjects.empty() || theTools.empty()) {
return;
}
aBuilder->SetRunParallel(bRunParallel);
// Set fuzzy value to eliminate thin results
- static const Standard_Real aFuzzy = 1.e-5;
+ // => Either use the value set by the user (greater or equal than minimum valid value 1.e-7)
+ // => or use the old default value of 1.e-5
+ Standard_Real aFuzzy = (theFuzzy >= 1.e-7 ? theFuzzy : 1.e-5);
aBuilder->SetFuzzyValue(aFuzzy);
// Building and getting result.
this->setDone(true);
}
+//=================================================================================================
static bool isHistoryType(TopAbs_ShapeEnum theType) {
return theType == TopAbs_VERTEX || theType == TopAbs_EDGE ||
theType == TopAbs_FACE || theType == TopAbs_SOLID;
}
+//=================================================================================================
/// searches the corresponding result for theOld
static void searchResult(const TopoDS_Shape& theOld, const TopoDS_Shape& theResult,
BOPAlgo_BOP* theBuilder, TopTools_MapOfShape& theNews)
}
}
+//=================================================================================================
// check the shape is on the higher level of compound or compsolid
bool isInComp(const TopoDS_Shape& theComp, const TopoDS_Shape& theShape) {
if (theComp.ShapeType() == TopAbs_COMPOUND || theComp.ShapeType() == TopAbs_COMPSOLID) {
public:
/// Constructor.
+ /// \param[in] theObject the main object.
+ /// \param[in] theTool the tool object.
+ /// \param[in] theOperationType type of boolean operation.
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// boolean operation will use a default additional tolerance value of 1.e-5.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
const GeomShapePtr theTool,
- const GeomAlgoAPI_Tools::BOPType theOperationType);
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy = 1.e-8);
/// Constructor.
+ /// \param[in] theObject the main object.
+ /// \param[in] theTools list of tools.
+ /// \param[in] theOperationType type of boolean operation.
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// boolean operation will use a default additional tolerance value of 1.e-5.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType);
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy = 1.e-8);
/// Constructor.
+ /// \param[in] theObjects list of main objects.
+ /// \param[in] theTools list of tools.
+ /// \param[in] theOperationType type of boolean operation.
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// boolean operation will use a default additional tolerance value of 1.e-5.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType);
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy = 1.e-8);
/// Redefinition of the generic method for the Fuse problem: OCCT 30481
GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
/// Builds resulting shape.
void build(const ListOfShape& theObjects,
const ListOfShape& theTools,
- const GeomAlgoAPI_Tools::BOPType theOperationType);
+ const GeomAlgoAPI_Tools::BOPType theOperationType,
+ const double theFuzzy);
};
#endif
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Section.hxx>
+
//==================================================================================================
-GeomAlgoAPI_Intersection::GeomAlgoAPI_Intersection(const ListOfShape& theObjects)
+GeomAlgoAPI_Intersection::GeomAlgoAPI_Intersection(const ListOfShape& theObjects, const double theFuzzy)
: myFiller(0)
{
- build(theObjects);
+ build(theObjects, theFuzzy);
}
+//==================================================================================================
GeomAlgoAPI_Intersection::~GeomAlgoAPI_Intersection() {
if (myFiller)
delete (BOPAlgo_PaveFiller*)myFiller;
}
+
//==================================================================================================
-void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects)
+void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects, const double theFuzzy)
{
if (theObjects.empty()) {
return;
aDSFiller->SetRunParallel(false);
aDSFiller->SetNonDestructive(false);
aDSFiller->SetGlue(BOPAlgo_GlueOff);
+ if (theFuzzy >= 1.e-7) aDSFiller->SetFuzzyValue(theFuzzy);
// optimization for the issue #2399
BOPAlgo_SectionAttribute theSecAttr(Standard_True,
anOperation->SetArguments(anObjects);
anOperation->SetRunParallel(false);
anOperation->SetCheckInverted(true);
+ if (theFuzzy >= 1.e-7) anOperation->SetFuzzyValue(theFuzzy);
anOperation->PerformWithFiller(*aDSFiller); // it references a filler fields, so keep the filler
myFiller = 0;
public:
/// \brief Constructor.
/// \param[in] theObjects list of objects.
- /// \param[in] theTools list of tools.
- GEOMALGOAPI_EXPORT GeomAlgoAPI_Intersection(const ListOfShape& theObjects);
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// algorithm will use the default internal fuzzy value from OCCT.
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_Intersection(const ListOfShape& theObjects,
+ const double theFuzzy = 1.e-8);
/// Destructor to erase the filler
GEOMALGOAPI_EXPORT virtual ~GeomAlgoAPI_Intersection();
private:
/// Builds resulting shape.
- void build(const ListOfShape& theObjects);
+ void build(const ListOfShape& theObjects, const double theFuzzy);
};
//=================================================================================================
GeomAlgoAPI_Partition::GeomAlgoAPI_Partition(const ListOfShape& theObjects,
- const ListOfShape& theTools)
+ const ListOfShape& theTools,
+ const double theFuzzy)
{
- build(theObjects, theTools);
+ build(theObjects, theTools, theFuzzy);
}
static void prepareShapes(const TopoDS_Shape& theShape,
//=================================================================================================
void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects,
- const ListOfShape& theTools)
+ const ListOfShape& theTools,
+ const double theFuzzy)
{
if (theObjects.empty()) {
return;
Standard_Boolean bRunParallel = Standard_True;
anOperation->SetRunParallel(bRunParallel);
+ if (theFuzzy >= 1.e-7) anOperation->SetFuzzyValue(theFuzzy);
+
// Building and getting result.
anOperation->Perform();
if (anOperation->HasErrors())
{
public:
/// Constructor.
+ /// \param[in] theObjects list of main objects.
+ /// \param[in] theTools list of tools.
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// algorithm will use the default internal fuzzy value from OCCT.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Partition(const ListOfShape& theObjects,
- const ListOfShape& theTools);
+ const ListOfShape& theTools,
+ const double theFuzzy = 1.e-8);
private:
/// Builds resulting shape.
void build(const ListOfShape& theObjects,
- const ListOfShape& theTools);
+ const ListOfShape& theTools,
+ const double theFuzzy);
};
#endif
#include <TopoDS_Builder.hxx>
#include <TopoDS_Iterator.hxx>
+
//=================================================================================================
GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape,
- const bool theIsMakeCompSolids)
+ const bool theIsMakeCompSolids,
+ const double theFuzzy)
{
- build(theListOfShape, theIsMakeCompSolids);
+ build(theListOfShape, theIsMakeCompSolids, theFuzzy);
}
//=================================================================================================
void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
- const bool theIsMakeCompSolids)
+ const bool theIsMakeCompSolids,
+ const double theFuzzy)
{
BOPAlgo_PaveFiller* aPaveFiller = new BOPAlgo_PaveFiller;
TopTools_ListOfShape aListOfShape;
}
}
aPaveFiller->SetArguments(aListOfShape);
+ if (theFuzzy >= 1.e-7) aPaveFiller->SetFuzzyValue(theFuzzy);
aPaveFiller->Perform();
if (aPaveFiller->HasErrors())
return;
this->setImpl(aBuilder);
this->setBuilderType(OCCT_BOPAlgo_Builder);
aBuilder->SetArguments(aListOfShape);
+ if (theFuzzy >= 1.e-7) aBuilder->SetFuzzyValue(theFuzzy);
aBuilder->PerformWithFiller(*aPaveFiller);
if (aBuilder->HasErrors())
return;
/// \brief Constructor.
/// \param[in] theListOfShape list of shape which should be splitted.
/// \param[in] theIsMakeCompSolids if true gather shapes with shared faces to compsolids.
+ /// \param[in] theFuzzy additional tolerance value.
+ /// If the fuzzy value is below the minimum tolerance value (1.e-7), the
+ /// algorithm will use the default internal fuzzy value from OCCT.
GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape,
- const bool theIsMakeCompSolids = false);
+ const bool theIsMakeCompSolids = false,
+ const double theFuzzy = 1.e-8);
private:
/// Builds resulting shape.
- void build(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids);
+ void build(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids, const double theFuzzy);
};
#endif