feat(world): Parkwege, Felder, Plätze, Pool und Parkplatz als eigene Schichten
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e675e62a16
commit
b736afb7ff
10 files changed
+96
-17
No files matched your search
@@ -101,6 +101,27 @@ describe("geometry", () => {
|
||||
expect(out.urban).toBeNull();
|
||||
});
|
||||
|
||||
it("baut Parkwege flach auf Straßenhöhe und die neuen Flächenarten wie Beläge", () => {
|
||||
const chunk = {
|
||||
chunk: [0, 0], origin: [0, 0], land: [], roads: [], centerlines: [], palms: [], buildings: [],
|
||||
surfaces: ["field", "court", "pool", "parking"].map((kind) => ({ poly: PLOT, kind })),
|
||||
paths: [{ poly: COURTYARD }],
|
||||
};
|
||||
const out = buildChunkGeometry(chunk);
|
||||
for (const kind of ["field", "court", "pool", "parking"]) {
|
||||
const box = new Box3().setFromBufferAttribute(out[kind].getAttribute("position"));
|
||||
expect(box.max.y, kind).toBeCloseTo(0.02);
|
||||
}
|
||||
const paths = new Box3().setFromBufferAttribute(out.paths.getAttribute("position"));
|
||||
expect(paths.min.y).toBeCloseTo(0.03);
|
||||
expect(footprintArea(out.paths)).toBeCloseTo(800, 6); // Weg um einen Hof: das Loch bleibt offen
|
||||
});
|
||||
|
||||
it("liefert ohne Parkwege null statt einer leeren Geometrie", () => {
|
||||
const chunk = { chunk: [0, 0], origin: [0, 0], land: [PLOT], surfaces: [], roads: [], centerlines: [], buildings: [], palms: [] };
|
||||
expect(buildChunkGeometry(chunk).paths).toBeNull();
|
||||
});
|
||||
|
||||
it("gibt Gebäuden eine Farbe je Haus", () => {
|
||||
const chunk = { chunk: [0, 0], origin: [0, 0], land: [], surfaces: [], roads: [], centerlines: [], palms: [],
|
||||
buildings: [{ poly: PLOT, height: 9, source: "district", speculative: false }] };
|
||||
|
||||
Reference in new issue
Block a user