[5] Doppelspur Door/Opening aufgeloest: Formatversion 2 migriert Legacy-Tueren zu Oeffnungen (kind door), Project.doors und Door entfernt, Legacy-Pfade in Plan/Schnitt/Ansicht/3D/Liste gestrichen; Tests angepasst

This commit is contained in:
karim committed 2026-10-27 20:00:24 +01:00
1 parent 346798eee6
commit b0270bae3e
94 files changed
+100 -367

No files matched your search

-1
View File
@@ -33,7 +33,6 @@ function projectWithColumn(column: Column): Project {
{ code: "50", name: "Tragwerk", color: "#0a0a0a", lw: 0.5, visible: true, locked: false },
],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -34,7 +34,6 @@ function project(drawings: Drawing2D[]): Project {
],
layers: SHARED.layers,
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
@@ -37,7 +37,6 @@ function projectWithCeiling(openings?: Ceiling["openings"]): Project {
],
layers: [{ code: "30", name: "Decken", color: "#0a0a0a", lw: 0.3, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [ceiling],
stairs: [],
-1
View File
@@ -20,7 +20,6 @@ function projectWith(context: Project["context"]): Project {
],
layers: [],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -52,7 +52,6 @@ function cornerProject(): Project {
wall("W1", { x: 0, y: 0 }, { x: 5, y: 0 }),
wall("W2", { x: 5, y: 0 }, { x: 5, y: 4 }),
],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -35,7 +35,6 @@ function project(drawings: Drawing2D[], layouts: Layout[] = []): Project {
],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -51,7 +51,6 @@ function project(
{ code: "21", name: "Öffnungen", color: "#0a0a0a", lw: 0.3, visible: true, locked: false },
],
walls: [wall],
doors: [],
openings,
ceilings: [],
stairs: [],
+1 -1
View File
@@ -28,7 +28,7 @@ const project = (d: Drawing2D): Project =>
{ id: "eg", name: "EG", kind: "floor", visible: true, locked: false, floorHeight: 2.6, cutHeight: 1.0, baseElevation: 0 },
],
layers: [{ code: "60", name: "Zeichnung", color: "#0a0a0a", lw: 0.25, visible: true, locked: false }],
walls: [], doors: [], openings: [], ceilings: [], stairs: [], rooms: [],
walls: [], openings: [], ceilings: [], stairs: [], rooms: [],
drawings2d: [d],
context: [],
}) as unknown as Project;
@@ -38,7 +38,6 @@ function project(drawing: Drawing2D): Project {
],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -31,7 +31,6 @@ function project(drawings: Drawing2D[]): Project {
],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -37,7 +37,6 @@ function projectWithOpening(opening: Opening): Project {
{ code: "21", name: "Öffnungen", color: "#0a0a0a", lw: 0.3, visible: true, locked: false },
],
walls: [wall],
doors: [],
openings: [opening],
ceilings: [],
stairs: [],
-1
View File
@@ -36,7 +36,6 @@ function project(overrideRules?: OverrideRule[]): Project {
{ code: "60", name: "Zeichnung", color: "#0a0a0a", lw: 0.25, visible: true, locked: false },
],
walls: [wall],
doors: [],
openings: [],
ceilings: [],
stairs: [],
@@ -30,7 +30,6 @@ function project(drawings: Drawing2D[]): Project {
],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -33,7 +33,6 @@ function baseProject(roofs?: Roof[]): Project {
],
layers: [{ code: "35", name: "Dächer", color: "#8a4b32", lw: 0.25, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -31,7 +31,6 @@ function project(drawings: Drawing2D[]): Project {
],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
@@ -28,7 +28,6 @@ function baseProject(levels: DrawingLevel[]): Project {
drawingLevels: levels,
layers: [{ code: "20", name: "Wände", color: "#333", lw: 0.18, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -50,7 +50,6 @@ function project(stair: Stair): Project {
drawingLevels: [floor],
layers: [{ code: "40", name: "Treppen", color: "#333", lw: 0.18, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [stair],
-1
View File
@@ -43,7 +43,6 @@ function projectWithText(drawing: Drawing2D): Project {
{ code: "70", name: "Text", color: "#0a0a0a", lw: 0.3, visible: true, locked: false },
],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-1
View File
@@ -57,7 +57,6 @@ function tJunctionProject(): Project {
wall("WA2", { x: 5, y: 0 }, { x: 10, y: 0 }),
wall("WB", { x: 5, y: 0 }, { x: 5, y: 3 }),
],
doors: [],
openings: [],
ceilings: [],
stairs: [],
+3 -14
View File
@@ -81,7 +81,7 @@ import {
} from "./generatePlan/drawing2d";
import { drawingBox } from "../geometry/drawingBounds";
import { layersStyleSig } from "./generatePlan/layerSig";
import { addDoorSymbol, addOpeningSymbol } from "./generatePlan/openings";
import { addOpeningSymbol } from "./generatePlan/openings";
import { addRoof } from "./generatePlan/roofs";
import { addRoomArea } from "./generatePlan/rooms";
import { addSectionLines } from "./generatePlan/sections";
@@ -511,11 +511,9 @@ export function generatePlan(
wallCategory,
lwByCode.get(wall.categoryCode) ?? WALL_FALLBACK_MM,
);
// Türen (Legacy) + Öffnungen (Fenster/Türen) am Wandhost: BEIDE sparen die
// Wand-Poché aus. Aus beiden wird eine gemeinsame Lücken-Intervall-Liste.
const doors = project.doors.filter((d) => d.hostWallId === wall.id);
// Öffnungen (Fenster/Türen) am Wandhost sparen die Wand-Poché aus (Lücken-Intervall-Liste).
const openings = openingsOfWall(project, wall.id);
const gaps = wallGaps(wall, doors, openings);
const gaps = wallGaps(wall, openings);
const cuts = joins.get(wall.id) ?? { startCut: null, endCut: null };
// Schnitt vs. Ansicht nach Schnitthöhe (BIM-Standard): erreicht die Wand die
// Grundriss-Schnittebene nicht (z. B. eine Brüstung/ein Podestrand), wird sie
@@ -534,15 +532,6 @@ export function generatePlan(
// Referenzlinie: dünne gestrichelte Wand-Achslinie (von der Oberleiste
// umschaltbar). Wird über der Poché gezeichnet, damit sie sichtbar bleibt.
if (showReferenceLines) addReferenceLine(primitives, wall, wallGreyed);
// Tür-Symbol (Legacy-Door) nur, wenn die Kategorie sichtbar ist und der Modus
// sie zeigt.
for (const door of doors) {
const d = categoryDisplay(door.categoryCode);
if (visibleCodes.has(door.categoryCode) && d.render) {
const doorLwMm = lwByCode.get(door.categoryCode) ?? LAYER_LINE_MM;
addDoorSymbol(primitives, wall, door, d.greyed, detail, doorLwMm);
}
}
// Öffnungs-Symbole (Fenster/Tür) je Detailgrad + Auswahl-taggbar.
for (const o of openings) {
const d = categoryDisplay(o.categoryCode);
-1
View File
@@ -36,7 +36,6 @@ function project(drawings: Drawing2D[], levels = [level("L1")]): Project {
wallTypes: [],
drawingLevels: levels,
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
-3
View File
@@ -37,7 +37,6 @@ function project(): Project {
wall("HI", { x: 0, y: 0 }, { x: 4, y: 0 }, 2.6), // erreicht Schnitt → Poché
wall("LOW", { x: 0, y: 2 }, { x: 4, y: 2 }, 0.3), // Brüstung → nur Ansicht
],
doors: [],
openings: [],
ceilings: [],
stairs: [],
@@ -143,7 +142,6 @@ function nonSolidWallProject(): Project {
],
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [wall],
doors: [],
openings: [],
ceilings: [],
stairs: [],
@@ -191,7 +189,6 @@ function ceilingProject(): Project {
],
layers: [{ code: "30", name: "Decken", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [
{
@@ -54,7 +54,6 @@ function project(opening: Opening, windowTypes?: WindowType[]): Project {
{ code: "21", name: "Öffnungen", color: "#0a0a0a", lw: 0.3, visible: true, locked: false },
],
walls: [wall],
doors: [],
openings: [opening],
ceilings: [],
stairs: [],
-1
View File
@@ -20,7 +20,6 @@ function project(): Project {
drawingLevels: [],
layers: [{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
+1 -70
View File
@@ -20,7 +20,7 @@ import {
windowSymbol,
} from "../../geometry/opening";
import { wallReferenceOffset } from "../../model/wall";
import { add, along, dot, leftNormal, normalize, scale, sub } from "../../model/geometry";
import { add, along, dot, scale, sub } from "../../model/geometry";
import {
NO_HATCH,
OVERHEAD_DASH,
@@ -30,75 +30,6 @@ import {
type Primitive,
} from "./shared";
/**
* Tür-Symbol je Detailgrad:
* • grob — nur die gerade Türblatt-Linie (die Öffnungs-Lücke kommt aus der
* ausgesparten Poché).
* • mittel — + Schwenkbogen (geschlossen → offen).
* • fein — + Rahmen/Anschlag-Striche an beiden Pfosten (kurze Striche quer
* zur Wand, die den Türrahmen/-anschlag andeuten).
*/
export function addDoorSymbol(
out: Primitive[],
wall: Wall,
door: Project["doors"][number],
greyed: boolean,
detail: DetailLevel,
_doorLwMm: number,
): void {
const u = normalize(sub(wall.end, wall.start));
const n = leftNormal(u); // linke Seite der Wandachse
const swingDir = door.swing === "left" ? n : scale(n, -1);
const jambStart = along(wall.start, wall.end, door.position);
const jambEnd = along(wall.start, wall.end, door.position + door.width);
const hinge = door.hinge === "start" ? jambStart : jambEnd;
const closedDir = door.hinge === "start" ? u : scale(u, -1);
const openEnd = add(hinge, scale(swingDir, door.width));
const closedEnd = add(hinge, scale(closedDir, door.width));
// Türblatt in geöffneter Stellung (alle Stufen).
out.push({
kind: "line",
a: hinge,
b: openEnd,
cls: "door-leaf",
weightMm: SYMBOL_HAIRLINE_MM,
greyed,
});
// mittel + fein: Schwenkbogen von geschlossen → offen.
if (detail !== "grob") {
out.push({
kind: "arc",
center: hinge,
from: closedEnd,
to: openEnd,
r: door.width,
cls: "door-swing",
weightMm: SYMBOL_HAIRLINE_MM,
greyed,
});
}
// fein: Rahmen/Anschlag-Striche an beiden Pfosten (kurz quer zur Wand,
// symmetrisch um die Achse über eine halbe Wanddicke-Andeutung).
if (detail === "fein") {
const reveal = 0.06; // 6 cm Anschlag-Andeutung je Seite
for (const jamb of [jambStart, jambEnd]) {
out.push({
kind: "line",
a: add(jamb, scale(n, reveal)),
b: add(jamb, scale(n, -reveal)),
cls: "door-frame",
weightMm: SYMBOL_HAIRLINE_MM,
greyed,
});
}
}
}
/**
* Aufgelöste Rahmen-Parameter (Typ-Bibliothek) einer Tür-/Fenster-Öffnung —
* nur vorhanden, wenn die Öffnung einen Bauteil-Typ referenziert (`typeId`).
@@ -43,7 +43,6 @@ function project(overrides: Partial<Project> = {}): Project {
drawingLevels: [],
layers: [category],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
+1 -3
View File
@@ -45,17 +45,15 @@ export interface WallGap {
}
/**
* Vereint Legacy-Türen (`Door`) und Öffnungen (`Opening`) einer Wand zu einer
* Wandet die Öffnungen (`Opening`: Fenster und Türen) einer Wand zu einer
* sortierten Lücken-Intervall-Liste entlang der Wandachse. Entartete Intervalle
* (Breite ≤ 0 oder außerhalb der Achse) werden verworfen.
*/
export function wallGaps(
wall: Wall,
doors: Project["doors"],
openings: Opening[],
): WallGap[] {
const gaps: WallGap[] = [];
for (const d of doors) gaps.push({ from: d.position, to: d.position + d.width });
for (const o of openings) {
const iv = openingInterval(wall, o);
if (iv) gaps.push(iv);
@@ -37,7 +37,6 @@ function baseProject(levels: DrawingLevel[], walls: Wall[]): Project {
drawingLevels: levels,
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls,
doors: [],
openings: [],
ceilings: [],
stairs: [],
+1 -1
View File
@@ -11,7 +11,7 @@ const project = {
},
],
walls: [{ id: "w1", categoryCode: "20" }],
doors: [{ id: "t1", categoryCode: "20" }],
openings: [{ id: "t1", categoryCode: "20" }],
drawings2d: [{ id: "d1", categoryCode: "100" }, { id: "d2", categoryCode: "99" }],
} as unknown as Project;
+1 -1
View File
@@ -18,7 +18,7 @@ function collection(project: Project, kind: PickKind): readonly WithCategory[] {
case "wall": return p.walls ?? [];
case "drawing": return p.drawings2d ?? [];
case "ceiling": return p.ceilings ?? [];
case "opening": return [...(p.openings ?? []), ...(p.doors ?? [])];
case "opening": return p.openings ?? [];
case "stair": return p.stairs ?? [];
case "room": return p.rooms ?? [];
case "roof": return p.roofs ?? [];
+1 -1
View File
@@ -35,7 +35,7 @@ const project = (drawings: Drawing2D[]) =>
components: [], wallTypes: [],
drawingLevels: [{ id: "L", name: "L", kind: "drawing", visible: true, locked: false }],
layers: [{ code: "60", name: "Z", color: "#000", lw: 0.25, visible: true, locked: false }],
walls: [], doors: [], openings: [], ceilings: [], stairs: [], rooms: [], drawings2d: drawings, context: [],
walls: [], openings: [], ceilings: [], stairs: [], rooms: [], drawings2d: drawings, context: [],
}) as unknown as Project;
describe("underlayAccess == Primitiv-Varianten", () => {
-1
View File
@@ -295,7 +295,6 @@ function elevationProject(opts: { overhang: boolean }): Project {
],
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [w("NEAR", 0), w("FAR", 3)],
doors: [],
openings: [],
ceilings: opts.overhang
? [
-15
View File
@@ -42,7 +42,6 @@ import {
sashesOfWindowType,
wallTypeThickness,
} from "../model/types";
import { wallVerticalExtent } from "../model/wall";
import { openingInterval, openingVerticalExtent } from "../geometry/opening";
import { roofBaseElevation, roofGeometry } from "../geometry/roof";
import { projectToModel3d } from "./toWalls3d";
@@ -721,8 +720,6 @@ function collectOpenings(project: Project, frame: ElevationFrame): ProjectedOpen
} catch {
thickness = 0.2;
}
const { zBottom, zTop } = wallVerticalExtent(project, wall);
const axisLen = Math.hypot(wall.end.x - wall.start.x, wall.end.y - wall.start.y);
for (const op of openingsOfWall(project, wall.id)) {
const iv = openingInterval(wall, op);
if (!iv) continue;
@@ -897,18 +894,6 @@ function collectOpenings(project: Project, frame: ElevationFrame): ProjectedOpen
}
out.push(pr);
}
for (const d of project.doors ?? []) {
if (d.hostWallId !== wall.id) continue;
const from = Math.max(0, Math.min(d.position, axisLen));
const to = Math.max(from, Math.min(d.position + d.width, axisLen));
const oTop = Math.min(zTop, zBottom + d.height);
const pr = projectOpeningRect(frame, wall, from, to, zBottom, oTop, thickness);
if (pr) {
pr.isDoor = true;
pr.doorLeaf.push(rect(pr.pts, 0.04, 0.96, 0, 0.97)); // Legacy-Tür: kein Typ, kein Glasblatt
out.push(pr);
}
}
}
return out;
}
-1
View File
@@ -28,7 +28,6 @@ const project = {
ceilings: [],
roofs: [],
openings: [],
doors: [],
components: [],
wallTypes: [],
drawingLevels: [{ id: "eg", name: "EG", kind: "floor", visible: true, locked: false }],
-1
View File
@@ -43,7 +43,6 @@ function project(r: Roof, extra: Partial<Project> = {}): Project {
drawingLevels: [],
layers: [],
walls: [],
doors: [],
roofs: [r],
...extra,
} as unknown as Project;
-8
View File
@@ -267,14 +267,6 @@ export function wallSegmentOwners(project: Project): Wall[] {
const v = openingVerticalExtent(project, wall, op);
cutouts.push({ from: iv.from, to: iv.to, oBottom: v.zBottom, oTop: v.zTop });
}
for (const d of project.doors ?? []) {
if (d.hostWallId !== wall.id) continue;
const from = Math.max(0, Math.min(d.position, axisLen));
const to = Math.max(from, Math.min(d.position + d.width, axisLen));
if (to - from < OWNER_EPS) continue;
const oTop = Math.min(zTop, zBottom + d.height);
cutouts.push({ from, to, oBottom: zBottom, oTop });
}
cutouts.sort((a, b) => a.from - b.from);
if (cutouts.length === 0) {
+3 -47
View File
@@ -155,7 +155,6 @@ describe("Öffnungen als echte Löcher in EINEM Körper (3D-Pfad, layeredWalls:t
// erscheinen. W1: start (0,0)->(5,0), floor "eg" (baseElevation 0).
const twoOffsetWindows: Project = {
...sampleProject,
doors: [],
openings: [
{
id: "WA",
@@ -228,7 +227,6 @@ describe("Öffnungen als echte Löcher in EINEM Körper (3D-Pfad, layeredWalls:t
const p: Project = {
...sampleProject,
walls: [w1],
doors: [],
ceilings: [],
context: [],
windowTypes: [
@@ -292,7 +290,7 @@ describe("Öffnungen als echte Löcher in EINEM Körper (3D-Pfad, layeredWalls:t
it("Tür = Loch bis zur Wand-UK (zBottom == baseElevation)", () => {
// Eine Tür (D1 auf W1) muss im 3D-Pfad als Loch bis zum Boden erscheinen:
// zBottom des Lochs == Wand-UK (0), NICHT ab einer Brüstung.
const p: Project = { ...sampleProject, openings: [] };
const p: Project = { ...sampleProject, openings: (sampleProject.openings ?? []).filter((o) => o.id === "D1") };
const w1 = projectToWalls3d(p, true).filter((w) => w.wallId === "W1");
// W1 ist Durchgangswand für W9 (T-Stoss) -> innerste Putzschicht span-cutout-
// gebrochen. Zusätzlich spaltet die Decke C1 (Beton 100) den Backstein (50) im
@@ -380,7 +378,6 @@ describe("Fenster-Glasscheiben (emitOpeningGlass)", () => {
const p: Project = {
...sampleProject,
openings: (sampleProject.openings ?? []).filter((o) => o.id === "O1"),
doors: sampleProject.doors,
context: [],
};
const { meshes } = projectToModel3d(p);
@@ -419,26 +416,6 @@ describe("Fenster-Glasscheiben (emitOpeningGlass)", () => {
expect(a.max).toBeLessThanOrEqual(b.min + 1e-9);
});
it("Legacy-Tür (project.doors, ohne Öffnungs-Typsystem) bekommt ein Blatt-Panel statt eines blanken Lochs", () => {
// D1 ist eine LEGACY-Tür (project.doors, kein typeId/Öffnungs-Typsystem) —
// vor der Behebung durchliefen emitOpeningGlass/emitOpeningFrames nur
// project.openings, D1 blieb im 3D ein reines Loch in der Wand (Nutzer-
// Report: "Türen fehlen im 3D komplett"). DOOR_LEAF_RGB = [0.93,0.9,0.85].
const { meshes } = projectToModel3d(sampleProject);
const leafMeshes = meshes.filter(
(m) => m.color[0] === 0.93 && m.color[1] === 0.9 && m.color[2] === 0.85,
);
expect(leafMeshes.length).toBe(1);
const leaf = leafMeshes[0];
expect(leaf.positions.length).toBe(24); // Quader: 8 Ecken
expect(leaf.indices.length).toBe(36); // 12 Dreiecke
// D1: height 2.1, sitzt am Wand-UK (0) -> Blatt UK 0 .. OK 2.1.
const zs: number[] = [];
for (let i = 2; i < leaf.positions.length; i += 3) zs.push(leaf.positions[i]);
expect(Math.min(...zs)).toBeCloseTo(0, 6);
expect(Math.max(...zs)).toBeCloseTo(2.1, 6);
});
it("Türen bekommen keine Scheibe; je Fenster genau 2 (window-standard = zweifach verglast)", () => {
// Volles Sample-Projekt: 2 Fenster (O1, O2, beide Typ "window-standard" =
// Zweifachverglasung) + 1 Tür (D1), Kontext leer. Neben den Glasscheiben
@@ -484,7 +461,6 @@ describe("Fenster-Glasscheiben (emitOpeningGlass)", () => {
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const { meshes } = projectToModel3d(p);
@@ -519,7 +495,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
const p: Project = {
...sampleProject,
openings: (sampleProject.openings ?? []).filter((o) => o.id === "O1"),
doors: [],
context: [],
};
const { meshes } = projectToModel3d(p);
@@ -540,7 +515,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
const p: Project = {
...sampleProject,
openings: [{ ...o1, wingCount: 2 }],
doors: [],
context: [],
};
const frameCount = (detail: "grob" | "mittel" | "fein"): number =>
@@ -586,7 +560,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const { meshes } = projectToModel3d(p);
@@ -645,7 +618,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const withMullions: Project = {
@@ -680,7 +652,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const baselineFrames = projectToModel3d(baseline).meshes.filter(isFrame);
@@ -727,7 +698,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const withMullions: Project = {
@@ -762,7 +732,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const baselineFrames = projectToModel3d(baseline).meshes.filter(isFrame);
@@ -807,7 +776,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
});
const fixedCount = projectToModel3d(win("fest")).meshes.filter(isFrame).length;
@@ -847,7 +815,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0,
},
],
doors: [],
context: [],
});
// Vollglas (ratio 1 / fehlt): Glas über (fast) die ganze Blatthöhe.
@@ -921,8 +888,8 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
];
const pFlush: Project = { ...flushWindow(sampleProject), openings: openingWithType("win-flush-test"), doors: [], context: [] };
const pInset: Project = { ...insetWindow(sampleProject), openings: openingWithType("win-inset-test"), doors: [], context: [] };
const pFlush: Project = { ...flushWindow(sampleProject), openings: openingWithType("win-flush-test"), context: [] };
const pInset: Project = { ...insetWindow(sampleProject), openings: openingWithType("win-inset-test"), context: [] };
const minY = (meshes: { positions: number[]; color: [number, number, number] }[]): number => {
let m = Infinity;
@@ -977,7 +944,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const trueAussenY = -0.345 / 2;
@@ -1021,7 +987,6 @@ describe("Rahmen-/Sprossen-Riegel typisierter Öffnungen (emitOpeningFrames)", (
sillHeight: 0.9,
},
],
doors: [],
context: [],
};
const { meshes } = projectToModel3d(p);
@@ -1061,7 +1026,6 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl
sillHeight: 0.9,
},
],
doors: [],
context: [],
});
@@ -1212,7 +1176,6 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl
sillHeight: 0,
},
],
doors: [],
context: [],
});
const baseDoor = {
@@ -1273,7 +1236,6 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl
sillHeight: 0,
},
],
doors: [],
context: [],
});
const baseDoor = {
@@ -1344,7 +1306,6 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl
sillHeight: 0,
},
],
doors: [],
context: [],
});
const frames = (frameKind: "zarge" | "blockrahmen"): number =>
@@ -1393,7 +1354,6 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl
sillHeight: 0,
},
],
doors: [],
context: [],
});
// Ohne threshold: der Blendrahmen-Riegel (FRAME_RGB) fehlt bereits (hasSill
@@ -1689,7 +1649,6 @@ describe("Dach-Wand-Verschneidung (clipPieceToRoofs) — Wand-Top folgt der Dach
...sampleProject,
walls: [gableWall],
roofs: [gableRoof],
doors: [],
openings: [],
ceilings: [],
};
@@ -1720,7 +1679,6 @@ describe("Dach-Wand-Verschneidung (clipPieceToRoofs) — Wand-Top folgt der Dach
...sampleProject,
walls: [gableWall],
roofs: [],
doors: [],
openings: [],
ceilings: [],
};
@@ -1736,7 +1694,6 @@ describe("Dach-Wand-Verschneidung (clipPieceToRoofs) — Wand-Top folgt der Dach
...sampleProject,
walls: [gableWall],
roofs: [{ ...gableRoof, floorId: "og" }],
doors: [],
openings: [],
ceilings: [],
};
@@ -2492,7 +2449,6 @@ describe("emitOpeningShading (Rollladen-/Sonnenschutzkasten als 3D-Box)", () =>
sillHeight: 0.9,
},
],
doors: [],
context: [],
});
+1 -2
View File
@@ -71,7 +71,7 @@ import { applyVoids3d } from "./toWalls3d/voids3d";
import { emitDrawingLineVerts, pickDrawingSegs } from "./toWalls3d/drawing2d";
import { emitColumns } from "./toWalls3d/columns";
import { emitRoofCutLayers, emitRoofs } from "./toWalls3d/roofs";
import { emitLegacyDoorLeaves, emitOpeningFrames, emitOpeningGlass, emitOpeningShading } from "./toWalls3d/openings";
import { emitOpeningFrames, emitOpeningGlass, emitOpeningShading } from "./toWalls3d/openings";
// Re-Export des gemeinsamen Vokabulars — externe Konsumenten (viewport/,
// export/, toSection.ts, nativeSync.ts, …) importieren weiterhin
@@ -224,7 +224,6 @@ export function projectToModel3d(project: Project, opts: Model3dOptions = {}): R
meshes: [
...emitMeshes(project),
...emitOpeningGlass(project),
...emitLegacyDoorLeaves(project),
...emitOpeningFrames(project, detail),
...emitOpeningShading(project, detail),
...emitStairMeshes(project),
+1 -11
View File
@@ -734,8 +734,7 @@ export function emitWall(out: RWall[], project: Project, wall: Wall, layered = t
};
// Aussparungen der Wand als vereinheitlichte Cutouts sammeln:
// • Öffnungen (project.openings, Fenster mit Brüstung/Sturz),
// • Legacy-Türen (project.doors, sitzen am Boden, nur Sturz).
// • Öffnungen (project.openings: Fenster und Türen, mit Brüstung/Sturz).
// Jeweils [from..to] auf die Achse geklemmt + vertikale Öffnungs-Ausdehnung.
const cutouts: Array<{
from: number;
@@ -754,15 +753,6 @@ export function emitWall(out: RWall[], project: Project, wall: Wall, layered = t
op.kind === "window" && getWindowType(project, op)?.innerLayerRecess === true;
cutouts.push({ from: iv.from, to: iv.to, oBottom: v.zBottom, oTop: v.zTop, recessInnerLayer });
}
for (const d of project.doors ?? []) {
if (d.hostWallId !== wall.id) continue;
const from = Math.max(0, Math.min(d.position, axisLen));
const to = Math.max(from, Math.min(d.position + d.width, axisLen));
if (to - from < EPS) continue;
// Tür sitzt am Boden (UK der Wand), reicht bis zur lichten Türhöhe.
const oTop = Math.min(zTop, zBottom + d.height);
cutouts.push({ from, to, oBottom: zBottom, oTop, recessInnerLayer: false });
}
cutouts.sort((a, b) => a.from - b.from);
// ── 3D-Viewer-Pfad (layered=true): EIN Körper je Schicht-Band über die volle
-44
View File
@@ -6,7 +6,6 @@
import type { FrameCornerJoin, Opening, Project, SashDef, Wall } from "../../model/types";
import { getDoorType, getWindowType, glazingPanesOf, openingsOfWall } from "../../model/types";
import { openingInterval, openingVerticalExtent } from "../../geometry/opening";
import { wallVerticalExtent } from "../../model/wall";
import type { DetailLevel } from "../../model/viewTypes";
import { EPS, type RMesh, type RRgb } from "./shared";
import { wallThicknessSafe } from "./bands";
@@ -1036,49 +1035,6 @@ export function emitOpeningGlass(project: Project): RMesh[] {
return out;
}
/**
* Emittiert je LEGACY-Tür (`project.doors` — das alte flache Türfeld VOR dem
* Öffnungs-Typsystem, z. B. `Door.hostWallId/position/width/height` ohne
* `typeId`) EIN Blatt-Panel als rohen Quader. `emitWall` (`../bands.ts`)
* schneidet für diese Türen zwar bereits ein Loch in die Wand, aber
* `emitOpeningGlass`/`emitOpeningFrames` durchlaufen NUR `project.openings`
* (das neue Typsystem) — ohne diese Funktion blieb eine Legacy-Tür ein
* blankes Loch, durch das man hindurchsieht (Nutzer-Report: "Türen fehlen im
* 3D komplett"). Analog zum Alt-Verhalten typloser Fenster
* ({@link emitOpeningGlass}: EINE Vollscheibe ohne Rahmen) — hier EIN
* Vollblatt ohne Rahmen/Zarge (das Rahmen-System gehört exklusiv zu
* `project.openings`, s. {@link resolveOpeningFrame}). `positions` in
* MODELL-Metern.
*/
export function emitLegacyDoorLeaves(project: Project): RMesh[] {
const out: RMesh[] = [];
for (const wall of project.walls) {
const axisLen = Math.hypot(wall.end.x - wall.start.x, wall.end.y - wall.start.y);
if (axisLen < 1e-9) continue;
const { zBottom } = wallVerticalExtent(project, wall);
for (const d of project.doors ?? []) {
if (d.hostWallId !== wall.id) continue;
const from = Math.max(0, Math.min(d.position, axisLen));
const to = Math.max(from, Math.min(d.position + d.width, axisLen));
if (to - from <= EPS) continue;
const zTop = zBottom + d.height;
if (zTop - zBottom <= EPS) continue;
const mesh = openingAxisBox(
wall,
from,
to,
zBottom,
zTop,
-DOOR_LEAF_THICK / 2,
DOOR_LEAF_THICK / 2,
DOOR_LEAF_RGB,
);
if (mesh) out.push(mesh);
}
}
return out;
}
/**
* Emittiert je Öffnung MIT auflösbarem Typ (`getDoorType`/`getWindowType`) die
* Rahmen-/Sprossen-Riegel (Zarge/Blendrahmen, Sturz, Schwelle, Kämpfer,