From 928198bd120dfe4d3231c5e0b5c3f43a6cd70ea9 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 17 Nov 2015 18:09:25 +0300 Subject: [PATCH] Correct fillet calculation on reversed arcs --- src/SketchPlugin/SketchPlugin_Arc.cpp | 5 +++++ src/SketchPlugin/SketchPlugin_Arc.h | 2 ++ src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) 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)); -- 2.39.2