X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_EdgeBuilder.cpp;h=d6ba70d19919110cfe07087731d15cd75995457f;hb=1c3738ae81b02ba62136ac03a53a81a532b95141;hp=c292ee4824f55409256af51df5fa1eff68a28024;hpb=57199135053dfe0636ff8ff29eb6c75a6df6f08d;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp index c292ee482..d6ba70d19 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -198,7 +199,7 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircleArc( /// OCCT creates an edge on a circle with empty radius, but visualization /// is not able to process it - if (theCenter->isEqual(theStartPoint)) + if (theCenter->isEqual(theStartPoint) || theCenter->isEqual(theEndPoint)) return aRes; double aRadius = theCenter->distance(theStartPoint); @@ -222,3 +223,23 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircleArc( } return aRes; } + +std::shared_ptr GeomAlgoAPI_EdgeBuilder::ellipse( + const std::shared_ptr& theCenter, + const std::shared_ptr& theNormal, + const std::shared_ptr& theMajorAxis, + const double theMajorRadius, + const double theMinorRadius) +{ + const gp_Pnt& aCenter = theCenter->impl(); + const gp_Dir& aNormal = theNormal->impl(); + const gp_Dir& aMajorAxis = theMajorAxis->impl(); + + gp_Elips anEllipse(gp_Ax2(aCenter, aNormal, aMajorAxis), theMajorRadius, theMinorRadius); + + BRepBuilderAPI_MakeEdge anEdgeBuilder(anEllipse); + std::shared_ptr aRes(new GeomAPI_Edge); + TopoDS_Edge anEdge = anEdgeBuilder.Edge(); + aRes->setImpl(new TopoDS_Shape(anEdge)); + return aRes; +}