Tür: zweiflügelige Türen wirklich rendern (leafCount 2D+3D)

DoorType.leafCount wurde bisher von keinem Renderer gelesen — eine zweiflügelige
Tür sah aus wie eine einflügelige (Designdoc-Prio #3).

- opening.ts: additive doorLeaves(wall, o, leafCount) — einflüglig ein Blatt
  voller Breite, zweiflüglig zwei halbbreite Blätter an gegenüberliegenden
  Pfosten, beide zur selben Seite (symmetrische Doppeltür). doorSymbol bleibt
  unverändert (Parität).
- generatePlan: Tür-Zweig zeichnet je Blatt Linie + Schwenkbogen (leafCount aus
  DoorType).
- toWalls3d: Tür-wingCount = leafCount → mittiger Anschlagpfosten (Stulp) im 3D.
- +1 Test (2 Blätter/Bögen, halber Radius). 669/669 grün.
This commit is contained in:
2026-07-10 02:06:37 +02:00
parent e28b7fd980
commit ccf4d039ec
4 changed files with 106 additions and 19 deletions
+24
View File
@@ -164,6 +164,30 @@ describe("generatePlan — Tür-/Fenstertyp-Rahmenband (opening-frame)", () => {
});
});
describe("generatePlan — zweiflügelige Tür (leafCount)", () => {
it("leafCount 2 -> zwei Türblätter + zwei Schwenkbögen; leafCount 1 -> je eines", () => {
const oneLeaf = project([{ ...baseDoor, typeId: "dt1" }], { doorTypes: [doorType] });
expect(linesOfClass(oneLeaf, "door-leaf", "T1").length).toBe(1);
const twoLeafType: DoorType = { ...doorType, id: "dt2", leafCount: 2 };
const twoLeaf = project([{ ...baseDoor, typeId: "dt2" }], { doorTypes: [twoLeafType] });
expect(linesOfClass(twoLeaf, "door-leaf", "T1").length).toBe(2);
// Zwei Schwenkbögen (arc-Primitive) bei mittel/fein.
const arcs = generatePlan(twoLeaf, "eg", visible, undefined, "mittel").primitives.filter(
(pr) => pr.kind === "arc" && (pr as { cls?: string }).cls === "door-swing",
);
expect(arcs.length).toBe(2);
// Die beiden Blätter sind je halb so breit (Radius) wie das einflügelige.
const oneRadius = (
generatePlan(oneLeaf, "eg", visible, undefined, "mittel").primitives.find(
(pr) => pr.kind === "arc" && (pr as { cls?: string }).cls === "door-swing",
) as { r: number }
).r;
const twoRadius = (arcs[0] as { r: number }).r;
expect(twoRadius).toBeCloseTo(oneRadius / 2, 6);
});
});
describe("generatePlan — Oberlicht (opening-transom)", () => {
it("erscheint genau dann, wenn transomHeight > 0", () => {
const withTransom = project([{ ...baseWindow, typeId: "wt1" }], { windowTypes: [windowType] });