Update tests to use explicit junction edge settings instead of resolved settings

This commit is contained in:
2026-05-13 17:20:35 +02:00
parent 292674fced
commit 93cec1006a

View File

@@ -9,8 +9,7 @@ import {
} from "../../src/geometry/spline-corridor-junction-footprint"; } from "../../src/geometry/spline-corridor-junction-footprint";
import { import {
buildSplineCorridorJunctionEdgeMeshData, buildSplineCorridorJunctionEdgeMeshData,
buildSplineCorridorJunctionMeshGeometry, buildSplineCorridorJunctionMeshGeometry
resolveSplineCorridorJunctionEdgeSettings
} from "../../src/geometry/spline-corridor-junction-mesh"; } from "../../src/geometry/spline-corridor-junction-mesh";
function createRoadPath( function createRoadPath(
@@ -131,7 +130,7 @@ describe("spline corridor junction mesh generation", () => {
); );
}); });
it("builds a mitered junction perimeter edge from enabled connected road edges", () => { it("builds a mitered junction perimeter edge from authored junction edge settings", () => {
const pathA = createScenePath({ const pathA = createScenePath({
id: "path-junction-edge-a", id: "path-junction-edge-a",
road: { road: {
@@ -169,6 +168,14 @@ describe("spline corridor junction mesh generation", () => {
id: "junction-edge", id: "junction-edge",
center: { x: 5, y: 0, z: 0 }, center: { x: 5, y: 0, z: 0 },
radius: 3, radius: 3,
edge: {
enabled: true,
collisionEnabled: false,
kind: "curb",
width: 0.4,
height: 0.2,
materialId: "curb-material"
},
connections: [ connections: [
{ {
pathId: pathA.id, pathId: pathA.id,
@@ -183,19 +190,10 @@ describe("spline corridor junction mesh generation", () => {
] ]
}); });
const edge = resolveSplineCorridorJunctionEdgeSettings({
junction,
paths: [pathA, pathB]
});
if (edge === null) {
throw new Error("Expected a junction edge setting.");
}
const meshData = buildSplineCorridorJunctionEdgeMeshData({ const meshData = buildSplineCorridorJunctionEdgeMeshData({
junction, junction,
paths: [pathA, pathB], paths: [pathA, pathB],
edge edge: junction.edge
}); });
const footprint = buildSplineCorridorJunctionFootprint({ const footprint = buildSplineCorridorJunctionFootprint({
junction, junction,
@@ -213,7 +211,7 @@ describe("spline corridor junction mesh generation", () => {
) )
).length; ).length;
expect(edge.materialId).toBe("curb-material"); expect(junction.edge.materialId).toBe("curb-material");
expect(roadMouthSegmentCount).toBe(4); expect(roadMouthSegmentCount).toBe(4);
expect(meshData?.footprintPointCount).toBe(8); expect(meshData?.footprintPointCount).toBe(8);
expect(meshData?.profileVertexCount).toBe(4); expect(meshData?.profileVertexCount).toBe(4);