[292] Wand: OK bis Decke (folgt der Deckenunterkante, auch geneigt; Deckenloch = Krone), Objekt-Info und Befehl wand

This commit is contained in:
Claude committed 2026-11-19 09:23:30 +00:00
1 parent b0fff66ac7
commit 548789fe9b
16 files changed
+249 -37

No files matched your search

+13 -9
View File
@@ -81,8 +81,10 @@ interface ArcMode {
typeName: string | null;
/** [285] Aussenbauteil (IFC `IsExternal`): „auto“ = nach dem Wandtyp („Aussenwand“ ⇒ aussen), „yes“/„no“ ausdrücklich. */
ext: "auto" | "yes" | "no";
/** [292] OK bis Decke: neue Wände enden an der Unterkante der Decke ihres Geschosses (Vorgabe aus). */
ceil: boolean;
}
const NO_MODE: ArcMode = { arc: false, tangent: false, typeId: null, typeName: null, ext: "auto" };
const NO_MODE: ArcMode = { arc: false, tangent: false, typeId: null, typeName: null, ext: "auto", ceil: false };
const EXT_NEXT = { auto: "yes", yes: "no", no: "auto" } as const;
/** Kontext mit dem gewählten Wandtyp des Befehls (Option „Wandtyp“); ein inzwischen gelöschter Typ fällt auf den aktiven zurück. */
@@ -118,6 +120,7 @@ const arcOption = (on: boolean): CmdOption => ({ id: "arc", labelKey: "cmd.polyl
const tangentOption = (on: boolean): CmdOption => ({ id: "tangent", labelKey: "cmd.polyline.tangentOpt", value: on ? "on" : "off" });
const typeOption = (s: ArcMode): CmdOption => ({ id: "wtype", labelKey: "cmd.wall.typeOpt", value: s.typeName ?? t("cmd.wall.typeActive"), key: "W" });
const extOption = (s: ArcMode): CmdOption => ({ id: "ext", labelKey: "cmd.wall.extOpt", value: t(`cmd.wall.ext.${s.ext}`), key: t("cmd.wall.extKey") });
const ceilOption = (s: ArcMode): CmdOption => ({ id: "ceil", labelKey: "cmd.wall.ceilOpt", value: t(s.ceil ? "cmd.wall.ext.yes" : "cmd.wall.ext.no"), key: t("cmd.wall.ceilKey") });
/**
* Bänder der schon gesetzten Segmente: sie ändern sich je Mausschritt nicht und werden nur neu gerechnet,
@@ -167,13 +170,13 @@ function wallDraft(
* Commit: je Achssegment eine Wand des aktiven Typs (Höhe aus dem Geschoss); eine gelockte Dicke
* (einschichtig) wählt/erzeugt den passenden Wandtyp — beides im Kern (`cmd_create.rs`).
*/
const appendWalls = (pts: Vec2[], ctx: CommandContext, thick: number | null, segs: Seg[] = [], ext: ArcMode["ext"] = "auto") => {
const appendWalls = (pts: Vec2[], ctx: CommandContext, thick: number | null, segs: Seg[] = [], ext: ArcMode["ext"] = "auto", ceil = false) => {
const external = ext === "auto" ? null : ext === "yes";
return createMutation(
ctx,
segs.some((g) => g !== 0)
? { cmd: "wall", pts: pts.map(xy), thick, segs, external }
: { cmd: "wall", pts: pts.map(xy), thick, external },
? { cmd: "wall", pts: pts.map(xy), thick, segs, external, ceilingAttach: ceil }
: { cmd: "wall", pts: pts.map(xy), thick, external, ceilingAttach: ceil },
);
};
@@ -186,7 +189,7 @@ const idle = (
{ draft: null, done: true },
];
const modeOf = (s: ArcMode): ArcMode => ({ arc: s.arc, tangent: s.tangent, typeId: s.typeId, typeName: s.typeName, ext: s.ext });
const modeOf = (s: ArcMode): ArcMode => ({ arc: s.arc, tangent: s.tangent, typeId: s.typeId, typeName: s.typeName, ext: s.ext, ceil: s.ceil });
const draftOf = (ctx: CommandContext, s: WallDrawing): ToolDraft => wallDraft(ctx, s.points, s.cursor, s.thickOverride, s);
export const wallCommand: Command = {
@@ -202,7 +205,7 @@ export const wallCommand: Command = {
accepts: () => ["point", "number", "option"],
options: (s) => {
const ps = s as WallCmdState;
const arc = [arcOption(!!ps.arc), ...(ps.arc ? [tangentOption(!!ps.tangent)] : []), typeOption(ps), extOption(ps)];
const arc = [arcOption(!!ps.arc), ...(ps.arc ? [tangentOption(!!ps.tangent)] : []), typeOption(ps), extOption(ps), ceilOption(ps)];
return ps.phase === "next" ? [...arc, UNDO] : arc;
},
init: (): WallIdle => ({ phase: "start", lastPoint: null, thickOverride: null, single: false, ...NO_MODE }),
@@ -212,9 +215,10 @@ export const wallCommand: Command = {
const to = s.thickOverride;
// [285] Wandtyp wählen (reihum durch die Typen des Projekts) bzw. Aussenbauteil umschalten.
if (input.kind === "option" && (input.id === "wtype" || input.id === "ext")) {
if (input.kind === "option" && (input.id === "wtype" || input.id === "ext" || input.id === "ceil")) {
let flip: Partial<ArcMode>;
if (input.id === "ext") flip = { ext: EXT_NEXT[s.ext] };
else if (input.id === "ceil") flip = { ceil: !s.ceil };
else {
const list = ctx0.project.wallTypes;
if (list.length === 0) return [s, { draft: null }];
@@ -297,7 +301,7 @@ export const wallCommand: Command = {
if (s.points.length >= 3 && segLen(s.points[0], pt) < EPS) {
return [
{ phase: "start", lastPoint: null, thickOverride: to, single, ...modeOf(s) } as WallIdle,
{ draft: null, done: true, commit: appendWalls([...s.points, s.points[0]], ctx, to, [...s.segs, seg], s.ext) },
{ draft: null, done: true, commit: appendWalls([...s.points, s.points[0]], ctx, to, [...s.segs, seg], s.ext, s.ceil) },
];
}
const ns: WallDrawing = {
@@ -330,7 +334,7 @@ export const wallCommand: Command = {
const to = s.thickOverride;
return [
{ phase: "start", lastPoint: null, thickOverride: to, single: s.single, ...modeOf(s) } as WallIdle,
{ draft: null, done: true, commit: appendWalls(pts, ctx, to, s.segs, s.ext) },
{ draft: null, done: true, commit: appendWalls(pts, ctx, to, s.segs, s.ext, s.ceil) },
];
}
return idle(s.thickOverride, s.single, modeOf(s));
+6
View File
@@ -653,6 +653,10 @@ export const de = {
"objinfo.wall.roofAttach.auto": "Automatisch",
"objinfo.wall.roofAttach.on": "Ja, bis unters Dach",
"objinfo.wall.roofAttach.off": "Nein",
"objinfo.wall.ceilingAttach": "Oberkante",
"objinfo.wall.ceilingAttach.off": "Geschosshöhe",
"objinfo.wall.ceilingAttach.on": "Bis Decke",
"objinfo.wall.ceilingAttach.tip": "Geschosshöhe: Die Wand endet an ihrer Oberkante (Geschoss bzw. frei gesetzt). Bis Decke: Sie endet an der Unterkante der Decke ihres Geschosses, auch bei geneigter Decke; im Deckenloch bleibt die Krone.",
"objinfo.wall.roofAttach.tip": "Automatisch: Die Wand endet je Schicht an der Dach-Unterkante, wo ihre Krone darüber liegt. Ja: zusätzlich bis unter das Dach verlängert. Nein: Dächer schneiden die Wand nicht.",
"objinfo.wall.sliceTermination.both": "Aus",
"objinfo.wall.sliceTermination.below": "Unten",
@@ -2076,6 +2080,8 @@ export const de = {
"cmd.wall.typeActive": "aktiv",
"cmd.wall.extOpt": "Aussenbauteil",
"cmd.wall.extKey": "A",
"cmd.wall.ceilOpt": "OK bis Decke",
"cmd.wall.ceilKey": "D",
"cmd.wall.ext.auto": "nach Typ",
"cmd.wall.ext.yes": "ja",
"cmd.wall.ext.no": "nein",
+6
View File
@@ -651,6 +651,10 @@ export const en: Record<TranslationKey, string> = {
"objinfo.wall.roofAttach.auto": "Automatic",
"objinfo.wall.roofAttach.on": "Yes, up to the roof",
"objinfo.wall.roofAttach.off": "No",
"objinfo.wall.ceilingAttach": "Top",
"objinfo.wall.ceilingAttach.off": "Storey height",
"objinfo.wall.ceilingAttach.on": "Up to ceiling",
"objinfo.wall.ceilingAttach.tip": "Storey height: the wall ends at its top (storey or freely set). Up to ceiling: it ends at the underside of its storey's ceiling, also for a sloped ceiling; the crown stays in a ceiling opening.",
"objinfo.wall.roofAttach.tip": "Automatic: each wall layer ends at the roof underside where its top lies above it. Yes: also extended up to the roof. No: roofs do not cut the wall.",
"objinfo.wall.sliceTermination.both": "Off",
"objinfo.wall.sliceTermination.below": "Below",
@@ -2065,6 +2069,8 @@ export const en: Record<TranslationKey, string> = {
"cmd.wall.typeActive": "active",
"cmd.wall.extOpt": "External",
"cmd.wall.extKey": "E",
"cmd.wall.ceilOpt": "Top to ceiling",
"cmd.wall.ceilKey": "C",
"cmd.wall.ext.auto": "by type",
"cmd.wall.ext.yes": "yes",
"cmd.wall.ext.no": "no",
+6
View File
@@ -5044,6 +5044,12 @@ export type Wall = {
* unter das Dach verlängert, `false` = Dächer schneiden die Wand nicht.
*/
roofAttach?: boolean;
/**
* OK bis Decke ([292]): `true` = die Wand endet an der Unterkante der Decke ihres Geschosses (waagrecht: Decken-UK;
* geneigt: schräge Oberkante; im Deckenloch/ausserhalb der Decke bleibt die Krone); `undefined`/`false` = Wandkrone
* (Geschosshöhe bzw. `top`).
*/
ceilingAttach?: boolean;
/**
* Ansichtsschraffur ([100]): Drehung (Grad) des Oberflächenmusters dieses Elements gegenüber der
* Ausrichtung am Element (Default 0).
+1
View File
@@ -422,6 +422,7 @@ export interface PanelHostValue {
onSetWallSliceTermination: (termination: SliceTermination) => void;
/** An Dach anschliessen ([G2]): "auto" = Default (Wand endet an der Dach-Unterkante). */
onSetWallRoofAttach: (attach: "auto" | "on" | "off") => void;
onSetWallCeilingAttach: (attach: boolean) => void;
/** Aussenbauteil/tragend der gewählten Wand bzw. Decke ([97]/[98]); `false` = Feld weg. */
onSetBuildingFlags: (flags: { isExternal?: boolean; loadBearing?: boolean }) => void;
/** [178] Deckenrand der gewählten Decke: `true` = bis an den Umriss, `false` = Auflager bis Kern (Standard). */
+14
View File
@@ -115,6 +115,20 @@ export function WallSection({
width={120}
/>
</div>
{/* OK bis Decke ([292]): Oberkante an der Unterkante der Decke des Geschosses, auch geneigt. */}
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.wall.ceilingAttach")}</span>
<Dropdown
value={wall.ceilingAttach ? "on" : "off"}
onChange={(v) => host.onSetWallCeilingAttach(v === "on")}
options={[
{ value: "off", label: t("objinfo.wall.ceilingAttach.off") },
{ value: "on", label: t("objinfo.wall.ceilingAttach.on") },
]}
title={t("objinfo.wall.ceilingAttach.tip")}
width={120}
/>
</div>
<BuildingFlags isExternal={wall.isExternal} loadBearing={wall.loadBearing} host={host} />
{/* Aufbau-Typ-Segment. */}
@@ -93,6 +93,9 @@ export function buildElementAttributesHost(c: FlatHostOpts) {
// "auto" ist der Default ⇒ als undefined speichern.
patchAll("walls", selection.id, { roofAttach: attach === "auto" ? undefined : attach === "on" });
},
onSetWallCeilingAttach: (attach) => {
if (selection?.kind === "wall") patchAll("walls", selection.id, { ceilingAttach: attach ? true : undefined });
},
onSetBuildingFlags: (flags) => {
const patch: { isExternal?: boolean; loadBearing?: boolean } = {};
if (flags.isExternal !== undefined) patch.isExternal = flags.isExternal || undefined;
+2
View File
@@ -133,6 +133,8 @@ export interface WallInfo {
sliceTermination: SliceTermination;
/** An Dach anschliessen ([G2]): "auto" (Default), "on" (bis unter das Dach verlängern), "off". */
roofAttach: "auto" | "on" | "off";
/** OK bis Decke ([292]): Wand endet an der Decken-Unterkante ihres Geschosses (auch geneigt). */
ceilingAttach: boolean;
/** Aussenbauteil / tragend ([97]/[98]). */
isExternal: boolean;
loadBearing: boolean;