[B5] IFC-Export: Tür-/Fenster-Geometrie nach Rust (ifc_openings.rs), TS sammelt nur Parameter
- ifc_openings.rs: Rahmen/Zarge, Blatt, Glas, Füllungs-Placement, OperationType/PartitioningType (JS-Zahlsemantik für min/max/round/hypot, Rechenreihenfolge wie TS) - ifcOpenings.ts: fillParams statt fillGeometry; flache Kodierung FILL, FLAT_VERSION 2 - Golden-Vergleich: 419 verschiedene IFC-Ausgaben vorher/nachher zeichengleich (bis auf Zeitstempel) Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
7 files changed
+904
-544
No files matched your search
+23
-12
@@ -32,7 +32,7 @@
|
||||
// • Decke → IfcSlab (outline-Polygon, PredefinedType FLOOR).
|
||||
// • Öffnung → IfcOpeningElement (Quader über die ganze Wanddicke, etwas vorstehend) in der
|
||||
// Wand (IfcRelVoidsElement), darin IfcDoor/IfcWindow (IfcRelFillsElement) aus getrennten Körpern
|
||||
// ([B5], 28.10., `ifcOpenings.ts`): Rahmen/Zarge + Türblatt bzw. Glas je Flügel, mit Farbe/
|
||||
// ([B5], 28.10., Parameter `ifcOpenings.ts`, Rechnung `ifc_openings.rs`): Rahmen/Zarge + Türblatt bzw. Glas je Flügel, mit Farbe/
|
||||
// Transparenz je Rolle; OperationType (Tür: Blattzahl, Scharnierseite, Schiebe) und
|
||||
// PartitioningType (Fenster: Flügelzahl). Masse aus dem Modell (Rahmenbreite/-tiefe, Einzug,
|
||||
// Verglasung, Glasanteil, Oberlicht), sonst die Konstanten des 3D. Ohne Sprossen, Fensterbank,
|
||||
@@ -87,7 +87,7 @@ import { columnFootprint } from "../geometry/column";
|
||||
import { openingInterval, openingVerticalExtent } from "../geometry/opening";
|
||||
import { emitRoofs } from "../plan/toWalls3d/roofs";
|
||||
import { fileio } from "../engine/fileioWasm";
|
||||
import { fillGeometry, type FillGeometry } from "./ifcOpenings";
|
||||
import { fillParams, type FillParams } from "./ifcOpenings";
|
||||
|
||||
/** Deterministische 22-stellige IFC-GUID aus einem Namen (Rust, `ifc_export.rs::ifc_guid`). */
|
||||
export function ifcGuid(name: string): string {
|
||||
@@ -101,7 +101,7 @@ export function ifcString(s: string): string {
|
||||
|
||||
// ── Flacher Puffer (Gegenstück zu src-tauri/fileio/src/ifc_export.rs, dort die Kodierung) ─────
|
||||
|
||||
const FLAT_VERSION = 1;
|
||||
const FLAT_VERSION = 2;
|
||||
const REC_WALL_SOLIDS = 1;
|
||||
const REC_WALL_MESH = 2;
|
||||
const REC_CEILING = 3;
|
||||
@@ -246,18 +246,29 @@ class FlatIfc {
|
||||
voidZRel: number;
|
||||
depth: number;
|
||||
width: number;
|
||||
fill: FillGeometry;
|
||||
fill: FillParams;
|
||||
psets: PsetIn[];
|
||||
}): void {
|
||||
this.nums.push(REC_OPENING, this.str(o.wallId), o.structure, this.str(o.openingId), o.isDoor ? 1 : 0, this.str(o.fillName));
|
||||
this.pts(o.voidRect);
|
||||
this.nums.push(o.voidZRel, o.depth, o.width, o.fill.kind === null ? -1 : this.str(o.fill.kind));
|
||||
this.nums.push(o.fill.origin.x, o.fill.origin.y, o.fill.u.x, o.fill.u.y, o.fill.parts.length);
|
||||
for (const p of o.fill.parts) {
|
||||
this.nums.push(p.role);
|
||||
this.pts(p.pts);
|
||||
this.nums.push(p.zRel, p.depth);
|
||||
this.nums.push(o.voidZRel, o.depth, o.width);
|
||||
// FILL (Kopf von `ifc_export.rs`): Parameter, die Rust zu Körpern und Ausführung rechnet.
|
||||
const f = o.fill;
|
||||
const opt = (v: number | null | undefined) => this.nums.push(v == null ? 0 : 1, v ?? 0);
|
||||
this.nums.push(f.wallStart.x, f.wallStart.y, f.wallEnd.x, f.wallEnd.y, f.from, f.to, f.zBottom, f.zTop, f.nLo, f.nHi);
|
||||
opt(f.frameDepth);
|
||||
opt(f.inset);
|
||||
this.nums.push(f.insetOutside ? 1 : 0);
|
||||
opt(f.frameWidth);
|
||||
this.nums.push(f.wingCount, f.panes, f.sashes.length);
|
||||
for (const s of f.sashes) {
|
||||
this.nums.push(s.post ? 1 : 0);
|
||||
opt(s.postWidth);
|
||||
this.nums.push(s.fixed ? 1 : 0);
|
||||
opt(s.width);
|
||||
}
|
||||
this.nums.push(f.doorKind, f.leafCount, f.swingSign, f.dirSign, f.hingeAtStart ? 1 : 0, f.transomHeight, f.glazed ? 1 : 0);
|
||||
opt(f.glazingRatio);
|
||||
this.psets(o.psets);
|
||||
}
|
||||
|
||||
@@ -680,7 +691,7 @@ export function exportIfcSpf(projectIn: Project): string {
|
||||
// Der Öffnungskörper ist ein Quader über das Achs-Intervall und die Höhe, wie sie das 3D
|
||||
// stanzt (`openingInterval`/`openingVerticalExtent`), quer über alle Bänder der Wand plus
|
||||
// OPENING_OVERSHOOT. Die Füllung (Tür/Fenster) hat ein eigenes Placement
|
||||
// (Öffnungsmitte, Achse bzw. Aufschlagrichtung) und liegt in der Rahmentiefe (`ifcOpenings.ts`).
|
||||
// (Öffnungsmitte, Achse bzw. Aufschlagrichtung) und liegt in der Rahmentiefe (`ifc_openings.rs`).
|
||||
for (const wall of project.walls ?? []) {
|
||||
const host = hostExtent.get(wall.id);
|
||||
if (!host) continue; // Wirtswand übersprungen (degeneriert)
|
||||
@@ -715,7 +726,7 @@ export function exportIfcSpf(projectIn: Project): string {
|
||||
voidZRel: c.zBottom - baseOf(structure),
|
||||
depth,
|
||||
width: c.to - c.from,
|
||||
fill: fillGeometry(project, wall, opening, c, host),
|
||||
fill: fillParams(project, wall, opening, c, host),
|
||||
psets: [{ name: psetName, props }],
|
||||
});
|
||||
}
|
||||
|
||||
+56
-185
@@ -1,204 +1,75 @@
|
||||
// Geometrie der Türen/Fenster im IFC-Export ([B5]): Rahmen, Blatt, Glas, Ausführung. Reine Rechnung,
|
||||
// kein WASM nötig.
|
||||
// Türen/Fenster im IFC-Export ([B5]): TS sammelt nur die Parameter aus Typ und Öffnung; die Geometrie
|
||||
// rechnet Rust (`src-tauri/fileio/src/ifc_openings.rs`, dort die Fälle Rahmen/Blatt/Glas/Ausführung).
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { fillGeometry, DEFAULT_FRAME_WIDTH, DEFAULT_FRAME_DEPTH, DOOR_LEAF_THICK } from "./ifcOpenings";
|
||||
import { fillParams } from "./ifcOpenings";
|
||||
import type { DoorType, Opening, Project, Wall, WindowType } from "../model/types";
|
||||
|
||||
const wall = { id: "W", start: { x: 0, y: 0 }, end: { x: 5, y: 0 } } as Wall;
|
||||
const host = { nLo: -0.2, nHi: 0.2 };
|
||||
|
||||
function proj(over: { doorTypes?: DoorType[]; windowTypes?: WindowType[] }): Project {
|
||||
return { doorTypes: over.doorTypes ?? [], windowTypes: over.windowTypes ?? [] } as unknown as Project;
|
||||
}
|
||||
function door(over: Partial<Opening> = {}): Opening {
|
||||
return { id: "D", type: "opening", hostWallId: "W", categoryCode: "21", kind: "door", position: 1, width: 1, height: 2.1, sillHeight: 0, ...over } as Opening;
|
||||
}
|
||||
function win(over: Partial<Opening> = {}): Opening {
|
||||
return { id: "F", type: "opening", hostWallId: "W", categoryCode: "21", kind: "window", position: 1, width: 1.2, height: 1.2, sillHeight: 0.9, ...over } as Opening;
|
||||
}
|
||||
const proj = (over: { doorTypes?: DoorType[]; windowTypes?: WindowType[] }) =>
|
||||
({ doorTypes: over.doorTypes ?? [], windowTypes: over.windowTypes ?? [] }) as unknown as Project;
|
||||
const door = (over: Partial<Opening> = {}) =>
|
||||
({ id: "D", type: "opening", hostWallId: "W", categoryCode: "21", kind: "door", position: 1, width: 1, height: 2.1, sillHeight: 0, ...over }) as Opening;
|
||||
const win = (over: Partial<Opening> = {}) =>
|
||||
({ id: "F", type: "opening", hostWallId: "W", categoryCode: "21", kind: "window", position: 1, width: 1.2, height: 1.2, sillHeight: 0.9, ...over }) as Opening;
|
||||
const cut = (o: Opening) => ({ from: o.position, to: o.position + o.width, zBottom: o.sillHeight, zTop: o.sillHeight + o.height });
|
||||
const wt = (over: Partial<WindowType> = {}): WindowType =>
|
||||
({ id: "wt", name: "Fenster", kind: "dreh", wingCount: 1, glazing: "zweifach", frameThickness: 0.08, defaultSillHeight: 0.9, defaultWidth: 1.2, defaultHeight: 1.2, ...over }) as WindowType;
|
||||
({ id: "wt", name: "Fenster", kind: "dreh", wingCount: 1, glazing: "dreifach", frameThickness: 0.08, defaultSillHeight: 0.9, defaultWidth: 1.2, defaultHeight: 1.2, ...over }) as WindowType;
|
||||
const dtp = (over: Partial<DoorType> = {}): DoorType =>
|
||||
({ id: "dt", name: "Tür", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.06, defaultWidth: 1, defaultHeight: 2.1, ...over }) as DoorType;
|
||||
|
||||
const bbox = (pts: { x: number; y: number }[]) => ({
|
||||
x0: Math.min(...pts.map((p) => p.x)),
|
||||
x1: Math.max(...pts.map((p) => p.x)),
|
||||
y0: Math.min(...pts.map((p) => p.y)),
|
||||
y1: Math.max(...pts.map((p) => p.y)),
|
||||
});
|
||||
const volume = (parts: { pts: { x: number; y: number }[]; depth: number }[]) =>
|
||||
parts.reduce((a, p) => {
|
||||
const b = bbox(p.pts);
|
||||
return a + (b.x1 - b.x0) * (b.y1 - b.y0) * p.depth;
|
||||
}, 0);
|
||||
|
||||
describe("fillGeometry — Fenster", () => {
|
||||
it("Blendrahmen aus 4 Teilen + eine Glasscheibe, Masse aus Konstanten, Glas = Paketdicke", () => {
|
||||
const o = win({ typeId: "wt" });
|
||||
const g = fillGeometry(proj({ windowTypes: [wt()] }), wall, o, cut(o), host);
|
||||
const frame = g.parts.filter((p) => p.role === 0);
|
||||
const glass = g.parts.filter((p) => p.role === 2);
|
||||
expect(frame.length).toBe(4);
|
||||
expect(glass.length).toBe(1);
|
||||
expect(g.kind).toBe("SINGLE_PANEL");
|
||||
// Rahmenvolumen = (W·H − lichtes Mass) · Tiefe
|
||||
const fw = DEFAULT_FRAME_WIDTH;
|
||||
expect(volume(frame)).toBeCloseTo((1.2 * 1.2 - (1.2 - 2 * fw) * (1.2 - 2 * fw)) * DEFAULT_FRAME_DEPTH, 9);
|
||||
// Glas füllt das lichte Mass, 24 mm (zweifach), mittig in der Rahmentiefe (aussen = nLo).
|
||||
const gb = bbox(glass[0].pts);
|
||||
expect(gb.x1 - gb.x0).toBeCloseTo(1.2 - 2 * fw, 9);
|
||||
expect(gb.y1 - gb.y0).toBeCloseTo(0.024, 9);
|
||||
expect((gb.y0 + gb.y1) / 2).toBeCloseTo(-0.2 + DEFAULT_FRAME_DEPTH / 2, 9);
|
||||
expect(glass[0].zRel).toBeCloseTo(fw, 9);
|
||||
expect(glass[0].depth).toBeCloseTo(1.2 - 2 * fw, 9);
|
||||
});
|
||||
it("Rahmenbreite/-tiefe/Einzug/Verglasung aus dem Typ; Einzug von innen", () => {
|
||||
const o = win({ typeId: "wt" });
|
||||
const t = wt({ frameWidth: 0.09, frameDepth: 0.1, insetFromFace: 0.05, insetFace: "innen", glazing: "dreifach" });
|
||||
const g = fillGeometry(proj({ windowTypes: [t] }), wall, o, cut(o), host);
|
||||
const frame = g.parts.filter((p) => p.role === 0);
|
||||
const b = bbox(frame[0].pts);
|
||||
// innen = nHi: Vorderkante 5 cm eingezogen → Rahmen von 0.05 bis 0.15 (Tiefe 10 cm nach aussen)
|
||||
expect(b.y0).toBeCloseTo(0.05, 9);
|
||||
expect(b.y1).toBeCloseTo(0.15, 9);
|
||||
expect(bbox(frame[2].pts).y1 - bbox(frame[2].pts).y0).toBeCloseTo(0.1, 9);
|
||||
const gl = bbox(g.parts.find((p) => p.role === 2)!.pts);
|
||||
expect(gl.y1 - gl.y0).toBeCloseTo(0.036, 9);
|
||||
expect(gl.x1 - gl.x0).toBeCloseTo(1.2 - 0.18, 9);
|
||||
});
|
||||
it("Rahmentiefe wird auf die Wanddicke geklemmt", () => {
|
||||
const o = win({ typeId: "wt" });
|
||||
const g = fillGeometry(proj({ windowTypes: [wt({ frameDepth: 1 })] }), wall, o, cut(o), host);
|
||||
const b = bbox(g.parts[0].pts);
|
||||
expect(b.y0).toBeCloseTo(-0.2, 9);
|
||||
expect(b.y1).toBeCloseTo(0.2, 9);
|
||||
});
|
||||
it("Flügelzahl → Mittelpfosten + eine Scheibe je Flügel, PartitioningType", () => {
|
||||
for (const [wing, kind] of [
|
||||
[2, "DOUBLE_PANEL_VERTICAL"],
|
||||
[3, "TRIPLE_PANEL_VERTICAL"],
|
||||
[4, "NOTDEFINED"],
|
||||
] as const) {
|
||||
const o = win({ typeId: "wt", wingCount: wing });
|
||||
const g = fillGeometry(proj({ windowTypes: [wt()] }), wall, o, cut(o), host);
|
||||
expect(g.parts.filter((p) => p.role === 2).length, `${wing}`).toBe(wing);
|
||||
expect(g.parts.filter((p) => p.role === 0).length, `${wing}`).toBe(4 + (wing - 1));
|
||||
expect(g.kind).toBe(kind);
|
||||
}
|
||||
});
|
||||
it("Flügeltabelle mit Pfosten und fester Breite: Gläser abgrenzend, keine Überlappung", () => {
|
||||
const o = win({ typeId: "wt" });
|
||||
describe("fillParams", () => {
|
||||
it("Fenster: Typwerte, Flügeltabelle, Flügelzahl der Öffnung vor dem Typ", () => {
|
||||
const t = wt({
|
||||
frameWidth: 0.09,
|
||||
frameDepth: 0.1,
|
||||
insetFromFace: 0.05,
|
||||
insetFace: "innen",
|
||||
wingCount: 3,
|
||||
sashes: [{ kind: "fluegel", autoWidth: false, width: 0.5 }, { kind: "pfosten", postWidth: 0.1 }, { kind: "fluegel" }],
|
||||
});
|
||||
const o = win({ typeId: "wt", wingCount: 2 });
|
||||
expect(fillParams(proj({ windowTypes: [t] }), wall, o, cut(o), host)).toMatchObject({
|
||||
from: 1,
|
||||
to: 2.2,
|
||||
zBottom: 0.9,
|
||||
zTop: 2.1,
|
||||
nLo: -0.2,
|
||||
nHi: 0.2,
|
||||
frameDepth: 0.1,
|
||||
frameWidth: 0.09,
|
||||
inset: 0.05,
|
||||
insetOutside: false,
|
||||
wingCount: 2,
|
||||
panes: 3,
|
||||
sashes: [
|
||||
{ kind: "fluegel", autoWidth: false, width: 0.5 },
|
||||
{ kind: "pfosten", postWidth: 0.1 },
|
||||
{ kind: "fluegel" },
|
||||
{ post: false, fixed: true, width: 0.5 },
|
||||
{ post: true, postWidth: 0.1, fixed: false },
|
||||
{ post: false, fixed: false },
|
||||
],
|
||||
});
|
||||
const g = fillGeometry(proj({ windowTypes: [t] }), wall, o, cut(o), host);
|
||||
const glass = g.parts.filter((p) => p.role === 2).map((p) => bbox(p.pts));
|
||||
expect(glass.length).toBe(2);
|
||||
expect(glass[0].x1 - glass[0].x0).toBeCloseTo(0.5, 9);
|
||||
const clear = 1.2 - 2 * 0.06;
|
||||
expect(glass[1].x1 - glass[1].x0).toBeCloseTo(clear - 0.6, 9);
|
||||
expect(glass[1].x0).toBeCloseTo(glass[0].x1 + 0.1, 9);
|
||||
expect(g.kind).toBe("DOUBLE_PANEL_VERTICAL");
|
||||
// Ohne Typ: nichts vom Typ, zwei Scheiben, eine Flügel.
|
||||
const p = fillParams(proj({}), wall, win(), cut(win()), host);
|
||||
expect(p).toMatchObject({ frameDepth: undefined, frameWidth: undefined, insetOutside: true, wingCount: 1, panes: 2, sashes: [] });
|
||||
});
|
||||
it("ohne Typ: Standardmasse, zweifach, Flügelzahl der Öffnung", () => {
|
||||
const o = win({ wingCount: 2 });
|
||||
const g = fillGeometry(proj({}), wall, o, cut(o), host);
|
||||
const glass = g.parts.filter((p) => p.role === 2);
|
||||
expect(glass.length).toBe(2);
|
||||
const b = bbox(glass[0].pts);
|
||||
expect(b.y1 - b.y0).toBeCloseTo(0.024, 9);
|
||||
});
|
||||
it("alle Teile liegen innerhalb der Öffnung und der Wand", () => {
|
||||
const o = win({ typeId: "wt", wingCount: 2 });
|
||||
const g = fillGeometry(proj({ windowTypes: [wt()] }), wall, o, cut(o), host);
|
||||
for (const p of g.parts) {
|
||||
const b = bbox(p.pts);
|
||||
expect(b.x0).toBeGreaterThanOrEqual(1 - 1e-9);
|
||||
expect(b.x1).toBeLessThanOrEqual(2.2 + 1e-9);
|
||||
expect(b.y0).toBeGreaterThanOrEqual(-0.2 - 1e-9);
|
||||
expect(b.y1).toBeLessThanOrEqual(0.2 + 1e-9);
|
||||
expect(p.zRel).toBeGreaterThanOrEqual(-1e-9);
|
||||
expect(p.zRel + p.depth).toBeLessThanOrEqual(1.2 + 1e-9);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("fillGeometry — Tür", () => {
|
||||
it("Zarge (3 Teile) + Blatt, Blatt 4 cm mittig, Höhe bis unter den Sturz", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
const g = fillGeometry(proj({ doorTypes: [dtp()] }), wall, o, cut(o), host);
|
||||
expect(g.parts.filter((p) => p.role === 0).length).toBe(3);
|
||||
const leaf = g.parts.filter((p) => p.role === 1);
|
||||
expect(leaf.length).toBe(1);
|
||||
const lb = bbox(leaf[0].pts);
|
||||
expect(lb.y1 - lb.y0).toBeCloseTo(DOOR_LEAF_THICK, 9);
|
||||
expect(lb.x1 - lb.x0).toBeCloseTo(1 - 2 * DEFAULT_FRAME_WIDTH, 9);
|
||||
expect(leaf[0].zRel).toBe(0);
|
||||
expect(leaf[0].depth).toBeCloseTo(2.1 - DEFAULT_FRAME_WIDTH, 9);
|
||||
expect(g.parts.some((p) => p.role === 2)).toBe(false);
|
||||
});
|
||||
it("zweiflügelig: zwei Blätter, DOUBLE_DOOR_SINGLE_SWING", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
const g = fillGeometry(proj({ doorTypes: [dtp({ leafCount: 2 })] }), wall, o, cut(o), host);
|
||||
expect(g.parts.filter((p) => p.role === 1).length).toBe(2);
|
||||
expect(g.kind).toBe("DOUBLE_DOOR_SINGLE_SWING");
|
||||
});
|
||||
it("Glastür: Glasfläche = glazingRatio des Blatts, Blatt als Rahmen darum, ohne Überlappung", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
const g = fillGeometry(proj({ doorTypes: [dtp({ leafStyle: "glas", glazingRatio: 0.36 })] }), wall, o, cut(o), host);
|
||||
const glass = g.parts.filter((p) => p.role === 2);
|
||||
expect(glass.length).toBe(1);
|
||||
const gb = bbox(glass[0].pts);
|
||||
const leafW = 1 - 2 * DEFAULT_FRAME_WIDTH;
|
||||
const leafH = 2.1 - DEFAULT_FRAME_WIDTH;
|
||||
expect(((gb.x1 - gb.x0) * glass[0].depth) / (leafW * leafH)).toBeCloseTo(0.36, 9);
|
||||
const leaf = g.parts.filter((p) => p.role === 1);
|
||||
expect(leaf.length).toBe(4);
|
||||
// Blatt ohne Glasfläche = volle Blattfläche − Glasfläche, über 4 cm
|
||||
expect(volume(leaf)).toBeCloseTo((leafW * leafH - (gb.x1 - gb.x0) * glass[0].depth) * DOOR_LEAF_THICK, 9);
|
||||
});
|
||||
it("Oberlicht: Riegel + Glasstreifen, Blatt entsprechend kürzer", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
const g = fillGeometry(proj({ doorTypes: [dtp({ transomHeight: 0.4 })] }), wall, o, cut(o), host);
|
||||
const glass = g.parts.filter((p) => p.role === 2);
|
||||
expect(glass.length).toBe(1);
|
||||
expect(glass[0].depth).toBeCloseTo(0.4, 9);
|
||||
expect(glass[0].zRel + glass[0].depth).toBeCloseTo(2.1 - DEFAULT_FRAME_WIDTH, 9);
|
||||
const leaf = g.parts.find((p) => p.role === 1)!;
|
||||
expect(leaf.zRel + leaf.depth).toBeCloseTo(2.1 - DEFAULT_FRAME_WIDTH - 0.4 - DEFAULT_FRAME_WIDTH, 9);
|
||||
});
|
||||
it("reine Wandöffnung (Typ oder Inline): kein Körper, keine Ausführung", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
expect(fillGeometry(proj({ doorTypes: [dtp({ kind: "wandoeffnung" })] }), wall, o, cut(o), host)).toMatchObject({ kind: null, parts: [] });
|
||||
const o2 = door({ doorType: "wandoeffnung" });
|
||||
expect(fillGeometry(proj({}), wall, o2, cut(o2), host)).toMatchObject({ kind: null, parts: [] });
|
||||
});
|
||||
it("Scharnierseite und Aufschlag → LEFT/RIGHT (von der Aufschlagseite gesehen), Schiebetür", () => {
|
||||
// Wand entlang +X, linke Normale +Y. Standard: Aufschlag nach +Y, Scharnier am Anfang (x klein):
|
||||
// von +Y nach −Y gesehen liegt x klein rechts → RIGHT.
|
||||
const kind = (o: Opening, t: DoorType = dtp()) => fillGeometry(proj({ doorTypes: [t] }), wall, o, cut(o), host).kind;
|
||||
expect(kind(door({ typeId: "dt" }))).toBe("SINGLE_SWING_RIGHT");
|
||||
expect(kind(door({ typeId: "dt", hinge: "end" }))).toBe("SINGLE_SWING_LEFT");
|
||||
// Aufschlag nach aussen (−Y): Blickrichtung dreht → Seiten tauschen.
|
||||
expect(kind(door({ typeId: "dt", openingDir: "out" }))).toBe("SINGLE_SWING_LEFT");
|
||||
expect(kind(door({ typeId: "dt", swing: "right" }))).toBe("SINGLE_SWING_LEFT");
|
||||
expect(kind(door({ typeId: "dt" }), dtp({ kind: "schiebe" }))).toBe("SLIDING_TO_RIGHT");
|
||||
expect(kind(door({ typeId: "dt" }), dtp({ kind: "schiebe", leafCount: 2 }))).toBe("DOUBLE_DOOR_SLIDING");
|
||||
});
|
||||
it("Füllungssystem: Y = Aufschlagrichtung, Ursprung = Öffnungsmitte auf der Achse", () => {
|
||||
const o = door({ typeId: "dt" });
|
||||
const g = fillGeometry(proj({ doorTypes: [dtp()] }), wall, o, cut(o), host);
|
||||
expect(g.origin).toEqual({ x: 1.5, y: 0 });
|
||||
expect(g.u.x).toBeCloseTo(1, 12); // Aufschlag +Y → X = (swing.y, −swing.x) = (1, 0)
|
||||
expect(g.u.y).toBeCloseTo(0, 12);
|
||||
const out = fillGeometry(proj({ doorTypes: [dtp()] }), wall, door({ typeId: "dt", openingDir: "out" }), cut(o), host);
|
||||
expect(out.u.x).toBeCloseTo(-1, 12);
|
||||
it("Tür: Art, Blätter, Aufschlag, Scharnier, Oberlicht, Glas", () => {
|
||||
const o = door({ typeId: "dt", hinge: "end", swing: "right", openingDir: "out" });
|
||||
const t = dtp({ kind: "schiebe", leafCount: 2, transomHeight: 0.4, leafStyle: "glas", glazingRatio: 0.36 });
|
||||
expect(fillParams(proj({ doorTypes: [t] }), wall, o, cut(o), host)).toMatchObject({
|
||||
doorKind: 1,
|
||||
leafCount: 2,
|
||||
swingSign: -1,
|
||||
dirSign: -1,
|
||||
hingeAtStart: false,
|
||||
transomHeight: 0.4,
|
||||
glazed: true,
|
||||
glazingRatio: 0.36,
|
||||
});
|
||||
const plain = fillParams(proj({}), wall, door(), cut(door()), host);
|
||||
expect(plain).toMatchObject({ doorKind: 0, leafCount: 1, swingSign: 1, dirSign: 1, hingeAtStart: true, transomHeight: 0, glazed: false });
|
||||
expect(fillParams(proj({}), wall, door({ doorType: "wandoeffnung" }), cut(door()), host).doorKind).toBe(2);
|
||||
expect(fillParams(proj({ doorTypes: [dtp({ kind: "wandoeffnung" })] }), wall, door({ typeId: "dt" }), cut(door()), host).doorKind).toBe(2);
|
||||
});
|
||||
});
|
||||
+69
-238
@@ -1,260 +1,91 @@
|
||||
// Geometrie der Türen und Fenster für den IFC-Export ([B5], 28.10.): statt einer Box getrennte Körper im
|
||||
// selben Bauteil — Rahmen/Zarge, Türblatt bzw. Glas — plus OperationType (Tür) und PartitioningType
|
||||
// (Fenster). Alles sind vertikale Extrusionen von Grundriss-Rechtecken (wie die Wände), Profile in
|
||||
// Welt-XY, Höhen ab Öffnungs-Unterkante; Rust (`ifc_export.rs`) rechnet sie ins Füllungssystem.
|
||||
//
|
||||
// Masse kommen aus dem Modell, soweit es sie hergibt (Rahmenbreite/-tiefe, Schichteinzug, Flügelzahl und
|
||||
// -tabelle, Verglasung, Blattzahl, Glasanteil, Oberlicht). Fehlendes füllen dieselben Konstanten wie das
|
||||
// 3D (`src-tauri/core/src/openings3d.rs`), damit IFC und Ansicht dasselbe zeigen:
|
||||
// - Rahmenbreite 6 cm (`DEFAULT_FRAME_WIDTH`), Rahmentiefe 7 cm (`DEFAULT_FRAME_DEPTH`: reale Rahmen
|
||||
// sind 70–90 mm tief, nicht so dick wie die Wand), Türblatt 4 cm (`DOOR_LEAF_THICK`).
|
||||
// - Glaspaket: nur im IFC nötig, das 3D zeichnet Einzelscheiben. 1 Scheibe 6 mm, 2 Scheiben 24 mm
|
||||
// (4-16-4, übliches Isolierglas), 3 Scheiben 36 mm (4-12-4-12-4 ≈ 36 mm).
|
||||
// Nicht abgebildet (bewusst einfach): Sprossen, Fensterbank/Rollladenkasten, Schwelle, Flügelrahmen im
|
||||
// Blendrahmen, Kassettenfelder, Schiebe-Laufschiene — die Körper stehen im geschlossenen Zustand.
|
||||
// Türen und Fenster im IFC-Export ([B5]): sammelt die Parameter einer Füllung aus dem Modell (Typ und
|
||||
// Öffnung) für den Rust-Schreiber. Körper (Rahmen/Zarge, Türblatt, Glas), Füllungs-Placement und
|
||||
// OperationType/PartitioningType rechnet `src-tauri/fileio/src/ifc_openings.rs` (Port der früheren
|
||||
// TS-Rechnung, 28.10.; Kodierung FILL im Kopf von `ifc_export.rs`). Fehlende Typwerte bleiben `undefined`,
|
||||
// die Standardmasse (Rahmen 6 × 7 cm, Blatt 4 cm, Glaspakete) kennt nur Rust.
|
||||
|
||||
import type { Opening, Project, SashDef, Vec2, Wall } from "../model/types";
|
||||
import type { Opening, Project, Vec2, Wall } from "../model/types";
|
||||
import { getDoorType, getWindowType, glazingPanesOf } from "../model/types";
|
||||
|
||||
/** Rolle eines Körpers: 0 Rahmen/Zarge, 1 Türblatt, 2 Glas (Kodierung `ifc_export.rs`). */
|
||||
export type FillRole = 0 | 1 | 2;
|
||||
|
||||
export interface FillPart {
|
||||
role: FillRole;
|
||||
/** Profil in Welt-XY (Rechteck, gegen den Uhrzeigersinn in Achs-/Normalenrichtung). */
|
||||
pts: Vec2[];
|
||||
/** Unterkante ab Öffnungs-Unterkante (m). */
|
||||
zRel: number;
|
||||
/** Höhe des Körpers (m). */
|
||||
depth: number;
|
||||
/** Ein Eintrag der Flügeltabelle, wie im Modell (`SashDef`). */
|
||||
export interface FillSash {
|
||||
post: boolean;
|
||||
postWidth?: number;
|
||||
fixed: boolean;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
export interface FillGeometry {
|
||||
/** Ursprung des Füllungssystems (Welt-XY): Öffnungsmitte auf der Wandachse. */
|
||||
origin: Vec2;
|
||||
/** X-Richtung des Füllungssystems (Einheitsvektor); Y = linke Normale davon. */
|
||||
u: Vec2;
|
||||
/** IfcDoorTypeOperationEnum bzw. IfcWindowTypePartitioningEnum; null = Modell gibt nichts her. */
|
||||
kind: string | null;
|
||||
parts: FillPart[];
|
||||
}
|
||||
|
||||
export const DEFAULT_FRAME_WIDTH = 0.06;
|
||||
export const DEFAULT_FRAME_DEPTH = 0.07;
|
||||
export const DOOR_LEAF_THICK = 0.04;
|
||||
/** Glaspaket-Dicke je Scheibenzahl (1, 2, 3). */
|
||||
export const GLASS_PACKAGE_THICKNESS = [0.006, 0.024, 0.036] as const;
|
||||
/** Glasanteil des Türblatts, wenn der Typ keinen angibt (`glas` ohne `glazingRatio`). */
|
||||
const DEFAULT_GLAZING_RATIO = 0.5;
|
||||
/** Kleinste Teilabmessung, damit nie ein flaches Profil entsteht (Meter). */
|
||||
const MIN_DIM = 0.005;
|
||||
|
||||
const sub = (a: Vec2, b: Vec2): Vec2 => ({ x: a.x - b.x, y: a.y - b.y });
|
||||
const norm = (v: Vec2): Vec2 => {
|
||||
const len = Math.hypot(v.x, v.y) || 1;
|
||||
return { x: v.x / len, y: v.y / len };
|
||||
};
|
||||
const leftOf = (u: Vec2): Vec2 => ({ x: -u.y, y: u.x });
|
||||
const dotv = (a: Vec2, b: Vec2): number => a.x * b.x + a.y * b.y;
|
||||
|
||||
/** Flügeleinteilung eines Fensters, auf die Achsbreite aufgelöst: (von, bis, Pfosten?) ab Laibungsanfang. */
|
||||
interface SashSpan {
|
||||
/** Parameter einer Füllung (Reihenfolge der Kodierung: `FlatIfc.opening` in `exportIfc.ts`). */
|
||||
export interface FillParams {
|
||||
wallStart: Vec2;
|
||||
wallEnd: Vec2;
|
||||
/** Achs-Intervall (Abstand ab `wall.start`) und absolute Höhen der Öffnung. */
|
||||
from: number;
|
||||
to: number;
|
||||
post: boolean;
|
||||
zBottom: number;
|
||||
zTop: number;
|
||||
/** Querausdehnung der ganzen Wand entlang der linken Normalen ab `wall.start` (`nLo` = Aussenseite). */
|
||||
nLo: number;
|
||||
nHi: number;
|
||||
frameDepth?: number;
|
||||
inset?: number;
|
||||
insetOutside: boolean;
|
||||
frameWidth?: number;
|
||||
/** Fenster: Flügelzahl, Scheiben (1–3), Flügeltabelle. */
|
||||
wingCount: number;
|
||||
panes: number;
|
||||
sashes: FillSash[];
|
||||
/** Tür: 0 Dreh, 1 Schiebe, 2 reine Wandöffnung. */
|
||||
doorKind: 0 | 1 | 2;
|
||||
leafCount: number;
|
||||
/** +1 Aufschlag links der Achse, −1 rechts; Richtung +1 innen, −1 aussen. */
|
||||
swingSign: 1 | -1;
|
||||
dirSign: 1 | -1;
|
||||
hingeAtStart: boolean;
|
||||
transomHeight: number;
|
||||
glazed: boolean;
|
||||
glazingRatio?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Löst Flügel (`fluegel`) und Pfosten (`pfosten`) zu Intervallen auf: Pfosten und Flügel mit fester Breite
|
||||
* behalten sie, die übrigen teilen den Rest gleichmässig (gleiche Regel wie `sashSegments` im 2D). Ohne
|
||||
* Tabelle: `wingCount` gleiche Flügel.
|
||||
* Parameter der Füllung einer Öffnung. `c` = Achs-Intervall und absolute Höhen der Öffnung, `host` =
|
||||
* Querausdehnung der ganzen Wand (wie im 2D/3D).
|
||||
*/
|
||||
function sashSpans(sashes: readonly SashDef[] | undefined, wingCount: number, total: number): SashSpan[] {
|
||||
const list: readonly SashDef[] =
|
||||
sashes && sashes.length > 0
|
||||
? sashes
|
||||
: Array.from({ length: Math.max(1, Math.round(wingCount)) }, (): SashDef => ({ kind: "fluegel" }));
|
||||
const postW = (s: SashDef): number => Math.max(0, s.postWidth ?? 0.06);
|
||||
const fixedW = (s: SashDef): number | null => (s.kind === "pfosten" ? postW(s) : s.autoWidth === false ? Math.max(0, s.width ?? 0) : null);
|
||||
let fixed = 0;
|
||||
let auto = 0;
|
||||
for (const s of list) {
|
||||
const w = fixedW(s);
|
||||
if (w === null) auto++;
|
||||
else fixed += w;
|
||||
}
|
||||
const autoW = auto > 0 ? Math.max(0, total - fixed) / auto : 0;
|
||||
const out: SashSpan[] = [];
|
||||
let at = 0;
|
||||
for (const s of list) {
|
||||
const w = fixedW(s) ?? autoW;
|
||||
out.push({ from: at, to: at + w, post: s.kind === "pfosten" });
|
||||
at += w;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Körper und Ausführung der Füllung einer Öffnung.
|
||||
*
|
||||
* `c` = Achs-Intervall (`from`/`to`, Abstand ab `wall.start`) und absolute Höhen der Öffnung, `host` =
|
||||
* Querausdehnung der ganzen Wand (`nLo`/`nHi` entlang der linken Normalen ab `wall.start`; `nLo` ist die
|
||||
* Aussenseite, wie im 2D/3D).
|
||||
*/
|
||||
export function fillGeometry(
|
||||
export function fillParams(
|
||||
project: Project,
|
||||
wall: Wall,
|
||||
opening: Opening,
|
||||
c: { from: number; to: number; zBottom: number; zTop: number },
|
||||
host: { nLo: number; nHi: number },
|
||||
): FillGeometry {
|
||||
const u = norm(sub(wall.end, wall.start));
|
||||
const n = leftOf(u);
|
||||
): FillParams {
|
||||
const isDoor = opening.kind === "door";
|
||||
const W = c.to - c.from;
|
||||
const H = c.zTop - c.zBottom;
|
||||
const at = (a: number, b: number): Vec2 => ({
|
||||
x: wall.start.x + u.x * a + n.x * b,
|
||||
y: wall.start.y + u.y * a + n.y * b,
|
||||
});
|
||||
/** Rechteck [a0,a1] entlang der Achse × [b0,b1] quer dazu (Welt-XY). */
|
||||
const rect = (a0: number, a1: number, b0: number, b1: number): Vec2[] => [at(a0, b0), at(a1, b0), at(a1, b1), at(a0, b1)];
|
||||
const center = c.from + W / 2;
|
||||
const origin = at(center, 0);
|
||||
const parts: FillPart[] = [];
|
||||
const add = (role: FillRole, a0: number, a1: number, b0: number, b1: number, z0: number, z1: number): void => {
|
||||
if (a1 - a0 < 1e-6 || b1 - b0 < 1e-6 || z1 - z0 < 1e-6) return;
|
||||
parts.push({ role, pts: rect(a0, a1, b0, b1), zRel: z0, depth: z1 - z0 });
|
||||
};
|
||||
|
||||
const dt = isDoor ? getDoorType(project, opening) : undefined;
|
||||
const wt = isDoor ? undefined : getWindowType(project, opening);
|
||||
const t = dt ?? wt;
|
||||
|
||||
// Querlage des Rahmens: Tiefe (Typ oder 7 cm), Schichteinzug von der gewählten Wandfläche, auf die
|
||||
// Wanddicke geklemmt — dieselbe Rechnung wie `windowSymbol` (2D) und `resolveFrameNormalRange` (3D).
|
||||
const total = host.nHi - host.nLo;
|
||||
const frameDepth = Math.min(total, t?.frameDepth && t.frameDepth > 1e-9 ? t.frameDepth : DEFAULT_FRAME_DEPTH);
|
||||
const inset = Math.max(0, t?.insetFromFace ?? 0);
|
||||
const outside = (t?.insetFace ?? "aussen") === "aussen";
|
||||
const front = outside ? host.nLo + inset : host.nHi - inset;
|
||||
const back = outside ? front + frameDepth : front - frameDepth;
|
||||
let b0 = Math.max(host.nLo, Math.min(host.nHi, Math.min(front, back)));
|
||||
let b1 = Math.max(host.nLo, Math.min(host.nHi, Math.max(front, back)));
|
||||
if (b1 - b0 < MIN_DIM) {
|
||||
b0 = host.nLo;
|
||||
b1 = host.nHi;
|
||||
}
|
||||
const bMid = (b0 + b1) / 2;
|
||||
|
||||
// Sichtbare Rahmenbreite: höchstens ein Viertel der kleineren Öffnungsabmessung, sonst bliebe nichts offen.
|
||||
const fw = Math.max(MIN_DIM, Math.min(t?.frameWidth && t.frameWidth > 1e-9 ? t.frameWidth : DEFAULT_FRAME_WIDTH, Math.min(W, H) / 4));
|
||||
const aIn0 = c.from + fw;
|
||||
const aIn1 = c.to - fw;
|
||||
|
||||
if (!isDoor) {
|
||||
// ── Fenster: Blendrahmen (Pfosten links/rechts, Sturz, Sohlbank), Mittelpfosten, Glas je Flügel ──
|
||||
const wing = opening.wingCount ?? wt?.wingCount ?? 1;
|
||||
add(0, c.from, aIn0, b0, b1, 0, H);
|
||||
add(0, aIn1, c.to, b0, b1, 0, H);
|
||||
add(0, aIn0, aIn1, b0, b1, H - fw, H);
|
||||
add(0, aIn0, aIn1, b0, b1, 0, fw);
|
||||
const panes = wt ? glazingPanesOf(wt) : 2;
|
||||
const gt = Math.min(GLASS_PACKAGE_THICKNESS[panes - 1], b1 - b0);
|
||||
const g0 = bMid - gt / 2;
|
||||
const g1 = bMid + gt / 2;
|
||||
const spans = sashSpans(wt?.sashes, wing, aIn1 - aIn0);
|
||||
let glassCount = 0;
|
||||
spans.forEach((s, i) => {
|
||||
const x0 = aIn0 + s.from;
|
||||
const x1 = aIn0 + s.to;
|
||||
if (s.post) {
|
||||
add(0, x0, x1, b0, b1, fw, H - fw);
|
||||
return;
|
||||
}
|
||||
// Zwischen zwei Flügeln ohne Pfosten steht ein Mittelpfosten (Breite = Rahmenbreite) auf der Grenze.
|
||||
const prev = spans[i - 1];
|
||||
const next = spans[i + 1];
|
||||
const gx0 = i === 0 || prev.post ? x0 : x0 + fw / 2;
|
||||
const gx1 = i === spans.length - 1 || next.post ? x1 : x1 - fw / 2;
|
||||
if (next && !next.post) add(0, x1 - fw / 2, x1 + fw / 2, b0, b1, fw, H - fw);
|
||||
add(2, gx0, gx1, g0, g1, fw, H - fw);
|
||||
glassCount++;
|
||||
});
|
||||
// Teilung nach IFC: nur die senkrechten Standardfälle sind benannt (sonst NOTDEFINED, das Modell
|
||||
// kennt Sprossen und Seitenverhältnisse, die IFC nicht als Enum führt).
|
||||
const kind = glassCount === 1 ? "SINGLE_PANEL" : glassCount === 2 ? "DOUBLE_PANEL_VERTICAL" : glassCount === 3 ? "TRIPLE_PANEL_VERTICAL" : "NOTDEFINED";
|
||||
return { origin, u, kind, parts };
|
||||
}
|
||||
|
||||
// ── Tür ──
|
||||
const kind = dt?.kind ?? (opening.doorType === "wandoeffnung" ? "wandoeffnung" : "dreh");
|
||||
const leafCount = dt?.leafCount ?? 1;
|
||||
// Aufschlagrichtung wie `doorSymbol`: linke Achsnormale, `openingDir: "out"` spiegelt sie.
|
||||
const swingSign = (opening.swing ?? "left") === "left" ? 1 : -1;
|
||||
const dirSign = (opening.openingDir ?? "in") === "in" ? 1 : -1;
|
||||
const swingDir: Vec2 = { x: n.x * swingSign * dirSign, y: n.y * swingSign * dirSign };
|
||||
// Füllungssystem der Tür: Y = Aufschlagrichtung (IFC: die Tür schlägt nach +Y auf), X = Y × Z.
|
||||
const doorU: Vec2 = { x: swingDir.y, y: -swingDir.x };
|
||||
if (kind === "wandoeffnung") return { origin, u: doorU, kind: null, parts: [] };
|
||||
|
||||
// Zarge: Pfosten links/rechts über die ganze Höhe und Sturz (keine Schwelle).
|
||||
add(0, c.from, aIn0, b0, b1, 0, H);
|
||||
add(0, aIn1, c.to, b0, b1, 0, H);
|
||||
add(0, aIn0, aIn1, b0, b1, H - fw, H);
|
||||
|
||||
// Oberlicht: fester Glasstreifen über einem Kämpfer (Riegel in Rahmenbreite) innerhalb der Öffnungshöhe.
|
||||
const th = dt?.transomHeight ?? 0;
|
||||
const hasTransom = th > MIN_DIM && th < H - fw - 0.5;
|
||||
const leafTop = hasTransom ? H - fw - th - fw : H - fw;
|
||||
if (hasTransom) {
|
||||
add(0, aIn0, aIn1, b0, b1, leafTop, leafTop + fw);
|
||||
const gt = Math.min(GLASS_PACKAGE_THICKNESS[1], b1 - b0);
|
||||
add(2, aIn0, aIn1, bMid - gt / 2, bMid + gt / 2, leafTop + fw, H - fw);
|
||||
}
|
||||
|
||||
// Türblatt/-blätter im lichten Mass der Zarge, mittig in der Rahmentiefe.
|
||||
const lt = Math.min(DOOR_LEAF_THICK, b1 - b0);
|
||||
const l0 = bMid - lt / 2;
|
||||
const l1 = bMid + lt / 2;
|
||||
const leafSpans: [number, number][] =
|
||||
leafCount >= 2
|
||||
? [
|
||||
[aIn0, (aIn0 + aIn1) / 2],
|
||||
[(aIn0 + aIn1) / 2, aIn1],
|
||||
]
|
||||
: [[aIn0, aIn1]];
|
||||
const glazed = dt?.leafStyle === "glas";
|
||||
const ratio = Math.min(0.9, Math.max(0.05, dt?.glazingRatio ?? DEFAULT_GLAZING_RATIO));
|
||||
for (const [x0, x1] of leafSpans) {
|
||||
if (!glazed) {
|
||||
add(1, x0, x1, l0, l1, 0, leafTop);
|
||||
continue;
|
||||
}
|
||||
// Glastür: Glasfläche = `glazingRatio` des Blatts (gleichmässig verkleinert um die Blattmitte), das
|
||||
// Blatt als umlaufender Rahmen darum; das Glas füllt die Blattdicke zu 60 % (4–24 mm, mittig).
|
||||
const s = Math.sqrt(ratio);
|
||||
const cx = (x0 + x1) / 2;
|
||||
const cz = leafTop / 2;
|
||||
const gw = (x1 - x0) * s;
|
||||
const gh = leafTop * s;
|
||||
const [px0, px1, pz0, pz1] = [cx - gw / 2, cx + gw / 2, cz - gh / 2, cz + gh / 2];
|
||||
add(1, x0, x1, l0, l1, 0, pz0);
|
||||
add(1, x0, x1, l0, l1, pz1, leafTop);
|
||||
add(1, x0, px0, l0, l1, pz0, pz1);
|
||||
add(1, px1, x1, l0, l1, pz0, pz1);
|
||||
const gt = Math.min(GLASS_PACKAGE_THICKNESS[1], lt * 0.6);
|
||||
add(2, px0, px1, bMid - gt / 2, bMid + gt / 2, pz0, pz1);
|
||||
}
|
||||
|
||||
// OperationType: Blattzahl und Scharnierseite. IFC blickt von der Aufschlagseite (+Y des Füllungssystems)
|
||||
// auf die Tür; "links" = Scharnier auf der +X-Seite des Systems (X = Y × Z, von +Y aus gesehen links).
|
||||
const hingeAtStart = (opening.hinge ?? "start") === "start";
|
||||
const hingeAxis = hingeAtStart ? c.from : c.to;
|
||||
const hingeLocalX = dotv(sub(at(hingeAxis, 0), origin), doorU);
|
||||
const left = hingeLocalX > 0;
|
||||
let op: string;
|
||||
if (kind === "schiebe") op = leafCount >= 2 ? "DOUBLE_DOOR_SLIDING" : left ? "SLIDING_TO_LEFT" : "SLIDING_TO_RIGHT";
|
||||
else op = leafCount >= 2 ? "DOUBLE_DOOR_SINGLE_SWING" : left ? "SINGLE_SWING_LEFT" : "SINGLE_SWING_RIGHT";
|
||||
return { origin, u: doorU, kind: op, parts };
|
||||
return {
|
||||
wallStart: wall.start,
|
||||
wallEnd: wall.end,
|
||||
from: c.from,
|
||||
to: c.to,
|
||||
zBottom: c.zBottom,
|
||||
zTop: c.zTop,
|
||||
nLo: host.nLo,
|
||||
nHi: host.nHi,
|
||||
frameDepth: t?.frameDepth,
|
||||
inset: t?.insetFromFace,
|
||||
insetOutside: (t?.insetFace ?? "aussen") === "aussen",
|
||||
frameWidth: t?.frameWidth,
|
||||
wingCount: opening.wingCount ?? wt?.wingCount ?? 1,
|
||||
panes: wt ? glazingPanesOf(wt) : 2,
|
||||
sashes: (wt?.sashes ?? []).map((s) => ({ post: s.kind === "pfosten", postWidth: s.postWidth, fixed: s.autoWidth === false, width: s.width })),
|
||||
doorKind: kind === "schiebe" ? 1 : kind === "wandoeffnung" ? 2 : 0,
|
||||
leafCount: dt?.leafCount ?? 1,
|
||||
swingSign: (opening.swing ?? "left") === "left" ? 1 : -1,
|
||||
dirSign: (opening.openingDir ?? "in") === "in" ? 1 : -1,
|
||||
hingeAtStart: (opening.hinge ?? "start") === "start",
|
||||
transomHeight: dt?.transomHeight ?? 0,
|
||||
glazed: dt?.leafStyle === "glas",
|
||||
glazingRatio: dt?.glazingRatio,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user