Remove handling of converged fat-line, as it causes issues.

Example 23 in #784 was caused by this, and the code's removal has not produced any new issues, while it solved 6 issues in @iconexperience's test suite.

Closes #795
This commit is contained in:
Jürg Lehni 2015-10-05 17:20:56 +02:00
parent 93cacffd06
commit 1f03b00f99

View file

@ -1450,13 +1450,6 @@ new function() { // Scope for intersection using bezier fat-line clipping
dMax = factor * Math.max(0, d1, d2),
tMinNew, tMaxNew,
tDiff;
if (q0x === q3x && uMax - uMin < epsilon && recursion >= 3) {
// The fat-line of Q has converged to a point, the clipping is not
// reliable. Return the value we have even though we will miss the
// precision.
tMaxNew = tMinNew = (tMax + tMin) / 2;
tDiff = 0;
} else {
// Calculate non-parametric bezier curve D(ti, di(t)) - di(t) is the
// distance of P from the baseline l of the fat-line, ti is equally
// spaced in [0, 1]
@ -1478,11 +1471,10 @@ new function() { // Scope for intersection using bezier fat-line clipping
// Clip P with the fat-line for Q
v1 = Curve.getPart(v1, tMinClip, tMaxClip);
tDiff = tMaxClip - tMinClip;
// tMin and tMax are within the range (0, 1). We need to project it
// to the original parameter range for v2.
// tMin and tMax are within the range (0, 1). We need to project it to
// the original parameter range for v2.
tMinNew = tMax * tMinClip + tMin * (1 - tMinClip);
tMaxNew = tMax * tMaxClip + tMin * (1 - tMaxClip);
}
// Check if we need to subdivide the curves
if (oldTDiff > 0.5 && tDiff > 0.5) {
// Subdivide the curve which has converged the least.