feat(junction): report shared seam tolerance
This commit is contained in:
1 parent
134e0752ed
commit
a4b1ad8510
2 files changed
+19
No files matched your search
@@ -204,11 +204,25 @@ function buildCoreClosure(topology, graph, center) {
|
||||
return { status: 'unsupported', reason: 'core-closure-invalid' };
|
||||
if (graph.exclusionRegions.some((region) => ringsOverlap(region.ring, ring)))
|
||||
return { status: 'unsupported', reason: 'known-exclusion-region' };
|
||||
const seamErrorMeters = graph.sections.reduce((maximum, section) => {
|
||||
const leftIndex = ring.findIndex(
|
||||
(point) => point[0] === section.inner.left[0] && point[1] === section.inner.left[1],
|
||||
);
|
||||
const rightIndex = ring.findIndex(
|
||||
(point) => point[0] === section.inner.right[0] && point[1] === section.inner.right[1],
|
||||
);
|
||||
const contiguous =
|
||||
leftIndex >= 0 &&
|
||||
rightIndex >= 0 &&
|
||||
(Math.abs(leftIndex - rightIndex) === 1 || Math.abs(leftIndex - rightIndex) === ring.length - 2);
|
||||
return Math.max(maximum, contiguous ? 0 : Infinity);
|
||||
}, 0);
|
||||
return {
|
||||
status: 'supported',
|
||||
ring,
|
||||
sharedEdgeRefs: [...pairedEdges.keys()].sort(),
|
||||
closureCount: graph.sections.length,
|
||||
maxSharedSeamErrorMeters: seamErrorMeters,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user