Commit 0a6979e0 authored by wmayer's avatar wmayer
Browse files

Improve algorithm to check intersection of axis and sketch

parent 7d6508de
......@@ -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;
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment