test(junction): bound transition length by source availability
This commit is contained in:
1 parent
433499bbcb
commit
95c49722d4
2 files changed
+5
-2
No files matched your search
@@ -2,11 +2,12 @@
|
||||
|
||||
// Pure default geometry metrics. Reference-file calibration is resolved by the
|
||||
// compiler boundary and can be supplied as plain data by its caller.
|
||||
function transitionLengthForCutback(metrics, cutbackMeters = 0) {
|
||||
function transitionLengthForCutback(metrics, cutbackMeters = 0, availableMeters = Infinity) {
|
||||
const outer = Number(metrics?.approachOuterRadius);
|
||||
const inner = Number(metrics?.approachInnerRadius);
|
||||
const cutback = Math.max(0, Number(cutbackMeters) || 0);
|
||||
return Math.max(0, outer - cutback - inner);
|
||||
const available = Math.max(0, Number(availableMeters));
|
||||
return Math.min(available, Math.max(0, outer - cutback - inner));
|
||||
}
|
||||
|
||||
function complexJunctionMetrics(cluster, calibration = null) {
|
||||
|
||||
Reference in new issue
Block a user