From: mpv Date: Wed, 24 Jun 2015 05:29:02 +0000 (+0300) Subject: Fix for the issue #673 : creation of sketch on -X direction-plane X-Git-Tag: V_1.3.0~204 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00074cfd3880c016908daac0e8eb8667fba19c1d;p=modules%2Fshaper.git Fix for the issue #673 : creation of sketch on -X direction-plane --- diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index f7d09acbb..1b97f5634 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -228,8 +228,8 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) { aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero)); std::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); // X axis is preferable to be dirX on the sketch - static const double tol = 1.e-7; - bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol; + static const double tol = 0.1; // here can not be very small value to avoid very close to X normal axis (issue 595) + bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol; std::shared_ptr aTempDir( isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0)); std::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));