[105][103][G3][106][97] Fenster/Türen: Rahmen-Detail in der Ansicht, Türblatt im Falz, Pfostenbreite, Dachfenster-Griffe/Info/Liste, Formöffnung in der Projektion, Schnitt parallel durch die Leibung

Ansicht: Rahmen je Seite, Verbreiterungs-/Bank-/Storenprofile, Anschlag je Seite, Zargenspiegel/Bekleidung je
sichtbarer Seite. 3D/Grundriss: Türblatt im Falz der Zarge (Drehpunkt an der Falzkante). Pfostenbreite in
Grundriss, Schnitt (Kämpfer/Riegel) und Ansicht. Ressourcen-Tabs mit Rahmen-Detail/Anschlag/Zarge.
Dachfenster: Griffe (Lage, Breite, Höhe im Gefälle), Objekt-Info, Liste mit Dach/Decke als Wirt, Löschen mit
dem Wirt. Formöffnungen: Umriss in der Projektion, Füllkörper je Wandschicht. Schnitt parallel zur Wand
durch die Leibung mit Rücksprung und Zusatzstücken.
This commit is contained in:
Claude committed 2026-10-30 04:12:00 +00:00
1 parent 081f8023c5
commit 0f8cb9a37b
34 files changed
+1215 -72

No files matched your search

