fix: keep complex islands beyond outer lane edge

This commit is contained in:
que01 committed 2026-09-15 13:53:31 +08:00
1 parent 3ed503a986
commit c3579074fd
3 files changed
+19 -2

No files matched your search

+1 -1
View File
@@ -547,7 +547,7 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
landing(first, pair.a),
landing(second, pair.b),
COMPLEX_CROSSWALK_DEPTH_METERS,
{ maxLegLength: outerRadius },
{ maxLegLength: outerRadius, minLegLength: Math.max(outerRadius - coreRadius, COMPLEX_CROSSWALK_DEPTH_METERS) },
);
if (contactSolution.status !== 'solved') {
cornerDiagnostics.push(
+4 -1
View File
@@ -145,7 +145,10 @@ function solveIslandContacts(firstSegment, secondSegment, thirdWidth, options =
const tangent = unit(chord);
// This scale leaves positive connectors on both sides even for unequal depths.
const scale = 1 + thirdWidth / chordLength;
const legLengths = [a * scale, b * scale];
const baseLegLengths = [a * scale, b * scale];
const minimumLegLength = Number.isFinite(options.minLegLength) ? Math.max(0, options.minLegLength) : 0;
const legScale = Math.max(1, minimumLegLength / Math.max(...baseLegLengths));
const legLengths = baseLegLengths.map((value) => value * legScale);
if (
options.maxLegLength !== undefined &&
(!Number.isFinite(options.maxLegLength) || legLengths.some((value) => value > options.maxLegLength))