[63] Lage-Panel: Gebäudeprofil (Winkel, Höhe an der Grenze), Wände als Vorsprung markierbar

This commit is contained in:
Claude committed 2026-11-05 02:19:25 +00:00
1 parent 3206f7b2ee
commit 2b7b915067
4 files changed
+79 -8

No files matched your search

+7 -1
View File
@@ -6,8 +6,10 @@
// • Baulinie: Halbebene auf der Seite des Parzellen-Schwerpunkts.
// • Gebäude-Grundfläche: Wände aller Geschosse und freie Körper (ohne Abzugskörper).
// • Vorsprünge (nur mit `projectionDepth`): Dachüberstände und als Vorsprung markierte Decken/Körper
// (`siteProjection`) dürfen bis zur Tiefe in den Abstand ragen, markierte zusätzlich höchstens
// bzw. Erkerwände (`siteProjection`) dürfen bis zur Tiefe in den Abstand ragen, markierte zusätzlich höchstens
// auf `projectionShare` der Fassadenlänge je Grenze.
// • Gebäudeprofil (mit `profileAngle`): zulässige Höhe = `profileHeight` + tan(α)·Abstand zur Grenze/
// Baulinie über dem massgebenden Terrain; geprüft werden obere Punkte der Bauteile.
// • Zulässige Hülle im 3D (`siteEnvelope3d`, mit `show3d`): durchscheinend in render3d.
// Gerechnet wird im Rust-Kern (`src-tauri/core/src/site_rules.rs`), die Prüfung des Modells auf dem
// Projekt-Dokument; die Flächen-Hilfen (`allowedArea`, `multiPolygonArea`) nehmen flache Daten.
@@ -66,6 +68,10 @@ export interface SiteCheck {
terrainMin: number | null;
/** Gesamthöhe über dem massgebenden Terrain; mit Gelände prüft die Höhe dagegen statt gegen ±0.00. */
heightAboveTerrain: number | null;
/** Gebäudeprofil ([63], mit `profileAngle`): ein Bauteil ragt mit oberen Punkten über das Profil. */
profileExceeded: boolean;
/** Grundrisse der Bauteile über dem Profil (ganzes Bauteil, Näherung). */
profileViolations: Area;
}
/** Prüft das Modell gegen `project.siteRules`; `null` ohne (gültiges) Baurecht. Rechnung im Rust-Kern (`site_rules.rs`). */
+7 -1
View File
@@ -2538,7 +2538,13 @@ export const de = {
"siteRules.projectionShare": "Vorsprünge max. Anteil Fassade",
"siteRules.projectionShare.hint": "Höchstens dieser Anteil der Fassadenlänge je Grenze darf von markierten Vorsprüngen belegt sein (Dachüberstände zählen nicht). Leer = unbegrenzt.",
"siteRules.markProjection": "Auswahl ist Vorsprung (Balkon, Erker)",
"siteRules.markProjection.hint": "Gewählte Decke oder gewählten Körper als Vorsprung nach der Vorsprungsregel prüfen.",
"siteRules.markProjection.hint": "Gewählte Decke, gewählten Körper oder gewählte Wand (Erker) als Vorsprung nach der Vorsprungsregel prüfen.",
"siteRules.profileAngle": "Profilwinkel",
"siteRules.profileAngle.hint": "Gebäudeprofil: zulässige Höhe steigt von jeder Grenze und Baulinie nach innen unter diesem Winkel (z. B. 45°). Leer = kein Profil.",
"siteRules.profileHeight": "Profilhöhe an der Grenze",
"siteRules.profileHeight.hint": "Höhe des Profils an der Grenze bzw. Baulinie über dem massgebenden Terrain (ohne Gelände über ±0.00).",
"siteRules.profileOk": "Gebäudeprofil eingehalten",
"siteRules.profileOver": "Gebäudeprofil überschritten (rot im 3D)",
"clash.none": "Keine Kollisionen gefunden.",
"clash.run": "Prüfung starten",
"clash.running": "Prüfung läuft …",
+7 -1
View File
@@ -2488,7 +2488,13 @@ export const en: Record<TranslationKey, string> = {
"siteRules.projectionShare": "Projections max. share of façade",
"siteRules.projectionShare.hint": "At most this share of the façade length per boundary may be taken by marked projections (roof overhangs do not count). Empty = unlimited.",
"siteRules.markProjection": "Selection is a projection (balcony, bay window)",
"siteRules.markProjection.hint": "Check the selected slab or solid as a projection under the projection rule.",
"siteRules.markProjection.hint": "Check the selected slab, solid or wall (bay window) as a projection under the projection rule.",
"siteRules.profileAngle": "Profile angle",
"siteRules.profileAngle.hint": "Building profile: the permitted height rises inward from every boundary and building line at this angle (e.g. 45°). Empty = no profile.",
"siteRules.profileHeight": "Profile height at boundary",
"siteRules.profileHeight.hint": "Height of the profile at the boundary or building line above the governing terrain (without terrain above ±0.00).",
"siteRules.profileOk": "Building profile respected",
"siteRules.profileOver": "Building profile exceeded (red in 3D)",
"clash.run": "Run check",
"clash.running": "Checking …",
"clash.clear": "Clear",
+58 -5
View File
@@ -18,15 +18,19 @@ function parseLen(text: string): number | undefined | null {
return Number.isFinite(v) && v >= 0 ? v : null;
}
/** Gewählte Decke/Körper, der als Vorsprung markiert werden kann, samt aktuellem Stand. */
/** Gewählte Decke/Körper/Wand (Erker), die als Vorsprung markiert werden kann, samt aktuellem Stand. */
function projectionTarget(
p: Project,
sel: { kind: string; id: string } | null | undefined,
): { kind: "ceiling" | "extrudedSolid"; id: string; flag: boolean } | null {
): { kind: "ceiling" | "extrudedSolid" | "wall"; id: string; flag: boolean } | null {
if (sel?.kind === "ceiling") {
const c = p.ceilings?.find((x) => x.id === sel.id);
return c ? { kind: "ceiling", id: c.id, flag: c.siteProjection === true } : null;
}
if (sel?.kind === "wall") {
const w = p.walls.find((x) => x.id === sel.id);
return w ? { kind: "wall", id: w.id, flag: w.siteProjection === true } : null;
}
if (sel?.kind === "extrudedSolid") {
const x = p.extrudedSolids?.find((e) => e.id === sel.id);
return x && x.operation !== "subtract" ? { kind: "extrudedSolid", id: x.id, flag: x.siteProjection === true } : null;
@@ -48,7 +52,7 @@ export function SiteRulesSection() {
const selDrawing = sel?.kind === "drawing2d" ? host.project.drawings2d.find((d) => d.id === sel.id) : undefined;
const selParcel = parcelFromDrawing(selDrawing);
const selLine = lineFromDrawing(selDrawing);
// Vorsprung markieren: gewählte Decke (Balkon) oder freier Körper (Erker).
// Vorsprung markieren: gewählte Decke (Balkon), freier Körper oder Wand (Erker).
const selProjection = projectionTarget(host.project, sel);
const write = (fn: (r: SiteRules) => SiteRules | undefined, key?: string) =>
@@ -81,7 +85,7 @@ export function SiteRulesSection() {
const check = checkSiteRules(host.project);
const n = rules.parcel.length;
const ok = check !== null && check.violationArea < 0.01 && !check.heightExceeded;
const ok = check !== null && check.violationArea < 0.01 && !check.heightExceeded && !check.profileExceeded;
return (
<div className="site-rules">
@@ -121,6 +125,9 @@ export function SiteRulesSection() {
})}
</div>
)}
{rules.profileAngle !== undefined && (
<div>{t(check.profileExceeded ? "siteRules.profileOver" : "siteRules.profileOk")}</div>
)}
{check.terrainMin !== null && (
<div>{t("siteRules.terrainAtFacade", { z: fmt(check.terrainMin, 2) })}</div>
)}
@@ -163,6 +170,50 @@ export function SiteRulesSection() {
<span>m</span>
</label>
<label className="kz-parcel" title={t("siteRules.profileAngle.hint")}>
<span>{t("siteRules.profileAngle")}</span>
<input
type="number"
min={0}
max={89}
step={5}
className="kz-input kz-num"
value={rules.profileAngle ?? ""}
placeholder="–"
onChange={(e) => {
const v = parseLen(e.target.value);
if (v === null || (v !== undefined && v >= 90)) return;
write((r) => {
const { profileAngle: _old, ...rest } = r;
return v === undefined ? rest : { ...rest, profileAngle: v };
}, "siteRules:profileAngle");
}}
/>
<span>°</span>
</label>
{rules.profileAngle !== undefined && (
<label className="kz-parcel" title={t("siteRules.profileHeight.hint")}>
<span>{t("siteRules.profileHeight")}</span>
<input
type="number"
min={0}
step={0.5}
className="kz-input kz-num"
value={rules.profileHeight ?? ""}
placeholder="0"
onChange={(e) => {
const v = parseLen(e.target.value);
if (v === null) return;
write((r) => {
const { profileHeight: _old, ...rest } = r;
return v === undefined ? rest : { ...rest, profileHeight: v };
}, "siteRules:profileHeight");
}}
/>
<span>m</span>
</label>
)}
<label className="kz-parcel" title={t("siteRules.projectionDepth.hint")}>
<span>{t("siteRules.projectionDepth")}</span>
<input
@@ -216,7 +267,9 @@ export function SiteRulesSection() {
applyChange((p: Project) =>
selProjection.kind === "ceiling"
? patchItem(p, "ceilings", selProjection.id, (c) => withProjection(c, v))
: patchItem(p, "extrudedSolids", selProjection.id, (x) => withProjection(x, v)),
: selProjection.kind === "wall"
? patchItem(p, "walls", selProjection.id, (w) => withProjection(w, v))
: patchItem(p, "extrudedSolids", selProjection.id, (x) => withProjection(x, v)),
);
}}
/>