fix: curve complex island away from junction core

This commit is contained in:
que01 committed 2026-09-15 11:06:30 +08:00
1 parent f122e8236a
commit 95b8f068aa
2 files changed
+19 -1

No files matched your search

+10
View File
@@ -30,6 +30,16 @@ assert.deepEqual(sketchIsland[0], sketchIsland.at(-1));
assert.ok(sketchIsland.every(([x, y]) => x <= 0 && y >= 0));
const arcMiddle = sketchIsland[7];
assert.ok(arcMiddle[1] - arcMiddle[0] < 6.8, 'hypotenuse bends toward the right-angle vertex');
const longEdgeStart = sketchIsland[18];
const longEdgeEnd = sketchIsland[34];
const longEdgeMid = sketchIsland[26];
const longEdgeCross =
(longEdgeEnd[0] - longEdgeStart[0]) * (longEdgeMid[1] - longEdgeStart[1]) -
(longEdgeEnd[1] - longEdgeStart[1]) * (longEdgeMid[0] - longEdgeStart[0]);
const cornerSideCross =
(longEdgeEnd[0] - longEdgeStart[0]) * (0 - longEdgeStart[1]) -
(longEdgeEnd[1] - longEdgeStart[1]) * (0 - longEdgeStart[0]);
assert.ok(longEdgeCross * cornerSideCross > 0, 'long edge must bow toward the right-angle vertex');
for (const crossing of [
[
[0, 0],