From 715a554637fa8b136e251a793d46485b27a84a5d Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Tue, 27 Jan 2009 01:22:18 -0800 Subject: [PATCH] So that's why projection into the surface kept failing; was using the magnitude of the wrong derivative! Fix that, good. [git-p4: depot-paths = "//depot/solvespace/": change = 1908] --- srf/ratpoly.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srf/ratpoly.cpp b/srf/ratpoly.cpp index cccf5f6..4c677f5 100644 --- a/srf/ratpoly.cpp +++ b/srf/ratpoly.cpp @@ -535,7 +535,7 @@ void SSurface::ClosestPointTo(Vector p, double *u, double *v) { Vector dp = p.Minus(p0); double du = dp.Dot(tu), dv = dp.Dot(tv); *u += du / (tu.MagSquared()); - *v += dv / (tu.MagSquared()); + *v += dv / (tv.MagSquared()); } dbp("didn't converge"); dbp("have %.3f %.3f %.3f", CO(p0));