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]
solver
Jonathan Westhues 2009-01-27 01:22:18 -08:00
parent a754018a44
commit 715a554637
1 changed files with 1 additions and 1 deletions

View File

@ -535,7 +535,7 @@ void SSurface::ClosestPointTo(Vector p, double *u, double *v) {
Vector dp = p.Minus(p0); Vector dp = p.Minus(p0);
double du = dp.Dot(tu), dv = dp.Dot(tv); double du = dp.Dot(tu), dv = dp.Dot(tv);
*u += du / (tu.MagSquared()); *u += du / (tu.MagSquared());
*v += dv / (tu.MagSquared()); *v += dv / (tv.MagSquared());
} }
dbp("didn't converge"); dbp("didn't converge");
dbp("have %.3f %.3f %.3f", CO(p0)); dbp("have %.3f %.3f %.3f", CO(p0));