Merge [25][B3][B4][B5] IFC: Advanced Brep/NURBS, Rasterplatzierung, Sweep-Parameter; Tueranschlag beim Import; Tuer-/Fenstergeometrie in Rust
Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
18 files changed
+3452
-602
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,
|
||||
};
|
||||
}
|
||||
@@ -79,6 +79,42 @@ describe("IFC-Import als Bauteile: Rundreise Demo-Haus", () => {
|
||||
expect(text).toContain('"walls":9');
|
||||
});
|
||||
|
||||
it("Tür-Anschlag/Aufschlag und Fensterteilung aus OperationType/PartitioningType (Rundreise)", async () => {
|
||||
// Lage im Raum vergleichen (die Wand kann umgekehrt ankommen): Scharnierpunkt und Aufschlagrichtung.
|
||||
const physical = (o: Opening, w: Wall) => {
|
||||
const l = Math.hypot(w.end.x - w.start.x, w.end.y - w.start.y);
|
||||
const u = { x: (w.end.x - w.start.x) / l, y: (w.end.y - w.start.y) / l };
|
||||
const along = (o.hinge ?? "start") === "start" ? o.position : o.position + o.width;
|
||||
const s = ((o.swing ?? "left") === "left" ? 1 : -1) * ((o.openingDir ?? "in") === "in" ? 1 : -1);
|
||||
return { hinge: { x: w.start.x + u.x * along, y: w.start.y + u.y * along }, swing: { x: -u.y * s, y: u.x * s } };
|
||||
};
|
||||
for (const hinge of ["start", "end"] as const)
|
||||
for (const swing of ["left", "right"] as const)
|
||||
for (const openingDir of ["in", "out"] as const) {
|
||||
const src: Project = {
|
||||
...sampleProject,
|
||||
openings: (sampleProject.openings ?? []).map((o) =>
|
||||
o.id === "D1" ? { ...o, hinge, swing, openingDir } : o.id === "O2" ? { ...o, wingCount: 2 } : o,
|
||||
),
|
||||
};
|
||||
const { project: p } = await importInto(emptyProject, src);
|
||||
const d1 = src.openings!.find((o) => o.id === "D1")!;
|
||||
const w1 = src.walls.find((w) => w.id === d1.hostWallId)!;
|
||||
const got = (p.openings ?? []).find((o) => o.kind === "door")!;
|
||||
const gw = p.walls.find((w) => w.id === got.hostWallId)!;
|
||||
const want = physical(d1, w1);
|
||||
const have = physical(got, gw);
|
||||
const tag = `${hinge}/${swing}/${openingDir}`;
|
||||
expect(near(have.hinge, want.hinge), tag).toBe(true);
|
||||
expect(near(have.swing, want.swing), tag).toBe(true);
|
||||
expect(got.typeId, tag).toBe("door-standard");
|
||||
// Fenster O2 mit zwei Flügeln: Typ mit zwei Flügeln (oder eigene Flügelzahl).
|
||||
const o2 = (p.openings ?? []).find((o) => o.kind === "window" && Math.abs(o.width - 1.4) < 1e-6)!;
|
||||
const wt = (p.windowTypes ?? []).find((t) => t.id === o2.typeId);
|
||||
expect(o2.wingCount ?? wt?.wingCount, tag).toBe(2);
|
||||
}
|
||||
});
|
||||
|
||||
it("in ein Projekt ohne Geschosse/Typen: legt Geschosse, Wand-/Deckentypen und Materialien an", async () => {
|
||||
const bare: Project = {
|
||||
...emptyProject,
|
||||
|
||||
+42
-3
@@ -77,6 +77,12 @@ export interface IfcOpeningData extends IfcInfo {
|
||||
width: number;
|
||||
sill: number;
|
||||
height: number;
|
||||
/** Ausführung: IfcDoorTypeOperationEnum bzw. IfcWindowTypePartitioningEnum (Bauteil, sonst Typ). */
|
||||
operation: string | null;
|
||||
/** Tür: Aufschlag links (+1) / rechts (−1) der Wandachse, 0 = unbekannt (Rust `ifc_semantic`). */
|
||||
swing: number;
|
||||
/** Tür: Scharnier am Wandanfang (+1) / -ende (−1), 0 = unbekannt. */
|
||||
hinge: number;
|
||||
}
|
||||
export interface IfcSlabData extends IfcInfo {
|
||||
outline: Vec2[];
|
||||
@@ -117,6 +123,7 @@ interface RawElement extends IfcInfo {
|
||||
n: number;
|
||||
host?: number;
|
||||
openingKind?: "door" | "window" | "hole";
|
||||
operation?: string | null;
|
||||
profile?: "rect" | "round";
|
||||
longName?: string | null;
|
||||
sia?: string | null;
|
||||
@@ -170,8 +177,19 @@ export function decodeIfcElements(flat: IfcFlat): IfcElementsData | null {
|
||||
break;
|
||||
case "opening": {
|
||||
const host = wallIndex.get(e.host ?? -1);
|
||||
if (host !== undefined && v.length === 4) {
|
||||
out.openings.push({ ...info, host, kind: e.openingKind ?? "hole", position: v[0], width: v[1], sill: v[2], height: v[3] });
|
||||
if (host !== undefined && v.length === 6) {
|
||||
out.openings.push({
|
||||
...info,
|
||||
host,
|
||||
kind: e.openingKind ?? "hole",
|
||||
position: v[0],
|
||||
width: v[1],
|
||||
sill: v[2],
|
||||
height: v[3],
|
||||
operation: e.operation ?? null,
|
||||
swing: Math.sign(v[4]),
|
||||
hinge: Math.sign(v[5]),
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -422,7 +440,26 @@ export function ifcElementsToProject(
|
||||
const host = walls[o.host];
|
||||
if (!host) continue;
|
||||
const kind = o.kind === "window" ? "window" : "door";
|
||||
const typeId = o.kind === "door" ? project.doorTypes?.[0]?.id : o.kind === "window" ? project.windowTypes?.[0]?.id : undefined;
|
||||
const op = o.operation ?? "";
|
||||
// Tür: Typ nach Art (Dreh/Schiebe) und Blattzahl aus der Ausführung, sonst der erste Typ.
|
||||
const sliding = op.includes("SLIDING");
|
||||
const leaves = op.startsWith("DOUBLE_DOOR") ? 2 : 1;
|
||||
const doorType =
|
||||
(op ? project.doorTypes?.find((t) => t.kind === (sliding ? "schiebe" : "dreh") && t.leafCount === leaves) : undefined) ??
|
||||
project.doorTypes?.[0];
|
||||
// Fenster: Flügelzahl aus der Teilung (nur senkrechte Standardfälle); Typ mit dieser Flügelzahl, sonst
|
||||
// der erste Typ mit eigener Flügelzahl an der Öffnung.
|
||||
const wings = ({ SINGLE_PANEL: 1, DOUBLE_PANEL_VERTICAL: 2, TRIPLE_PANEL_VERTICAL: 3 } as Record<string, number>)[op];
|
||||
const windowType = (wings ? project.windowTypes?.find((t) => t.wingCount === wings) : undefined) ?? project.windowTypes?.[0];
|
||||
const typeId = o.kind === "door" ? doorType?.id : o.kind === "window" ? windowType?.id : undefined;
|
||||
const doorExtra =
|
||||
o.kind === "door"
|
||||
? {
|
||||
...(o.hinge !== 0 ? { hinge: o.hinge > 0 ? ("start" as const) : ("end" as const) } : {}),
|
||||
...(o.swing !== 0 ? { swing: o.swing > 0 ? ("left" as const) : ("right" as const) } : {}),
|
||||
}
|
||||
: {};
|
||||
const windowExtra = o.kind === "window" && wings && (windowType?.wingCount ?? 1) !== wings ? { wingCount: wings } : {};
|
||||
openings.push({
|
||||
id: newId("opening"),
|
||||
type: "opening",
|
||||
@@ -435,6 +472,8 @@ export function ifcElementsToProject(
|
||||
sillHeight: round(o.sill, 1e-6),
|
||||
...(o.kind === "hole" ? { doorType: "wandoeffnung" as const } : {}),
|
||||
...(typeId ? { typeId } : {}),
|
||||
...doorExtra,
|
||||
...windowExtra,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,9 @@ describe("IFC-Import: Rundreise mit dem eigenen Export", () => {
|
||||
// UNION/INTERSECTION/DIFFERENCE, Rotation 90°/360°, Rohr (hohl, dünn), Sweep mit fester Referenz und
|
||||
// auf Ebene, Bogen-Leitkurve. Sollwerte von Hand; ifcopenshell bestätigt sie unten.
|
||||
const casesFile = new URL("./testdata/ifc-geometry-cases.ifc", import.meta.url);
|
||||
// Freiform-Fälle ([25], `testdata/ifc-freeform-cases.ifc`, von Hand erzeugt): IfcAdvancedBrep mit Zylinder,
|
||||
// Kugel, bilinearen und rationalen B-Spline-Flächen, B-Spline-Profil, Rohre mit StartParam/EndParam.
|
||||
const freeformFile = new URL("./testdata/ifc-freeform-cases.ifc", import.meta.url);
|
||||
|
||||
describe("IFC-Import: Öffnungen, Boolesche Körper, Rotation, Sweeps", () => {
|
||||
it("alle Fälle gelesen, Volumen von Hand", async () => {
|
||||
@@ -193,6 +196,24 @@ describe("IFC-Import: Öffnungen, Boolesche Körper, Rotation, Sweeps", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("Freiform-Fälle: alle gelesen, Volumen von Hand", async () => {
|
||||
const { products, report } = await readIfc(new Uint8Array(readFileSync(freeformFile)));
|
||||
expect(report.skippedItems).toEqual({});
|
||||
const pi = Math.PI;
|
||||
const want: Array<[string, number]> = [
|
||||
["IfcColumn", pi * 0.25 * 2],
|
||||
["IfcBuildingElementProxy", (2 / 3) * pi],
|
||||
["IfcColumn", pi * 0.25],
|
||||
["IfcBuildingElementProxy", 2 / 3],
|
||||
["IfcColumn", pi * 0.25],
|
||||
["IfcPipeSegment", pi * 0.01 * 3.5],
|
||||
["IfcPipeSegment", pi * 0.01 * pi],
|
||||
["IfcPipeSegment", pi * 0.01 * 2 * pi],
|
||||
];
|
||||
expect(products.map((p) => p.ifcClass)).toEqual(want.map((w) => w[0]));
|
||||
want.forEach(([, w], i) => expect(relClose(vol(products[i]), w, 0.02), `${i}: ${vol(products[i])} ≠ ${w}`).toBe(true));
|
||||
});
|
||||
|
||||
describe("Laden im Web-Worker", () => {
|
||||
afterEach(() => vi.unstubAllGlobals());
|
||||
|
||||
@@ -312,6 +333,14 @@ describe.skipIf(!hasIfcOpenShell)("IFC-Import gegen ifcopenshell", { timeout: 12
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
it("Freiform-Fälle: Advanced Brep (Zylinder, B-Spline-Flächen), B-Spline-Profil und -Leitkurve", async () => {
|
||||
// ifcopenshell 0.9 liefert die nahtlose Halbkugel nicht (Volumen 0) und übergeht StartParam/EndParam
|
||||
// der Rohre (IfcOpenShell zieht absichtlich die ganze Leitkurve); diese prüft der Rust-Test von Hand.
|
||||
const handOnly = ["2dome", "6pipeparams", "7pipearc"];
|
||||
const problems = await compare(freeformFile.pathname, () => 0.03);
|
||||
expect(problems.filter((p) => !handOnly.some((h) => p.includes(h)))).toEqual([]);
|
||||
});
|
||||
|
||||
// Freie Beispieldateien (z. B. github.com/buildingSMART/Sample-Test-Files, nicht im Repo, Lizenz
|
||||
// ungeklärt): DOSSIER_IFC_SAMPLES=<Verzeichnis> setzen.
|
||||
const samples = process.env.DOSSIER_IFC_SAMPLES;
|
||||
|
||||
+332
@@ -0,0 +1,332 @@
|
||||
ISO-10303-21;
|
||||
HEADER;
|
||||
FILE_DESCRIPTION(('ViewDefinition [DesignTransferView]'),'2;1');
|
||||
FILE_NAME('freeform.ifc','2026-10-28T00:00:00',(''),(''),'','','');
|
||||
FILE_SCHEMA(('IFC4'));
|
||||
ENDSEC;
|
||||
DATA;
|
||||
#1=IFCPROJECT('0proj000000000000000a2',$,'P',$,$,$,$,(#8),#2);
|
||||
#2=IFCUNITASSIGNMENT((#3,#4));
|
||||
#3=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
|
||||
#4=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
|
||||
#8=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#13,$);
|
||||
#9=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#8,$,.MODEL_VIEW.,$);
|
||||
#10=IFCCARTESIANPOINT((0.,0.,0.));#11=IFCDIRECTION((0.,0.,1.));#12=IFCDIRECTION((1.,0.,0.));
|
||||
#13=IFCAXIS2PLACEMENT3D(#10,$,$);#14=IFCLOCALPLACEMENT($,#13);
|
||||
#20=IFCBUILDING('0bldg00000000000000002',$,'B',$,$,#14,$,$,.ELEMENT.,$,$,$);
|
||||
#24=IFCBUILDINGSTOREY('0eg0000000000000000002',$,'EG',$,$,#14,$,$,.ELEMENT.,0.);
|
||||
#25=IFCRELAGGREGATES('0agg000000000000000003',$,$,$,#20,(#24));
|
||||
#26=IFCRELAGGREGATES('0agg000000000000000004',$,$,$,#1,(#20));
|
||||
#1001=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1002=IFCVERTEXPOINT(#1001);
|
||||
#1003=IFCCARTESIANPOINT((0.5,0.0,2.0));
|
||||
#1004=IFCVERTEXPOINT(#1003);
|
||||
#1005=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1006=IFCAXIS2PLACEMENT3D(#1005,$,$);
|
||||
#1007=IFCCIRCLE(#1006,0.5);
|
||||
#1008=IFCCARTESIANPOINT((0.0,0.0,2.0));
|
||||
#1009=IFCAXIS2PLACEMENT3D(#1008,$,$);
|
||||
#1010=IFCCIRCLE(#1009,0.5);
|
||||
#1011=IFCEDGECURVE(#1002,#1002,#1007,.T.);
|
||||
#1012=IFCEDGECURVE(#1004,#1004,#1010,.T.);
|
||||
#1013=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1014=IFCAXIS2PLACEMENT3D(#1013,$,$);
|
||||
#1015=IFCCYLINDRICALSURFACE(#1014,0.5);
|
||||
#1016=IFCORIENTEDEDGE(*,*,#1011,.T.);
|
||||
#1017=IFCEDGELOOP((#1016));
|
||||
#1018=IFCFACEOUTERBOUND(#1017,.T.);
|
||||
#1019=IFCORIENTEDEDGE(*,*,#1012,.F.);
|
||||
#1020=IFCEDGELOOP((#1019));
|
||||
#1021=IFCFACEBOUND(#1020,.T.);
|
||||
#1022=IFCADVANCEDFACE((#1018,#1021),#1015,.T.);
|
||||
#1023=IFCORIENTEDEDGE(*,*,#1011,.F.);
|
||||
#1024=IFCEDGELOOP((#1023));
|
||||
#1025=IFCFACEOUTERBOUND(#1024,.T.);
|
||||
#1026=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1027=IFCDIRECTION((0.0,0.0,-1.0));
|
||||
#1028=IFCAXIS2PLACEMENT3D(#1026,#1027,$);
|
||||
#1029=IFCPLANE(#1028);
|
||||
#1030=IFCADVANCEDFACE((#1025),#1029,.T.);
|
||||
#1031=IFCORIENTEDEDGE(*,*,#1012,.T.);
|
||||
#1032=IFCEDGELOOP((#1031));
|
||||
#1033=IFCFACEOUTERBOUND(#1032,.T.);
|
||||
#1034=IFCCARTESIANPOINT((0.0,0.0,2.0));
|
||||
#1035=IFCAXIS2PLACEMENT3D(#1034,$,$);
|
||||
#1036=IFCPLANE(#1035);
|
||||
#1037=IFCADVANCEDFACE((#1033),#1036,.T.);
|
||||
#1038=IFCCLOSEDSHELL((#1022,#1030,#1037));
|
||||
#1039=IFCADVANCEDBREP(#1038);
|
||||
#1040=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1041=IFCAXIS2PLACEMENT3D(#1040,$,$);
|
||||
#1042=IFCLOCALPLACEMENT(#14,#1041);
|
||||
#1043=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1039));
|
||||
#1044=IFCPRODUCTDEFINITIONSHAPE($,$,(#1043));
|
||||
#1045=IFCCOLUMN('1cylxxxxxxxxxxxxxxxxxx',$,'T',$,$,#1042,#1044,$,$);
|
||||
#1046=IFCCARTESIANPOINT((1.0,0.0,0.0));
|
||||
#1047=IFCVERTEXPOINT(#1046);
|
||||
#1048=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1049=IFCAXIS2PLACEMENT3D(#1048,$,$);
|
||||
#1050=IFCCIRCLE(#1049,1.);
|
||||
#1051=IFCEDGECURVE(#1047,#1047,#1050,.T.);
|
||||
#1052=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1053=IFCAXIS2PLACEMENT3D(#1052,$,$);
|
||||
#1054=IFCSPHERICALSURFACE(#1053,1.);
|
||||
#1055=IFCORIENTEDEDGE(*,*,#1051,.T.);
|
||||
#1056=IFCEDGELOOP((#1055));
|
||||
#1057=IFCFACEOUTERBOUND(#1056,.T.);
|
||||
#1058=IFCADVANCEDFACE((#1057),#1054,.T.);
|
||||
#1059=IFCORIENTEDEDGE(*,*,#1051,.F.);
|
||||
#1060=IFCEDGELOOP((#1059));
|
||||
#1061=IFCFACEOUTERBOUND(#1060,.T.);
|
||||
#1062=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1063=IFCDIRECTION((0.0,0.0,-1.0));
|
||||
#1064=IFCAXIS2PLACEMENT3D(#1062,#1063,$);
|
||||
#1065=IFCPLANE(#1064);
|
||||
#1066=IFCADVANCEDFACE((#1061),#1065,.T.);
|
||||
#1067=IFCCLOSEDSHELL((#1058,#1066));
|
||||
#1068=IFCADVANCEDBREP(#1067);
|
||||
#1069=IFCCARTESIANPOINT((10.0,0.0,0.0));
|
||||
#1070=IFCAXIS2PLACEMENT3D(#1069,$,$);
|
||||
#1071=IFCLOCALPLACEMENT(#14,#1070);
|
||||
#1072=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1068));
|
||||
#1073=IFCPRODUCTDEFINITIONSHAPE($,$,(#1072));
|
||||
#1074=IFCBUILDINGELEMENTPROXY('2domexxxxxxxxxxxxxxxxx',$,'T',$,$,#1071,#1073,$,$);
|
||||
#1075=IFCCARTESIANPOINT((0.5,0.0));
|
||||
#1076=IFCCARTESIANPOINT((0.5,0.5));
|
||||
#1077=IFCCARTESIANPOINT((0.0,0.5));
|
||||
#1078=IFCCARTESIANPOINT((-0.5,0.5));
|
||||
#1079=IFCCARTESIANPOINT((-0.5,0.0));
|
||||
#1080=IFCCARTESIANPOINT((-0.5,-0.5));
|
||||
#1081=IFCCARTESIANPOINT((0.0,-0.5));
|
||||
#1082=IFCCARTESIANPOINT((0.5,-0.5));
|
||||
#1083=IFCCARTESIANPOINT((0.5,0.0));
|
||||
#1084=IFCRATIONALBSPLINECURVEWITHKNOTS(2,(#1075,#1076,#1077,#1078,#1079,#1080,#1081,#1082,#1083),.CIRCULAR_ARC.,.T.,.F.,(3,2,2,2,3),(0.,0.25,0.5,0.75,1.),.UNSPECIFIED.,(1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0));
|
||||
#1085=IFCARBITRARYCLOSEDPROFILEDEF(.AREA.,$,#1084);
|
||||
#1086=IFCEXTRUDEDAREASOLID(#1085,#13,#11,1.);
|
||||
#1087=IFCCARTESIANPOINT((20.0,0.0,0.0));
|
||||
#1088=IFCAXIS2PLACEMENT3D(#1087,$,$);
|
||||
#1089=IFCLOCALPLACEMENT(#14,#1088);
|
||||
#1090=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1086));
|
||||
#1091=IFCPRODUCTDEFINITIONSHAPE($,$,(#1090));
|
||||
#1092=IFCCOLUMN('3bspprofilexxxxxxxxxxx',$,'T',$,$,#1089,#1091,$,$);
|
||||
#1093=IFCCARTESIANPOINT((-0.5,-0.5,0.0));
|
||||
#1094=IFCCARTESIANPOINT((0.5,-0.5,0.0));
|
||||
#1095=IFCCARTESIANPOINT((0.5,0.5,0.0));
|
||||
#1096=IFCCARTESIANPOINT((-0.5,0.5,0.0));
|
||||
#1097=IFCCARTESIANPOINT((0.5,-0.5,1.0));
|
||||
#1098=IFCCARTESIANPOINT((0.5,0.5,1.0));
|
||||
#1099=IFCCARTESIANPOINT((-0.5,0.5,1.0));
|
||||
#1100=IFCCARTESIANPOINT((-0.5,-0.5,1.0));
|
||||
#1101=IFCVERTEXPOINT(#1093);
|
||||
#1102=IFCVERTEXPOINT(#1094);
|
||||
#1103=IFCVERTEXPOINT(#1095);
|
||||
#1104=IFCVERTEXPOINT(#1096);
|
||||
#1105=IFCVERTEXPOINT(#1097);
|
||||
#1106=IFCVERTEXPOINT(#1098);
|
||||
#1107=IFCVERTEXPOINT(#1099);
|
||||
#1108=IFCVERTEXPOINT(#1100);
|
||||
#1109=IFCPOLYLINE((#1093,#1094));
|
||||
#1110=IFCEDGECURVE(#1101,#1102,#1109,.T.);
|
||||
#1111=IFCPOLYLINE((#1094,#1095));
|
||||
#1112=IFCEDGECURVE(#1102,#1103,#1111,.T.);
|
||||
#1113=IFCPOLYLINE((#1095,#1096));
|
||||
#1114=IFCEDGECURVE(#1103,#1104,#1113,.T.);
|
||||
#1115=IFCPOLYLINE((#1096,#1093));
|
||||
#1116=IFCEDGECURVE(#1104,#1101,#1115,.T.);
|
||||
#1117=IFCPOLYLINE((#1097,#1098));
|
||||
#1118=IFCEDGECURVE(#1105,#1106,#1117,.T.);
|
||||
#1119=IFCPOLYLINE((#1098,#1099));
|
||||
#1120=IFCEDGECURVE(#1106,#1107,#1119,.T.);
|
||||
#1121=IFCPOLYLINE((#1099,#1100));
|
||||
#1122=IFCEDGECURVE(#1107,#1108,#1121,.T.);
|
||||
#1123=IFCPOLYLINE((#1100,#1097));
|
||||
#1124=IFCEDGECURVE(#1108,#1105,#1123,.T.);
|
||||
#1125=IFCPOLYLINE((#1093,#1097));
|
||||
#1126=IFCEDGECURVE(#1101,#1105,#1125,.T.);
|
||||
#1127=IFCPOLYLINE((#1094,#1098));
|
||||
#1128=IFCEDGECURVE(#1102,#1106,#1127,.T.);
|
||||
#1129=IFCPOLYLINE((#1095,#1099));
|
||||
#1130=IFCEDGECURVE(#1103,#1107,#1129,.T.);
|
||||
#1131=IFCPOLYLINE((#1096,#1100));
|
||||
#1132=IFCEDGECURVE(#1104,#1108,#1131,.T.);
|
||||
#1133=IFCBSPLINESURFACEWITHKNOTS(1,1,((#1093,#1097),(#1094,#1098)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
||||
#1134=IFCORIENTEDEDGE(*,*,#1110,.T.);
|
||||
#1135=IFCORIENTEDEDGE(*,*,#1128,.T.);
|
||||
#1136=IFCORIENTEDEDGE(*,*,#1118,.F.);
|
||||
#1137=IFCORIENTEDEDGE(*,*,#1126,.F.);
|
||||
#1138=IFCEDGELOOP((#1134,#1135,#1136,#1137));
|
||||
#1139=IFCFACEOUTERBOUND(#1138,.T.);
|
||||
#1140=IFCADVANCEDFACE((#1139),#1133,.T.);
|
||||
#1141=IFCBSPLINESURFACEWITHKNOTS(1,1,((#1094,#1098),(#1095,#1099)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
||||
#1142=IFCORIENTEDEDGE(*,*,#1112,.T.);
|
||||
#1143=IFCORIENTEDEDGE(*,*,#1130,.T.);
|
||||
#1144=IFCORIENTEDEDGE(*,*,#1120,.F.);
|
||||
#1145=IFCORIENTEDEDGE(*,*,#1128,.F.);
|
||||
#1146=IFCEDGELOOP((#1142,#1143,#1144,#1145));
|
||||
#1147=IFCFACEOUTERBOUND(#1146,.T.);
|
||||
#1148=IFCADVANCEDFACE((#1147),#1141,.T.);
|
||||
#1149=IFCBSPLINESURFACEWITHKNOTS(1,1,((#1095,#1099),(#1096,#1100)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
||||
#1150=IFCORIENTEDEDGE(*,*,#1114,.T.);
|
||||
#1151=IFCORIENTEDEDGE(*,*,#1132,.T.);
|
||||
#1152=IFCORIENTEDEDGE(*,*,#1122,.F.);
|
||||
#1153=IFCORIENTEDEDGE(*,*,#1130,.F.);
|
||||
#1154=IFCEDGELOOP((#1150,#1151,#1152,#1153));
|
||||
#1155=IFCFACEOUTERBOUND(#1154,.T.);
|
||||
#1156=IFCADVANCEDFACE((#1155),#1149,.T.);
|
||||
#1157=IFCBSPLINESURFACEWITHKNOTS(1,1,((#1096,#1100),(#1093,#1097)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
||||
#1158=IFCORIENTEDEDGE(*,*,#1116,.T.);
|
||||
#1159=IFCORIENTEDEDGE(*,*,#1126,.T.);
|
||||
#1160=IFCORIENTEDEDGE(*,*,#1124,.F.);
|
||||
#1161=IFCORIENTEDEDGE(*,*,#1132,.F.);
|
||||
#1162=IFCEDGELOOP((#1158,#1159,#1160,#1161));
|
||||
#1163=IFCFACEOUTERBOUND(#1162,.T.);
|
||||
#1164=IFCADVANCEDFACE((#1163),#1157,.T.);
|
||||
#1165=IFCORIENTEDEDGE(*,*,#1116,.F.);
|
||||
#1166=IFCORIENTEDEDGE(*,*,#1114,.F.);
|
||||
#1167=IFCORIENTEDEDGE(*,*,#1112,.F.);
|
||||
#1168=IFCORIENTEDEDGE(*,*,#1110,.F.);
|
||||
#1169=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1170=IFCDIRECTION((0.0,0.0,-1.0));
|
||||
#1171=IFCAXIS2PLACEMENT3D(#1169,#1170,$);
|
||||
#1172=IFCPLANE(#1171);
|
||||
#1173=IFCEDGELOOP((#1165,#1166,#1167,#1168));
|
||||
#1174=IFCFACEOUTERBOUND(#1173,.T.);
|
||||
#1175=IFCADVANCEDFACE((#1174),#1172,.T.);
|
||||
#1176=IFCORIENTEDEDGE(*,*,#1118,.T.);
|
||||
#1177=IFCORIENTEDEDGE(*,*,#1120,.T.);
|
||||
#1178=IFCORIENTEDEDGE(*,*,#1122,.T.);
|
||||
#1179=IFCORIENTEDEDGE(*,*,#1124,.T.);
|
||||
#1180=IFCCARTESIANPOINT((0.0,0.0,1.0));
|
||||
#1181=IFCAXIS2PLACEMENT3D(#1180,$,$);
|
||||
#1182=IFCPLANE(#1181);
|
||||
#1183=IFCEDGELOOP((#1176,#1177,#1178,#1179));
|
||||
#1184=IFCFACEOUTERBOUND(#1183,.T.);
|
||||
#1185=IFCADVANCEDFACE((#1184),#1182,.T.);
|
||||
#1186=IFCCLOSEDSHELL((#1140,#1148,#1156,#1164,#1175,#1185));
|
||||
#1187=IFCADVANCEDBREP(#1186);
|
||||
#1188=IFCCARTESIANPOINT((30.0,0.0,0.0));
|
||||
#1189=IFCAXIS2PLACEMENT3D(#1188,$,$);
|
||||
#1190=IFCLOCALPLACEMENT(#14,#1189);
|
||||
#1191=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1187));
|
||||
#1192=IFCPRODUCTDEFINITIONSHAPE($,$,(#1191));
|
||||
#1193=IFCBUILDINGELEMENTPROXY('4twistxxxxxxxxxxxxxxxx',$,'T',$,$,#1190,#1192,$,$);
|
||||
#1194=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1195=IFCCARTESIANPOINT((0.5,0.5,0.0));
|
||||
#1196=IFCCARTESIANPOINT((0.0,0.5,0.0));
|
||||
#1197=IFCCARTESIANPOINT((-0.5,0.5,0.0));
|
||||
#1198=IFCCARTESIANPOINT((-0.5,0.0,0.0));
|
||||
#1199=IFCCARTESIANPOINT((-0.5,-0.5,0.0));
|
||||
#1200=IFCCARTESIANPOINT((0.0,-0.5,0.0));
|
||||
#1201=IFCCARTESIANPOINT((0.5,-0.5,0.0));
|
||||
#1202=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1203=IFCRATIONALBSPLINECURVEWITHKNOTS(2,(#1194,#1195,#1196,#1197,#1198,#1199,#1200,#1201,#1202),.CIRCULAR_ARC.,.T.,.F.,(3,2,2,2,3),(0.,0.25,0.5,0.75,1.),.UNSPECIFIED.,(1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0));
|
||||
#1204=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1205=IFCCARTESIANPOINT((0.5,0.5,1.0));
|
||||
#1206=IFCCARTESIANPOINT((0.0,0.5,1.0));
|
||||
#1207=IFCCARTESIANPOINT((-0.5,0.5,1.0));
|
||||
#1208=IFCCARTESIANPOINT((-0.5,0.0,1.0));
|
||||
#1209=IFCCARTESIANPOINT((-0.5,-0.5,1.0));
|
||||
#1210=IFCCARTESIANPOINT((0.0,-0.5,1.0));
|
||||
#1211=IFCCARTESIANPOINT((0.5,-0.5,1.0));
|
||||
#1212=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1213=IFCRATIONALBSPLINECURVEWITHKNOTS(2,(#1204,#1205,#1206,#1207,#1208,#1209,#1210,#1211,#1212),.CIRCULAR_ARC.,.T.,.F.,(3,2,2,2,3),(0.,0.25,0.5,0.75,1.),.UNSPECIFIED.,(1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0));
|
||||
#1214=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1215=IFCVERTEXPOINT(#1214);
|
||||
#1216=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1217=IFCVERTEXPOINT(#1216);
|
||||
#1218=IFCEDGECURVE(#1215,#1215,#1203,.T.);
|
||||
#1219=IFCEDGECURVE(#1217,#1217,#1213,.T.);
|
||||
#1220=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1221=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1222=IFCCARTESIANPOINT((0.5,0.5,0.0));
|
||||
#1223=IFCCARTESIANPOINT((0.5,0.5,1.0));
|
||||
#1224=IFCCARTESIANPOINT((0.0,0.5,0.0));
|
||||
#1225=IFCCARTESIANPOINT((0.0,0.5,1.0));
|
||||
#1226=IFCCARTESIANPOINT((-0.5,0.5,0.0));
|
||||
#1227=IFCCARTESIANPOINT((-0.5,0.5,1.0));
|
||||
#1228=IFCCARTESIANPOINT((-0.5,0.0,0.0));
|
||||
#1229=IFCCARTESIANPOINT((-0.5,0.0,1.0));
|
||||
#1230=IFCCARTESIANPOINT((-0.5,-0.5,0.0));
|
||||
#1231=IFCCARTESIANPOINT((-0.5,-0.5,1.0));
|
||||
#1232=IFCCARTESIANPOINT((0.0,-0.5,0.0));
|
||||
#1233=IFCCARTESIANPOINT((0.0,-0.5,1.0));
|
||||
#1234=IFCCARTESIANPOINT((0.5,-0.5,0.0));
|
||||
#1235=IFCCARTESIANPOINT((0.5,-0.5,1.0));
|
||||
#1236=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1237=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1238=IFCRATIONALBSPLINESURFACEWITHKNOTS(2,1,((#1220,#1221),(#1222,#1223),(#1224,#1225),(#1226,#1227),(#1228,#1229),(#1230,#1231),(#1232,#1233),(#1234,#1235),(#1236,#1237)),.UNSPECIFIED.,.F.,.F.,.F.,(3,2,2,2,3),(2,2),(0.,0.25,0.5,0.75,1.),(0.,1.),.UNSPECIFIED.,((1.0,1.0),(0.7071067811865476,0.7071067811865476),(1.0,1.0),(0.7071067811865476,0.7071067811865476),(1.0,1.0),(0.7071067811865476,0.7071067811865476),(1.0,1.0),(0.7071067811865476,0.7071067811865476),(1.0,1.0)));
|
||||
#1239=IFCCARTESIANPOINT((0.5,0.0,0.0));
|
||||
#1240=IFCCARTESIANPOINT((0.5,0.0,1.0));
|
||||
#1241=IFCPOLYLINE((#1239,#1240));
|
||||
#1242=IFCEDGECURVE(#1215,#1217,#1241,.T.);
|
||||
#1243=IFCORIENTEDEDGE(*,*,#1218,.T.);
|
||||
#1244=IFCORIENTEDEDGE(*,*,#1242,.T.);
|
||||
#1245=IFCORIENTEDEDGE(*,*,#1219,.F.);
|
||||
#1246=IFCORIENTEDEDGE(*,*,#1242,.F.);
|
||||
#1247=IFCEDGELOOP((#1243,#1244,#1245,#1246));
|
||||
#1248=IFCFACEOUTERBOUND(#1247,.T.);
|
||||
#1249=IFCADVANCEDFACE((#1248),#1238,.T.);
|
||||
#1250=IFCORIENTEDEDGE(*,*,#1218,.F.);
|
||||
#1251=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1252=IFCDIRECTION((0.0,0.0,-1.0));
|
||||
#1253=IFCAXIS2PLACEMENT3D(#1251,#1252,$);
|
||||
#1254=IFCPLANE(#1253);
|
||||
#1255=IFCEDGELOOP((#1250));
|
||||
#1256=IFCFACEOUTERBOUND(#1255,.T.);
|
||||
#1257=IFCADVANCEDFACE((#1256),#1254,.T.);
|
||||
#1258=IFCORIENTEDEDGE(*,*,#1219,.T.);
|
||||
#1259=IFCCARTESIANPOINT((0.0,0.0,1.0));
|
||||
#1260=IFCAXIS2PLACEMENT3D(#1259,$,$);
|
||||
#1261=IFCPLANE(#1260);
|
||||
#1262=IFCEDGELOOP((#1258));
|
||||
#1263=IFCFACEOUTERBOUND(#1262,.T.);
|
||||
#1264=IFCADVANCEDFACE((#1263),#1261,.T.);
|
||||
#1265=IFCCLOSEDSHELL((#1249,#1257,#1264));
|
||||
#1266=IFCADVANCEDBREP(#1265);
|
||||
#1267=IFCCARTESIANPOINT((40.0,0.0,0.0));
|
||||
#1268=IFCAXIS2PLACEMENT3D(#1267,$,$);
|
||||
#1269=IFCLOCALPLACEMENT(#14,#1268);
|
||||
#1270=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1266));
|
||||
#1271=IFCPRODUCTDEFINITIONSHAPE($,$,(#1270));
|
||||
#1272=IFCCOLUMN('5nurbscylxxxxxxxxxxxxx',$,'T',$,$,#1269,#1271,$,$);
|
||||
#1273=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1274=IFCCARTESIANPOINT((4.0,0.0,0.0));
|
||||
#1275=IFCCARTESIANPOINT((4.0,3.0,0.0));
|
||||
#1276=IFCPOLYLINE((#1273,#1274,#1275));
|
||||
#1277=IFCSWEPTDISKSOLID(#1276,0.1,$,0.5,1.5);
|
||||
#1278=IFCCARTESIANPOINT((50.0,0.0,0.0));
|
||||
#1279=IFCAXIS2PLACEMENT3D(#1278,$,$);
|
||||
#1280=IFCLOCALPLACEMENT(#14,#1279);
|
||||
#1281=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1277));
|
||||
#1282=IFCPRODUCTDEFINITIONSHAPE($,$,(#1281));
|
||||
#1283=IFCPIPESEGMENT('6pipeparamsxxxxxxxxxxx',$,'T',$,$,#1280,#1282,$,$);
|
||||
#1284=IFCCARTESIANPOINT((0.0,0.0,0.0));
|
||||
#1285=IFCAXIS2PLACEMENT3D(#1284,$,$);
|
||||
#1286=IFCCIRCLE(#1285,2.);
|
||||
#1287=IFCSWEPTDISKSOLID(#1286,0.1,$,0.,1.5707963267948966);
|
||||
#1288=IFCCARTESIANPOINT((60.0,0.0,0.0));
|
||||
#1289=IFCAXIS2PLACEMENT3D(#1288,$,$);
|
||||
#1290=IFCLOCALPLACEMENT(#14,#1289);
|
||||
#1291=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1287));
|
||||
#1292=IFCPRODUCTDEFINITIONSHAPE($,$,(#1291));
|
||||
#1293=IFCPIPESEGMENT('7pipearcxxxxxxxxxxxxxx',$,'T',$,$,#1290,#1292,$,$);
|
||||
#1294=IFCCARTESIANPOINT((1.0,0.0,0.0));
|
||||
#1295=IFCCARTESIANPOINT((1.0,1.0,0.0));
|
||||
#1296=IFCCARTESIANPOINT((0.0,1.0,0.0));
|
||||
#1297=IFCCARTESIANPOINT((-1.0,1.0,0.0));
|
||||
#1298=IFCCARTESIANPOINT((-1.0,0.0,0.0));
|
||||
#1299=IFCCARTESIANPOINT((-1.0,-1.0,0.0));
|
||||
#1300=IFCCARTESIANPOINT((0.0,-1.0,0.0));
|
||||
#1301=IFCCARTESIANPOINT((1.0,-1.0,0.0));
|
||||
#1302=IFCCARTESIANPOINT((1.0,0.0,0.0));
|
||||
#1303=IFCRATIONALBSPLINECURVEWITHKNOTS(2,(#1294,#1295,#1296,#1297,#1298,#1299,#1300,#1301,#1302),.CIRCULAR_ARC.,.T.,.F.,(3,2,2,2,3),(0.,0.25,0.5,0.75,1.),.UNSPECIFIED.,(1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0,0.7071067811865476,1.0));
|
||||
#1304=IFCSWEPTDISKSOLID(#1303,0.1,$,$,$);
|
||||
#1305=IFCCARTESIANPOINT((70.0,0.0,0.0));
|
||||
#1306=IFCAXIS2PLACEMENT3D(#1305,$,$);
|
||||
#1307=IFCLOCALPLACEMENT(#14,#1306);
|
||||
#1308=IFCSHAPEREPRESENTATION(#9,'Body','AdvancedBrep',(#1304));
|
||||
#1309=IFCPRODUCTDEFINITIONSHAPE($,$,(#1308));
|
||||
#1310=IFCPIPESEGMENT('8pipenurbsxxxxxxxxxxxx',$,'T',$,$,#1307,#1309,$,$);
|
||||
#99=IFCRELCONTAINEDINSPATIALSTRUCTURE('0rel000000000000000002',$,$,$,(#1045,#1074,#1092,#1193,#1272,#1283,#1293,#1310),#24);
|
||||
ENDSEC;
|
||||
END-ISO-10303-21;
|
||||
Reference in new issue
Block a user