#include <GeomAlgoAPI_PointBuilder.h>
+const double TOLERANCE = 1.e-7;
const double paramTolerance = 1.e-4;
const double PI = 3.141592653589793238463;
myStartPnt = anEllipsePoints[2];
myEndPnt = anEllipsePoints[3];
+ if (myCenter->distance(myMajorAxis) < TOLERANCE)
+ return; // ellipse is not valid
+
std::shared_ptr<GeomAPI_Ellipse2d> anEllipse;
if (aNbInitialized == 2) {
GeomDir2dPtr aXDir(new GeomAPI_Dir2d(anEllipsePoints[1]->x() - anEllipsePoints[0]->x(),
return GeomShapePtr();
SketchPlugin_Sketch* aSketch = sketch();
- if (!aSketch)
+ if (!aSketch || myCenter->distance(myMajorAxis) < 1.e-7)
return GeomShapePtr();
GeomPointPtr aCenter(aSketch->to3D(myCenter->x(), myCenter->y()));