]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2127: arc disappears after move
authorazv <azv@opencascade.com>
Tue, 11 Apr 2017 12:14:49 +0000 (15:14 +0300)
committerazv <azv@opencascade.com>
Tue, 11 Apr 2017 12:14:49 +0000 (15:14 +0300)
Workaround for Debian 8.0: project end point when building an arc

src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp

index 8cb92153842d53e5ff13ab672b42532a041c5b4e..a1ada3eca4646509a46838e02f1e0a977646a247 100644 (file)
@@ -191,7 +191,11 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::lineCircleArc(
   gp_Circ aCircle(gp_Ax2(aCenter, aDir), aRadius);
 
   const gp_Pnt& aStart = theStartPoint->impl<gp_Pnt>();
-  const gp_Pnt& anEnd = theEndPoint->impl<gp_Pnt>();
+  const gp_Pnt& anEndInter = theEndPoint->impl<gp_Pnt>();
+
+  // project end point to a circle
+  gp_XYZ aEndDir = anEndInter.XYZ() - aCenter.XYZ();
+  gp_Pnt anEnd(aCenter.XYZ() + aEndDir.Normalized() * aRadius);
 
   BRepBuilderAPI_MakeEdge anEdgeBuilder;
   anEdgeBuilder = BRepBuilderAPI_MakeEdge(aCircle, aStart, anEnd);