feat: complete complex junction transition editing
This commit is contained in:
1 parent
801d8be980
commit
79f83412e6
18 files changed
+400
-59
No files matched your search
@@ -39,8 +39,9 @@ function offsetCoordinate(point, heading, meters) {
|
||||
];
|
||||
}
|
||||
|
||||
function sectionAt(item, radius, center, widthMeters, helpers) {
|
||||
const station = Math.min(item.length, stationAtDistanceFrom(item.approach.line, center, radius, helpers));
|
||||
function sectionAt(item, radius, center, widthMeters, helpers, explicitStation) {
|
||||
const station =
|
||||
explicitStation ?? Math.min(item.length, stationAtDistanceFrom(item.approach.line, center, radius, helpers));
|
||||
const point = pointAtStation(item.approach.line, station, helpers);
|
||||
const tangent = tangentAtStation(item.approach.line, station, helpers);
|
||||
const halfWidth = Math.max(0, Number(widthMeters) || 0) / 2;
|
||||
@@ -63,7 +64,16 @@ function buildJunctionBoundaryGraph(topology, center, radii, helpers, exclusionR
|
||||
const outerWidthMeters = Number(item.approach.sourceWidthMeters) || item.approach.widthMeters;
|
||||
const innerWidthMeters = item.approach.widthMeters;
|
||||
const outer = sectionAt(item, outerRadius, center, outerWidthMeters, helpers);
|
||||
const inner = sectionAt(item, innerRadius, center, innerWidthMeters, helpers);
|
||||
const inner = sectionAt(
|
||||
item,
|
||||
innerRadius,
|
||||
center,
|
||||
innerWidthMeters,
|
||||
helpers,
|
||||
Number.isFinite(item.approach.transitionLengthMeters)
|
||||
? outer.stationMeters - item.approach.transitionLengthMeters
|
||||
: undefined,
|
||||
);
|
||||
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));
|
||||
|
||||
Reference in new issue
Block a user