]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAPI/GeomAPI_Edge.cpp
Salome HOME
Task 3.9. Detect free points in the sketcher (issue #2927)
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.cpp
index 379bdab86b9f396eee35febc5f608727d43d321b..682211f82620776e4ca640bd46f61f18f0117f12 100644 (file)
@@ -332,7 +332,8 @@ void GeomAPI_Edge::intersectWithPlane(const std::shared_ptr<GeomAPI_Pln> thePlan
       // find minimal distance between the plane and the curve
       GeomAPI_ExtremaCurveSurface anExtrema(aCurve, aPlane);
       double aTolerance = BRep_Tool::Tolerance(TopoDS::Edge(aShape));
-      if (anExtrema.LowerDistance() < aTolerance) {
+      if (anExtrema.NbExtrema() > 0 &&
+          anExtrema.LowerDistance() < aTolerance) {
         // distance is lower than tolerance => tangent case
         gp_Pnt aPntC, aPntS;
         anExtrema.NearestPoints(aPntC, aPntS);