From 89e737b25e17f2e166472e7ad19232dac93e2aae Mon Sep 17 00:00:00 2001 From: Karim Date: Thu, 9 Jul 2026 21:00:25 +0200 Subject: [PATCH] =?UTF-8?q?Platzierte=20=C3=96ffnungen=20bekommen=20Standa?= =?UTF-8?q?rd-Bauteiltyp=20(Rahmen=20sofort=20sichtbar)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frisch mit dem Fenster-/Tür-Werkzeug platzierte Öffnungen erhielten keinen typeId → resolveOpeningFrame lieferte null → weder 2D-Rahmenband noch 3D-Rahmen/Laibung wurden gezeichnet (nur Loch + flache Scheibe). Das war der Grund, warum die vertiefte Fenster-/Tür-Darstellung „im 3D gar nicht so aussah". Fix: appendOpening weist den ersten Fenster-/Türtyp der Bibliothek zu (Fenster→windowTypes[0], Tür→doorTypes[0]); ohne Bibliothek bleibt das typlose Inline-Verhalten. --- src/commands/cmds/opening.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/cmds/opening.ts b/src/commands/cmds/opening.ts index 9b83b4d..58edd85 100644 --- a/src/commands/cmds/opening.ts +++ b/src/commands/cmds/opening.ts @@ -187,6 +187,12 @@ function appendOpening(p: Project, s: OpPos, ctx: CommandContext): Project { const len = Math.hypot(s.end.x - s.start.x, s.end.y - s.start.y); const width = Math.max(0.1, Math.min(s.width, len)); const position = Math.max(0, Math.min(s.posAlong, Math.max(0, len - width))); + // Standard-Bauteiltyp zuweisen (erster Tür-/Fenstertyp der Bibliothek), damit + // frisch platzierte Öffnungen SOFORT die volle Rahmen-/Laibungs-Darstellung + // (2D + 3D) bekommen — ohne Typ blieben sie ein blosses Loch mit flacher + // Scheibe. Fehlt eine Bibliothek, bleibt es beim Inline-Verhalten (kein Typ). + const typeId = + s.kind === "door" ? ctx.project.doorTypes?.[0]?.id : ctx.project.windowTypes?.[0]?.id; const opening: Opening = { id: uniqueId("O"), type: "opening", @@ -197,6 +203,7 @@ function appendOpening(p: Project, s: OpPos, ctx: CommandContext): Project { width, height: s.height, sillHeight: s.kind === "door" ? 0 : s.sill, + ...(typeId ? { typeId } : {}), ...(s.kind === "door" ? { hinge: s.hinge, swing: s.side, openingDir: s.dir, swingAngle: s.swingAngle } : {}),