test(junction): cover irregular five-arm closure

This commit is contained in:
que01 committed 2026-09-09 13:41:30 +08:00
1 parent 173296e348
commit 1de7bc2bd0
1 file changed
+16
@@ -502,3 +502,19 @@ const skewFourArmGraph = buildJunctionBoundaryGraph(
skewFourArm.helpers,
);
assertCoreGeometry(skewFourArm.topology, skewFourArmGraph, point(0, 0));
const irregularFiveArm = topology(
'irregular-five-arm',
[5, 78, 151, 238, 319].map((angle, index) => ({
widthMeters: [4, 7, 5.5, 3.75, 8.25][index],
line: [point(0, 0), point(Math.sin((angle * Math.PI) / 180) * 46, Math.cos((angle * Math.PI) / 180) * 46)],
})),
);
assert.equal(irregularFiveArm.topology.arms.length, 5);
const irregularFiveArmGraph = buildJunctionBoundaryGraph(
irregularFiveArm.topology,
point(0, 0),
{ outerRadiusFor: () => 29, innerRadiusFor: () => 10 },
irregularFiveArm.helpers,
);
assertCoreGeometry(irregularFiveArm.topology, irregularFiveArmGraph, point(0, 0));