#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);
}