From 00cbdb3c1b61976e5c2becafb8e5f84ccde937d4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 06:20:09 +0000 Subject: [PATCH] =?UTF-8?q?[T3]=20Objekt-Info=20Treppe:=20Betonvolumen=20u?= =?UTF-8?q?nd=20Untersicht=20(Wendelfl=C3=A4che)=20f=C3=BCr=20Ortbetontrep?= =?UTF-8?q?pen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/core/src/selection_info.rs | 39 ++++++++++++++++++++++++++++ src/i18n/de.ts | 2 ++ src/i18n/en.ts | 2 ++ src/panels/ObjectInfoPanel.tsx | 12 +++++++++ src/state/selectionInfo.ts | 4 +++ 5 files changed, 59 insertions(+) diff --git a/src-tauri/core/src/selection_info.rs b/src-tauri/core/src/selection_info.rs index 9a73e26a..24318e2e 100644 --- a/src-tauri/core/src/selection_info.rs +++ b/src-tauri/core/src/selection_info.rs @@ -909,6 +909,21 @@ fn stair_selection(root: &Map, s: &Value) -> Result { } let b = crate::stair::bbox(&geo); let bb = if b.len() < 4 { [0.0; 4] } else { [b[0], b[1], b[2], b[3]] }; + // Ortbeton (gerade/Wendel): Betonvolumen des Laufs und Untersicht (Schal-/Wendelfläche) aus + // demselben Netz wie 3D und IFC — Projekt nur mit dieser Treppe und ihrem Typ. + let amounts = { + let ty: Option = typed.type_id.as_ref().and_then(|tid| { + arr(root.get("stairTypes")).iter().find(|t| field(t, "id").and_then(Value::as_str) == Some(tid.as_str())).and_then(|t| serde_json::from_value(t.clone()).ok()) + }); + ty.and_then(|ty| { + let one = crate::model::Project { + stairs: Some(vec![crate::model::Stair { total_rise: Some(total_rise), floor_id: String::new(), ..typed.clone() }]), + stair_types: Some(vec![ty]), + ..Default::default() + }; + crate::ifc_stairs::concrete_flight_amounts(&one) + }) + }; let info = O::default() .raw("shape", s, "shape") .raw("width", s, "width") @@ -925,6 +940,8 @@ fn stair_selection(root: &Map, s: &Value) -> Result { .o("floorName", floor_name(floor, field(s, "floorId"))) .n("zBottom", zb) .n("zTop", zt) + .o("concreteVolume", amounts.map(|a| js_num(a.0))) + .o("soffitArea", amounts.map(|a| js_num(a.1))) .done(); Ok(O::default() .s("kind", "stair") @@ -1355,6 +1372,28 @@ mod tests { assert_eq!(sel(&bad, json!({"wallIds": ["w"]})).unwrap_err(), "Unbekannter Wandtyp: x"); } + #[test] + fn betonwendel_mit_volumen_und_wendelflaeche() { + let stair = |ty: &str| json!({"id": "s", "floorId": "eg", "shape": "spiral", "start": {"x": 2, "y": 0}, "dir": {"x": 0, "y": 1}, + "runLength": 0, "center": {"x": 0, "y": 0}, "radius": 1.5, "sweep": 270, "width": 1, "totalRise": 2.8, "stepCount": 14, "typeId": ty}); + let r = root(json!({ + "drawingLevels": [{"id": "eg", "name": "EG", "kind": "floor", "baseElevation": 0}], + "stairTypes": [{"id": "b", "name": "Beton", "structure": "beton", "closedRisers": false, "treadThickness": 0.04, "defaultWidth": 1}, + {"id": "h", "name": "Holz", "structure": "wange", "closedRisers": false, "treadThickness": 0.04, "defaultWidth": 1}], + "stairs": [stair("b")], + })); + let s = sel(&r, json!({"stairId": "s"})).unwrap(); + let v = s["stair"]["concreteVolume"].as_f64().unwrap(); + let a = s["stair"]["soffitArea"].as_f64().unwrap(); + assert!(v > 1.5 && v < 3.2, "{v}"); + assert!(a > 7.0 && a < 9.5, "{a}"); + // Holz-Wangentreppe: keine Betonmengen + let mut h = r.clone(); + h["stairs"] = json!([stair("h")]); + let s = sel(&h, json!({"stairId": "s"})).unwrap(); + assert!(s["stair"].get("concreteVolume").is_none() && s["stair"].get("soffitArea").is_none()); + } + #[test] fn hoehen_von_waenden_und_decken() { let r = root(json!({ diff --git a/src/i18n/de.ts b/src/i18n/de.ts index 5036f989..6d429279 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -837,6 +837,8 @@ export const de = { "objinfo.stair.rise": "Steighöhe (gesamt)", "objinfo.stair.riser": "Steigungshöhe", "objinfo.stair.tread": "Auftrittstiefe", + "objinfo.stair.concreteVolume": "Betonvolumen Lauf", + "objinfo.stair.soffitArea": "Untersicht (Schalfläche)", "objinfo.stair.direction": "Laufrichtung", "objinfo.stair.direction.up": "Aufwärts", "objinfo.stair.direction.down": "Abwärts", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index fb1ce97e..5ab0fa79 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -834,6 +834,8 @@ export const en: Record = { "objinfo.stair.rise": "Total rise", "objinfo.stair.riser": "Riser height", "objinfo.stair.tread": "Tread depth", + "objinfo.stair.concreteVolume": "Concrete volume (flight)", + "objinfo.stair.soffitArea": "Soffit area (formwork)", "objinfo.stair.direction": "Run direction", "objinfo.stair.direction.up": "Upwards", "objinfo.stair.direction.down": "Downwards", diff --git a/src/panels/ObjectInfoPanel.tsx b/src/panels/ObjectInfoPanel.tsx index 871203c4..61a9770d 100644 --- a/src/panels/ObjectInfoPanel.tsx +++ b/src/panels/ObjectInfoPanel.tsx @@ -1515,6 +1515,18 @@ export function StairSection({ {t("objinfo.stair.tread")} {formatM(stair.treadDepth)} + {stair.concreteVolume !== undefined && ( +
+ {t("objinfo.stair.concreteVolume")} + {stair.concreteVolume.toFixed(2)} m³ +
+ )} + {stair.soffitArea !== undefined && ( +
+ {t("objinfo.stair.soffitArea")} + {stair.soffitArea.toFixed(2)} m² +
+ )} {/* Referenzgeschoss (read-only). */}
diff --git a/src/state/selectionInfo.ts b/src/state/selectionInfo.ts index a6c73556..03e69178 100644 --- a/src/state/selectionInfo.ts +++ b/src/state/selectionInfo.ts @@ -277,6 +277,10 @@ export interface StairInfo { /** Aufgelöste absolute UK/OK (Meter). */ zBottom: number; zTop: number; + /** Nur Ortbeton (gerade/Wendel): Betonvolumen des Laufs (m³, ohne Säule). */ + concreteVolume?: number; + /** Nur Ortbeton: Untersicht (m², Schalfläche; bei der Wendel die Wendelfläche). */ + soffitArea?: number; } /**