Improve algorithm to check intersection of axis and sketch
This commit is contained in:
parent
7d6508de5e
commit
0a6979e0b9
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user