feat(workbench): stabilize junction tools workspace
This commit is contained in:
1 parent
e6b822416d
commit
f10a5da325
22 files changed
+1078
-53
No files matched your search
@@ -894,10 +894,12 @@ function applyDirectJunctionPlans(plans, directEdit) {
|
||||
if (requestedRadii.length) changed = true;
|
||||
if (!changed) continue;
|
||||
const referenceWidth = Math.max(...plan.approaches.map((approach) => approach.widthMeters), 1);
|
||||
const cornerRadiusMultiplier = requestedRadii.length
|
||||
? Math.max(0.1, Math.min(3, requestedRadii[0] / referenceWidth))
|
||||
: 1;
|
||||
const boundary = junctionBoundary(plan.approaches, plan.node, plan.cutbackMeters, cornerRadiusMultiplier, 1);
|
||||
const cornerRadiusMultipliers = Object.fromEntries(
|
||||
Object.entries(directPlan.corners || {})
|
||||
.filter(([, radius]) => Number.isFinite(radius))
|
||||
.map(([key, radius]) => [key, Math.max(0.1, Math.min(3, radius / referenceWidth))]),
|
||||
);
|
||||
const boundary = junctionBoundary(plan.approaches, plan.node, plan.cutbackMeters, cornerRadiusMultipliers, 1);
|
||||
plan.boundary = boundary.points;
|
||||
plan.boundaryMode = boundary.mode;
|
||||
plan.boundaryFallbacks = boundary.fallbacks;
|
||||
@@ -2892,13 +2894,18 @@ function junctionBoundary(approaches, node, cutbackMeters, cornerRadiusMultiplie
|
||||
// bends the far side of a T junction and exposes junction asphalt beyond
|
||||
// the pedestrian strip.
|
||||
if (first.segmentId === second.segmentId || isStraightJunctionEdge(first, second)) continue;
|
||||
const cornerKey = `${first.segmentId}->${second.segmentId}`;
|
||||
const multiplier =
|
||||
cornerRadiusMultiplier && typeof cornerRadiusMultiplier === 'object'
|
||||
? (cornerRadiusMultiplier[cornerKey] ?? 1)
|
||||
: cornerRadiusMultiplier;
|
||||
const curve = roundedCorner(
|
||||
node,
|
||||
first.point,
|
||||
second.point,
|
||||
first.outwardHeading,
|
||||
second.outwardHeading,
|
||||
cornerRadiusMultiplier,
|
||||
multiplier,
|
||||
);
|
||||
if (!curve) {
|
||||
fallbacks += 1;
|
||||
|
||||
Reference in new issue
Block a user