feat: establish junction region geometry baseline
This commit is contained in:
1 parent
de97600fe8
commit
76f81d024a
14 files changed
+287
-11
No files matched your search
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const { solvePavedRegion } = require('./junction-region-solver');
|
||||
|
||||
const { stationAtDistanceFrom } = require('./junction-build-plan');
|
||||
|
||||
function pointAtStation(line, station, helpers) {
|
||||
@@ -252,6 +254,11 @@ function buildCoreClosure(topology, graph, center) {
|
||||
Math.atan2(second.point[1] - center[1], second.point[0] - center[0]),
|
||||
);
|
||||
const ring = [...points.map((item) => item.point), points[0]?.point].filter(Boolean);
|
||||
const pavedRegion = solvePavedRegion(
|
||||
ring,
|
||||
graph.exclusionRegions.filter((region) => !region.isHole).map((region) => region.ring),
|
||||
);
|
||||
if (!pavedRegion.length) return { status: 'unsupported', reason: 'known-exclusion-region' };
|
||||
const hasZeroLengthEdge = ring.slice(1).some((point, index) => {
|
||||
const previous = ring[index];
|
||||
const dx = point[0] - previous[0];
|
||||
|
||||
Reference in new issue
Block a user