X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Projection.cpp;h=91b45643c5b46e6cf5848b9f9d4fc059d6b5a264;hb=15fc1914159f4671968f56eb32d878a022edcd8b;hp=4c6dfefc27e9a96a90a55682564c45b52db64f43;hpb=51cfbd8e37603efaae48a4102d4376899bc6fcae;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 4c6dfefc2..91b45643c 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -204,6 +204,10 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) std::shared_ptr aCircle = anEdge->circle(); double aRadius = aCircle->radius(); + double aNormalsDot = aCircle->normal()->dot(aSketchPlane->direction()); + if (fabs(fabs(aNormalsDot) - 1.0) > tolerance) + return; // circle is not in the plane, parallel to the sketch plane + std::shared_ptr aCenter = aSketchPlane->project(aCircle->center()); std::shared_ptr aCenterInSketch = sketch()->to2D(aCenter); @@ -227,7 +231,11 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) std::shared_ptr aCenter = aSketchPlane->project(aCircle->center()); std::shared_ptr aCenterInSketch = sketch()->to2D(aCenter); - bool isInversed = aCircle->normal()->dot(aSketchPlane->direction()) < 0.; + double aNormalsDot = aCircle->normal()->dot(aSketchPlane->direction()); + if (fabs(fabs(aNormalsDot) - 1.0) > tolerance) + return; // arc is not in the plane, parallel to the sketch plane + + bool isInversed = aNormalsDot < 0.; if (!hasPrevProj) aProjection = sketch()->addFeature(SketchPlugin_Arc::ID()); @@ -249,7 +257,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aCenterPnt->setValue(aCenterInSketch); aProjection->boolean(SketchPlugin_Arc::REVERSED_ID())->setValue(isInversed); - aProjection->data()->blockSendAttributeUpdated(aWasBlocked, false); + aProjection->data()->blockSendAttributeUpdated(aWasBlocked); } else return;