Implement optimal values in fat line clipping code for maximum recursion and curve time difference, as determined by @iconexperience.

Closes #565
This commit is contained in:
Jürg Lehni 2015-01-02 16:29:12 +01:00
parent 45c86a3035
commit b75def3f3a

View file

@ -1056,7 +1056,7 @@ new function() { // Scope for methods that require numerical integration
tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion) {
/*#*/ if (__options.fatlineClipping) {
// Avoid deeper recursion.
if (recursion > 20)
if (recursion > 32)
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],
@ -1107,7 +1107,7 @@ new function() { // Scope for methods that require numerical integration
tMaxNew = tMax * tMaxClip + tMin * (1 - tMaxClip);
}
// Check if we need to subdivide the curves
if (oldTDiff > 0.8 && tDiff > 0.8) {
if (oldTDiff > 0.5 && tDiff > 0.5) {
// Subdivide the curve which has converged the least.
if (tMaxNew - tMinNew > uMax - uMin) {
var parts = Curve.subdivide(v1, 0.5),