]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
PlaneGCS: fix incorrect range of fillet arc on the XZ plane
authorazv <azv@opencascade.com>
Thu, 9 Jun 2016 14:15:36 +0000 (17:15 +0300)
committerazv <azv@opencascade.com>
Thu, 9 Jun 2016 14:16:49 +0000 (17:16 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp

index a3f832e6e516372cace418466678d2496ebd794b..66c47d162c41f2ef9f5e47076353a99687432dcd 100644 (file)
@@ -418,6 +418,17 @@ void PlaneGCSSolver_Storage::processArc(const EntityWrapperPtr& theArc)
   if (!anArcEdge)
     return;
   anArcEdge->getRange(*aStartAngle, *aEndAngle);
+  // verify the range is correct and not shifted to an angle
+  std::shared_ptr<GeomAPI_Dir2d> aDir(new GeomAPI_Dir2d(cos(*aStartAngle), sin(*aStartAngle)));
+  std::shared_ptr<GeomAPI_Pnt2d> aCalcStartPnt(
+      new GeomAPI_Pnt2d(aCenterPnt->xy()->added(aDir->xy()->multiplied(*aRadius))));
+  if (aCalcStartPnt->distance(aStartPnt) > tolerance) {
+    std::shared_ptr<GeomAPI_Dir2d> aDirToStart(
+        new GeomAPI_Dir2d(aStartPnt->xy()->decreased(aCenterPnt->xy())));
+    double anAngle = aDir->angle(aDirToStart);
+    *aStartAngle += anAngle;
+    *aEndAngle += anAngle;
+  }
 
   // do not constraint copied arc
   if (anArcFeature->isCopy())