Schnittebenen 2D↔3D Phase 1+2, native Fenster, Hell/Dunkel-Theme, SWISSIMAGE-Import

- Schnittebenen: 3D-Live-Schnitt folgt der gewählten Grundriss-Schnittlinie
  (section3dCutId/sectionPlaneFromLevel), Schalter "Im 3D schneiden" im
  Objekt-Info, Doppelklick auf Schnittlinie springt in 2D-Schnittansicht,
  unsichtbare Ebenen blenden ihre Führungslinie aus
- Eigene native Tauri-Fenster für Kontext-Import/Zeichnungsebenen/
  Ebenen-Einstellungen/Ressourcen/Einstellungen + klassische Menüleiste
  (AppMenuBar) neben der Wortmarke
- Hell/Dunkel-Umschalter (Einstellungen → Darstellung), persistiert,
  flackerfrei vor erstem Render gesetzt
- SWISSIMAGE-Luftbild-Import (swisstopo WMS) als Kontext-Hintergrundebene
- UI-Politur: Werkzeug-Panel Symbole/Liste umschaltbar, Topbar-Quick-Access-
  Icons entfernt, Zahnrad→Einstellungen in Panel-Köpfen, Footerbar/
  Snap-Marker/Maß-HUD auf helle Pillen-Sprache umgestellt
- Neues Dachziegel-Material (RoofingTiles013A)
This commit is contained in:
karim committed 2026-07-20 10:51:37 +02:00
1 parent 51e57c368b
commit b9e330ecb7
89 files changed
+7723 -1848

No files matched your search

