X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MacroEllipticArc.cpp;h=86f469d0bf6fa67132ce6e1a4a15b5382d1de651;hb=645e2cb70c0e40290725f28fdc5fec8a93338d28;hp=bd8290c0c5db33c4d749befe5146c0bfb09049a9;hpb=59d7c196ce4f5ed43cb550ee5caecd68676abfb3;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp index bd8290c0c..86f469d0b 100644 --- a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp @@ -42,6 +42,7 @@ #include +const double TOLERANCE = 1.e-7; const double paramTolerance = 1.e-4; const double PI = 3.141592653589793238463; @@ -132,6 +133,9 @@ void SketchPlugin_MacroEllipticArc::attributeChanged(const std::string& theID) myStartPnt = anEllipsePoints[2]; myEndPnt = anEllipsePoints[3]; + if (myCenter->distance(myMajorAxis) < TOLERANCE) + return; // ellipse is not valid + std::shared_ptr anEllipse; if (aNbInitialized == 2) { GeomDir2dPtr aXDir(new GeomAPI_Dir2d(anEllipsePoints[1]->x() - anEllipsePoints[0]->x(), @@ -360,7 +364,7 @@ GeomShapePtr SketchPlugin_MacroEllipticArc::getArcShape() 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()));