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
@@ -507,8 +507,11 @@ function buildComplexJunctionGeometry(model, cluster, helpers) {
|
||||
0,
|
||||
),
|
||||
width_m: item.approach.widthMeters,
|
||||
outer_width_m: section.outerWidthMeters,
|
||||
inner_width_m: section.innerWidthMeters,
|
||||
transition_length_m: Math.round((section.outer.stationMeters - section.inner.stationMeters) * 10) / 10,
|
||||
boundary_refs: section.edgeRefs,
|
||||
provenance: 'native-road-complex-junction/v5',
|
||||
provenance: 'native-road-complex-junction/v6-shared-transition-sections',
|
||||
},
|
||||
geometry: { type: 'Polygon', coordinates: [ring] },
|
||||
});
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -988,7 +988,13 @@ function applyDirectClusterPlans(model, junctionPlans, directEdit, clusters) {
|
||||
});
|
||||
for (const item of topology.carriageways) {
|
||||
const width = widths.get(item.key);
|
||||
if (Number.isFinite(width)) item.approach.widthMeters = width;
|
||||
if (Number.isFinite(width)) {
|
||||
// The outer section stays attached to the untouched source road. The
|
||||
// complex approach then tapers from that fixed width to this local
|
||||
// correction instead of opening a seam at the cluster boundary.
|
||||
item.approach.sourceWidthMeters ??= item.approach.widthMeters;
|
||||
item.approach.widthMeters = width;
|
||||
}
|
||||
const cutback = cutbacks.get(item.key);
|
||||
if (Number.isFinite(cutback)) item.approach.cutback = cutback;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user