From eb6a405c170dd7a7ef5035d5fd837099cdd14dc7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 17 Oct 2019 00:22:39 +0200 Subject: [PATCH] abort hyperbola creation when angles are NaN --- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 40051ff20f..be0adda009 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -3770,6 +3770,12 @@ public: double endAngle = atanh( (((endPoint.y-centerPoint.y)*cos(phi)-(endPoint.x-centerPoint.x)*sin(phi))*a) / (((endPoint.x-centerPoint.x)*cos(phi)+(endPoint.y-centerPoint.y)*sin(phi))*b) ); + if (boost::math::isnan(startAngle) || boost::math::isnan(endAngle)) { + sketchgui->purgeHandler(); + Base::Console().Error("Cannot create arc of hyperbola from invalid angles, try again!\n"); + return false; + } + bool isOriginalArcCCW=true;