fix complex junction island geometry

This commit is contained in:
que01 committed 2026-09-16 13:24:34 +08:00
1 parent c3579074fd
commit 0c42eb46cd
19 files changed
+424 -44

No files matched your search

+26
View File
@@ -64,4 +64,30 @@ for (const [name, nodeIds] of Object.entries({
`${name} ${stripe.properties.native_id} must lie on the unified pavement`,
);
}
// A valid five-arm corner-radius edit used to let polygon-clipping throw while
// assembling connector pavement, aborting the entire preview. It must instead
// retain the changed structural pavement and defer only unverifiable routes.
{
const cluster = {
id: 'five-arm-pavement-assembly',
template: 'complex-junction-v1',
coreRadiusMeters: 32,
nodeIds: ['8005332807', '8024512135', '8024512145', '8024512147', '8613058676'],
};
const options = { edgeLines: false, junctionTemplates: { enabled: true, clusters: [cluster] } };
const baseline = compileGeometry(model, { overrides: [] }, options);
const cornerKeys = baseline.roadSurface.features
.filter((feature) => feature.properties.kind === 'complex-corner-fillet')
.map((feature) => feature.properties.corner_key);
const edited = compileGeometry(
model,
{ overrides: [] },
{
...options,
directEdit: { clusterCorners: new Map([[cluster.id, new Map(cornerKeys.map((key) => [key, 14]))]]) },
},
);
assert.ok(edited.roadSurface.features.some((feature) => feature.properties.kind === 'complex-corner-fillet'));
}
console.log('junction pavement region tests passed');