Rename local epsilon in addCurveIntersections() to fatLineEpsilon.

This commit is contained in:
Jürg Lehni 2017-01-15 18:41:40 +01:00
parent a101183fba
commit f996f035ca

View file

@ -1742,7 +1742,7 @@ new function() { // Scope for intersection using bezier fat-line clipping
return calls; return calls;
// Use an epsilon smaller than CURVETIME_EPSILON to compare curve-time // Use an epsilon smaller than CURVETIME_EPSILON to compare curve-time
// parameters in fat-line clipping code. // parameters in fat-line clipping code.
var epsilon = 1e-9, var fatLineEpsilon = 1e-9,
// Let P be the first curve and Q be the second // Let P be the first curve and Q be the second
q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7], q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7],
getSignedDistance = Line.getSignedDistance, getSignedDistance = Line.getSignedDistance,
@ -1779,7 +1779,7 @@ new function() { // Scope for intersection using bezier fat-line clipping
// original parameter range for v2. // original parameter range for v2.
var tMinNew = tMin + (tMax - tMin) * tMinClip, var tMinNew = tMin + (tMax - tMin) * tMinClip,
tMaxNew = tMin + (tMax - tMin) * tMaxClip; tMaxNew = tMin + (tMax - tMin) * tMaxClip;
if (Math.max(uMax - uMin, tMaxNew - tMinNew) < epsilon) { if (Math.max(uMax - uMin, tMaxNew - tMinNew) < fatLineEpsilon) {
// We have isolated the intersection with sufficient precision // We have isolated the intersection with sufficient precision
var t = (tMinNew + tMaxNew) / 2, var t = (tMinNew + tMaxNew) / 2,
u = (uMin + uMax) / 2; u = (uMin + uMax) / 2;
@ -1815,7 +1815,7 @@ new function() { // Scope for intersection using bezier fat-line clipping
u, uMax, tMinNew, tMaxNew, !flip, recursion, calls); u, uMax, tMinNew, tMaxNew, !flip, recursion, calls);
} }
} else { // Iterate } else { // Iterate
if (uMax - uMin >= epsilon) { if (uMax - uMin >= fatLineEpsilon) {
calls = addCurveIntersections( calls = addCurveIntersections(
v2, v1, c2, c1, locations, param, v2, v1, c2, c1, locations, param,
uMin, uMax, tMinNew, tMaxNew, !flip, recursion, calls); uMin, uMax, tMinNew, tMaxNew, !flip, recursion, calls);