diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 735ab91bc..c7dd94746 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -292,8 +292,8 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M bool on = rGrp.GetBool("ZoomAtCursor", false); _viewer->navigationStyle()->setZoomAtCursor(on); } - else if (strcmp(Reason,"ZoomSetp") == 0) { - float val = rGrp.GetFloat("ZoomSetp", 0.0f); + else if (strcmp(Reason,"ZoomStep") == 0) { + float val = rGrp.GetFloat("ZoomStep", 0.0f); _viewer->navigationStyle()->setZoomStep(val); } else if (strcmp(Reason,"EyeDistance") == 0) { diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 64694c44a..5edc850c7 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -572,15 +572,27 @@ const bool SketchBased::checkLineCrossesFace(const gp_Lin &line, const TopoDS_Fa continue; BRepExtrema_SupportType type = distss.SupportTypeShape1(i); if (type == BRepExtrema_IsOnEdge) { - //This further check is not really needed - return true; - // TopoDS_Edge edge = TopoDS::Edge(distss.SupportOnShape1(i)); BRepAdaptor_Curve adapt(edge); + // create a plane (pnt,dir) that goes through the intersection point and is built of + // the vectors of the sketch normal and the rotation axis + const gp_Dir& normal = BRepAdaptor_Surface(face).Plane().Axis().Direction(); + gp_Dir dir = line.Direction().Crossed(normal); + gp_Pnt pnt = distss.PointOnShape1(i); + Standard_Real t; distss.ParOnEdgeS1(i, t); - if (t > adapt.FirstParameter() && t < adapt.LastParameter()) { - return true; + gp_Pnt p_eps1 = adapt.Value(std::max(adapt.FirstParameter(), t-10*Precision::Confusion())); + gp_Pnt p_eps2 = adapt.Value(std::min(adapt.LastParameter(), t+10*Precision::Confusion())); + + // now check if we get a change in the sign of the distances + 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) > 5*Precision::Confusion() && + fabs(dist_p_eps2_pnt) > 5*Precision::Confusion()) { + if (dist_p_eps1_pnt * dist_p_eps2_pnt < 0) + return true; } } else if (type == BRepExtrema_IsVertex) {