From: azv Date: Thu, 9 Jun 2016 14:15:36 +0000 (+0300) Subject: PlaneGCS: fix incorrect range of fillet arc on the XZ plane X-Git-Tag: V_2.4.0~121 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=862c385c7548fb69d1674a409b3ccaeae13ddf1c;p=modules%2Fshaper.git PlaneGCS: fix incorrect range of fillet arc on the XZ plane --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index a3f832e6e..66c47d162 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -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 aDir(new GeomAPI_Dir2d(cos(*aStartAngle), sin(*aStartAngle))); + std::shared_ptr aCalcStartPnt( + new GeomAPI_Pnt2d(aCenterPnt->xy()->added(aDir->xy()->multiplied(*aRadius)))); + if (aCalcStartPnt->distance(aStartPnt) > tolerance) { + std::shared_ptr 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())