From de9e7cc9424bf22aa73adfc07fed10ef2fbebf01 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 9 Jul 2018 14:12:36 +0200 Subject: [PATCH] Part: Improvement to closest parameter determination when the projection does not exist in the trimmer curve --- src/Mod/Part/App/Geometry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 6979faceab..368dfe338e 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -454,6 +454,16 @@ bool GeomCurve::closestParameter(const Base::Vector3d& point, double &u) const return true; } } + catch (StdFail_NotDone e) { // projection does not exist on trimmer curve, let's try basis curve + closestParameterToBasicCurve(point,u); + + if(abs(u-c->FirstParameter()) < abs(u-c->LastParameter())) + u = c->FirstParameter(); + else + u = c->LastParameter(); + + return true; + } catch (Standard_Failure& e) { throw Base::RuntimeError(e.GetMessageString());