[B4] IFC-Import: eigene Dächer als Dach (Pset Dossier_Roof, Rundreise :komplex 4/4)

This commit is contained in:
Claude committed 2026-11-18 11:55:12 +00:00
1 parent b672290d26
commit c315377810
7 files changed
+198 -11

No files matched your search

+2 -2
View File
@@ -171,8 +171,8 @@ describe("anonyme Wettbewerbs-Abgabe in allen Ausgaben", () => {
expect(o[key], key).toContain("D:20000101000000");
}
for (const key of ["IFC4", "IFC2x3"]) {
// „Dossier_Qto_…" ist der Name eines Eigenschaftssatzes (Programm-Konvention), keine Angabe zur Herkunft.
expect(o[key].replace(/Dossier_Qto_/g, ""), key).not.toMatch(/dossier/i);
// „Dossier_Qto_…" und „Dossier_Roof" ([B4]) sind Namen von Eigenschaftssätzen (Programm-Konvention), keine Angabe zur Herkunft.
expect(o[key].replace(/Dossier_(Qto_|Roof)/g, ""), key).not.toMatch(/dossier/i);
expect(o[key], key).not.toContain(`${year}-`);
expect(o[key], key).toContain(`'${NEUTRAL_ISO}'`);
}
+3 -3
View File
@@ -40,13 +40,13 @@ describe("IFC-Import als Bauteile: Rundreise Demo-Haus", () => {
expect(summary).toMatchObject({ roofs: 1, stairs: 1, roofTypes: 0, doorTypes: 0, windowTypes: 0 });
expect(p.context ?? []).toEqual([]);
expect(validateProject(p)).toEqual([]);
// Satteldach: Umriss = Traufe samt Überstand (0.4), Überstand 0, Traufhöhe = OK OG (5.2), 30°, First x.
// Satteldach ([B4], Pset `Dossier_Roof`): Umriss und Überstand (0.4) wie im Modell, Traufhöhe = OK OG (5.2), 30°, First x.
const roof = p.roofs![0];
expect([roof.shape, roof.ridgeAxis, roof.overhang]).toEqual(["sattel", "x", 0]);
expect([roof.shape, roof.ridgeAxis, roof.overhang]).toEqual(["sattel", "x", 0.4]);
expect(roof.pitchDeg).toBeCloseTo(30, 4);
expect(roof.baseElevation!).toBeCloseTo(5.2, 6);
expect(roof.thickness).toBeCloseTo(0.2, 6);
for (const q of [{ x: -0.4, y: -0.4 }, { x: 5.4, y: 4.4 }]) expect(roof.outline.some((g) => near(g, q, 1e-6)), JSON.stringify(roof.outline)).toBe(true);
for (const q of [{ x: 0, y: 0 }, { x: 5, y: 4 }]) expect(roof.outline.some((g) => near(g, q, 1e-6)), JSON.stringify(roof.outline)).toBe(true);
// Gerade Treppe: gleicher Antritt, Richtung, Breite, Stufen, Steighöhe und Lauflänge.
const st0 = sampleProject.stairs![0];
const st = p.stairs![0];
+32
View File
@@ -45,6 +45,38 @@ describe("[B4] IFC-Rundreise: Träger, Geländer, Rampen, Dächer", () => {
expect(new Set(gids).size, "kein Bauteil doppelt als Netz").toBe(gids.length);
});
it(":komplex: alle Dächer kommen als Dach zurück (Form, Neigung, Umriss, Gauben)", async () => {
const src = buildComplexSampleProject();
const { spf, p, summary } = await roundtrip(src);
expect(src.roofs!.length).toBe(4);
expect((spf.match(/IFCPROPERTYSET\([^;]*Dossier_Roof/g) ?? []).length).toBe(src.roofs!.length);
expect(p.roofs?.length).toBe(src.roofs!.length);
expect(summary.roofs).toBe(src.roofs!.length);
for (const r of src.roofs!) {
const got = p.roofs!.find((g) => g.shape === r.shape && g.ridgeAxis === r.ridgeAxis && g.outline.length === r.outline.length && g.outline.every((q, i) => near(q.x, r.outline[i].x) && near(q.y, r.outline[i].y)))!;
expect(got, r.id).toBeDefined();
expect(near(got.pitchDeg, r.pitchDeg) && near(got.overhang, r.overhang) && near(got.thickness, r.thickness, 1e-4), JSON.stringify(got)).toBe(true);
expect(got.overhangGable ?? null).toEqual(r.overhangGable ?? null);
expect(got.outlineBulge ?? null).toEqual(r.outlineBulge ?? null);
expect(got.parapetHeight ?? null).toEqual(r.parapetHeight ?? null);
expect((got.dormers ?? []).map((d) => [d.kind, d.width])).toEqual((r.dormers ?? []).map((d) => [d.kind, d.width]));
expect((got.dormers ?? []).every((d, i) => near(d.position.x, r.dormers![i].position.x) && near(d.position.y, r.dormers![i].position.y))).toBe(true);
expect(near(got.baseElevation ?? 0, r.baseElevation ?? got.baseElevation ?? 0, 1e-4), `${r.id} ${got.baseElevation} ${r.baseElevation}`).toBe(true);
}
});
it(":wettbewerb: Dach kommt als Dach zurück", async () => {
const src = buildWettbewerbSampleProject();
const { p } = await roundtrip(src);
expect(src.roofs!.length).toBeGreaterThan(0);
expect(p.roofs?.length).toBe(src.roofs!.length);
for (const r of src.roofs!) {
const got = p.roofs!.find((g) => g.shape === r.shape && g.outline.length === r.outline.length && near(g.pitchDeg, r.pitchDeg))!;
expect(got, r.id).toBeDefined();
expect(near(got.thickness, r.thickness, 1e-4)).toBe(true);
}
});
it(":wettbewerb: Geländer und Rampe kommen als Bauteile zurück", async () => {
const src = buildWettbewerbSampleProject();
const { spf, p, summary } = await roundtrip(src);