use VERY_NEGATIVE and VERY_POSITIVE instead of numeric values which is some cases were 1e-10 instead of -1e10

pull/786/head
phkahler 2020-10-27 19:37:30 -04:00
parent 6c4b075eef
commit eadeac44f0
1 changed files with 4 additions and 4 deletions

View File

@ -507,9 +507,9 @@ void SShell::MakeFromExtrusionOf(SBezierLoopSet *sbls, Vector t0, Vector t1, Rgb
Vector n = sbls->normal.ScaledBy(-1); Vector n = sbls->normal.ScaledBy(-1);
Vector u = n.Normal(0), v = n.Normal(1); Vector u = n.Normal(0), v = n.Normal(1);
Vector orig = sbls->point; Vector orig = sbls->point;
double umax = 1e-10, umin = 1e10; double umax = VERY_NEGATIVE, umin = VERY_POSITIVE;
sbls->GetBoundingProjd(u, orig, &umin, &umax); sbls->GetBoundingProjd(u, orig, &umin, &umax);
double vmax = 1e-10, vmin = 1e10; double vmax = VERY_NEGATIVE, vmin = VERY_POSITIVE;
sbls->GetBoundingProjd(v, orig, &vmin, &vmax); sbls->GetBoundingProjd(v, orig, &vmin, &vmax);
// and now fix things up so that all u and v lie between 0 and 1 // and now fix things up so that all u and v lie between 0 and 1
orig = orig.Plus(u.ScaledBy(umin)); orig = orig.Plus(u.ScaledBy(umin));
@ -663,9 +663,9 @@ void SShell::MakeFromHelicalRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector
Vector n = sbls->normal.ScaledBy(-1); Vector n = sbls->normal.ScaledBy(-1);
Vector u = n.Normal(0), v = n.Normal(1); Vector u = n.Normal(0), v = n.Normal(1);
Vector orig = sbls->point; Vector orig = sbls->point;
double umax = 1e-10, umin = 1e10; double umax = VERY_NEGATIVE, umin = VERY_POSITIVE;
sbls->GetBoundingProjd(u, orig, &umin, &umax); sbls->GetBoundingProjd(u, orig, &umin, &umax);
double vmax = 1e-10, vmin = 1e10; double vmax = VERY_NEGATIVE, vmin = VERY_POSITIVE;
sbls->GetBoundingProjd(v, orig, &vmin, &vmax); sbls->GetBoundingProjd(v, orig, &vmin, &vmax);
// and now fix things up so that all u and v lie between 0 and 1 // and now fix things up so that all u and v lie between 0 and 1
orig = orig.Plus(u.ScaledBy(umin)); orig = orig.Plus(u.ScaledBy(umin));