Introduce separate epsilon for fat-line clipping code, and reduce curve-time epsilon.

This commit is contained in:
Jürg Lehni 2015-10-21 23:44:24 +02:00
parent e9c3e72f60
commit bafb6794a6
2 changed files with 8 additions and 4 deletions
src/util

View file

@ -99,13 +99,13 @@ var Numerical = new function() {
* cannot be smaller, because errors add up to around 8e-7 in the bezier
* fat-line clipping code as a result of recursive sub-division.
*/
CURVETIME_EPSILON: 8e-7,
CURVETIME_EPSILON: 4e-7, // NOTE: 2e-7 doesn't work in some edge-cases!
/**
* The epsilon to be used when performing "geometric" checks, such as
* point distances and examining cross products to check for
* collinearity.
*/
GEOMETRIC_EPSILON: 4e-7, // NOTE: 1e-7 doesn't work in some edge-cases!
GEOMETRIC_EPSILON: 4e-7, // NOTE: 2e-7 doesn't work in some edge-cases!
/**
* The epsilon to be used when performing winding contribution checks.
*/
@ -115,6 +115,10 @@ var Numerical = new function() {
* as examining cross products to check for collinearity.
*/
TRIGONOMETRIC_EPSILON: 1e-7,
/**
* The epsilon to be used in the fatline clipping code.
*/
CLIPPING_EPSILON: 1e-7,
// Kappa, see: http://www.whizkidtech.redprince.net/bezier/circle/kappa/
KAPPA: 4 * (sqrt(2) - 1) / 3,