feat(junction): taper complex carriageway edits
This commit is contained in:
1 parent
d353b48a0b
commit
280b726c6f
4 files changed
+31
-6
No files matched your search
@@ -39,11 +39,11 @@ function offsetCoordinate(point, heading, meters) {
|
||||
];
|
||||
}
|
||||
|
||||
function sectionAt(item, radius, center, helpers) {
|
||||
function sectionAt(item, radius, center, widthMeters, helpers) {
|
||||
const station = 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(item.approach.widthMeters) || 0) / 2;
|
||||
const halfWidth = Math.max(0, Number(widthMeters) || 0) / 2;
|
||||
return {
|
||||
stationMeters: station,
|
||||
point,
|
||||
@@ -60,13 +60,17 @@ function buildJunctionBoundaryGraph(topology, center, radii, helpers, exclusionR
|
||||
const sections = topology.carriageways.map((item) => {
|
||||
const outerRadius = radii.outerRadiusFor(item);
|
||||
const innerRadius = radii.innerRadiusFor(item);
|
||||
const outer = sectionAt(item, outerRadius, center, helpers);
|
||||
const inner = sectionAt(item, innerRadius, center, helpers);
|
||||
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 key = `boundary:${item.key}`;
|
||||
return {
|
||||
key,
|
||||
carriagewayKey: item.key,
|
||||
armKey: item.armKey,
|
||||
outerWidthMeters,
|
||||
innerWidthMeters,
|
||||
outer,
|
||||
inner,
|
||||
edgeRefs: {
|
||||
|
||||
Reference in new issue
Block a user