[95] Fenster/Türen: Schiebe-, Hebeschiebe-, Pendeltür, Oberlicht-Einteilung, Typen-Bibliothek

Türtyp kind hebeschiebe/pendel neu, schiebe wird gezeichnet (Grundriss nach SIA, Schnitt,
Ansicht, 3D, IFC-OperationType). Tür-Oberlicht in der Ansicht. Fenster transomSashes
(Pfosten/Riegel im Oberlicht) in Ansicht und 3D. Vorlagen in opening_presets.rs, in den
Ressourcen-Tabs über „Aus Bibliothek…“.
This commit is contained in:
Claude committed 2026-10-29 22:51:49 +00:00
1 parent 754ed4d3c2
commit 85e2f63b20
27 files changed
+874 -124

No files matched your search

+40
View File
@@ -291,6 +291,8 @@ const DOOR_KIND_OPTS = (): { value: DoorKind; label: string }[] => [
{ value: "dreh", label: t("oed.kind.dreh") },
{ value: "schiebe", label: t("oed.kind.schiebe") },
{ value: "wandoeffnung", label: t("oed.door.wandoeffnung") },
{ value: "hebeschiebe", label: t("oed.door.hebeschiebe") },
{ value: "pendel", label: t("oed.door.pendel") },
];
function BasisPanel({
@@ -557,6 +559,23 @@ function cornerJoinOptions(): { value: FrameCornerJoin; label: string }[] {
];
}
/** Oberlicht-Einteilung ([95]): Anzahl Felder und Öffnungsart des ersten Felds. */
function transomFields(wt: WindowType): { count: number; opening: OpeningKind } {
const fields = (wt.transomSashes ?? []).filter((s) => s.kind === "fluegel");
return { count: Math.max(1, fields.length), opening: fields[0]?.opening ?? "fest" };
}
/** Gleichmässige Oberlicht-Einteilung: `count` Felder, dazwischen Pfosten; ein festes Feld = keine Liste. */
function transomSashes(count: number, opening: OpeningKind): SashDef[] | undefined {
if (count <= 1 && opening === "fest") return undefined;
const out: SashDef[] = [];
for (let i = 0; i < count; i++) {
if (i > 0) out.push({ kind: "pfosten", postWidth: 0.06 });
out.push({ kind: "fluegel", autoWidth: true, opening, hingeSide: i % 2 === 0 ? "left" : "right" });
}
return out;
}
/** Flügeleinteilung: Tabelle mit Flügel/Pfosten, Öffnungsart + Anschlag je Zeile. */
function FluegelPanel({
wt,
@@ -589,6 +608,27 @@ function FluegelPanel({
min={0}
onCommit={(n) => patchWt({ transomHeight: n || undefined })}
/>
{(wt.transomHeight ?? 0) > 0 && (
<>
<NumField
label={t("oed.f.transomFields")}
value={transomFields(wt).count}
step={1}
min={1}
onCommit={(n) => patchWt({ transomSashes: transomSashes(Math.max(1, Math.min(6, Math.round(n))), transomFields(wt).opening) })}
/>
<SelField<OpeningKind>
label={t("oed.f.transomOpening")}
value={transomFields(wt).opening}
options={[
{ value: "fest", label: t("oed.kind.fest") },
{ value: "kipp", label: t("oed.kind.kipp") },
{ value: "dreh", label: t("oed.kind.dreh") },
]}
onChange={(v) => patchWt({ transomSashes: transomSashes(transomFields(wt).count, v) })}
/>
</>
)}
<NumField
label={t("oed.f.mullionRows")}
value={wt.mullionRows ?? 1}
+2 -2
View File
@@ -126,10 +126,10 @@ export interface ResourceManagerHandlers {
* Deckentypen. Optional, damit ältere Einbettungen ohne diesen Handler
* weiter kompilieren; ohne Handler bleiben die Tabs verborgen.
*/
onAddDoorType?: () => void;
onAddDoorType?: (preset?: DoorType) => void;
onPatchDoorType?: (id: string, patch: Partial<DoorType>) => void;
onDeleteDoorType?: (id: string) => void;
onAddWindowType?: () => void;
onAddWindowType?: (preset?: WindowType) => void;
onPatchWindowType?: (id: string, patch: Partial<WindowType>) => void;
onDeleteWindowType?: (id: string) => void;
onAddStairType?: () => void;
+10 -2
View File
@@ -6,6 +6,7 @@ import { t } from "../../i18n";
import { FieldRow, NumberField, Segmented, SelectField } from "./fields";
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
import { ElevationPreview } from "../ElevationPreview";
import { openingTypePresets } from "../../model/openingPresets";
/**
* Synthetische Öffnungs-Instanz NUR für die Vorschau — s. WindowStylesTab.
@@ -30,6 +31,8 @@ const DOOR_KIND_OPTIONS: { value: DoorType["kind"]; labelKey: string }[] = [
{ value: "dreh", labelKey: "resources.doorKind.dreh" },
{ value: "schiebe", labelKey: "resources.doorKind.schiebe" },
{ value: "wandoeffnung", labelKey: "resources.doorKind.wandoeffnung" },
{ value: "hebeschiebe", labelKey: "resources.doorKind.hebeschiebe" },
{ value: "pendel", labelKey: "resources.doorKind.pendel" },
];
const DOOR_LEAF_STYLE_OPTIONS: { value: DoorType["leafStyle"]; labelKey: string }[] = [
@@ -50,7 +53,7 @@ export function DoorStylesTab({
onDeleteDoorType,
}: {
project: Project;
onAddDoorType?: () => void;
onAddDoorType?: (preset?: DoorType) => void;
onPatchDoorType?: (id: string, patch: Partial<DoorType>) => void;
onDeleteDoorType?: (id: string) => void;
}) {
@@ -61,7 +64,12 @@ export function DoorStylesTab({
emptyKey="resources.doorTypes.empty"
placeholderKey="resources.doorTypes.placeholder"
deleteKeyPrefix="resources.delete.doorType"
onAdd={onAddDoorType}
onAdd={() => onAddDoorType?.()}
presets={openingTypePresets().doorTypes.map((p) => ({ id: p.id, label: t(`preset.${p.id}`) }))}
onAddPreset={(id) => {
const p = openingTypePresets().doorTypes.find((x) => x.id === id);
if (p) onAddDoorType?.({ ...p, name: t(`preset.${p.id}`) });
}}
onPatch={onPatchDoorType}
onDelete={onDeleteDoorType}
renderFields={(door, patch) => (
+20
View File
@@ -26,6 +26,8 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
placeholderKey,
deleteKeyPrefix,
onAdd,
presets,
onAddPreset,
onPatch,
onDelete,
renderFields,
@@ -36,6 +38,9 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
placeholderKey: string;
deleteKeyPrefix: string;
onAdd?: () => void;
/** Vorlagen aus der Typen-Bibliothek ([95]); Auswahl legt eine Kopie an. */
presets?: { id: string; label: string }[];
onAddPreset?: (presetId: string) => void;
onPatch?: (id: string, patch: Partial<T>) => void;
onDelete?: (id: string) => void;
renderFields: (item: T, onPatch: (patch: Partial<T>) => void) => React.ReactNode;
@@ -64,6 +69,21 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
<button className="res-add" onClick={() => onAdd?.()}>
<span className="res-add-plus">+</span> {t("resources.add")}
</button>
{presets && presets.length > 0 && onAddPreset && (
<select
className="res-input res-add-preset"
value=""
title={t("resources.addPreset.hint")}
onChange={(e) => e.target.value && onAddPreset(e.target.value)}
>
<option value="">{t("resources.addPreset")}</option>
{presets.map((p) => (
<option key={p.id} value={p.id}>
{p.label}
</option>
))}
</select>
)}
</div>
</div>
<div className="res-md-detail">
+8 -2
View File
@@ -6,6 +6,7 @@ import { t } from "../../i18n";
import { FieldRow, NumberField, SelectField } from "./fields";
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
import { ElevationPreview } from "../ElevationPreview";
import { openingTypePresets } from "../../model/openingPresets";
/**
* Synthetische Öffnungs-Instanz NUR für die Vorschau: `ElevationPreview`
@@ -56,7 +57,7 @@ export function WindowStylesTab({
onDeleteWindowType,
}: {
project: Project;
onAddWindowType?: () => void;
onAddWindowType?: (preset?: WindowType) => void;
onPatchWindowType?: (id: string, patch: Partial<WindowType>) => void;
onDeleteWindowType?: (id: string) => void;
}) {
@@ -67,7 +68,12 @@ export function WindowStylesTab({
emptyKey="resources.windowTypes.empty"
placeholderKey="resources.windowTypes.placeholder"
deleteKeyPrefix="resources.delete.windowType"
onAdd={onAddWindowType}
onAdd={() => onAddWindowType?.()}
presets={openingTypePresets().windowTypes.map((p) => ({ id: p.id, label: t(`preset.${p.id}`) }))}
onAddPreset={(id) => {
const p = openingTypePresets().windowTypes.find((x) => x.id === id);
if (p) onAddWindowType?.({ ...p, name: t(`preset.${p.id}`) });
}}
onPatch={onPatchWindowType}
onDelete={onDeleteWindowType}
renderFields={(win, patch) => (