From 0eaedadf102d9c711a1350fc4b7923c0bf660626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Wed, 7 Sep 2016 09:02:57 +0200 Subject: [PATCH] modified spline projection --- libsrc/gprim/spline.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libsrc/gprim/spline.cpp b/libsrc/gprim/spline.cpp index cc4c44d7..3d7c3ccd 100644 --- a/libsrc/gprim/spline.cpp +++ b/libsrc/gprim/spline.cpp @@ -197,11 +197,25 @@ namespace netgen { double t_old = -1; + /* if(proj_latest_t > 0. && proj_latest_t < 1.) t = proj_latest_t; else t = 0.5; - + */ + double tmin = 1; + double dist_min2 = Dist2 (GetPoint(tmin), point); + for (double ti = 0; ti < 0.99; ti += 0.25) + { + double di = Dist2(GetPoint(ti), point); + if (di < dist_min2) + { + tmin = ti; + dist_min2 = di; + } + } + t = tmin; + Point phi; Vec phip,phipp,phimp;