fix(junction): protect entry surfaces from exclusion regions
This commit is contained in:
1 parent
9b6b5b5791
commit
a22319a149
3 files changed
+31
No files matched your search
@@ -123,6 +123,19 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
|||||||
// carriageway's outer transition, leaving neighboring arms untouched. A
|
// carriageway's outer transition, leaving neighboring arms untouched. A
|
||||||
// collapsed handoff is reported and omitted rather than publishing a
|
// collapsed handoff is reported and omitted rather than publishing a
|
||||||
// zero-area trapezoid that downstream layers could mistake for pavement.
|
// zero-area trapezoid that downstream layers could mistake for pavement.
|
||||||
|
if (section.exclusionStatus !== 'clear') {
|
||||||
|
transitionDiagnostics.push(
|
||||||
|
helpers.diagnostic(
|
||||||
|
'warning',
|
||||||
|
`carriageway:${item.key}`,
|
||||||
|
item.approach.roadIds.map(String),
|
||||||
|
'complex-junction-entry-overlaps-known-region',
|
||||||
|
'该进口过渡区域侵入已知排除区域,已省略该进口面以保留来源区域。',
|
||||||
|
section.inner.point,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (section.transitionStatus !== 'supported') {
|
if (section.transitionStatus !== 'supported') {
|
||||||
transitionDiagnostics.push(
|
transitionDiagnostics.push(
|
||||||
helpers.diagnostic(
|
helpers.diagnostic(
|
||||||
|
|||||||
@@ -65,9 +65,13 @@ function buildJunctionBoundaryGraph(topology, center, radii, helpers, exclusionR
|
|||||||
const outer = sectionAt(item, outerRadius, center, outerWidthMeters, helpers);
|
const outer = sectionAt(item, outerRadius, center, outerWidthMeters, helpers);
|
||||||
const inner = sectionAt(item, innerRadius, center, innerWidthMeters, helpers);
|
const inner = sectionAt(item, innerRadius, center, innerWidthMeters, helpers);
|
||||||
const key = `boundary:${item.key}`;
|
const key = `boundary:${item.key}`;
|
||||||
|
const sectionRing = [outer.right, inner.right, inner.left, outer.left, outer.right];
|
||||||
|
const exclusion = exclusionRegions.find((region) => ringsOverlap(region.ring, sectionRing));
|
||||||
return {
|
return {
|
||||||
key,
|
key,
|
||||||
carriagewayKey: item.key,
|
carriagewayKey: item.key,
|
||||||
|
exclusionStatus: exclusion ? 'overlaps-known-region' : 'clear',
|
||||||
|
...(exclusion ? { exclusionRegionId: String(exclusion.id ?? '') } : {}),
|
||||||
armKey: item.armKey,
|
armKey: item.armKey,
|
||||||
outerWidthMeters,
|
outerWidthMeters,
|
||||||
innerWidthMeters,
|
innerWidthMeters,
|
||||||
|
|||||||
@@ -345,3 +345,17 @@ assert.equal(taperedSection.outerWidthMeters, 10);
|
|||||||
assert.equal(taperedSection.innerWidthMeters, 6);
|
assert.equal(taperedSection.innerWidthMeters, 6);
|
||||||
assert.ok(taperedSection.transitionMeters > 0);
|
assert.ok(taperedSection.transitionMeters > 0);
|
||||||
assert.equal(taperedSection.transitionStatus, 'supported');
|
assert.equal(taperedSection.transitionStatus, 'supported');
|
||||||
|
|
||||||
|
const approachExclusion = [point(-6, 8), point(6, 8), point(6, 24), point(-6, 24), point(-6, 8)];
|
||||||
|
const graphWithApproachExclusion = buildJunctionBoundaryGraph(
|
||||||
|
tee.topology,
|
||||||
|
point(0, 0),
|
||||||
|
{ outerRadiusFor: () => 30, innerRadiusFor: () => 10 },
|
||||||
|
tee.helpers,
|
||||||
|
[{ id: 'island:approach', ring: approachExclusion }],
|
||||||
|
);
|
||||||
|
const excludedSection = graphWithApproachExclusion.sections.find(
|
||||||
|
(section) => section.outer.point[1] > section.outer.point[1] - 1,
|
||||||
|
);
|
||||||
|
assert.equal(excludedSection.exclusionStatus, 'overlaps-known-region');
|
||||||
|
assert.equal(excludedSection.exclusionRegionId, 'island:approach');
|
||||||
Reference in new issue
Block a user