From 63007c12d4980bb2de02e1017fd6a1c1495c9b99 Mon Sep 17 00:00:00 2001 From: rnc Date: Fri, 26 Oct 2012 11:50:58 +0000 Subject: [PATCH] Fixed 2 fatal error at 3d sketcher dialog opening and when using it. --- src/EntityGUI/EntityGUI_3DSketcherDlg.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx index 7012f28b5..a165d952c 100755 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx @@ -1308,11 +1308,17 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store) XYZ Last = getLastPoint(); XYZ Current = getCurrentPoint(); - gp_Pnt P0(Last.x,Last.y,Last.z); + gp_Pnt Last_Pnt(Last.x,Last.y,Last.z); + gp_Pnt P0 = Last_Pnt; if (myMode == 0) // Absolute coordinates P0=gp::Origin(); gp_Pnt Current_Pnt(Current.x,Current.y,Current.z); gp_Pnt P1, P2; + + // Check if last end current point are coincident + if (Last_Pnt.IsEqual(Current_Pnt, 1e-7)) + return; + gp_Dir aNormal = getPresentationPlane(); if (myCoordType == 0) @@ -1535,7 +1541,7 @@ Handle(AIS_AngleDimension) EntityGUI_3DSketcherDlg::createAISAngleDimension(doub double aLength = P0.Distance(P1); // Check input data - if (Abs(theAngle - 90.0) < Precision::Angular() || + if (Abs(theAngle) < Precision::Angular() || aLength < Precision::Confusion()) return NULL; -- 2.39.2