Skip to content

Commit 2b1234d

Browse files
committed
Relax curve epsilon thresholds for better tolerance
Increased epsilon values for curve collinearity and control point proximity checks from 1e-12/1e-4 to 1e-3, making curve calculations less sensitive to floating point errors. Updated the publish date to reflect the new build.
1 parent ad368f3 commit 2b1234d

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

build/two.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ var Two = (() => {
12201220
* @name Two.PublishDate
12211221
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
12221222
*/
1223-
PublishDate: "2025-09-30T23:58:14.873Z",
1223+
PublishDate: "2025-10-01T00:18:49.277Z",
12241224
/**
12251225
* @name Two.Identifier
12261226
* @property {String} - String prefix for all Two.js object's ids. This trickles down to SVG ids.
@@ -1460,8 +1460,8 @@ var Two = (() => {
14601460
a = -3 * y1 + 9 * y2 - 9 * y3 + 3 * y4;
14611461
c = 3 * y2 - 3 * y1;
14621462
}
1463-
if (Math.abs(a) < 1e-12) {
1464-
if (Math.abs(b) < 1e-12) {
1463+
if (Math.abs(a) < 1e-3) {
1464+
if (Math.abs(b) < 1e-3) {
14651465
continue;
14661466
}
14671467
t = -c / b;
@@ -1530,7 +1530,7 @@ var Two = (() => {
15301530
let d1 = Vector.distanceBetween(a, b);
15311531
let d2 = Vector.distanceBetween(c, b);
15321532
let mid = (a1 + a2) / 2;
1533-
if (d1 < 1e-4 || d2 < 1e-4) {
1533+
if (d1 < 1e-3 || d2 < 1e-3) {
15341534
if (typeof b.relative === "boolean" && !b.relative) {
15351535
b.controls.left.copy(b);
15361536
b.controls.right.copy(b);

build/two.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/two.module.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ var Constants = {
12281228
* @name Two.PublishDate
12291229
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
12301230
*/
1231-
PublishDate: "2025-09-30T23:58:14.873Z",
1231+
PublishDate: "2025-10-01T00:18:49.277Z",
12321232
/**
12331233
* @name Two.Identifier
12341234
* @property {String} - String prefix for all Two.js object's ids. This trickles down to SVG ids.
@@ -1468,8 +1468,8 @@ function getCurveBoundingBox(x1, y1, x2, y2, x3, y3, x4, y4) {
14681468
a = -3 * y1 + 9 * y2 - 9 * y3 + 3 * y4;
14691469
c = 3 * y2 - 3 * y1;
14701470
}
1471-
if (Math.abs(a) < 1e-12) {
1472-
if (Math.abs(b) < 1e-12) {
1471+
if (Math.abs(a) < 1e-3) {
1472+
if (Math.abs(b) < 1e-3) {
14731473
continue;
14741474
}
14751475
t = -c / b;
@@ -1538,7 +1538,7 @@ function getControlPoints(a, b, c) {
15381538
let d1 = Vector.distanceBetween(a, b);
15391539
let d2 = Vector.distanceBetween(c, b);
15401540
let mid = (a1 + a2) / 2;
1541-
if (d1 < 1e-4 || d2 < 1e-4) {
1541+
if (d1 < 1e-3 || d2 < 1e-3) {
15421542
if (typeof b.relative === "boolean" && !b.relative) {
15431543
b.controls.left.copy(b);
15441544
b.controls.right.copy(b);

0 commit comments

Comments
 (0)