X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_BooleanFuse.cpp;fp=src%2FFeaturesPlugin%2FFeaturesPlugin_BooleanFuse.cpp;h=5b080a18083015e64804849db85693e9176ff778;hb=57f95f226733dbd01fcd42c4b1f842c71560b7d7;hp=a10fead97811daf2ed32203bcf9f9d79ef3ccf72;hpb=256fe1dbf23ff64c24028e625ba26e948dcb948f;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp index a10fead97..5b080a180 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp @@ -41,6 +41,9 @@ #include +static const double DEFAULT_FUZZY = 1.e-5; + + //================================================================================================== static void explodeCompound(const GeomShapePtr& theShape, ListOfShape& theResult) { @@ -72,11 +75,10 @@ void FeaturesPlugin_BooleanFuse::initAttributes() data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); + data()->addAttribute(FeaturesPlugin_Boolean::USE_FUZZY_ID(), ModelAPI_AttributeBoolean::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); + boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default. + real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY); data()->addAttribute(REMOVE_INTERSECTION_EDGES_ID(), ModelAPI_AttributeBoolean::typeId()); @@ -126,7 +128,9 @@ void FeaturesPlugin_BooleanFuse::execute() // Getting fuzzy parameter. // Used as additional tolerance to eliminate tiny results. - double aFuzzy = real(FUZZY_PARAM_ID())->value(); + // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation! + bool aUseFuzzy = boolean(USE_FUZZY_ID())->value(); + double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1); // version of FUSE feature const std::string aFuseVersion = data()->version();