From: azv Date: Tue, 17 Nov 2015 15:09:25 +0000 (+0300) Subject: Correct fillet calculation on reversed arcs X-Git-Tag: V_2.0.0~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=928198bd120dfe4d3231c5e0b5c3f43a6cd70ea9;p=modules%2Fshaper.git Correct fillet calculation on reversed arcs --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index e1de89560..7d285d079 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -325,3 +325,8 @@ void SketchPlugin_Arc::setReversed(bool isReversed) std::dynamic_pointer_cast(attribute(INVERSED_ID()))->setValue(isReversed); myParamBefore = 0.0; } + +bool SketchPlugin_Arc::isReversed() +{ + return std::dynamic_pointer_cast(attribute(INVERSED_ID()))->value(); +} diff --git a/src/SketchPlugin/SketchPlugin_Arc.h b/src/SketchPlugin/SketchPlugin_Arc.h index 789d6076a..0464ebead 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.h +++ b/src/SketchPlugin/SketchPlugin_Arc.h @@ -95,6 +95,8 @@ class SketchPlugin_Arc : public SketchPlugin_SketchEntity, public GeomAPI_IPrese /// Updates the "reversed" flag /// \param isReversed whether the arc will be reversed void setReversed(bool isReversed); + /// Returns \c true is the arc is reversed + bool isReversed(); /// Use plugin manager for features creation SketchPlugin_Arc(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index 4a49c2e4b..d723a3e20 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -205,7 +205,7 @@ void SketchPlugin_ConstraintFillet::execute() double y = aDir->y(); aDir->setX(-y); aDir->setY(x); - if (!isStart[i]) + if (isStart[i] == std::dynamic_pointer_cast(aFeature[i])->isReversed()) aDir = aDir->multiplied(-1.0); } aTangentDir[i] = std::shared_ptr(new GeomAPI_Dir2d(aDir));