feat(junction): validate entry ring geometry
This commit is contained in:
1 parent
a90826efed
commit
a37c707188
3 files changed
+32
-1
No files matched your search
@@ -67,6 +67,9 @@ function buildJunctionBoundaryGraph(topology, center, radii, helpers, exclusionR
|
||||
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));
|
||||
const ringFinite = sectionRing.every((coordinate) => coordinate?.every(Number.isFinite));
|
||||
const ringArea = ringFinite ? Math.abs(signedArea(sectionRing)) : 0;
|
||||
const ringStatus = !ringFinite || ringArea < 1e-14 || ringSelfIntersects(sectionRing) ? 'invalid' : 'supported';
|
||||
return {
|
||||
key,
|
||||
carriagewayKey: item.key,
|
||||
@@ -79,7 +82,8 @@ function buildJunctionBoundaryGraph(topology, center, radii, helpers, exclusionR
|
||||
transitionStatus: outer.stationMeters - inner.stationMeters > 1e-6 ? 'supported' : 'insufficient-source-length',
|
||||
outer,
|
||||
inner,
|
||||
ring: [outer.right, inner.right, inner.left, outer.left, outer.right],
|
||||
ring: sectionRing,
|
||||
ringStatus,
|
||||
edgeRefs: {
|
||||
left: `${key}:left`,
|
||||
right: `${key}:right`,
|
||||
|
||||
Reference in new issue
Block a user