]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correct fillet calculation on reversed arcs
authorazv <azv@opencascade.com>
Tue, 17 Nov 2015 15:09:25 +0000 (18:09 +0300)
committerazv <azv@opencascade.com>
Tue, 17 Nov 2015 15:09:25 +0000 (18:09 +0300)
src/SketchPlugin/SketchPlugin_Arc.cpp
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp

index e1de895605f04a9f77ddce9d0633bb510506e705..7d285d079dd1cfa00f5c3494330be7ef428054cf 100644 (file)
@@ -325,3 +325,8 @@ void SketchPlugin_Arc::setReversed(bool isReversed)
   std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()))->setValue(isReversed);
   myParamBefore = 0.0;
 }
+
+bool SketchPlugin_Arc::isReversed()
+{
+  return std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()))->value();
+}
index 789d6076a5694a5ac588d2afb1809cbc828da9f1..0464ebeadb30d60da9aa89f6937af6657f29508c 100644 (file)
@@ -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();
index 4a49c2e4b68ddeb371c988694ddbe61472b1a107..d723a3e209d2a5e007cb89654398011829f3fd58 100644 (file)
@@ -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<SketchPlugin_Arc>(aFeature[i])->isReversed())
         aDir = aDir->multiplied(-1.0);
     }
     aTangentDir[i] = std::shared_ptr<GeomAPI_Dir2d>(new GeomAPI_Dir2d(aDir));