+2 -2
View File
@@ -1264,8 +1264,8 @@ export default function App() {
...removeItems(p, "rooms", rmids),
...removeItems(p, "extrudedSolids", exids),
...removeItems(p, "columns", colids),
// Öffnungen: eigene Auswahl löschen UND alle, deren Host-Wand entfällt.
...removeItems(p, "openings", (o) => oids.has(o.id) || wids.has(o.hostWallId)),
// Öffnungen: eigene Auswahl löschen UND alle, deren Wirt (Wand, Dach, Decke [103]) entfällt.
...removeItems(p, "openings", (o) => oids.has(o.id) || wids.has(o.hostWallId) || (!!o.hostRoofId && rfids.has(o.hostRoofId)) || (!!o.hostCeilingId && cids.has(o.hostCeilingId))),
...removeItems(p, "context", ctxids),
]),
);
+1
View File
@@ -61,6 +61,7 @@ export type RootQueryName = "penRebakeOps" | "penDeleteOps" | "penSeedOps" | "st
/** Abfragen des Kerns (`queries.rs`). */
export type QueryName =
| "surfaceOpening"
| "kennzahlen"
| "areaTable"
| "programCompare"
+2
View File
@@ -63,3 +63,5 @@ export type { VerticalExtent } from "../geometry/grips";
export type { GripRequest } from "../geometry/grips";
export { openingPreviewProject, openingPreviewSvgs } from "../plan/openingPreview";
export type { OpeningPreviewSvgs } from "../plan/openingPreview";
export { surfaceOpeningInfo, surfaceOpeningGrips, surfaceOpeningGripPatch } from "../plan/surfaceOpening";
export type { SurfaceOpeningInfo } from "../plan/surfaceOpening";
+2
View File
@@ -12,7 +12,9 @@ import type { AreaReport, Cell, ReportRow, ReportSection } from "./areaReport";
export interface OpeningScheduleRow {
kind: "door" | "window";
id: string;
/** Wirt: Wand, bei Dach-/Deckenfenstern ([103]) das Dach bzw. die Decke (s. `hostKind`). */
wallId: string;
hostKind: "wall" | "roof" | "ceiling";
/** Nummer: eingetragene oder automatische. */
mark: string;
markAuto: boolean;
+8
View File
@@ -731,6 +731,14 @@ export const de = {
"objinfo.opening.kind.window": "Fenster",
"objinfo.opening.kind.door": "Tür",
"objinfo.opening.hostWall": "Wirts-Wand",
"objinfo.opening.hostRoof": "Wirt Dach (Geschoss)",
"objinfo.opening.hostCeiling": "Wirt Decke (Geschoss)",
"objinfo.opening.surfaceWidth": "Breite (quer zum Gefälle)",
"objinfo.opening.surfaceHeight": "Höhe (im Gefälle)",
"objinfo.opening.hostX": "Lage X",
"objinfo.opening.hostY": "Lage Y",
"objinfo.opening.hostAngle": "Drehung (waagrechte Fläche)",
"objinfo.opening.slope": "Neigung der Fläche",
"objinfo.opening.position": "Position (ab Wandanfang)",
"objinfo.opening.width": "Breite",
"objinfo.opening.height": "Höhe",
+8
View File
@@ -730,6 +730,14 @@ export const en: Record<TranslationKey, string> = {
"objinfo.opening.kind.window": "Window",
"objinfo.opening.kind.door": "Door",
"objinfo.opening.hostWall": "Host wall",
"objinfo.opening.hostRoof": "Host roof (storey)",
"objinfo.opening.hostCeiling": "Host slab (storey)",
"objinfo.opening.surfaceWidth": "Width (across slope)",
"objinfo.opening.surfaceHeight": "Height (along slope)",
"objinfo.opening.hostX": "Position X",
"objinfo.opening.hostY": "Position Y",
"objinfo.opening.hostAngle": "Rotation (level surface)",
"objinfo.opening.slope": "Surface slope",
"objinfo.opening.position": "Position (from wall start)",
"objinfo.opening.width": "Width",
"objinfo.opening.height": "Height",
+83 -1
View File
@@ -36,7 +36,7 @@ import type {
VerticalAnchor,
WallReferenceLine,
} from "../model/types";
import { SIA_CATEGORIES, siaLabelFull } from "../core";
import { SIA_CATEGORIES, siaLabelFull, surfaceOpeningInfo } from "../core";
import type { EdgeSpec, RoofEdge } from "../core";
import { Dropdown } from "../ui/Dropdown";
import type { DetailLevel } from "../model/viewTypes";
@@ -1373,6 +1373,9 @@ export function OpeningSection({
host: ReturnType<typeof usePanelHost>;
}) {
const isDoor = opening.kind === "door";
if (opening.hostRoofId || opening.hostCeilingId) {
return <SurfaceOpeningSection opening={opening} host={host} />;
}
return (
<>
<div className="objinfo-sep" />
@@ -1604,6 +1607,85 @@ export function OpeningSection({
);
}
// ── Dach-/Deckenfenster ([103]) ─────────────────────────────────────────────
// Wirt (Dach/Decke + Geschoss), Breite quer und Höhe im Gefälle (in der Fläche gemessen), Lage des
// Mittelpunkts im Grundriss, Drehung nur auf waagrechten Flächen; UK/OK und Neigung aus dem Kern.
function SurfaceOpeningSection({
opening,
host,
}: {
opening: OpeningInfo;
host: ReturnType<typeof usePanelHost>;
}) {
const info = surfaceOpeningInfo(host.project, opening.id);
const roof = !!opening.hostRoofId;
const hp = opening.hostPoint ?? { x: 0, y: 0 };
return (
<>
<div className="objinfo-sep" />
<div className="objinfo-section-label">{t("objinfo.opening.section")}</div>
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.type")}</span>
<Dropdown
value={opening.typeId ?? ""}
onChange={(v) => host.onSetOpeningType(v)}
options={[
{ value: "", label: t("objinfo.type.none") },
...(host.project.windowTypes ?? []).map((ty) => ({ value: ty.id, label: ty.name })),
]}
title={t("objinfo.opening.type")}
width={106}
/>
<button
type="button"
className="objinfo-typebtn"
title={t("objinfo.opening.editType")}
aria-label={t("objinfo.opening.editType")}
onClick={() => host.onOpenOpeningEditor(opening.id)}
>
⚙
</button>
</div>
<div className="objinfo-field">
<span className="objinfo-flabel">{t(roof ? "objinfo.opening.hostRoof" : "objinfo.opening.hostCeiling")}</span>
<span className="objinfo-fval">{info?.hostName ?? "–"}</span>
</div>
<DimensionField label={t("objinfo.opening.surfaceWidth")} value={opening.width} onCommit={(v) => host.onSetOpeningWidth(v)} />
<DimensionField label={t("objinfo.opening.surfaceHeight")} value={opening.height} onCommit={(v) => host.onSetOpeningHeight(v)} />
<DimensionField label={t("objinfo.opening.hostX")} value={hp.x} min={-1e9} onCommit={(x) => host.onSetOpeningHost?.({ hostPoint: { x, y: hp.y } })} />
<DimensionField label={t("objinfo.opening.hostY")} value={hp.y} min={-1e9} onCommit={(y) => host.onSetOpeningHost?.({ hostPoint: { x: hp.x, y } })} />
{!roof && (
<DimensionField
label={t("objinfo.opening.hostAngle")}
value={opening.hostAngle ?? 0}
min={-360}
unit="°"
step={1}
digits={1}
onCommit={(a) => host.onSetOpeningHost?.({ hostAngle: a })}
/>
)}
{info && (
<>
<div className="objinfo-sep" />
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.slope")}</span>
<span className="objinfo-fval">{info.slopeDeg.toFixed(1)}°</span>
</div>
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.bottom")}</span>
<span className="objinfo-fval">{formatM(info.zBottom)}</span>
</div>
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.top")}</span>
<span className="objinfo-fval">{formatM(info.zTop)}</span>
</div>
</>
)}
</>
);
}
// ── Decken-Attribut-Abschnitt ────────────────────────────────────────────────
// Aufbau-Typ (einschichtig/mehrschichtig), Dicke/Preset, Referenzgeschoss +
// OK-Bindung, Fläche. Alle Werte/Setter über den Host.
+2
View File
@@ -448,6 +448,8 @@ export interface PanelHostValue {
onSetOpeningLintelLines: (lintelLines: "keine" | "innen" | "aussen" | "beide") => void;
/** Übersteuert die Detailstufe dieser Öffnung; `undefined` = Ansichts-Detailstufe gilt. */
onSetOpeningDetailLevel: (detailLevel: DetailLevel | undefined) => void;
/** Dach-/Deckenfenster ([103]): Lage in der Wirtsfläche (Mittelpunkt im Grundriss, Drehung). */
onSetOpeningHost?: (patch: { hostPoint?: { x: number; y: number }; hostAngle?: number }) => void;
/** Übersteuert Farbe/Strichstärke der geschnittenen Laibungs-/Stulp-Blöcke. */
onSetOpeningFrameLine: (v: { color?: string; weight?: number } | undefined) => void;
/** Übersteuert Farbe/Strichstärke der durchlaufenden Rahmen-Kontur in Aufsicht. */
+36
View File
@@ -0,0 +1,36 @@
import { describe, expect, it } from "vitest";
import { surfaceOpeningGripPatch, surfaceOpeningGrips } from "./surfaceOpening";
import type { SurfaceOpeningInfo } from "./surfaceOpening";
// Dachfläche mit 45° Gefälle nach Süden (Höhe läuft nach +y): projizierte Höhenachse = cos 45°.
const s = Math.SQRT1_2;
const info: SurfaceOpeningInfo = {
hostKind: "roof",
hostId: "r",
hostName: "DG",
floorId: "dg",
center: [2, 1, 3],
ew: [1, 0, 0],
eh: [0, s, s],
corners: [],
zBottom: 2.5,
zTop: 3.5,
slopeDeg: 45,
};
describe("Dachfenster-Griffe ([103])", () => {
it("liegen in der Mitte und an den Kanten (Höhe projiziert)", () => {
const g = surfaceOpeningGrips(info, 0.78, 1.18);
expect(g[0]).toEqual({ x: 2, y: 1 });
expect(g[1].x).toBeCloseTo(2.39);
expect(g[2].y).toBeCloseTo(1 + 0.59 * s);
});
it("rechnet einen Zug in Lage, Breite und Höhe in der Dachebene um", () => {
expect(surfaceOpeningGripPatch(info, 0, { x: 3, y: 4 })).toEqual({ hostPoint: { x: 3, y: 4 } });
expect(surfaceOpeningGripPatch(info, 1, { x: 2.5, y: 7 })).toEqual({ width: 1 });
// 0.5 m im Grundriss entlang des Gefälles = 0.5/cos45° in der Fläche, beidseitig.
expect(surfaceOpeningGripPatch(info, 2, { x: 2, y: 1.5 })!.height).toBeCloseTo(2 * 0.5 / s, 3);
expect(surfaceOpeningGripPatch(info, 1, { x: 2.01, y: 1 })).toBeNull();
});
});
+63
View File
@@ -0,0 +1,63 @@
// Dach-/Deckenfenster ([103]): Lage in der Wirtsfläche für Griffe und Objekt-Info. Gerechnet im Kern
// (Abfrage `surfaceOpening`, `src-tauri/core/src/opening_shape.rs`); hier nur die Fassade und die
// Umrechnung eines Griff-Zugs (Grundriss-Punkt) in neue Öffnungsfelder.
import type { Project } from "../model/types";
import { documentFor } from "../core/document";
type V3 = [number, number, number];
type P = { x: number; y: number };
export interface SurfaceOpeningInfo {
hostKind: "roof" | "ceiling";
hostId: string;
/** Geschossname des Wirts. */
hostName: string;
floorId: string;
/** Mittelpunkt auf der Oberfläche; Achsen Breite (waagrecht) und Höhe (das Gefälle hinauf). */
center: V3;
ew: V3;
eh: V3;
/** Rechteck im Grundriss (Gegenuhrzeigersinn). */
corners: [number, number][];
zBottom: number;
zTop: number;
slopeDeg: number;
}
/** Lage einer Dach-/Deckenöffnung oder `null` (kein solcher Wirt). */
export function surfaceOpeningInfo(project: Project, openingId: string): SurfaceOpeningInfo | null {
return documentFor(project).query<SurfaceOpeningInfo | null>("surfaceOpening", [], openingId);
}
/** Griffe im Grundriss: 0 Mitte (verschieben), 1 Breite (Kante rechts), 2 Höhe (Kante oben im Gefälle). */
export function surfaceOpeningGrips(info: SurfaceOpeningInfo, width: number, height: number): P[] {
const c = info.center;
return [
{ x: c[0], y: c[1] },
{ x: c[0] + info.ew[0] * width / 2, y: c[1] + info.ew[1] * width / 2 },
{ x: c[0] + info.eh[0] * height / 2, y: c[1] + info.eh[1] * height / 2 },
];
}
/**
* Neue Felder für einen Griff-Zug auf `pt` (Grundriss): Mitte → `hostPoint`; Breite/Höhe symmetrisch
* um die Mitte, die Höhe in der Dachebene (Grundriss-Abstand / Länge der projizierten Höhenachse).
* `null`, wenn der Zug keine gültige Grösse ergibt.
*/
export function surfaceOpeningGripPatch(
info: SurfaceOpeningInfo,
index: number,
pt: P,
): { hostPoint?: P; width?: number; height?: number } | null {
const c = info.center;
const d = { x: pt.x - c[0], y: pt.y - c[1] };
if (index === 0) return { hostPoint: { x: pt.x, y: pt.y } };
const axis = index === 1 ? info.ew : info.eh;
const l2 = axis[0] * axis[0] + axis[1] * axis[1];
if (!(l2 > 1e-9)) return null;
const v = Math.abs((d.x * axis[0] + d.y * axis[1]) / l2) * 2;
if (!(v >= 0.1) || !Number.isFinite(v)) return null;
const r = Math.round(v * 1000) / 1000;
return index === 1 ? { width: r } : { height: r };
}
+2 -1
View File
@@ -716,13 +716,14 @@ export function createProjectSlice(
const removedWallIds = new Set(
p.walls.filter((w) => w.floorId === id).map((w) => w.id),
);
const removedCeilingIds = new Set((p.ceilings ?? []).filter((c) => c.floorId === id).map((c) => c.id));
return [
...fieldOps(p, "drawingLevels", recomputeFloorElevations(p.drawingLevels.filter((z) => z.id !== id))),
...removeItems(p, "walls", removedWallIds),
...removeItems(p, "ceilings", (c) => c.floorId === id),
...removeItems(p, "stairs", (s) => s.floorId === id),
...removeItems(p, "rooms", (r) => r.floorId === id),
...removeItems(p, "openings", (o) => removedWallIds.has(o.hostWallId)),
...removeItems(p, "openings", (o) => removedWallIds.has(o.hostWallId) || (!!o.hostCeilingId && removedCeilingIds.has(o.hostCeilingId))),
];
});
},
+5
View File
@@ -225,6 +225,11 @@ export interface OpeningInfo {
frameViewLine?: { color?: string; weight?: number };
sashLine?: { color?: string; weight?: number };
sillLineStyle?: { color?: string; weight?: number };
/** Dach-/Deckenfenster ([103]): Wirt und Lage (dann ohne Wirts-Wand). */
hostRoofId?: string;
hostCeilingId?: string;
hostPoint?: { x: number; y: number };
hostAngle?: number;
}
/**
+15 -1
View File
@@ -9,7 +9,7 @@ import { useRef, useState, type RefObject } from "react";
import { add, dot, leftNormal, normalize, scale, sub, wallCorners } from "../model/geometry";
import type { Ceiling, Drawing2D, EdgeGrip, Project, Room, Stair, Vec2 } from "../model/types";
import { wallTypeThickness } from "../model/types";
import { drawingVertices } from "../core";
import { drawingVertices, surfaceOpeningGripPatch, surfaceOpeningGrips, surfaceOpeningInfo } from "../core";
import { gripDrawingIdsFor } from "./gripLimits";
import { openEdges, polylineEdgeGrips, ringEdges } from "../core";
import { areaMovePreview, drawingMovePreview } from "../tools/transform";
@@ -242,6 +242,14 @@ export function useGripEditing(opts: {
}
if (selectedOpeningId && modelEditable) {
const op = (project.openings ?? []).find((o) => o.id === selectedOpeningId);
// Dach-/Deckenfenster ([103]): Mitte (verschieben), Breite quer, Höhe im Gefälle.
if (op && (op.hostRoofId || op.hostCeilingId)) {
const info = surfaceOpeningInfo(project, op.id);
if (!info) return [];
const pts = surfaceOpeningGrips(info, op.width, op.height);
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
return pts;
}
const w = op && project.walls.find((x) => x.id === op.hostWallId);
if (op && w) {
const axis = normalize(sub(w.end, w.start));
@@ -865,6 +873,12 @@ export function useGripEditing(opts: {
// width/2 abziehen; auf [0, Wandlänge − Breite] klemmen (Öffnung bleibt drin).
if (selectedOpeningId) {
const op = (project.openings ?? []).find((o) => o.id === selectedOpeningId);
if (op && (op.hostRoofId || op.hostCeilingId)) {
const info = op.locked ? null : surfaceOpeningInfo(project, op.id);
const patch = info && surfaceOpeningGripPatch(info, index, pt);
if (patch) updateOpening(op.id, patch);
return;
}
const w = op && project.walls.find((x) => x.id === op.hostWallId);
if (op && w) {
const d = sub(w.end, w.start);
+3
View File
@@ -888,6 +888,9 @@ export function usePanelHostBase(opts: {
onSetOpeningLintelLines: (lintelLines) => {
if (selection?.kind === "opening") updateOpening(selection.id, { lintelLines });
},
onSetOpeningHost: (patch) => {
if (selection?.kind === "opening") updateOpening(selection.id, patch);
},
onSetOpeningDetailLevel: (detailLevel) => {
if (selection?.kind === "opening") updateOpening(selection.id, { detailLevel });
},
+18
View File
@@ -8683,3 +8683,21 @@ body {
cursor: pointer;
text-decoration: underline dotted;
}
/* [105] Ressourcen-Tabs Fenster-/Türtypen: Detail-Gruppen (Rahmen-Detail, Anschlag, Zarge) aufklappbar. */
.rm-detail-group {
display: flex;
flex-direction: column;
gap: 6px;
border-top: 1px solid var(--line);
padding: 6px 0;
}
.rm-detail-group > summary {
cursor: pointer;
font-size: 12px;
font-weight: 700;
color: var(--ink-2);
padding: 2px 0 6px;
}
.rm-detail-group[open] > summary ~ * {
margin-bottom: 6px;
}
+11 -12
View File
@@ -7,6 +7,7 @@ import { FieldRow, NumberField, Segmented, SelectField } from "./fields";
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
import { ElevationPreview } from "../ElevationPreview";
import { openingTypePresets } from "../../model/openingPresets";
import { DoorFramePanel, FrameDetailPanel, RebatePanel } from "../OpeningDetailPanels";
/**
* Synthetische Öffnungs-Instanz NUR für die Vorschau — s. WindowStylesTab.
@@ -41,11 +42,6 @@ const DOOR_LEAF_STYLE_OPTIONS: { value: DoorType["leafStyle"]; labelKey: string
{ value: "glas", labelKey: "resources.leafStyle.glas" },
];
const DOOR_FRAME_KIND_OPTIONS: { value: NonNullable<DoorType["frameKind"]>; labelKey: string }[] = [
{ value: "zarge", labelKey: "resources.frameKind.zarge" },
{ value: "blockrahmen", labelKey: "resources.frameKind.blockrahmen" },
];
export function DoorStylesTab({
project,
onAddDoorType,
@@ -150,13 +146,6 @@ export function DoorStylesTab({
min={0}
/>
</FieldRow>
<FieldRow label={t("resources.field.frameKind")}>
<SelectField
value={door.frameKind ?? "zarge"}
onChange={(frameKind) => patch({ frameKind })}
options={DOOR_FRAME_KIND_OPTIONS.map((o) => ({ value: o.value, label: t(o.labelKey) }))}
/>
</FieldRow>
<FieldRow label={t("resources.field.frameWidth")}>
<NumberField
value={door.frameWidth ?? 0.06}
@@ -213,6 +202,16 @@ export function DoorStylesTab({
onChange={(e) => patch({ threshold: e.target.checked })}
/>
</FieldRow>
{/* [105] Zarge/Rahmenart, Rahmen-Detail und Anschlag — dieselben Felder wie im Dialog „Tür bearbeiten“. */}
<details className="rm-detail-group" open={!!(door.frameKind && door.frameKind !== "zarge")}>
<summary>{t("oed.cat.zarge")}</summary>
<DoorFramePanel kind={door.frameKind} onKind={(frameKind) => patch({ frameKind })} value={door.doorFrame} onChange={(doorFrame) => patch({ doorFrame })} />
</details>
<details className="rm-detail-group" open={!!door.frameDetail}>
<summary>{t("oed.cat.rahmendetail")} · {t("oed.cat.anschlag")}</summary>
<FrameDetailPanel value={door.frameDetail} onChange={(frameDetail) => patch({ frameDetail })} isDoor />
<RebatePanel value={door.frameDetail} onChange={(frameDetail) => patch({ frameDetail })} isDoor />
</details>
</>
)}
/>
+7 -1
View File
@@ -7,7 +7,7 @@ import { FieldRow, NumberField, SelectField } from "./fields";
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
import { ElevationPreview } from "../ElevationPreview";
import { openingTypePresets } from "../../model/openingPresets";
import { REVEAL_PRESETS, revealPresetOf } from "../OpeningDetailPanels";
import { FrameDetailPanel, REVEAL_PRESETS, RebatePanel, revealPresetOf } from "../OpeningDetailPanels";
/**
* Synthetische Öffnungs-Instanz NUR für die Vorschau: `ElevationPreview`
@@ -223,6 +223,12 @@ export function WindowStylesTab({
options={WINDOW_SILL_BOARD_OPTIONS.map((o) => ({ value: o.value, label: t(o.labelKey) }))}
/>
</FieldRow>
{/* [105] Rahmen-Detail und Anschlag je Seite — dieselben Felder wie im Dialog „Fenster bearbeiten“. */}
<details className="rm-detail-group" open={!!win.frameDetail}>
<summary>{t("oed.cat.rahmendetail")} · {t("oed.cat.anschlag")}</summary>
<FrameDetailPanel value={win.frameDetail} onChange={(frameDetail) => patch({ frameDetail })} isDoor={false} />
<RebatePanel value={win.frameDetail} onChange={(frameDetail) => patch({ frameDetail })} isDoor={false} />
</details>
</>
)}
/>