[131] Geschosse: Bezugsgeschoss ±0.00, Untergeschosse negativ (Format 5)

DrawingLevel.zeroLevel markiert das Geschoss auf ±0.00; der Kern stapelt nach
Geschosshöhen und verschiebt den Stapel darauf. Koten im Schnitt/in der Ansicht
relativ zu ±0.00, an ±0.00 mit Meereshöhe. UI: Bezug ±0.00 und OK FB im
Geschoss-Editor, Navigator mit Vorzeichen. Musterhaus komplex: EG = ±0.00,
UG -2.70, absolute Höhen verschoben; Golden nachgeführt.
This commit is contained in:
Claude committed 2026-11-04 00:34:08 +00:00
1 parent 137afdda84
commit fd5f2693ab
31 files changed
+342 -94

No files matched your search

+19 -1
View File
@@ -2170,7 +2170,7 @@ Reihenfolge = Abhängigkeiten. Neue Geometrie entsteht in Rust ([K]).
Schnitte/Ansichten, 3D, Kennzahlen, Erdarbeiten, Blatt-Tabellen), e2e `sampleComplex.spec.ts` (Geschosse,
Ansichten, alle Blätter, Publikation als PDF). IFC: `scripts/validate-ifc.py` 0 Befunde (204 Produkte).
Geprüft: CLI-SVGs und Blatt-Screenshots angesehen (Linux), nicht in der Tauri-App/3D-Metal. **Befunde (offen):**
Geschosse stapeln ab dem ersten (UG = ±0.00, EG = +2.70; keine negative Basis möglich, Koten absolut);
~~Geschosse stapeln ab dem ersten (UG = ±0.00)~~ → [131] (EG = ±0.00, UG −2.70);
Flachdächer zeigen in der Ansicht keine Stirn (Carport darum Pultdach 3°); Stützen fehlen in Ansichten; T-Dach:
der unter dem Hauptdach liegende Teil des Anbaudachs erscheint im Schnitt als Hintergrundlinie; Aussenbemassung
am Bogenwand-Erker ergibt gedrängte Kleinmasse; Layout-Viewports rechnen nur Grundriss-/Zeichnungsebenen
@@ -2187,6 +2187,24 @@ Reihenfolge = Abhängigkeiten. Neue Geometrie entsteht in Rust ([K]).
und eigenen 2D-Elementen. vitest `viewportPlan.test.ts`, e2e `sectionViews.spec.ts`. Offen: Fang auf
Schnitt-Viewport-Inhalt (`sheet_viewports.rs` nur Grundriss), 3D-Ausschnitt im Viewport; nicht in der Tauri-App
geprüft (3D headless ohne Bild). · S
- ◐ **[131] Untergeschosse unter ±0.00 (Bezugsgeschoss).** (04.11., Befund aus [114]) Bisher stapelten die Geschosse
ab dem ersten (UG = ±0.00). Neu: `DrawingLevel.zeroLevel` (Rust-Modell) markiert das Bezugsgeschoss ±0.00 (wie
ArchiCADs Projektnullpunkt); `levels.rs::recompute_floor_elevations` stapelt weiter nach `floorHeight`, verschiebt den
Stapel aber so, dass dieses Geschoss auf 0 liegt — Geschosse darunter erhalten negative `baseElevation`, eine
geänderte UG-Höhe schiebt das UG nach unten statt das EG nach oben; nur ein Kennzeichen gilt. Ohne Kennzeichen
bleibt das erste Geschoss der Bezug. Format 5 (Migration 4 → 5 ohne Inhaltsänderung: alte Dateien sehen gleich aus;
die Version steigt, damit ältere Programme Dateien mit negativen Geschossen ablehnen). Alle Ableitungen lesen schon
die absolute `baseElevation` (Grundriss, Schnitt, Ansicht, 3D, IFC-Storey-Elevation, Gelände/Baugrube in
Modell-z). Koten im Schnitt/in der Ansicht: „-2.70" · „±0.00 = 515.10" (mit `referenceElevationMasl` = Höhe ±0.00
m ü. M., Einstellungen jetzt so benannt). UI: Geschoss-Einstellungen zeigen OK fertig Boden relativ zu ±0.00 und
„Bezug ±0.00" (ein Undo-Schritt), Navigator „−2.70"/„±0.00"/„+2.90". Musterhaus komplex: EG = ±0.00 (515.10 m ü. M.),
UG −2.70, alle absoluten Höhen (Gelände, Baugrube, Dachfuss, Carport, Fundamentriegel) um −2.70 verschoben;
Golden-Diffs geprüft (CLI-SVG Schnitt A-A alt/neu bis auf ±1e-5 m Gelände gleich, Ansicht Süd nur andere
Dach-Triangulierung; Grundrisse: Schatten/Baurecht jetzt im EG als Geschoss nächst ±0.00). Tests: cargo
(`levels`, Format 5, Koten), vitest `layers.test.ts`, `sampleProjectComplex.test.ts`, e2e `levelZero.spec.ts`
(Bezug wählen → EG −2.60, Höhe ändern, Undo), `sectionViews.spec.ts`. Geprüft: Screenshot Schnitt A-A im Browser
(Linux). Offen: Höhe eines Geschosses direkt eintippen (heute nur über Bezug + Geschosshöhen), Umordnen der Ebenen
stapelt nicht neu, nicht in der Tauri-App geprüft. · S
## Priorität 4 — später
+41
View File
@@ -0,0 +1,41 @@
// [131] Bezugsgeschoss ±0.00: im Geschoss-Editor ein anderes Geschoss auf ±0.00 legen — die Geschosse darunter
// erhalten negative Höhen (Navigator), ein Undo-Schritt stellt den alten Stapel wieder her.
import { blurFocus, expect, openSample, openTab, startNewProject, test } from "./app";
test("Geschoss als ±0.00 wählen: Erdgeschoss liegt danach negativ", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await openTab(page, "Zeichnungsebenen");
const egElev = page.getByTestId("level-elev-eg");
const ogElev = page.getByTestId("level-elev-og");
await expect(egElev).toHaveText("±0.00");
await expect(ogElev).toHaveText("+2.60");
await page.locator(".nav-row", { hasText: "Obergeschoss" }).first().click({ button: "right" });
await page.getByText("Einstellungen…", { exact: true }).click();
const zero = page.getByTestId("level-zero");
await expect(zero).not.toBeChecked();
await zero.check();
await expect(egElev).toHaveText("−2.60");
await expect(ogElev).toHaveText("±0.00");
await expect(page.getByTestId("level-elevation")).toHaveText("±0.00");
await expect(zero).toBeChecked();
// Geschosshöhe des EG ändert sich → ±0.00 bleibt beim OG, das EG wandert nach unten.
await page.keyboard.press("Escape");
await page.locator(".nav-row", { hasText: "Erdgeschoss" }).first().click({ button: "right" });
await page.getByText("Einstellungen…", { exact: true }).click();
const h = page.locator(".editor-num input[type=number]").first();
await h.fill("2.8");
await expect(egElev).toHaveText("−2.80");
await expect(ogElev).toHaveText("±0.00");
await page.keyboard.press("Escape");
// Undo: Höhe zurück, dann Bezug zurück (ein Schritt) → EG wieder ±0.00.
await blurFocus(page);
await page.keyboard.press("ControlOrMeta+z");
await expect(egElev).toHaveText("−2.60");
await page.keyboard.press("ControlOrMeta+z");
await expect(egElev).toHaveText("±0.00");
await expect(ogElev).toHaveText("+2.60");
});
+3 -1
View File
@@ -61,7 +61,9 @@ test("Layout-Blatt: Viewport zeigt Schnitt wie einen Grundriss", async ({ page }
// Der Schnitt mit seinen Höhenkoten — vorher rechnete der Viewport den Grundriss-Weg (Gelände-Höhenlinien,
// Schnittlinien-Symbole „West"/„A-A" …), aber keinen Schnitt.
const vp = page.locator("[data-viewport-id] svg").first();
await expect(vp).toContainText("+2.70", { timeout: 30_000 });
// [131] EG = ±0.00 (515.10 m ü. M.), UG darunter negativ.
await expect(vp).toContainText("±0.00 = 515.10", { timeout: 30_000 });
await expect(vp).toContainText("-2.70");
await expect(vp).not.toContainText("West");
expect(await vp.locator("path, line, polygon, polyline").count()).toBeGreaterThan(200);
await page.locator(".layout-sheet-pane").screenshot({ path: "test-results/blatt-schnitt.png" });
+1 -1
View File
@@ -879,7 +879,7 @@ mod tests {
assert_eq!(d.project().unwrap().walls.len(), 0);
assert_eq!(d.field("openings").unwrap()[0]["kind"], "door");
assert!(d.undo().is_none());
assert!(d.serialize().starts_with("{\n \"formatVersion\": 4,\n \"id\": \"q\""));
assert!(d.serialize().starts_with("{\n \"formatVersion\": 5,\n \"id\": \"q\""));
}
#[test]
+68 -6
View File
@@ -3,20 +3,47 @@
use serde_json::Value;
/// `recomputeFloorElevations`: Das erste Geschoss beginnt bei 0, jedes weitere bei `baseElevation +
/// floorHeight` des vorigen (fehlende Höhe = 0). Nicht-Geschoss-Ebenen verlieren `baseElevation`.
fn is_floor(level: &Value) -> bool {
level.get("kind").and_then(Value::as_str) == Some("floor")
}
fn is_zero(level: &Value) -> bool {
level.get("zeroLevel").and_then(Value::as_bool) == Some(true)
}
fn floor_height(level: &Value) -> f64 {
level.get("floorHeight").and_then(Value::as_f64).unwrap_or(0.0)
}
/// `recomputeFloorElevations`: Geschosse stapeln in Dokumentreihenfolge, jedes auf `baseElevation +
/// floorHeight` des vorigen (fehlende Höhe = 0). Der Stapel ist so verschoben, dass das Bezugsgeschoss
/// (`zeroLevel`, [131]; fehlt es: das erste Geschoss) auf ±0.00 liegt — Geschosse darunter erhalten
/// negative Höhen. Nur das erste Kennzeichen gilt, weitere entfallen. Nicht-Geschoss-Ebenen verlieren
/// `baseElevation` und `zeroLevel`.
pub fn recompute_floor_elevations(levels: &[Value]) -> Vec<Value> {
let mut next_base = 0.0_f64;
let zero_idx = levels.iter().filter(|l| is_floor(l)).position(is_zero).unwrap_or(0);
// Stapelhöhe des Bezugsgeschosses ab dem ersten Geschoss = Verschiebung des ganzen Stapels.
let offset: f64 = levels.iter().filter(|l| is_floor(l)).take(zero_idx).map(floor_height).sum();
let mut next_base = -offset;
let mut floor_i = 0usize;
levels
.iter()
.map(|level| {
let mut m = level.as_object().cloned().unwrap_or_default();
if level.get("kind").and_then(Value::as_str) != Some("floor") {
if !is_floor(level) {
m.shift_remove("baseElevation");
m.shift_remove("zeroLevel");
return Value::Object(m);
}
let base = next_base;
next_base = base + level.get("floorHeight").and_then(Value::as_f64).unwrap_or(0.0);
if floor_i == zero_idx && is_zero(level) {
m.insert("zeroLevel".into(), Value::Bool(true));
} else {
m.shift_remove("zeroLevel");
}
// −0 vermeiden (Datei und Koten zeigen sonst „-0").
let base = if next_base.abs() < 1e-12 { 0.0 } else { next_base };
next_base = base + floor_height(level);
floor_i += 1;
m.insert("baseElevation".into(), serde_json::Number::from_f64(base).map_or(Value::Null, Value::Number));
Value::Object(m)
})
@@ -43,4 +70,39 @@ mod tests {
assert_eq!(r[3]["baseElevation"], 2.6);
assert_eq!(l[0]["baseElevation"], 9.0); // Eingabe unverändert
}
#[test]
fn bezugsgeschoss_liegt_auf_null_untergeschosse_negativ() {
let l = vec![
json!({"id": "ug2", "kind": "floor", "floorHeight": 2.5}),
json!({"id": "ug", "kind": "floor", "floorHeight": 2.8}),
json!({"id": "s", "kind": "section", "zeroLevel": true}),
json!({"id": "eg", "kind": "floor", "floorHeight": 3.0, "zeroLevel": true}),
json!({"id": "og", "kind": "floor", "floorHeight": 2.9, "zeroLevel": true}),
];
let r = recompute_floor_elevations(&l);
let z = |i: usize| r[i]["baseElevation"].as_f64().unwrap();
assert!((z(0) + 5.3).abs() < 1e-9);
assert!((z(1) + 2.8).abs() < 1e-9);
assert_eq!(z(3), 0.0);
assert!((z(4) - 3.0).abs() < 1e-9);
assert!(r[2].get("zeroLevel").is_none());
assert_eq!(r[3]["zeroLevel"], true);
assert!(r[4].get("zeroLevel").is_none(), "nur ein Bezugsgeschoss");
// UG höher: der Bezug bleibt auf ±0.00, das UG wandert nach unten.
let mut l2 = r.clone();
l2[1]["floorHeight"] = json!(3.1);
let r2 = recompute_floor_elevations(&l2);
assert_eq!(r2[3]["baseElevation"], 0.0);
assert!((r2[1]["baseElevation"].as_f64().unwrap() + 3.1).abs() < 1e-9);
}
#[test]
fn zero_level_false_zaehlt_nicht() {
let l = vec![json!({"id": "a", "kind": "floor", "floorHeight": 2.0}), json!({"id": "b", "kind": "floor", "zeroLevel": false})];
let r = recompute_floor_elevations(&l);
assert_eq!(r[0]["baseElevation"], 0.0);
assert_eq!(r[1]["baseElevation"], 2.0);
assert!(r[1].get("zeroLevel").is_none());
}
}
+11 -6
View File
@@ -1725,6 +1725,13 @@ pub struct DrawingLevel {
#[serde(rename = "baseElevation", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub base_elevation: Option<f64>,
/// Bezugsgeschoss ±0.00 ([131], nur Geschoss): OK fertig Boden dieses Geschosses ist ±0.00
/// (Modell-z 0, m ü. M. = `Project.referenceElevationMasl`); Geschosse darunter erhalten negative
/// `baseElevation`. Höchstens ein Geschoss trägt das Kennzeichen; fehlt es, ist das erste Geschoss
/// der Bezug (Verhalten vor Format 5).
#[serde(rename = "zeroLevel", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub zero_level: Option<bool>,
/// Schnitt-/Ansichtslinie im Grundriss (nur Schnitt/Ansicht).
#[serde(rename = "linePoints", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
@@ -4744,12 +4751,10 @@ pub struct Project {
#[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub project_number: Option<String>,
/// Referenzhöhe des Erdgeschosses in Metern über Meer (m ü. M.), editierbar
/// im Einstellungs-Fenster. Optional, damit bestehende Projekte ohne diesen
/// Wert gültig bleiben (Default: unbestimmt/0). NUR Speicherfeld — die
/// eigentliche Verwendung (Terrain-Draping/reale Höhen relativ dazu, siehe
/// HANDOVER GEO-BLOCK) ist ein separater, späterer Task und liest dieses
/// Feld noch nicht.
/// Höhe von ±0.00 (OK fertig Boden des Bezugsgeschosses, `DrawingLevel.zeroLevel`)
/// in Metern über Meer (m ü. M.), editierbar im Einstellungs-Fenster. Optional.
/// Die automatischen Koten im Schnitt/in der Ansicht schreiben „±0.00 = 512.40"
/// ([131]); Terrain-Draping liest den Wert noch nicht.
#[serde(rename = "referenceElevationMasl", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub reference_elevation_masl: Option<f64>,
+27 -2
View File
@@ -388,12 +388,18 @@ fn kote_label(value: f64) -> String {
/// im Schnitt/in der Ansicht ([`level_markers`]).
#[allow(clippy::too_many_arguments)]
fn push_kote(sink: &mut Sink, at: Vec2, value: f64, kind: KoteKind, color: &str, weight: f64, greyed: bool, id: Option<&str>, f: f64) {
push_kote_labeled(sink, at, kote_label(value), kind, color, weight, greyed, id, f);
}
/// [`push_kote`] mit fertigem Text (z. B. „±0.00 = 512.40").
#[allow(clippy::too_many_arguments)]
fn push_kote_labeled(sink: &mut Sink, at: Vec2, label: String, kind: KoteKind, color: &str, weight: f64, greyed: bool, id: Option<&str>, f: f64) {
let up = if matches!(kind, KoteKind::OkFertig | KoteKind::OkRoh) { 1.0 } else { -1.0 };
let filled = matches!(kind, KoteKind::OkRoh | KoteKind::UkRoh);
let (size, half) = (KOTE_TRI_SIZE_M * f, KOTE_TRI_HALF_W_M * f);
let pts = vec![at, v(at.x - half, at.y + up * size), v(at.x + half, at.y + up * size)];
sink.push(polygon(pts, if filled { color } else { "none" }, color, weight, no_hatch(), greyed, id), 0);
sink.push(text(v(at.x + half + KOTE_TEXT_GAP_M * f, at.y + up * size * 0.5), kote_label(value), KOTE_TEXT_HEIGHT_M * f, 0.0, color, greyed, id), 0);
sink.push(text(v(at.x + half + KOTE_TEXT_GAP_M * f, at.y + up * size * 0.5), label, KOTE_TEXT_HEIGHT_M * f, 0.0, color, greyed, id), 0);
}
/// Aufgelöster Stil eines Element-Aufrufs.
@@ -1620,7 +1626,13 @@ pub fn level_markers(p: &Project, b: [f64; 4]) -> Vec<Primitive> {
LineRef { a: v(x - 0.3, z), b: v(min_x - LEADER_GAP_M, z), cls: "section-level-leader", weight_mm: 0.13, dash: None, zigzag: None, motif: None, color: Some(INK), drawing_id: None, opening_id: None, stair_id: None, greyed: None, opacity: None },
0,
);
push_kote(&mut sink, v(x, z), jsnum::round(z * 100.0) / 100.0, KoteKind::OkFertig, INK, 0.18, false, None, 1.0);
let value = jsnum::round(z * 100.0) / 100.0;
let mut label = kote_label(value);
// ±0.00 = Bezugsgeschoss ([131]): mit bekannter Meereshöhe „±0.00 = 512.40" (m ü. M.).
if let Some(masl) = p.reference_elevation_masl.filter(|m| m.is_finite() && value.abs() < 1e-6) {
label = format!("{label} = {}", to_fixed(masl, 2));
}
push_kote_labeled(&mut sink, v(x, z), label, KoteKind::OkFertig, INK, 0.18, false, None, 1.0);
}
out.prims
}
@@ -1832,6 +1844,19 @@ mod tests {
assert!(level_markers(&p, [0.0, 0.0, 0.0, 6.0]).is_empty());
}
/// [131] Untergeschoss unter ±0.00: negative Kote; mit `referenceElevationMasl` trägt ±0.00 die Meereshöhe.
#[test]
fn hoehenkoten_untergeschoss_und_meereshoehe() {
let p = project(serde_json::json!({ "referenceElevationMasl": 512.4, "drawingLevels": [
{"id": "ug", "name": "UG", "kind": "floor", "visible": true, "locked": false, "floorHeight": 2.8, "baseElevation": -2.8},
{"id": "eg", "name": "EG", "kind": "floor", "visible": true, "locked": false, "floorHeight": 3, "baseElevation": 0, "zeroLevel": true}] }));
let texts: Vec<String> = level_markers(&p, [0.0, -3.0, 10.0, 3.0])
.into_iter()
.filter_map(|q| if let Primitive::DrawingText { text, .. } = q { Some(text) } else { None })
.collect();
assert_eq!(texts, vec!["-2.80".to_string(), "±0.00 = 512.40".into(), "+3.00".into()]);
}
#[test]
fn kompakt_nur_ohne_enden_und_boegen() {
let mk = |g: serde_json::Value| -> Drawing2D { serde_json::from_value(drawing(g)).unwrap() };
+21 -3
View File
@@ -9,7 +9,7 @@
use serde_json::{Map, Value};
/// Aktuelle Version des Dateiformats. Bei jeder Formatänderung erhöhen + Migration anhängen.
pub const PROJECT_FORMAT_VERSION: u64 = 4;
pub const PROJECT_FORMAT_VERSION: u64 = 5;
const REQUIRED_ARRAYS: [&str; 3] = ["walls", "layers", "drawingLevels"];
const DEFAULT_ARRAYS: [&str; 5] = ["lineStyles", "hatches", "components", "wallTypes", "drawings2d"];
@@ -390,6 +390,10 @@ pub fn parse_project_object(raw: Value, now_ms: f64) -> Parsed {
1 => migrate_doors(obj),
2 => migrate_layout_annotations(obj),
3 => migrate_line_weights(obj),
// 4 → 5 ([131]): Bezugsgeschoss ±0.00 (`DrawingLevel.zeroLevel`), Untergeschosse dürfen negativ
// liegen. Ohne Kennzeichen bleibt das erste Geschoss der Bezug, gespeicherte Höhen gelten weiter:
// alte Dateien sehen gleich aus. Die Version steigt, damit ältere Programme Dateien mit negativen
// Geschossen ablehnen, statt sie beim nächsten Ebenen-Edit wieder ab ±0.00 zu stapeln.
_ => obj, // 0 → 1: Einführung von `formatVersion`; Inhalt unverändert.
};
}
@@ -639,7 +643,7 @@ mod tests {
fn alte_datei_wird_migriert_und_ergaenzt() {
let Parsed::Ok { project, warnings, migrated_from } = parse_project_object(minimal(), 0.0) else { panic!() };
assert_eq!(migrated_from, Some(0));
assert_eq!(project["formatVersion"], 4);
assert_eq!(project["formatVersion"], 5);
assert_eq!(project["lineStyles"], json!([]));
assert!(warnings.is_empty());
}
@@ -779,10 +783,24 @@ mod tests {
assert_eq!(keys(&v["a"]), ["2", "10", "4294967294", "x", "01", "4294967295"]);
}
/// [131] 4 → 5: Geschosse bleiben wie gespeichert (erstes Geschoss = Bezug, kein `zeroLevel` ergänzt).
#[test]
fn format5_laesst_geschosse_unveraendert() {
let levels = json!([
{"id":"ug","name":"UG","kind":"floor","visible":true,"locked":false,"floorHeight":2.7,"baseElevation":0},
{"id":"eg","name":"EG","kind":"floor","visible":true,"locked":false,"floorHeight":2.9,"baseElevation":2.7}
]);
let v = json!({"formatVersion": 4, "id":"p","name":"N","walls":[],"layers":[],"drawingLevels": levels});
let Parsed::Ok { project, migrated_from, .. } = parse_project_object(v, 0.0) else { panic!() };
assert_eq!(migrated_from, Some(4));
assert_eq!(project["drawingLevels"], levels);
assert_eq!(project["formatVersion"], 5);
}
#[test]
fn serialisierung_setzt_version_nach_vorn() {
let Value::Object(m) = minimal() else { panic!() };
let s = serialize_project(&m);
assert!(s.starts_with("{\n \"formatVersion\": 4,\n \"id\": \"p\""));
assert!(s.starts_with("{\n \"formatVersion\": 5,\n \"id\": \"p\""));
}
}
+5 -2
View File
@@ -1013,6 +1013,9 @@ export const de = {
"editor.hatch": "Schraffur",
"editor.floorHeight": "Geschosshöhe",
"editor.cutHeight": "Schnitthöhe",
"editor.levelElevation": "OK fertig Boden",
"editor.zeroLevel": "Bezug ±0.00",
"editor.zeroLevel.hint": "Dieses Geschoss liegt auf ±0.00; Geschosse darunter erhalten negative Höhen.",
"editor.viewTop": "Oberkante Sicht",
"editor.viewBottom": "Unterkante Sicht",
"editor.viewDepth": "Darunter sichtbar bis",
@@ -2565,9 +2568,9 @@ export const de = {
"settings.snapColor.hint":
"Farbe der Snap-/Endpunkt-Hervorhebung beim Zeichnen/Editieren im Grundriss.",
"settings.section.project": "Projekt",
"settings.referenceElevation": "Referenzhöhe EG (m ü. M.)",
"settings.referenceElevation": "Höhe ±0.00 (m ü. M.)",
"settings.referenceElevation.hint":
"Nur gespeichert — wird noch nicht verwendet. Folgt für Terrain-Draping/reale Höhen relativ zum Erdgeschoss.",
"OK fertig Boden des Bezugsgeschosses (±0.00) über Meer; erscheint in Schnitten und Ansichten an der Kote ±0.00.",
"settings.scaleLineWeights": "Strichstärken nach Massstab",
"settings.scaleLineWeights.hint": "Grundriss-Strichstärken werden mit (100/n)^¼ skaliert: 1:200 ≈ 84 %, 1:50 ≈ 119 %. Gilt am Bildschirm, in Layouts und im Export.",
"settings.section.shortcuts": "Befehlszeilen-Kürzel (Tipp-Alias)",
+5 -2
View File
@@ -1007,6 +1007,9 @@ export const en: Record<TranslationKey, string> = {
"editor.hatch": "Hatch",
"editor.floorHeight": "Floor height",
"editor.cutHeight": "Cut height",
"editor.levelElevation": "Finished floor level",
"editor.zeroLevel": "Datum ±0.00",
"editor.zeroLevel.hint": "This storey is at ±0.00; storeys below get negative elevations.",
"editor.viewTop": "View top",
"editor.viewBottom": "View bottom",
"editor.viewDepth": "Visible below down to",
@@ -2552,9 +2555,9 @@ export const en: Record<TranslationKey, string> = {
"settings.snapColor.hint":
"Color of the snap/endpoint highlight while drawing/editing in the plan view.",
"settings.section.project": "Project",
"settings.referenceElevation": "Ground floor reference elevation (m a.s.l.)",
"settings.referenceElevation": "Elevation of ±0.00 (m a.s.l.)",
"settings.referenceElevation.hint":
"Stored only — not used yet. Terrain draping / real-world elevations relative to the ground floor will follow.",
"Finished floor of the datum storey (±0.00) above sea level; shown in sections and elevations at the ±0.00 level mark.",
"settings.scaleLineWeights": "Line weights by scale",
"settings.scaleLineWeights.hint": "Plan line weights are scaled by (100/n)^¼: 1:200 ≈ 84 %, 1:50 ≈ 119 %. Applies on screen, in layouts and exports.",
"settings.section.shortcuts": "Command-line shortcuts (typed alias)",
+1 -1
View File
@@ -21,7 +21,7 @@ import { sharedDocument, withDocument } from "../core/document";
import type { LoadFileResult } from "../core/document";
/** Aktuelle Version des Dateiformats (muss `PROJECT_FORMAT_VERSION` im Kern entsprechen — Test). */
export const PROJECT_FORMAT_VERSION = 4;
export const PROJECT_FORMAT_VERSION = 5;
export type ParseProjectResult = LoadFileResult;
+34 -2
View File
@@ -7,9 +7,9 @@
import type { ComponentProps } from "react";
import { t } from "../i18n";
import { activePenSet, resolvePenColor, resolvePenWeight } from "../model/penSets";
import { findCategory } from "../model/layers";
import { findCategory, formatElevation } from "../model/layers";
import type { DrawingLevel, LayerCategory } from "../model/types";
import { useStore } from "../state/appStore";
import { getState, useStore } from "../state/appStore";
import { EditorField } from "../ui/EditorField";
import { HatchSwatch } from "../ui/hatchPreview";
import { PenColorField } from "../ui/PenColorField";
@@ -110,6 +110,12 @@ export function LayerInlineEditor({
);
}
/** Bezugsgeschoss ±0.00: das erste Geschoss mit `zeroLevel`, sonst das erste Geschoss. */
function isZeroLevel(levels: readonly DrawingLevel[], id: string): boolean {
const floors = levels.filter((z) => z.kind === "floor");
return (floors.find((z) => z.zeroLevel) ?? floors[0])?.id === id;
}
export function LevelInlineEditor({
editor,
onClose,
@@ -140,6 +146,32 @@ export function LevelInlineEditor({
</EditorField>
{isFloor && (
<>
{/* [131] OK fertig Boden relativ zu ±0.00 (aus dem Stapel); ein Geschoss ist der Bezug. */}
<EditorField label={t("editor.levelElevation")}>
<span className="editor-num">
<span data-testid="level-elevation">{formatElevation(level.baseElevation ?? 0)}</span>
<span className="editor-unit">{t("editor.unit.m")}</span>
</span>
</EditorField>
<EditorField label={t("editor.zeroLevel")}>
<input
type="checkbox"
data-testid="level-zero"
title={t("editor.zeroLevel.hint")}
checked={isZeroLevel(project.drawingLevels, level.id)}
disabled={isZeroLevel(project.drawingLevels, level.id)}
onChange={(e) => {
if (!e.target.checked) return;
const prev = project.drawingLevels.find((z) => z.kind === "floor" && z.zeroLevel && z.id !== level.id);
// Ein Undo-Schritt: altes Kennzeichen weg, neues setzen; der Kern stapelt neu.
if (prev) getState().groupChanges(() => {
patchLevel(prev.id, { zeroLevel: undefined });
patchLevel(level.id, { zeroLevel: true });
});
else patchLevel(level.id, { zeroLevel: true });
}}
/>
</EditorField>
<EditorField label={t("editor.floorHeight")}>
<span className="editor-num">
<input
+16
View File
@@ -8,6 +8,7 @@ import {
collectVisibleCodes,
findCategory,
flattenCategories,
formatElevation,
insertAfterCode,
nextFreeCode,
patchCategoryByCode,
@@ -69,4 +70,19 @@ describe("Geschoss-Stapelung (Kern)", () => {
it("Musterprojekt trägt die gestapelten Höhen ausgeschrieben (Modul wird vor dem Kern geladen)", () => {
expect(recomputeFloorElevations(sampleProject.drawingLevels)).toEqual(sampleProject.drawingLevels);
});
it("[131] Bezugsgeschoss ±0.00: Untergeschoss negativ, nur ein Kennzeichen", () => {
const l = [
{ id: "ug", name: "UG", kind: "floor", visible: true, locked: false, floorHeight: 2.8 },
{ id: "eg", name: "EG", kind: "floor", visible: true, locked: false, floorHeight: 3, zeroLevel: true },
{ id: "og", name: "OG", kind: "floor", visible: true, locked: false, floorHeight: 2.9, zeroLevel: true },
] as DrawingLevel[];
const r = recomputeFloorElevations(l);
expect(r.map((x) => x.baseElevation)).toEqual([-2.8, 0, 3]);
expect(r.map((x) => x.zeroLevel)).toEqual([undefined, true, undefined]);
});
it("[131] Höhenanzeige relativ zu ±0.00", () => {
expect([-2.8, 0, -0.001, 2.7].map(formatElevation)).toEqual(["−2.80", "±0.00", "±0.00", "+2.70"]);
});
});
+7
View File
@@ -127,3 +127,10 @@ export function recomputeFloorElevations(levels: DrawingLevel[]): DrawingLevel[]
if (out === "") throw new Error("Kern: Geschoss-Höhen fehlgeschlagen");
return JSON.parse(out) as DrawingLevel[];
}
/** Geschosshöhe relativ zu ±0.00 für die Anzeige ([131]): „±0.00" · „+2.70" · „−2.80". */
export function formatElevation(z: number): string {
const r = Math.round(z * 100) / 100;
if (Math.abs(r) < 1e-9) return "±0.00";
return `${r > 0 ? "+" : "−"}${Math.abs(r).toFixed(2)}`;
}
+1 -1
View File
@@ -52,7 +52,7 @@ export function richProject(): Project {
const lvl = sampleProject.drawingLevels[0].id;
return {
...sampleProject,
formatVersion: 4,
formatVersion: 5,
// Blatt-Ebene des Layouts „lay1" (2D-Zeichnung auf dem Blatt).
drawingLevels: [...sampleProject.drawingLevels, { id: "sheet-lay1", name: "Blatt 1", kind: "drawing", visible: true, locked: false, layoutId: "lay1" }],
textStyles: [{ id: "ts1", label: "Titel", marks: { bold: true, font: "Helvetica", sizePt: 14 } }],
+9 -1
View File
@@ -14,7 +14,7 @@ import { excavationQuantities } from "../analysis/excavation";
import { checkSiteRules } from "../analysis/siteRules";
import { sheetTables } from "../export/sheetTable";
import { serializeProject, parseProjectFile } from "../io/projectFormat";
import { collectVisibleCodes } from "./types";
import { collectVisibleCodes, recomputeFloorElevations } from "./types";
const p = buildComplexSampleProject();
const codes = collectVisibleCodes(p.layers);
@@ -44,6 +44,14 @@ describe("Musterhaus komplex", () => {
for (const k of ["blockrahmen", "umfassungszarge", "futter", "schiebe", "eckzarge", "wandoeffnung"]) expect(frameKinds).toContain(k);
});
it("[131] EG = ±0.00, UG darunter negativ; Höhen = Stapel des Kerns", () => {
const z = Object.fromEntries(p.drawingLevels.filter((l) => l.kind === "floor").map((l) => [l.id, l.baseElevation]));
expect(z).toEqual({ ug: -2.7, eg: 0, og: 2.9, dg: 5.7 });
expect(p.drawingLevels.find((l) => l.id === "eg")?.zeroLevel).toBe(true);
const r = recomputeFloorElevations(p.drawingLevels);
for (const [i, l] of r.entries()) if (l.kind === "floor") expect(l.baseElevation, l.id).toBeCloseTo(p.drawingLevels[i].baseElevation!, 9);
});
it("Grundrisse aller Geschosse und das Detail rechnen", () => {
for (const l of p.drawingLevels.filter((x) => x.kind === "floor" || x.kind === "drawing")) {
const plan = generatePlan(p, l.id, codes, undefined, "mittel", false, false, true, 100);
+24 -22
View File
@@ -11,8 +11,8 @@
// Lage (x = Ost, y = Nord): Haupthaus 15 × 10 m (Wandachsen), Anbau Nord 5 × 5 m (Eingang, T-Dach),
// runder Erker Ost (Bogenwand r = 2 m, Wendeltreppe UG → EG), Carport West. Das Gelände fällt nach
// Süden: das UG liegt im Norden im Hang, im Süden frei (Gartengeschoss).
// Höhen: Geschosse gestapelt ab UG = 0.00 (wie `recomputeFloorElevations`): UG 0.00, EG 2.70,
// OG 5.60, DG 8.40. Gelände und absolute Höhen (Dachfuss, Baugrube) im selben System.
// Höhen ([131]): EG = ±0.00 (Bezugsgeschoss, = 515.10 m ü. M.), gestapelt wie `recomputeFloorElevations`:
// UG −2.70, EG ±0.00, OG +2.90, DG +5.70. Gelände und absolute Höhen (Dachfuss, Baugrube) im selben System.
import type {
CeilingType,
@@ -88,9 +88,9 @@ function runCmd(p: Project, level: string, cmd: string, req: Record<string, unkn
// ═════════════════════════════════════════════════════════════════════════════
const H = { ug: 2.7, eg: 2.9, og: 2.8, dg: 2.6 } as const;
const Z = { ug: 0, eg: 2.7, og: 5.6, dg: 8.4 } as const;
const Z = { ug: -2.7, eg: 0, og: 2.9, dg: 5.7 } as const;
/** Traufhöhe (Dachfuss aussen) des Hauptdachs: 1.60 m über DG (Kniestock innen ≈ 1.2 m). */
const EAVE_MAIN = 10.0;
const EAVE_MAIN = 7.3;
const PITCH = 38;
/** Wanddicke der Aussenwände (alle Aufbauten 39 cm, damit die Fluchten über die Geschosse stimmen). */
const AW = 0.39;
@@ -98,7 +98,7 @@ const HA = AW / 2;
const LEVELS: DrawingLevel[] = [
{ id: "ug", name: "Untergeschoss", kind: "floor", visible: true, locked: false, floorHeight: H.ug, cutHeight: 1.2, baseElevation: Z.ug, viewTop: 2.7, viewBottom: 0, viewDepth: -0.5, templateId: "vt-gr100", templateLinked: false },
{ id: "eg", name: "Erdgeschoss", kind: "floor", visible: true, locked: false, floorHeight: H.eg, cutHeight: 1.0, baseElevation: Z.eg, viewTop: 2.9, viewBottom: 0, viewDepth: -2.7, templateId: "vt-gr100", templateLinked: false },
{ id: "eg", name: "Erdgeschoss", kind: "floor", visible: true, locked: false, floorHeight: H.eg, cutHeight: 1.0, baseElevation: Z.eg, zeroLevel: true, viewTop: 2.9, viewBottom: 0, viewDepth: -2.7, templateId: "vt-gr100", templateLinked: false },
{ id: "og", name: "Obergeschoss", kind: "floor", visible: true, locked: false, floorHeight: H.og, cutHeight: 1.0, baseElevation: Z.og, viewTop: 2.8, viewBottom: 0, viewDepth: -0.3, templateId: "vt-gr100", templateLinked: false },
{ id: "dg", name: "Dachgeschoss", kind: "floor", visible: true, locked: false, floorHeight: H.dg, cutHeight: 1.0, baseElevation: Z.dg, viewTop: 2.6, viewBottom: 0, viewDepth: -0.3, templateId: "vt-gr100", templateLinked: false },
// Schnitte: A längs durch Schleppgaube und Dachfenster (Blick nach Westen), B quer durch Treppen und Erker (Blick nach Norden).
@@ -272,9 +272,9 @@ shell("ug", "mk-aw-ug", H.ug, false);
cores("ug", "mk-iw-ks", H.ug);
wall("ug-iw-y5", "ug", P(0, 5), P(6, 5), "mk-iw-ks", H.ug);
wall("ug-iw-y75", "ug", P(10, 7.5), P(15, 7.5), "mk-iw-ks", H.ug);
// Fundamentriegel unter dem Anbau (kein UG): frostfrei ab 1.30 bis UK Decke.
// Fundamentriegel unter dem Anbau (kein UG): frostfrei ab −1.40 bis UK Decke.
for (const [id, a, b] of [["ug-fund-o", P(10, 10 + HA), P(10, 15)], ["ug-fund-n", P(10, 15), P(5, 15)], ["ug-fund-w", P(5, 15), P(5, 10 + HA)]] as const) {
wall(id, "ug", a, b, "mk-aw-ug", 1.03, { isExternal: true, bottom: { mode: "custom", z: 1.3 }, top: { mode: "custom", z: 2.33 } });
wall(id, "ug", a, b, "mk-aw-ug", 1.03, { isExternal: true, bottom: { mode: "custom", z: -1.4 }, top: { mode: "custom", z: -0.37 } });
}
// Stützmauer im Garten: schräger Stoss an die Westfassade, schräge Ecke (Gehrung).
wall("ug-stuetz-1", "ug", P(-HA, 4), P(-4.5, 1), "mk-stuetzmauer", 1.8, { isExternal: true });
@@ -446,7 +446,7 @@ const roofs: NonNullable<Project["roofs"]> = [
{
id: "dach-carport", type: "roof", floorId: "eg", categoryCode: "31", outline: rect(-6.6, 10.6, -0.9, 16.2),
// Pultdach 3° (Trapezblech) — ein Flachdach zeigt in der Ansicht keine Stirn.
shape: "pult", pitchDeg: 3, overhang: 0.1, ridgeAxis: "y", baseElevation: 5.0, thickness: 0.2, roofTypeId: "mk-rt-blech",
shape: "pult", pitchDeg: 3, overhang: 0.1, ridgeAxis: "y", baseElevation: 2.3, thickness: 0.2, roofTypeId: "mk-rt-blech",
},
];
@@ -474,7 +474,7 @@ const stairs: NonNullable<Project["stairs"]> = [
const columns: NonNullable<Project["columns"]> = [
...[P(-6.2, 11.0), P(-1.3, 11.0), P(-6.2, 15.8), P(-1.3, 15.8)].map((position, i) => ({
id: `st-carport-${i + 1}`, type: "column" as const, floorId: "eg", categoryCode: "25", position, profile: { kind: "rect" as const, width: 0.12, depth: 0.12 }, rotation: 0,
height: 3.0, componentId: "std-c-stahl", bottom: { mode: "custom" as const, z: 2.0 }, top: { mode: "custom" as const, z: 5.0 },
height: 3.0, componentId: "std-c-stahl", bottom: { mode: "custom" as const, z: -0.7 }, top: { mode: "custom" as const, z: 2.3 },
})),
// Rundstütze unter dem Podest der Gartenterrasse (UG, Sichtbeton).
{ id: "st-ug-1", type: "column", floorId: "ug", categoryCode: "25", position: P(10.0, 2.6), profile: { kind: "round", radius: 0.15 }, rotation: 0, height: H.ug, componentId: "std-c-stahlbeton" },
@@ -492,14 +492,16 @@ const extrudedSolids: NonNullable<Project["extrudedSolids"]> = [
// ═════════════════════════════════════════════════════════════════════════════
/** Gelände z(x, y): fällt nach Süden (tanh-Profil), leicht gewellt. */
const terrainZ = (x: number, y: number) => 0.9 + 1.5 * Math.tanh((y - 4 - 0.8 * Math.sin(x / 9)) / 8);
const terrainZ = (x: number, y: number) => -1.8 + 1.5 * Math.tanh((y - 4 - 0.8 * Math.sin(x / 9)) / 8);
/** Höhenlinie z als Polylinie y(x) über x = −16 … 32. */
function contourAt(z: number): Vec2[] {
const pts: Vec2[] = [];
for (let x = -16; x <= 32; x += 2) pts.push(P(x, r3(4 + 0.8 * Math.sin(x / 9) + 8 * Math.atanh((z - 0.9) / 1.5))));
for (let x = -16; x <= 32; x += 2) pts.push(P(x, r3(4 + 0.8 * Math.sin(x / 9) + 8 * Math.atanh((z + 1.8) / 1.5))));
return pts;
}
const CONTOUR_Z = [-0.55, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.35];
const CONTOUR_Z = [-3.25, -3.2, -2.95, -2.7, -2.45, -2.2, -1.95, -1.7, -1.45, -1.2, -0.95, -0.7, -0.45, -0.35];
/** Hauptlinie je halben Meter ab UG-Boden (−2.70). */
const isMainContour = (z: number) => Math.abs((z + 2.7) * 2 - Math.round((z + 2.7) * 2)) < 1e-9;
// Parzelle (Kataster) mit Nachbarparzellen; Grenzabstände je Kante, Baulinie an der Strasse (Nord).
const PARCEL = [P(-14, -12), P(28, -13), P(29, 23), P(-15, 24)];
@@ -702,12 +704,12 @@ function views(): Pick<Project, "viewTemplates" | "viewSnapshots" | "viewSnapsho
snap("vs-eg50", "EG 1:50 Ausschnitt Wohnen", "eg", 50, P(10, 3.5), { folderId: "vf-gr", templateId: "vt-gr50", templateLinked: true }),
snap("vs-situation", "Situation 1:500", "eg", 500, P(7, 5), { folderId: "vf-gr", detail: "grob", layerVisibility: ALL }),
snap("vs-brand", "EG Brandschutz", "eg", 100, P(7.5, 6), { folderId: "vf-gr", templateId: "vt-brand", templateLinked: true, enabledOverrideRuleIds: ["or-brand"] }),
snap("vs-schnitt-a", "Schnitt A-A", "schnitt-a", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-schnitt-b", "Schnitt B-B", "schnitt-b", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-s", "Ansicht Süd", "ansicht-sued", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-o", "Ansicht Ost", "ansicht-ost", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-n", "Ansicht Nord", "ansicht-nord", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-w", "Ansicht West", "ansicht-west", 100, P(6, 6), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-schnitt-a", "Schnitt A-A", "schnitt-a", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-schnitt-b", "Schnitt B-B", "schnitt-b", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-s", "Ansicht Süd", "ansicht-sued", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-o", "Ansicht Ost", "ansicht-ost", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-n", "Ansicht Nord", "ansicht-nord", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-ansicht-w", "Ansicht West", "ansicht-west", 100, P(6, 3.3), { folderId: "vf-sa", layerVisibility: ALL }),
snap("vs-detail", "Detail Deckenauflager 1:10", "detail-traufe", 10, P(DETAIL_X + 0.4, 1.0), { folderId: "vf-sa", detail: "fein", layerVisibility: HIDE_SITE }),
snap("vs-3d", "Axonometrie Südost", "eg", 100, P(7.5, 5), { folderId: "vf-3d", viewType: "perspektive", view3d: "isoFrontLeft", fov: 45 }),
],
@@ -805,13 +807,13 @@ export function buildComplexSampleProject(): Project {
context: [
{
type: "contourSet", id: "hoehenlinien", name: "Höhenlinien (Vermessung)", layer: "Terrain", categoryCode: "14",
contours: CONTOUR_Z.map((z) => ({ z, pts: contourAt(z), closed: false, layer: Number.isInteger(z * 2) ? "HL-Haupt" : "HL" })),
contours: CONTOUR_Z.map((z) => ({ z, pts: contourAt(z), closed: false, layer: isMainContour(z) ? "HL-Haupt" : "HL" })),
},
{
// Baugrube: Böschung 60° (Ost 50°), Nordkante (Hang) mit Rühlwand gesichert, Sohle unter der Bodenplatte.
type: "excavation", id: "baugrube", name: "Baugrube Haupthaus", layer: "Terrain", categoryCode: "07",
// Umriss = Gebäude-Grundfläche UG (mit Erker), Arbeitsraum 0.8 m; Neigungen in Grad.
outline: rect(-HA, -HA, 17.2, 10 + HA), bottom: -0.65, slope: 60, fillSlope: 33.7,
outline: rect(-HA, -HA, 17.2, 10 + HA), bottom: -3.35, slope: 60, fillSlope: 33.7,
edgeSlopes: [60, 50, 90, 60], edgeShoring: [false, false, true, false], workingSpace: 0.8,
},
],
@@ -834,8 +836,8 @@ export function buildComplexSampleProject(): Project {
buildingLines: [{ a: P(-15, 19.5), b: P(29, 18.5) }],
maxHeight: 15, show: true,
},
referenceElevationMasl: 512.4,
geoAnchor: { lv95: { e: 2689540, n: 1240310 }, height: 512.4, model: P(0, 0), label: "Musterweg 12, 8700 Küsnacht (fiktiv)" },
referenceElevationMasl: 515.1,
geoAnchor: { lv95: { e: 2689540, n: 1240310 }, height: 515.1, model: P(0, 0), label: "Musterweg 12, 8700 Küsnacht (fiktiv)" },
groups: [
{ id: "grp-carport", name: "Carport", wallIds: [], drawingIds: [], ceilingIds: [], roomIds: [], stairIds: [], columnIds: columns.filter((c) => c.id.startsWith("st-carport")).map((c) => c.id), roofIds: ["dach-carport"], openingIds: [], groupIds: [] },
],
+11 -6
View File
@@ -1060,6 +1060,13 @@ export type DrawingLevel = {
cutHeight?: number;
/** Oberkante Fertigfußboden in Metern (nur Geschoss). */
baseElevation?: number;
/**
* Bezugsgeschoss ±0.00 ([131], nur Geschoss): OK fertig Boden dieses Geschosses ist ±0.00
* (Modell-z 0, m ü. M. = `Project.referenceElevationMasl`); Geschosse darunter erhalten negative
* `baseElevation`. Höchstens ein Geschoss trägt das Kennzeichen; fehlt es, ist das erste Geschoss
* der Bezug (Verhalten vor Format 5).
*/
zeroLevel?: boolean;
/** Schnitt-/Ansichtslinie im Grundriss (nur Schnitt/Ansicht). */
linePoints?:[Vec2, Vec2];
/** Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht). */
@@ -2402,12 +2409,10 @@ export type Project = {
/** Projektnummer für Titelblock und Dateinamen ([79]). */
projectNumber?: string;
/**
* Referenzhöhe des Erdgeschosses in Metern über Meer (m ü. M.), editierbar
* im Einstellungs-Fenster. Optional, damit bestehende Projekte ohne diesen
* Wert gültig bleiben (Default: unbestimmt/0). NUR Speicherfeld — die
* eigentliche Verwendung (Terrain-Draping/reale Höhen relativ dazu, siehe
* HANDOVER GEO-BLOCK) ist ein separater, späterer Task und liest dieses
* Feld noch nicht.
* Höhe von ±0.00 (OK fertig Boden des Bezugsgeschosses, `DrawingLevel.zeroLevel`)
* in Metern über Meer (m ü. M.), editierbar im Einstellungs-Fenster. Optional.
* Die automatischen Koten im Schnitt/in der Ansicht schreiben „±0.00 = 512.40"
* ([131]); Terrain-Draping liest den Wert noch nicht.
*/
referenceElevationMasl?: number;
/**
+1 -1
View File
@@ -200,7 +200,7 @@ export const getFloor = (project: Project, id: string): DrawingLevel => {
// Ebenen-Baum und Geschoss-Stapelung liegen im Rust-Kern ([K4] S3, `model/layers.ts`); Re-Export, damit
// die Aufrufer gleich bleiben.
export { collectVisibleCodes, flattenCategories, getLayerCategory, recomputeFloorElevations } from "./layers";
export { collectVisibleCodes, flattenCategories, formatElevation, getLayerCategory, recomputeFloorElevations } from "./layers";
/** Gesamtdicke eines Wandtyps = Summe der Schichtdicken. */
export const wallTypeThickness = (wt: WallType): number =>
+2 -1
View File
@@ -22,6 +22,7 @@ import type { DrawingLevel } from "./host";
import type { DisplayMode } from "./types";
import { DisplayModeSelect } from "./DisplayModeSelect";
import type { DrawingLevelKind } from "../model/types";
import { formatElevation } from "../model/layers";
import { t } from "../i18n";
/** i18n-Key des Kurzbadges für die Art einer Zeichnungsebene. */
@@ -242,7 +243,7 @@ export function LevelRow({
<span className="nav-label">{level.name}</span>
{level.kind === "floor" && level.baseElevation !== undefined && (
<span className="nav-elev">+{level.baseElevation.toFixed(2)}</span>
<span className="nav-elev" data-testid={`level-elev-${level.id}`}>{formatElevation(level.baseElevation)}</span>
)}
<span className={`chip badge-${level.kind}`}>
@@ -1,9 +1,9 @@
viewBox -4.2 0 37.045 17.778
bytes 344306
bytes 342833
circle 4
line 1261
polygon 1529
line 1258
polygon 1520
rect 1
svg 1
text 4
hash ac47902c2752e848
hash 177fc7b70222fd3a
@@ -1,10 +1,10 @@
viewBox -16.5 0 49 35.22
bytes 339680
bytes 339400
circle 14
line 3498
line 3495
path 8
polygon 91
rect 1
svg 1
text 36
hash 30888ca0d5cb84be
hash 777a7a1ebaaae5c0
@@ -1,10 +1,10 @@
viewBox -16.5 0 49 35.22
bytes 343059
bytes 342779
circle 14
line 3498
line 3495
path 8
polygon 91
rect 1
svg 1
text 36
hash f96ebde7ba7f7e74
hash 1e90615f2149b374
@@ -1,10 +1,10 @@
viewBox -41.5 0 95 63.6
bytes 148973
bytes 151519
circle 16
line 861
line 869
path 68
polygon 260
polygon 263
rect 1
svg 1
text 123
hash aefdd0fe3c4658bd
hash 00c7b1a95fe41aa2
@@ -1,10 +1,10 @@
viewBox -41.5 0 95 63.6
bytes 149368
bytes 151930
circle 16
line 861
line 869
path 68
polygon 260
polygon 263
rect 1
svg 1
text 123
hash 65c62fa0ef5ee339
hash 6e0589f30494b4b0
@@ -7,4 +7,4 @@ polygon 236
rect 1
svg 1
text 93
hash 961473ba9c3e6937
hash b85a09c1cc75aa1b
@@ -7,4 +7,4 @@ polygon 236
rect 1
svg 1
text 93
hash 6f37dfa59b4e84a0
hash 3bbeb3cd79f1a439
@@ -1,10 +1,10 @@
viewBox -16.5 0 49 38.11
bytes 86366
viewBox -16.5 0 49 35.22
bytes 84125
circle 14
line 501
line 493
path 29
polygon 113
polygon 110
rect 1
svg 1
text 74
hash cd3c20b2431eec2e
hash 97d2f7e97ef77a9b
@@ -1,10 +1,10 @@
viewBox -16.5 0 49 38.11
bytes 86522
viewBox -16.5 0 49 35.22
bytes 84235
circle 14
line 501
line 493
path 29
polygon 113
polygon 110
rect 1
svg 1
text 74
hash 53435c6a8ca1a431
hash fad902cb1fc95e90
+3 -3
View File
@@ -1,7 +1,7 @@
meshes [1849]
meshes[].color [3] x1849
meshes[].indices [108] x6
meshes[].indices [156648]
meshes[].indices [156642]
meshes[].indices [348] x6
meshes[].indices [36] x1816
meshes[].indices [372]
@@ -21,7 +21,7 @@ meshes[].positions [2688]
meshes[].positions [288] x6
meshes[].positions [324] x6
meshes[].positions [72] x5
meshes[].positions [78840]
meshes[].positions [78837]
roofLayers [59]
roofLayers[].color [3] x59
roofLayers[].normal [3] x59
@@ -50,4 +50,4 @@ walls[].start [2] x1508
walls[].startCut [4] x1137
walls[].topDrop [2] x112
walls[].topPlane [3] x268
hash cd9596786d4adacb
hash a2e428fd2c5dbd0a
+2 -2
View File
@@ -52,7 +52,7 @@ describe("Projekt laden ([K4] S4)", () => {
st().undo();
expect(st().project).toBe(next);
// Kern-Dokument = Leseansicht (Speichern aus dem Kern).
expect(JSON.parse(serializeProject(st().project))).toEqual({ ...next, formatVersion: 4 });
expect(JSON.parse(serializeProject(st().project))).toEqual({ ...next, formatVersion: 5 });
});
it("openProjectFile: Kern liest, migriert und lädt direkt; Verlauf leer; kaputte Datei ändert nichts", () => {
@@ -70,7 +70,7 @@ describe("Projekt laden ([K4] S4)", () => {
expect(r.ok && r.migratedFrom).toBe(1);
expect(st().undoDepth).toBe(0);
expect(st().redoDepth).toBe(0);
expect(st().project.formatVersion).toBe(4);
expect(st().project.formatVersion).toBe(5);
expect(st().project.openings?.some((o) => o.id === "TX" && o.kind === "door")).toBe(true);
expect("doors" in st().project).toBe(false);
// Danach normal weiterarbeiten: ein Schritt, Undo zurück auf den geladenen Stand.