fix: fill internal complex junction pavement holes

This commit is contained in:
que01 committed 2026-09-14 18:12:18 +08:00
1 parent a2bce9f465
commit fda733ce72
2 files changed
+7 -2

No files matched your search

+6 -2
View File
@@ -12,9 +12,13 @@ function solveComplexPavementRegion(parts, crossingRegions = []) {
(ring) => Array.isArray(ring) && ring.length >= 4 && ring.every((point) => point?.every(Number.isFinite)),
);
const regions = union(...inputs.map((ring) => [ring]));
// Construction polygons can enclose unpaved pockets where approach,
// core and corner edges meet. Those pockets are the visible "holes" in a
// complex junction; they are not exclusion regions and must be paved.
const filledRegions = regions.map((polygon) => [polygon[0]]);
return {
status: regions.length === 1 ? 'supported' : 'disconnected',
regions,
status: filledRegions.length === 1 ? 'supported' : 'disconnected',
regions: filledRegions,
inputCount: inputs.length,
};
}