Salome HOME
bos#35152 [EDF] (2023-T1) Sketch Circle should allow user to position construction...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_EdgeBuilder.cpp
index 0988697b833b580e85beb5a99656312923639f6b..86fe03d7b30a640cba5b53ce8f00af2c8848c396 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -162,12 +162,16 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::cylinderAxis(
 
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::lineCircle(
     std::shared_ptr<GeomAPI_Pnt> theCenter, std::shared_ptr<GeomAPI_Dir> theNormal,
-    double theRadius)
+    double theRadius, double theRotationAngle)
 {
   const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
   const gp_Dir& aDir = theNormal->impl<gp_Dir>();
 
+  gp_Ax1 anAx(aCenter, aDir);
+
   gp_Circ aCircle(gp_Ax2(aCenter, aDir), theRadius);
+  if (Abs(theRotationAngle) > 1.e-7) // Tolerance
+    aCircle.Rotate(anAx, theRotationAngle);
 
   BRepBuilderAPI_MakeEdge anEdgeBuilder(aCircle);
   std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge);