diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 9b01368fb..28c002b3c 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -618,10 +618,14 @@ const bool SketchBased::checkLineCrossesFace(const gp_Lin &line, const TopoDS_Fa p_eps2 = adapt2.Value(adapt2.LastParameter() - 2*Precision::Confusion()); // now check if we get a change in the sign of the distances - Standard_Real dist_p_eps1_pnt = gp_Dir(gp_Vec(p_eps1, pnt)).Dot(dir); - Standard_Real dist_p_eps2_pnt = gp_Dir(gp_Vec(p_eps2, pnt)).Dot(dir); - if (dist_p_eps1_pnt * dist_p_eps2_pnt < 0) - return true; + Standard_Real dist_p_eps1_pnt = gp_Vec(p_eps1, pnt).Dot(gp_Vec(dir)); + Standard_Real dist_p_eps2_pnt = gp_Vec(p_eps2, pnt).Dot(gp_Vec(dir)); + // distance to the plane must be noticable + if (fabs(dist_p_eps1_pnt) > Precision::Confusion() && + fabs(dist_p_eps2_pnt) > Precision::Confusion()) { + if (dist_p_eps1_pnt * dist_p_eps2_pnt < 0) + return true; + } } } }