Use hullEpsilon in all comparisons of curve time values in fat-line clipping code.

Addresses first half of issue #568
This commit is contained in:
Jürg Lehni 2015-01-02 17:33:04 +01:00
parent 41c0584f35
commit 74844d8a2b

View file

@ -1085,7 +1085,6 @@ new function() { // Scope for methods that require numerical integration
return;
// Let P be the first curve and Q be the second
var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7],
tolerance = /*#=*/Numerical.TOLERANCE,
hullEpsilon = 1e-9,
// Calculate the fat-line L for Q is the baseline l and two
// offsets which completely encloses the curve P.
@ -1153,7 +1152,7 @@ new function() { // Scope for methods that require numerical integration
parts[1], v1, curve2, curve1, locations, include,
t, uMax, tMinNew, tMaxNew, tDiff, !reverse, recursion);
}
} else if (Math.max(uMax - uMin, tMaxNew - tMinNew) < tolerance) {
} else if (Math.max(uMax - uMin, tMaxNew - tMinNew) < hullEpsilon) {
// We have isolated the intersection with sufficient precision
var t1 = tMinNew + (tMaxNew - tMinNew) / 2,
t2 = uMin + (uMax - uMin) / 2;