Grundriss: Die Anschlag-Nasen (Schichtstücke vor dem Rahmen) waren eigene Flächen mit schwerer Umrisslinie und eigener Schraffur-Phase — sie gehen jetzt als Zusatzstücke in die Wand-Poché (Raster in wall_poche::adjusted_segment: Umriss nur zur Leere, keine Linie zwischen Schicht und Einzug); Band, Einzug und Nase je Schicht als EINE Fläche (i_overlay, Ecken auf die Eingabe zurückgerastet, Bogenwände polar). Schnitt: Band und Schichteinzug auch ohne Nase ein Umriss. Vorgabe (nur wo am Typ/an der Öffnung nichts gesetzt ist): in Wänden mit Aussendämmung sitzt der Rahmen in der Leibung der tragenden Schicht (bündig mit deren Aussenfläche), kein Anschlag, die Dämmung überdämmt ihn 3 cm — Grundriss, Schnitt, Ansicht, 3D, IFC. IFC: Wand mit Stücken als ein Manifold-Körper, Öffnungskörper in der Rahmenlage (schneidet die Stücke nicht weg); der IFC-Import erkennt Wände, deren Löcher schon im Körper sind. Goldens: Musterhaus komplex Grundrisse/Schnitt A (Nasen in der Schicht), Muster EG und 3D (Vorgabe: 12 Überdämmungs-Stücke). Geprüft: cargo test core + fileio, tsc, vitest (inkl. ifcopenshell), CLI-Grundriss 1:20/1:50 und Schnitt A-A als PNG vorher/nachher (Linux). Nicht in der Tauri-App/Mac.
54 lines
2.9 KiB
TypeScript
54 lines
2.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { sampleProject } from "../model/sampleProject";
|
|
import type { Project } from "../model/types";
|
|
import { areaReportToCsv, parseAreaReportCsv } from "./areaReport";
|
|
import { buildOpeningReport, openingSchedule } from "./openingSchedule";
|
|
|
|
const p: Project = {
|
|
...sampleProject,
|
|
name: "Test",
|
|
openings: (sampleProject.openings ?? []).map((o, i) =>
|
|
i === 0 ? { ...o, mark: "T-Haus", fireRating: "EI30", soundClass: "Rw 32 dB", uValue: 1.4, burglaryClass: "RC2", notes: 'Eingang; mit "Zusatz"', isExternal: true } : o,
|
|
),
|
|
};
|
|
|
|
describe("Fenster- und Türliste", () => {
|
|
it("eine Zeile je Öffnung, eigene Angaben übernommen, Rest automatisch nummeriert", () => {
|
|
const rows = openingSchedule(p);
|
|
expect(rows.length).toBe((p.openings ?? []).length);
|
|
const first = rows.find((r) => r.id === p.openings![0]!.id)!;
|
|
expect(first).toMatchObject({ mark: "T-Haus", markAuto: false, fireRating: "EI30", soundClass: "Rw 32 dB", uValue: 1.4, burglaryClass: "RC2", external: true });
|
|
for (const r of rows.filter((r) => r.id !== first.id)) expect(r.markAuto).toBe(true);
|
|
expect(new Set(rows.map((r) => r.mark)).size).toBe(rows.length);
|
|
});
|
|
it("Bericht: Abschnitte je Art, CSV-Rundreise", () => {
|
|
const rep = buildOpeningReport(p);
|
|
expect(rep.sections.length).toBeGreaterThan(0);
|
|
const parsed = parseAreaReportCsv(areaReportToCsv(rep));
|
|
const all = parsed.sections.flatMap((s) => s.rows);
|
|
expect(all.length).toBe((p.openings ?? []).length);
|
|
expect(all.some((r) => r[0] === "T-Haus" && r.includes('Eingang; mit "Zusatz"'))).toBe(true);
|
|
});
|
|
it("[106] Leibungsflächen je Schicht als optionale Spalten", () => {
|
|
// Ohne Schichteinzug (auch ohne die [168]-Vorgabe bei Aussendämmung): ausdrücklich leer.
|
|
const bare: Project = { ...p, openings: p.openings!.map((o) => ({ ...o, layerReveals: [] })) };
|
|
const plain = buildOpeningReport(bare);
|
|
const o0 = p.openings![0]!;
|
|
const withRev: Project = { ...bare, openings: bare.openings!.map((o) => (o.id === o0.id ? { ...o, layerReveals: [{ layer: 0, mode: "zurueck" as const }] } : o)) };
|
|
const rows = openingSchedule(withRev);
|
|
const r0 = rows.find((r) => r.id === o0.id)!;
|
|
expect(r0.revealAreas.length).toBe(1);
|
|
expect(r0.revealAreas[0]!.area).toBeGreaterThan(0);
|
|
for (const r of rows.filter((r) => r.id !== o0.id)) expect(r.revealAreas).toEqual([]);
|
|
const rep = buildOpeningReport(withRev);
|
|
const sec = rep.sections.find((s) => s.rows.some((row) => row.cells[0] === "T-Haus"))!;
|
|
const plainSec = plain.sections.find((s) => s.heading === sec.heading)!;
|
|
expect(sec.columns.length).toBe(plainSec.columns.length + 1);
|
|
expect(sec.widths.length).toBe(sec.columns.length);
|
|
expect(rep.notes.length).toBe(plain.notes.length + 1);
|
|
});
|
|
it("leeres Projekt: kein Abschnitt", () => {
|
|
expect(buildOpeningReport({ ...p, openings: [] }).sections).toEqual([]);
|
|
});
|
|
});
|