[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:
31 files changed
+342
-94
No files matched your search
+5
-2
@@ -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
@@ -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)",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]);
|
||||
});
|
||||
});
|
||||
@@ -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)}`;
|
||||
}
|
||||
@@ -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 } }],
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: [] },
|
||||
],
|
||||
|
||||
@@ -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
@@ -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 =>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user