+43
View File
@@ -308,6 +308,49 @@ describe("exportIfcSpf — IFC4-Export", () => {
expect(ifcGuid("W2")).not.toBe(guid); // unterschiedliche IDs → unterschiedliche GUIDs
});
it("georeferenziert: mit geoAnchor werden die ECHTEN LV95-Koordinaten geschrieben (lokal bearbeitet, weltweit lagerichtig)", () => {
// Modell lokal nahe (0,0), aber geoAnchor sagt: Modell (0,0) = LV95
// (2600000,1200000). Der Export muss die Profil-/Punkt-Koordinaten auf die
// echten Landeskoordinaten (Millionenbereich) verschoben schreiben.
const local = fixtureProject();
const withoutAnchor = exportIfcSpf(local);
// Ohne Bezug: lokale Koordinaten, KEINE Millionenwerte im Text.
expect(withoutAnchor).not.toMatch(/26000\d\d\./);
const geo: Project = {
...local,
geoAnchor: { lv95: { e: 2600000, n: 1200000 }, model: { x: 0, y: 0 } },
};
const spf = exportIfcSpf(geo);
// W1.start (0,0) -> LV95 (2600000,1200000); W2.end (5,4) -> (2600005,1200004).
expect(spf).toContain("2600000.");
expect(spf).toContain("1200000.");
expect(spf).toContain("2600005.");
// Struktur bleibt valide (keine dangling refs / Duplikate).
const { defined, referenced, duplicates } = collectIds(spf);
expect(duplicates).toEqual([]);
expect([...referenced].filter((id) => !defined.has(id))).toEqual([]);
});
it("geoAnchor.height wird als IfcSite.RefElevation geschrieben (Vermessungspunkt-Höhe)", () => {
const local = fixtureProject();
const geo: Project = {
...local,
geoAnchor: { lv95: { e: 2600000, n: 1200000 }, height: 683.5, model: { x: 0, y: 0 } },
};
const spf = exportIfcSpf(geo);
// Die IFCSITE-Zeile trägt die reale Datumshöhe (RefElevation, 12. Attribut).
const siteLine = spf.split("\n").find((l) => l.includes("=IFCSITE("));
expect(siteLine).toBeDefined();
expect(siteLine).toContain("683.5");
// Ohne Höhe bleibt RefElevation leer ($) — kein 683.5 irgendwo.
const noH = exportIfcSpf({
...local,
geoAnchor: { lv95: { e: 2600000, n: 1200000 }, model: { x: 0, y: 0 } },
});
expect(noH).not.toContain("683.5");
});
it("leeres Projekt ⇒ valider Minimal-IFC (Project/Site/Building, kein Crash)", () => {
const proj = fixtureProject();
proj.walls = [];
+14 -2
View File
@@ -59,6 +59,7 @@ import {
openingLabel,
wallTypeThickness,
} from "../model/types";
import { projectToWorldCoords } from "../model/geoRebase";
import {
ceilingVerticalExtent,
stairVerticalExtent,
@@ -283,7 +284,13 @@ interface Structure {
* File). Reiner Rechenkern — kein Datei-IO. Leeres Projekt ⇒ valider Minimal-
* IFC (Project/Site/Building, kein Crash).
*/
export function exportIfcSpf(project: Project): string {
export function exportIfcSpf(projectIn: Project): string {
// Georeferenziert exportieren: ist ein Standort-Bezug gesetzt (geoAnchor),
// wird die gesamte Geometrie auf die ECHTEN LV95-Weltkoordinaten verschoben,
// damit die IFC-Datei in anderer Software lagerichtig sitzt — auch wenn das
// Modell lokal nahe (0,0) bearbeitet wurde (s. projectToWorldCoords / der
// „Neuer Bezugspunkt"-Workflow). Ohne Bezug bleibt alles lokal (Identität).
const project = projectToWorldCoords(projectIn);
const w = new StepWriter();
// Geteilte Grundgeometrie: Ursprung, Z-Extrusionsrichtung, Identitäts-
@@ -341,9 +348,14 @@ export function exportIfcSpf(project: Project): string {
"IFCPROJECT",
`${S(ifcGuid(`${project.id}:project`))},#${ownerHistory},${S(project.name || "Projekt")},$,$,$,$,${LIST([`#${context}`])},#${unitAssignment}`,
);
// RefElevation (m ü. M.): reale Datumshöhe des Standorts aus dem
// Georeferenzierungs-Bezug (wie ArchiCADs Vermessungspunkt). Rein informativ —
// die Geometrie wird NICHT verschoben (das Terrain trägt bereits reale Höhen).
const refElevation = project.geoAnchor?.height;
const siteRefElev = typeof refElevation === "number" ? R(refElevation) : "$";
const siteId = w.add(
"IFCSITE",
`${S(ifcGuid(`${project.id}:site`))},#${ownerHistory},${S("Standort")},$,$,#${sitePlacement},$,$,${ENUM("ELEMENT")},$,$,$,$,$`,
`${S(ifcGuid(`${project.id}:site`))},#${ownerHistory},${S("Standort")},$,$,#${sitePlacement},$,$,${ENUM("ELEMENT")},$,$,${siteRefElev},$,$`,
);
const buildingId = w.add(
"IFCBUILDING",
+105
View File
@@ -199,3 +199,108 @@ describe("exportScheduleCsv — Bauteilliste", () => {
expect(scheduleRows(proj)).toHaveLength(0);
});
});
describe("scheduleRows — Dächer und Stützen (bisher fehlten sie in Liste/Element-Baum)", () => {
it("wertet ein Dach mit Dachtyp aus (Typname aus roofTypes, Dicke aus Schichtsumme via roof.thickness)", () => {
const proj = fixtureProject();
proj.roofTypes = [{ id: "rt", name: "Warmdach", layers: [{ componentId: "c", thickness: 0.35 }] }];
proj.roofs = [
{
id: "R1",
type: "roof",
floorId: "eg",
categoryCode: "31",
outline: [
{ x: 0, y: 0 },
{ x: 4, y: 0 },
{ x: 4, y: 3 },
{ x: 0, y: 3 },
], // 4×3 = 12 m²
shape: "flach",
pitchDeg: 0,
overhang: 0,
ridgeAxis: "x",
thickness: 0.35,
roofTypeId: "rt",
},
];
const rows = scheduleRows(proj).filter((r) => r.kind === "Dach");
expect(rows).toHaveLength(1);
expect(rows[0]).toMatchObject({
kind: "Dach",
id: "R1",
typeName: "Warmdach",
floor: "EG",
length: null,
heightM: null,
thickness: 0.35,
area: 12,
});
});
it("wertet eine rechteckige und eine runde Stütze aus (Profil-Masse als Länge/Dicke)", () => {
const proj = fixtureProject();
proj.columns = [
{
id: "C1",
type: "column",
floorId: "eg",
categoryCode: "50",
position: { x: 1, y: 1 },
profile: { kind: "rect", width: 0.3, depth: 0.4 },
rotation: 0,
height: 2.6,
},
{
id: "C2",
type: "column",
floorId: "eg",
categoryCode: "50",
position: { x: 2, y: 2 },
profile: { kind: "round", radius: 0.15 },
rotation: 0,
height: 2.6,
},
];
const rows = scheduleRows(proj).filter((r) => r.kind === "Stütze");
expect(rows).toHaveLength(2);
expect(rows[0]).toMatchObject({
id: "C1",
typeName: "Rechteck",
length: 0.3,
heightM: 2.6,
thickness: 0.4,
area: null,
});
expect(rows[1]).toMatchObject({
id: "C2",
typeName: "Rund",
length: null,
heightM: 2.6,
thickness: 0.3, // 2 × Radius
area: null,
});
});
it("Räume bleiben bewusst ausgeschlossen (eigener CSV-Export, siehe Dateikopf)", () => {
const proj = fixtureProject();
proj.rooms = [
{
id: "RM1",
type: "room",
floorId: "eg",
categoryCode: "45",
siaCategory: "HNF",
name: "Wohnen",
boundary: [
{ x: 0, y: 0 },
{ x: 3, y: 0 },
{ x: 3, y: 3 },
{ x: 0, y: 3 },
],
color: "#fff",
},
];
expect(scheduleRows(proj).some((r) => r.id === "RM1")).toBe(false);
});
});
+47 -5
View File
@@ -18,6 +18,8 @@ import type {
Opening,
Stair,
ExtrudedSolid,
Roof,
Column,
} from "../model/types";
import {
getWallType,
@@ -63,7 +65,9 @@ export type ScheduleKind =
| "Fenster"
| "Öffnung"
| "Treppe"
| "Extrusion";
| "Extrusion"
| "Dach"
| "Stütze";
/** Eine ausgewertete Zeile der Bauteilliste (je Bauteil-Vorkommen ein Datensatz). */
export interface ScheduleRow {
@@ -215,12 +219,48 @@ function evalExtrudedSolid(project: Project, solid: ExtrudedSolid): ScheduleRow
};
}
/** Wertet ein Dach für die Bauteilliste aus (defensiv gegen fehlenden Dachtyp). */
function evalRoof(project: Project, roof: Roof): ScheduleRow {
let typeName = roof.roofTypeId ?? roof.shape;
if (roof.roofTypeId) {
const rt = (project.roofTypes ?? []).find((t) => t.id === roof.roofTypeId);
if (rt) typeName = rt.name;
}
return {
kind: "Dach",
id: roof.id,
typeName,
floor: floorNameOf(project, roof.floorId),
floorId: roof.floorId,
length: null,
heightM: null,
thickness: roof.thickness,
area: polygonArea(roof.outline),
};
}
/** Wertet eine Stütze für die Bauteilliste aus (Querschnitt als „Dicke", Rechteck-Breite als „Länge"). */
function evalColumn(project: Project, column: Column): ScheduleRow {
return {
kind: "Stütze",
id: column.id,
typeName: column.profile.kind === "round" ? "Rund" : "Rechteck",
floor: floorNameOf(project, column.floorId),
floorId: column.floorId,
length: column.profile.kind === "rect" ? column.profile.width : null,
heightM: column.height,
thickness:
column.profile.kind === "rect" ? column.profile.depth : column.profile.radius * 2,
area: null,
};
}
/**
* Wertet ALLE Bauteil-Vorkommen eines Projekts aus (Wände, Decken, Türen,
* Fenster/Öffnungen, Treppen, Extrusionen — Räume bewusst ausgenommen, siehe
* Dateikopf). Reine Ableitung aus dem Modell — nichts wird gespeichert.
* Reihenfolge: Wände, Decken, Türen, Öffnungen, Treppen, Extrusionen (je in
* Dokumentreihenfolge).
* Fenster/Öffnungen, Treppen, Extrusionen, Dächer, Stützen — Räume bewusst
* ausgenommen, siehe Dateikopf). Reine Ableitung aus dem Modell — nichts wird
* gespeichert. Reihenfolge: Wände, Decken, Türen, Öffnungen, Treppen,
* Extrusionen, Dächer, Stützen (je in Dokumentreihenfolge).
*/
export function scheduleRows(project: Project): ScheduleRow[] {
const rows: ScheduleRow[] = [];
@@ -230,6 +270,8 @@ export function scheduleRows(project: Project): ScheduleRow[] {
for (const o of project.openings ?? []) rows.push(evalOpening(project, o));
for (const s of project.stairs ?? []) rows.push(evalStair(project, s));
for (const e of project.extrudedSolids ?? []) rows.push(evalExtrudedSolid(project, e));
for (const r of project.roofs ?? []) rows.push(evalRoof(project, r));
for (const c of project.columns ?? []) rows.push(evalColumn(project, c));
return rows;
}