fix(junction): make complex corner radius responsive

This commit is contained in:
que01 committed 2026-09-08 17:06:05 +08:00
1 parent 36a8291c05
commit 53a2cb3450
8 files changed
+103 -11

No files matched your search

+7 -5
View File
@@ -457,11 +457,13 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
continue;
}
// Tangent distance for a circle of `cornerRadius` inscribed in a wedge of
// opening `delta`, clamped so the tangent points stay on the built arms.
const tangentDistance = Math.min(
cornerRadius / Math.tan((delta * Math.PI) / 360),
Math.max(2, outerRadius - apexReach),
);
// opening `delta`.
// Keep the radius control continuous. The previous handoff cap made a
// sizeable part of the advertised 1..25 m range geometry-inert: once the
// tangent distance hit the cap, pressing Enter only changed metadata.
// The solver's radius bounds and the generated arm envelope provide the
// validity boundary; this value must remain the direct geometric response.
const tangentDistance = cornerRadius / Math.tan((delta * Math.PI) / 360);
const tangents = edges.map((edge) => helpers.offsetCoordinate(apex, edge.heading, tangentDistance));
const curve = quadraticCurve(tangents[0], apex, tangents[1], CORNER_FILLET_SEGMENTS);
const ring = [...curve, center, curve[0]];