[210] Kurzanleitung «Erster Wettbewerb», Beispielprojekt Wettbewerb, Hilfe → Tastaturkürzel
Beispielprojekt «Wettbewerb» (Mehrfamilienhaus, Baurecht, Raumprogramm, Schnitte, Präsentationsplan A1) als Vorlage in Menü und CLI (:wettbewerb); doc/KURZANLEITUNG.md mit Bildern aus dem CLI; neues Hilfe-Menü mit Kürzel-Übersicht, abgeleitet aus SHORTCUT_DEFS und ALIASES. TODO.md nachgeführt.
This commit is contained in:
24 files changed
+866
-7
No files matched your search
@@ -241,8 +241,6 @@ Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
|
||||
### Phase 4 (4.–12.12.): Härten und veröffentlichen
|
||||
- Nur noch Fehler aus dem Referenz-Ablauf; Leistung mit grossen Kontext-Importen; keine neuen Funktionen.
|
||||
- ○ **[210]** Kurzanleitung „Erster Wettbewerb mit Dossier“ (deutsch, Bilder) + Beispielprojekt „Wettbewerb“ als Vorlage
|
||||
(`src/model/sample*`), Tastaturkürzel-Übersicht im Hilfemenü. · M
|
||||
- Release 1.0.0: Tag, signierte Pakete, Release-Notes (ehrlich: was nicht geht), Download-Seite.
|
||||
|
||||
- ○ **[212]** Eigener GPU-Pathtracer in `render3d` als progressive Vorschau im Viewport (Entscheid Maintainer 12.11.: „beides“ —
|
||||
@@ -1094,7 +1092,7 @@ Punktwolken/BCF-Ausbau, Windows-Paket, [C5]/[C7]/[15] Kern-Umbauten — ausser s
|
||||
|
||||
Auf dem Mac (Tauri/Metal) noch nicht angesehen oder geprüft; bisher nur Linux-Container, CLI-SVG, Chromium oder
|
||||
Unit-Tests: [116] (atomares Speichern), [117] (CSP unter `tauri://`), [118], [122], [123], [126], [110], [101],
|
||||
[102], [131], [133], [136], [140], [145], [194], [146], [153], [64], [T2], [T4], [34], [108], [65], [169], [113], [181], [G1], [214], [209]. Je Punkt ansehen, dann hier und
|
||||
[102], [131], [133], [136], [140], [145], [194], [146], [153], [64], [T2], [T4], [34], [108], [65], [169], [113], [181], [G1], [214], [209], [210]. Je Punkt ansehen, dann hier und
|
||||
im jeweiligen Eintrag streichen. · M (gesamt)
|
||||
|
||||
---
|
||||
@@ -1105,6 +1103,7 @@ Einzeilig mit ID, Titel, Datum (2026). Kleine Reste erledigter Punkte (z. B. [T7
|
||||
exakte Durchdringung, [61] Zuordnung per Hand, [63] Profil je Kante, [70] Flächentabelle als Layout-Element,
|
||||
[80] Einzelplan-PDF ohne Ebenen, [82] Legende per Ziehen) stehen im Archiv beim jeweiligen Eintrag.
|
||||
|
||||
- [210] Kurzanleitung und Wettbewerbs-Beispiel (13.11.): `doc/KURZANLEITUNG.md` (deutsch, Schritt für Schritt entlang [206], Bilder in `doc/kurzanleitung/`: Plan EG/OG 1:200, Situation 1:500, Schnitt, Ansicht); Beispielprojekt `src/model/sampleProjectWettbewerb.ts` (Mehrfamilienhaus, 3 Geschosse, Flachdach, Baurecht, 30 Räume mit Raumprogramm, Schnitte/Ansichten, Situation, Präsentationsplan A1; Datei → Neu aus Vorlage → Wettbewerb, CLI `:wettbewerb`; Test `sampleProjectWettbewerb.test.ts`); Hilfe → Tastaturkürzel … (Overlay `ShortcutOverviewDialog`, Liste aus `SHORTCUT_DEFS` und `ALIASES` abgeleitet, `state/shortcutOverview.ts`, Test dazu; neues Hilfe-Menü in Browser-Leiste und nativem Menü). Offen: keine 3D- und keine Präsentationsplan-Bilder (Linux-Container ohne WebGPU/Metal), Hilfe-Menü und Dialog nicht in der Tauri-App/auf dem Mac geprüft, Anleitung nicht von einer zweiten Person durchgespielt
|
||||
- [209] Kostenschätzung grob (12.11.): Kennwert-Methode Menge × Kennwert je eBKP-H-Hauptgruppe B–J (Bezug m³ GV oder m² GF je Methode, wahlweise HNF/Fassade/Dach/pauschal), Honorare/Reserve/MwSt in %, Genauigkeit ±, Region- und Index-Faktor, Preisstand; `Project.costEstimate`, Kern `kosten.rs` (Mengen aus der SIA-416-Flächentabelle, eine Quelle mit [225]). Panel im Flächenbilanz-Panel, Blatt-Tabelle Quelle „costs", CSV/PDF wie der Flächen-Nachweis; e2e-Schritte 5b/10b in `release10.spec.ts`. Vorgaben sind Beispielwerte (≈ 800 CHF/m³ GV bzw. 2'600 CHF/m² GF, keine offizielle Quelle) und als solche markiert; belegt nur MwSt 8.1 % und die SIA-102-Genauigkeiten. Offen: Varianten nebeneinander, Kennwerte aus einer echten Quelle (Büro/CRB), Mac-Gegenprobe
|
||||
- [185] Navigation wie Archicad (12.11.): Geschosswechsel behält den Ausschnitt, Cmd+5/6 Geschoss runter/hoch, Cmd+3 „3D · Auswahl", Cmd+4 Auswahl im 3D ausblenden.
|
||||
- [195] Objekt-Einstellungsfenster (12.11.): Taste T öffnet die Objekteinstellungen (Objekt + Darstellung) für alle Bauteile; Weiterführung als natives Nebenfenster in [195b].
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
# Erster Wettbewerb mit Dossier
|
||||
|
||||
Kurzanleitung für die Version 1.0 „Wettbewerb & Vorprojekt“. Sie folgt dem Referenz-Ablauf aus `TODO.md` und
|
||||
`doc/RELEASE-1.0.md` vom leeren Projekt bis zur Abgabe: Kataster laden, Baurecht prüfen, Volumen bauen, Räume gegen das
|
||||
Raumprogramm halten, Kennzahlen nach SIA 416 lesen, Pläne 1:200 und Schnitt ableiten, Axonometrie und Schatten
|
||||
ansehen, den Präsentationsplan auf A1 legen und PDF, DXF und IFC ausgeben.
|
||||
|
||||
**Zum Mitlesen:** Das Beispielprojekt **Wettbewerb** hat alle Schritte schon gemacht. Öffnen über
|
||||
*Datei → Neu aus Vorlage → Wettbewerb* (Browser-Menü: „Neu aus Vorlage: Wettbewerb“). Es ist ein Mehrfamilienhaus mit
|
||||
6 Wohnungen auf einer fiktiven Parzelle in Winterthur (LV95), 3 Geschosse, Flachdach, 30 Räume mit Raumprogramm,
|
||||
Schnitte A-A und B-B, Ansichten, Situation 1:500 und ein Präsentationsplan A1. Auf der Kommandozeile:
|
||||
`node dist-cli/dossier-cli.mjs :wettbewerb kennzahlen`.
|
||||
|
||||
Die Menüpfade gelten für die macOS-App (Hauptplattform). Im Browser-Build stehen dieselben Punkte in der Menüleiste
|
||||
oben („Datei“, „Bearbeiten“, „Ansicht“, „Fenster“, „Hilfe“). Alle Tastenkürzel zeigt *Hilfe → Tastaturkürzel …*;
|
||||
dort stehen auch die Kürzel für die Befehlszeile.
|
||||
|
||||
> **Stand der Bilder:** Sie stammen aus dem Linux-Container (CLI-Ausgabe, mit Schraffur, als SVG im Chromium
|
||||
> aufgenommen). 3D-Bilder fehlen, weil es dort kein WebGPU/Metal gibt. Die Mac-Ansicht (Metal) kann in Strichstärke
|
||||
> und Schriftbild abweichen.
|
||||
|
||||
---
|
||||
|
||||
## 0. Befehle eingeben
|
||||
|
||||
Dossier hat unten eine **Befehlszeile**. Befehlsnamen oder Kürzel tippen, Enter. Danach fragt die Zeile nach Punkten:
|
||||
Klick in den Plan oder Koordinaten tippen (`x,y`; relativ mit `r5,3`), Enter beendet den Befehl, Esc bricht ab.
|
||||
Wichtige Kürzel: `w` (`wand`) Wand · `d` (`decke`) Decke · `rf` (`dach`) Dach · `rm` (`raum`) Raum ·
|
||||
`schnittlinie` (`sectionline`) Schnitt · `ansichtslinie` (`viewline`) Ansicht ·
|
||||
`praesentation` Präsentationsplan · `bild3d` 3D-Bild. Eigene Kürzel: *Einstellungen → Tastenkürzel*.
|
||||
|
||||
## 1. Leeres Projekt
|
||||
|
||||
*Datei → Neu* (⌘N). Das neue Projekt hat Erdgeschoss, Obergeschoss, Schnitt A und Ansicht Süd. Gleich speichern:
|
||||
*Datei → Speichern unter …* (⇧⌘S), z. B. `wettbewerb.obp`. Danach genügt ⌘S.
|
||||
|
||||
## 2. Kataster-DXF laden (LV95)
|
||||
|
||||
*Datei → Importieren …* (im Browser „DXF/DWG importieren…“) und die Kataster-Datei wählen. Im Dialog die Vorgaben lassen
|
||||
(neue Zeichnungsebene, Landeskoordinaten) und **Importieren**. Der Projekt-Nullpunkt liegt dann auf einem runden
|
||||
LV95-Punkt; die Statusleiste zeigt lokale und LV95-Koordinaten. Parzellen und Gebäude liegen auf der neuen
|
||||
Zeichnungsebene (Panel **Zeichnungsebenen**). Mit „Auf Plan einpassen“ (⌘0, „Alles einpassen“) siehst du alles.
|
||||
|
||||
Online lädt *Fenster → Standort importieren* Gebäude, Gelände und Luftbild von swisstopo. Das ist im Container nicht
|
||||
geprüft.
|
||||
|
||||
## 3. Baurecht
|
||||
|
||||
1. Parzellengrenze im Plan anklicken.
|
||||
2. Panel **Gelände** → Abschnitt „Baurecht der Parzelle“ → **Parzelle aus Auswahl**. Es erscheint z. B.
|
||||
„Parzelle 880 m² · zulässig …“.
|
||||
3. **Grenzabstand** setzen, bei Bedarf je Kante, **Baulinie aus Auswahl** für die Strassenseite.
|
||||
4. **Gesamthöhe max.** eintragen, optional **Profilwinkel** und **Vorsprünge**. Mit „Hülle im 3D“ zeigt Dossier die
|
||||
zulässige Hülle durchscheinend; Verstösse sind rot.
|
||||
|
||||
Die Prüfung steht darunter („Gebäude innerhalb der zulässigen Fläche“, „Höhe 9.50 m ≤ 12.00 m“). Im Beispiel:
|
||||
Abstände 4/4/5/4 m, 12 m Gesamthöhe, Parzelle 880 m².
|
||||
|
||||
## 4. Volumen: Wände, Decke, Dach
|
||||
|
||||
Zuerst das Geschoss wählen (Panel **Zeichnungsebenen**, „Erdgeschoss“; ⌘5/⌘6 wechseln das Geschoss).
|
||||
|
||||
- **Wände:** `w`, Ecken klicken oder als LV95 tippen, mit dem Startpunkt schliessen, Enter.
|
||||
- **Decke:** `d`, die vier Ecken, Enter. Die Decke bekommt den Deckentyp des Projekts.
|
||||
- **Dach:** `rf`, zwei Ecken; vorgegeben ist ein Satteldach. Ein Flachdach mit Attika stellst du in den
|
||||
Objekt-Informationen ein (Dachform „flach“), wie im Beispiel.
|
||||
- Obergeschosse: Wände auf das nächste Geschoss kopieren (⌘D dupliziert die Auswahl) und mit ⌘6 das Geschoss
|
||||
wechseln.
|
||||
|
||||
Die Volumenstudie als freier Körper (`koerper`) wird noch nicht automatisch in Wände und Decken umgewandelt ([222]).
|
||||
|
||||
## 5. Räume und Raumprogramm
|
||||
|
||||
1. `rm`, ins Gebäude klicken: Dossier erkennt den Raum aus den Wänden. Name und Nummer in den Objekt-Informationen
|
||||
setzen.
|
||||
2. Panel **Flächenbilanz** → **Raumprogramm importieren …**: CSV mit den Spalten
|
||||
`Raum;Fläche [m²];Anzahl;Flächenart;Gruppe` wählen, Spalten zuordnen, **Importieren**. Das Programm erscheint als
|
||||
Soll/Ist-Tabelle (grün = erfüllt, gelb = Abweichung, „fehlt“ = noch kein Raum).
|
||||
3. **Räume generieren** legt aus dem Programm ein Blatt mit Raumrechtecken an, um das Programm zu schieben.
|
||||
|
||||
Im Beispiel sind alle 7 Programmzeilen erfüllt (Toleranz 10 %).
|
||||
|
||||
## 6. Flächen und Kennzahlen SIA 416
|
||||
|
||||
Das Panel **Flächenbilanz** zeigt die Kennzahlenleiste: GF, aGF, GV, AZ, ÜZ. Darunter der „Flächen- und
|
||||
Kennzahlen-Nachweis“ (HNF, NNF, VF, FF, KF; IVHB-Ziffern) mit **CSV** und **PDF**. Das Menü
|
||||
*Bearbeiten → Kennzahlen und Raumprogramm …* gibt dasselbe als Meldung. Beispielwerte aus dem Projekt „Wettbewerb“:
|
||||
GF 745 m², GV 2’234 m³, AZ 0.75, ÜZ 0.28. Die **Kostenschätzung grob** (eBKP-H, CHF/m³ GV oder CHF/m² GF) steht im
|
||||
selben Panel und lässt sich als Tabelle auf ein Blatt legen.
|
||||
|
||||
## 7. Pläne 1:200
|
||||
|
||||
In der Kopfleiste den **Massstab** wählen (Papier-Massstab 1:N anwenden), z. B. 1:200 für den Wettbewerb und 1:100
|
||||
für das Vorprojekt. Der Detailgrad („grob“, „mittel“, „fein“) passt Strichstärken und Schraffuren an.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Die Situation 1:500 mit Schwarzplan kommt aus der Standard-Ansichtsvorlage „Situation WBW“ (Gebäude schwarz,
|
||||
Nachbarn grau, Parzelle, Nordpfeil, Massstabsbalken):
|
||||
|
||||

|
||||
|
||||
## 8. Schnitt und Ansicht
|
||||
|
||||
`schnittlinie`, Start- und Endpunkt quer durchs Gebäude, Enter: Es entsteht eine neue Ebene „Schnitt B“ in der
|
||||
Liste der Zeichnungsebenen; anklicken zeigt den Schnitt mit Wänden, Decken, Dach und Koten. „Schnitt A“ und „Ansicht
|
||||
Süd“ aus dem leeren Projekt folgen dem Gebauten, bis du ihre Linien verschiebst. Weitere Ansichten mit
|
||||
`ansichtslinie` (Nord, Ost, West).
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 9. Axonometrie und Schatten
|
||||
|
||||
Kopfleiste **Axonometrie** öffnet einen Reiter „3D · Erdgeschoss“. Im Panel **Gelände** schaltest du **Schatten im
|
||||
3D zeigen** ein (auch „Schatten im Grundriss zeigen“) und wählst Datum (Tagundnachtgleiche, Sommer-, Wintersonnenwende)
|
||||
und Uhrzeit. Ein 3D-Bild in Abgabeauflösung (z. B. A3 bei 300 dpi) erzeugt *Ansicht → 3D-Bild exportieren …* (Befehl
|
||||
`bild3d`); es lässt sich speichern oder ins Layout einsetzen.
|
||||
|
||||
*Hier fehlen die Bilder: Das 3D läuft nur mit WebGPU (Browser) oder Metal (Mac), nicht im Linux-Container.*
|
||||
|
||||
## 10. Präsentationsplan
|
||||
|
||||
Panel **Mappe** → **Präsentationsplan erstellen** (oder Befehl `praesentation`). Im Dialog Geschosse, Ansichten und den
|
||||
Schnitt wählen, Papier **A1**, Massstab 1:200 (Vorgabe) und **Erstellen**. Dossier ordnet alles im gemeinsamen
|
||||
Massstab, mit Titeln, Nordpfeil, Massstabsbalken und Schriftfeld. Das Beispiel enthält so ein Blatt (3 Grundrisse,
|
||||
4 Ansichten, Schnitt A-A). Die Ausschnitte folgen der Vorlage „Präsentation“.
|
||||
|
||||
## 11. Abgabe: PDF, DXF, IFC
|
||||
|
||||
- **PDF:** Panel **Mappe** → **Publikationssatz anlegen**, die Blätter anhaken, **Publizieren**. Es entsteht ein PDF
|
||||
(mit PDF-Ebenen je Kategorie, wenn eingeschaltet), Index im Titelblock und im Dateinamen.
|
||||
- **DXF:** Geschoss wählen, *Datei → Exportieren → DXF* (Browser: „Exportieren: DXF“). LV95, Layer je Kategorie.
|
||||
- **IFC:** *Datei → Exportieren → IFC* (IFC4 mit Wänden, Decken, Räumen).
|
||||
|
||||
Zum Schluss ⌘S. Das Projekt (`.obp`) enthält Volumen, Räume, Baurecht, Raumprogramm, Blätter und Publikationssätze.
|
||||
|
||||
---
|
||||
|
||||
## Noch offen
|
||||
|
||||
Das Wettbewerbsplakat A0/A1 mit Kennwort-Feld und anonymem PDF ist erst teilweise fertig ([208] in `TODO.md`), das
|
||||
Rendering mit Blender (*Ansicht → Rendering mit Blender …*, [211]) ist auf dem Mac noch nicht geprüft, und die
|
||||
Umwandlung eines Volumenkörpers in Wände und Decken fehlt ([222]). Der Ablauf wurde im Browser-Build automatisch
|
||||
geprüft (`e2e/release10.spec.ts`); der Durchlauf auf dem Mac steht noch aus (`doc/RELEASE-1.0.md`).
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
+2
-1
@@ -395,7 +395,7 @@ export default function App() {
|
||||
);
|
||||
const {
|
||||
projectFileInputRef, projectTemplateFileInputRef, openImportForFile, onSaveProject, onSaveProjectAs,
|
||||
onNewProject, onNewProjectFromSample, onNewProjectFromComplexSample, onNewProjectFromTemplate,
|
||||
onNewProject, onNewProjectFromSample, onNewProjectFromComplexSample, onNewProjectFromWettbewerbSample, onNewProjectFromTemplate,
|
||||
onProjectTemplateFileChosen, onExportIfc, onExportObj, onExportStl, onOpenProject, onProjectFileChosen,
|
||||
} = files;
|
||||
|
||||
@@ -700,6 +700,7 @@ export default function App() {
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
onNewProjectFromWettbewerbSample,
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
|
||||
+5
-2
@@ -51,7 +51,8 @@
|
||||
// dossier-cli bench --big [--floors 8 --apartments 15] dasselbe am parametrischen Grossgebäude (`:gross`, [20])
|
||||
//
|
||||
// Statt einer Datei nimmt `:beispiel` das eingebaute Demo-Haus (sampleProject), `:musterhaus-komplex` das
|
||||
// grosse Beispiel (model/sampleProjectComplex.ts; als Datei: `dossier-cli :musterhaus-komplex migrate --out mk.obp`).
|
||||
// grosse Beispiel (model/sampleProjectComplex.ts; als Datei: `dossier-cli :musterhaus-komplex migrate --out mk.obp`),
|
||||
// `:wettbewerb` das Wettbewerbs-Beispiel der Kurzanleitung (model/sampleProjectWettbewerb.ts, [210]).
|
||||
//
|
||||
// WASM-Pakete (src/engine/pkg*) werden aus DOSSIER_WASM_DIR bzw. `<repo>/src/engine` gelesen.
|
||||
|
||||
@@ -137,6 +138,7 @@ import {
|
||||
projectWarnings,
|
||||
sampleProject,
|
||||
buildComplexSampleProject,
|
||||
buildWettbewerbSampleProject,
|
||||
buildBigSampleProject,
|
||||
withDocument,
|
||||
AI_BRIDGE_DEFAULT_PORT,
|
||||
@@ -215,6 +217,7 @@ function fail(msg: string): never {
|
||||
function loadProject(path: string, args: Args): Project {
|
||||
if (path === ":beispiel") return sampleProject;
|
||||
if (path === ":musterhaus-komplex") return buildComplexSampleProject();
|
||||
if (path === ":wettbewerb") return buildWettbewerbSampleProject();
|
||||
if (path === ":gross") return buildBigSampleProject({ floors: Number(args.flags.get("floors") ?? 8), apartments: Number(args.flags.get("apartments") ?? 15) });
|
||||
let text: string;
|
||||
try {
|
||||
@@ -538,7 +541,7 @@ function importDoc(project: Project) {
|
||||
/** Liest Eingabe nach Endung in ein Projekt: obp direkt, dxf/dwg als 2D-Zeichnung + Meshes, ifc als Kontext-Meshes (`--elements`: Bauteile). */
|
||||
async function importAny(path: string, args: Args): Promise<Project> {
|
||||
const ext = extOf(path);
|
||||
if (ext === "obp" || ext === "json" || path === ":beispiel" || path === ":musterhaus-komplex") return loadProject(path, args);
|
||||
if (ext === "obp" || ext === "json" || path === ":beispiel" || path === ":musterhaus-komplex" || path === ":wettbewerb") return loadProject(path, args);
|
||||
let bytes: Uint8Array;
|
||||
try {
|
||||
bytes = new Uint8Array(readFileSync(path));
|
||||
|
||||
@@ -57,6 +57,7 @@ export { ProjectDocument, sharedDocument } from "./document";
|
||||
export { withDocument } from "./document";
|
||||
export { emptyProject } from "../model/sampleProject";
|
||||
export { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
export { buildWettbewerbSampleProject } from "../model/sampleProjectWettbewerb";
|
||||
export { buildBigSampleProject } from "../model/sampleProjectBig";
|
||||
export { readPointCloud, readPointCloudFlat, isPointCloudFile, DEFAULT_MAX_POINTS } from "../io/pointCloud";
|
||||
export type { PointCloudData, PointCloudOptions, PointCloudReport } from "../io/pointCloud";
|
||||
|
||||
@@ -4132,6 +4132,16 @@ export const de = {
|
||||
"costs.foot.priceBase": "Preisstand {base}; Region-Faktor {region}, Index-Faktor {index}.",
|
||||
"costs.foot.ebkp": "Gliederung nach eBKP-H (SN 506 511); ohne Grundstück (A). Honorare (V) auf B–J, Reserve (Y) auf B–J + V, MwSt (Z) auf das Total.",
|
||||
"costs.export.fail": "Export der Kostenschätzung fehlgeschlagen.",
|
||||
"menu.help": "Hilfe",
|
||||
"menu.help.shortcuts": "Tastaturkürzel …",
|
||||
"help.shortcuts.title": "Tastaturkürzel",
|
||||
"help.shortcuts.intro": "Tastenkombinationen und Befehlskürzel, wie sie gerade gelten (inklusive eigener Änderungen aus den Einstellungen).",
|
||||
"help.shortcuts.filter": "Suchen …",
|
||||
"help.shortcuts.keys": "Tastenkombinationen",
|
||||
"help.shortcuts.commands": "Befehlskürzel",
|
||||
"help.shortcuts.commandsHint": "In die Befehlszeile tippen, dann Enter. Ändern: Einstellungen → Tastenkürzel.",
|
||||
"file.newFromWettbewerbSample": "Neu aus Vorlage: Wettbewerb",
|
||||
"menu.native.newFromWettbewerbSample": "Wettbewerb",
|
||||
} as const;
|
||||
|
||||
export type TranslationKey = keyof typeof de;
|
||||
@@ -4118,4 +4118,14 @@ export const en: Record<TranslationKey, string> = {
|
||||
"costs.foot.priceBase": "Price base {base}; regional factor {region}, index factor {index}.",
|
||||
"costs.foot.ebkp": "Structure per eBKP-H (SN 506 511); without land (A). Fees (V) on B–J, contingency (Y) on B–J + V, VAT (Z) on the total.",
|
||||
"costs.export.fail": "Export of the cost estimate failed.",
|
||||
"menu.help": "Help",
|
||||
"menu.help.shortcuts": "Keyboard Shortcuts …",
|
||||
"help.shortcuts.title": "Keyboard Shortcuts",
|
||||
"help.shortcuts.intro": "Key combinations and command aliases as they apply now (including your changes from Settings).",
|
||||
"help.shortcuts.filter": "Search …",
|
||||
"help.shortcuts.keys": "Key combinations",
|
||||
"help.shortcuts.commands": "Command aliases",
|
||||
"help.shortcuts.commandsHint": "Type into the command line, then press Enter. Change: Settings → Keyboard shortcuts.",
|
||||
"file.newFromWettbewerbSample": "New From Template: Competition",
|
||||
"menu.native.newFromWettbewerbSample": "Competition",
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
// [210] Beispielprojekt „Wettbewerb": gültig, deterministisch, Plan/Schnitt/Ansicht/3D rechnen, Baurecht, Kennzahlen,
|
||||
// Raumprogramm und Präsentationsplan sind vorhanden. Mit WB_OUT=<pfad.obp> schreibt der Test die Projektdatei
|
||||
// (zum Ansehen über dossier-cli, Bilder der Kurzanleitung).
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { writeFileSync } from "node:fs";
|
||||
import { buildWettbewerbSampleProject } from "./sampleProjectWettbewerb";
|
||||
import { projectWarnings, validateProject } from "../core/ops";
|
||||
import { generatePlan } from "../plan/generatePlan";
|
||||
import { computeSection, generateSectionPlan } from "../plan/toSection";
|
||||
import { generateElevationPlan } from "../plan/toElevation";
|
||||
import { projectToModel3d } from "../plan/toWalls3d";
|
||||
import { computeKennzahlen } from "../analysis/kennzahlen";
|
||||
import { checkSiteRules } from "../analysis/siteRules";
|
||||
import { serializeProject, parseProjectFile } from "../io/projectFormat";
|
||||
import { collectVisibleCodes } from "./types";
|
||||
|
||||
const p = buildWettbewerbSampleProject();
|
||||
const codes = collectVisibleCodes(p.layers);
|
||||
|
||||
describe("Beispielprojekt Wettbewerb", () => {
|
||||
it("ist gültig und deterministisch; Datei-Rundreise", () => {
|
||||
expect(validateProject(p)).toEqual([]);
|
||||
expect(projectWarnings(p)).toEqual([]);
|
||||
const text = serializeProject(p);
|
||||
expect(serializeProject(buildWettbewerbSampleProject())).toBe(text);
|
||||
expect(parseProjectFile(text).ok).toBe(true);
|
||||
if (process.env.WB_OUT) writeFileSync(process.env.WB_OUT, text);
|
||||
});
|
||||
|
||||
it("drei Geschosse mit Wänden, Decken, Treppen, Flachdach und Räumen", () => {
|
||||
const floors = p.drawingLevels.filter((l) => l.kind === "floor" && !l.layoutId).map((l) => l.id);
|
||||
expect(floors).toEqual(["eg", "og1", "og2"]);
|
||||
for (const f of floors) {
|
||||
expect(p.walls.filter((w) => w.floorId === f && w.isExternal).length).toBe(4);
|
||||
expect(p.rooms!.filter((r) => r.floorId === f).length).toBe(10);
|
||||
}
|
||||
expect(p.ceilings!.length).toBe(3);
|
||||
expect(p.roofs![0].shape).toBe("flach");
|
||||
expect(p.stairs!.length).toBe(2);
|
||||
expect(p.rooms!.length).toBe(30);
|
||||
});
|
||||
|
||||
it("Grundrisse, Schnitte und Ansichten rechnen", async () => {
|
||||
for (const l of p.drawingLevels.filter((x) => x.kind === "floor" && !x.layoutId)) {
|
||||
expect(generatePlan(p, l.id, codes, undefined, "mittel", false, false, true, 200).primitives.length, l.id).toBeGreaterThan(50);
|
||||
}
|
||||
for (const l of p.drawingLevels.filter((x) => x.kind === "section")) {
|
||||
const o = await computeSection(p, l);
|
||||
expect(o, l.id).not.toBeNull();
|
||||
expect(generateSectionPlan(o!, false, { visibleCodes: codes, openings: true, scaleDenominator: 200 }).primitives.length, l.id).toBeGreaterThan(50);
|
||||
}
|
||||
for (const l of p.drawingLevels.filter((x) => x.kind === "elevation")) {
|
||||
expect(generateElevationPlan(p, l, { scaleDenominator: 200 })?.primitives.length ?? 0, l.id).toBeGreaterThan(50);
|
||||
}
|
||||
expect(projectToModel3d(p).walls.length).toBeGreaterThan(30);
|
||||
});
|
||||
|
||||
it("Baurecht: Parzelle, Grenzabstände, Gesamthöhe; Gebäude steht innerhalb", () => {
|
||||
expect(p.siteRules?.parcel.length).toBe(4);
|
||||
expect(p.siteRules?.maxHeight).toBe(12);
|
||||
expect(p.parcelArea).toBe(880);
|
||||
expect(p.geoAnchor?.lv95.e).toBeGreaterThan(2_000_000);
|
||||
const r = checkSiteRules(p) as { violations?: unknown[] } | null;
|
||||
expect(r).toBeTruthy();
|
||||
expect(r!.violations ?? []).toEqual([]);
|
||||
});
|
||||
|
||||
it("Kennzahlen und Raumprogramm", () => {
|
||||
const k = computeKennzahlen(p);
|
||||
expect(k.gf).toBeGreaterThan(600);
|
||||
expect(k.gf).toBeLessThan(800);
|
||||
expect(p.roomProgram!.length).toBe(7);
|
||||
// Soll und Ist liegen im gleichen Rahmen: Wohnungen 6 ×.
|
||||
expect(p.rooms!.filter((r) => r.name === "Wohnen/Essen").length).toBe(6);
|
||||
});
|
||||
|
||||
it("Präsentationsplan A1 mit Grundrissen, Ansichten und Schnitt; Situation", () => {
|
||||
const sheet = p.layouts!.find((l) => l.name.includes("Präsentation"));
|
||||
expect(sheet?.paper).toBe("a1");
|
||||
expect(sheet!.viewports.length).toBe(3 + 4 + 1);
|
||||
expect(sheet!.viewports.every((v) => v.scaleDenominator === 200)).toBe(true);
|
||||
const sit = p.layouts!.find((l) => l.id === "lay-situation");
|
||||
expect(sit?.viewports[0].scaleDenominator).toBe(500);
|
||||
expect(p.viewSnapshots!.find((s) => s.id === "vs-situation")?.templateId).toBe("std-vt-situation-wbw");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,327 @@
|
||||
// „Wettbewerb": kleiner, plausibler Stand eines Wettbewerbsbeitrags für ein Mehrfamilienhaus (Schweiz, LV95) — die Vorlage
|
||||
// zur Kurzanleitung „Erster Wettbewerb mit Dossier" (`doc/KURZANLEITUNG.md`, [210]). Alle Schritte des Referenz-Ablaufs
|
||||
// ([206]) sind darin schon einmal gemacht: Parzelle mit Baurecht-Angaben, drei Geschosse mit Aussen- und Innenwänden,
|
||||
// Decken, Treppe, Flachdach, Räume mit Raumprogramm, Schnitte und Ansichten, Situation und ein Präsentationsplan A1.
|
||||
//
|
||||
// Erzeugt deterministisch (feste ids, Kern-Befehle mit festem Stempel); braucht den geladenen Rust-Kern wie
|
||||
// `sampleProjectComplex.ts`. Nur bestehende Modellfelder.
|
||||
//
|
||||
// Lage (x = Ost, y = Nord): Baukörper 20 × 12 m (Wandachsen), Treppenhaus in der Mitte (x 8–12), je eine Wohnung pro
|
||||
// Geschoss und Seite (West/Ost), Eingang von Norden (Strasse). EG = ±0.00 (= 441.30 m ü. M.), Geschosshöhe 3.00 m, Flachdach
|
||||
// mit Attika auf +9.00 m.
|
||||
|
||||
import type {
|
||||
CeilingType,
|
||||
DoorType,
|
||||
Drawing2D,
|
||||
Drawing2DGeom,
|
||||
DrawingLevel,
|
||||
Opening,
|
||||
Project,
|
||||
Room,
|
||||
RoomStamp,
|
||||
RoofType,
|
||||
SiaCategory,
|
||||
Vec2,
|
||||
Wall,
|
||||
WindowType,
|
||||
} from "./types";
|
||||
import { sampleProject } from "./sampleProject";
|
||||
import { withStandards } from "./standards";
|
||||
import { buildingsToMesh, type GeoFeature } from "../io/geoContext";
|
||||
import { applyOps, type CoreOp } from "../core/ops";
|
||||
import { withDocument } from "../core/document";
|
||||
import { presentationDefaults, presentationSheetOps } from "../plan/presentationSheet";
|
||||
|
||||
const P = (x: number, y: number): Vec2 => ({ x, y });
|
||||
const HA = 0.39 / 2;
|
||||
const L = (componentId: string, thickness: number) => ({ componentId, thickness });
|
||||
/** Geschosse: id, Name, Sockelhöhe. */
|
||||
const FLOORS = [
|
||||
{ id: "eg", name: "Erdgeschoss", z: 0 },
|
||||
{ id: "og1", name: "1. Obergeschoss", z: 3 },
|
||||
{ id: "og2", name: "2. Obergeschoss", z: 6 },
|
||||
] as const;
|
||||
const FH = 3.0;
|
||||
const W = 20;
|
||||
const D = 12;
|
||||
|
||||
const LEVELS: DrawingLevel[] = [
|
||||
...FLOORS.map((f, i): DrawingLevel => ({
|
||||
id: f.id, name: f.name, kind: "floor", visible: true, locked: false, floorHeight: FH, cutHeight: 1.0, baseElevation: f.z,
|
||||
...(i === 0 ? { zeroLevel: true } : {}), viewTop: FH, viewBottom: 0, viewDepth: i === 0 ? -0.5 : -0.3,
|
||||
})),
|
||||
{ id: "schnitt-a", name: "Schnitt A-A", kind: "section", visible: true, locked: false, linePoints: [P(10, -10), P(10, 20)], directionSign: 1, levelMarks: true },
|
||||
{ id: "schnitt-b", name: "Schnitt B-B", kind: "section", visible: true, locked: false, linePoints: [P(-8, 3.5), P(28, 3.5)], directionSign: 1, levelMarks: true },
|
||||
{ id: "ansicht-sued", name: "Ansicht Süd", kind: "elevation", visible: true, locked: false, linePoints: [P(-10, -12), P(30, -12)], directionSign: 1, shadows: true, levelMarks: true },
|
||||
{ id: "ansicht-ost", name: "Ansicht Ost", kind: "elevation", visible: true, locked: false, linePoints: [P(34, -8), P(34, 20)], directionSign: 1, shadows: true, levelMarks: true },
|
||||
{ id: "ansicht-nord", name: "Ansicht Nord", kind: "elevation", visible: true, locked: false, linePoints: [P(30, 24), P(-10, 24)], directionSign: 1, shadows: true, levelMarks: true },
|
||||
{ id: "ansicht-west", name: "Ansicht West", kind: "elevation", visible: true, locked: false, linePoints: [P(-14, 20), P(-14, -8)], directionSign: 1, shadows: true, levelMarks: true },
|
||||
];
|
||||
|
||||
const CEILING_TYPES: CeilingType[] = [
|
||||
{ id: "wb-ct-decke", name: "Geschossdecke Unterlagsboden, Trittschall, STB 37 cm", layers: [L("std-c-parkett", 0.015), L("std-c-zementestrich", 0.065), L("std-c-trittschall", 0.04), L("std-c-stahlbeton", 0.24), L("std-c-innenputz", 0.01)] },
|
||||
{ id: "wb-ct-bodenplatte", name: "Bodenplatte STB auf XPS", layers: [L("std-c-zementestrich", 0.08), L("std-c-xps", 0.12), L("std-c-stahlbeton", 0.25), L("std-c-kies", 0.1)] },
|
||||
];
|
||||
const ROOF_TYPES: RoofType[] = [{ id: "wb-rt-flach", name: "Flachdach Umkehrdach bekiest", layers: [L("std-c-kies", 0.06), L("std-c-xps", 0.18), L("std-c-stahlbeton", 0.22)] }];
|
||||
const WINDOW_TYPES: WindowType[] = [
|
||||
{
|
||||
id: "wb-fe", name: "Holz-Metall Dreh-Kipp", kind: "drehkipp", wingCount: 1, glazing: "dreifach", frameThickness: 0.08, frameDepth: 0.08, frameWidth: 0.08,
|
||||
insetFromFace: 0.18, insetFace: "aussen", rebateDepth: 0.05, lintelHeight: 0.22, sillBoard: "beide", defaultSillHeight: 0.9, defaultWidth: 1.2, defaultHeight: 1.4,
|
||||
},
|
||||
];
|
||||
const DOOR_TYPES: DoorType[] = [
|
||||
{ id: "wb-tu", name: "Wohnungstür", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.05, frameKind: "umfassungszarge", frameWidth: 0.05, defaultWidth: 0.9, defaultHeight: 2.1 },
|
||||
{ id: "wb-tu-haus", name: "Haustür Glas", kind: "dreh", leafCount: 1, leafStyle: "glas", glazingRatio: 0.4, frameThickness: 0.08, frameKind: "blockrahmen", frameWidth: 0.09, threshold: true, defaultWidth: 1.2, defaultHeight: 2.3 },
|
||||
];
|
||||
const STAIR_TYPES = [{ id: "wb-tr-beton", name: "Ortbetontreppe mit Geländer rechts", structure: "beton" as const, closedRisers: true, treadThickness: 0.03, nosing: 0.02, railing: "rechts" as const, defaultWidth: 1.1 }];
|
||||
|
||||
// ── Wände ───────────────────────────────────────────────────────────────────
|
||||
|
||||
const walls: Wall[] = [];
|
||||
const wall = (id: string, floorId: string, a: Vec2, b: Vec2, typeId: string, extra: Partial<Wall> = {}) =>
|
||||
walls.push({ id, type: "wall", floorId, categoryCode: "20", start: a, end: b, wallTypeId: typeId, height: FH, ...extra });
|
||||
for (const f of FLOORS) {
|
||||
const ext = { isExternal: true, loadBearing: true };
|
||||
// Aussenwände im Gegenuhrzeigersinn (aussen = rechts).
|
||||
wall(`${f.id}-aw-s`, f.id, P(0, 0), P(W, 0), "std-wt-aw-kompakt", ext);
|
||||
wall(`${f.id}-aw-o`, f.id, P(W, 0), P(W, D), "std-wt-aw-kompakt", ext);
|
||||
wall(`${f.id}-aw-n`, f.id, P(W, D), P(0, D), "std-wt-aw-kompakt", ext);
|
||||
wall(`${f.id}-aw-w`, f.id, P(0, D), P(0, 0), "std-wt-aw-kompakt", ext);
|
||||
// Treppenhauswände (tragend), Wohnungstrennwände Nord, Quertrennwand im Treppenhaus.
|
||||
wall(`${f.id}-iw-x8`, f.id, P(8, 0), P(8, D), "std-wt-iw-backstein", { loadBearing: true });
|
||||
wall(`${f.id}-iw-x12`, f.id, P(12, 0), P(12, D), "std-wt-iw-backstein", { loadBearing: true });
|
||||
wall(`${f.id}-iw-th`, f.id, P(8, 7), P(12, 7), "std-wt-iw-backstein");
|
||||
for (const [side, x0, x1, xz, xb] of [["w", 0, 8, 4, 4], ["o", 12, 20, 16, 16]] as const) {
|
||||
wall(`${f.id}-iw-${side}-y7`, f.id, P(x0, 7), P(x1, 7), "std-wt-iw-backstein");
|
||||
wall(`${f.id}-iw-${side}-zimmer`, f.id, P(xz, 7), P(xz, D), "std-wt-iw-backstein");
|
||||
// Bad/Diele: Wand zwischen Diele (Seite Treppenhaus) und Bad.
|
||||
const [bx0, bx1] = side === "w" ? [xb, 8] : [12, xb];
|
||||
wall(`${f.id}-iw-${side}-bad`, f.id, P(bx0, 9.5), P(bx1, 9.5), "std-wt-iw-backstein");
|
||||
}
|
||||
}
|
||||
|
||||
// ── Öffnungen ───────────────────────────────────────────────────────────────
|
||||
|
||||
const openings: Opening[] = [];
|
||||
let winNo = 0;
|
||||
let doorNo = 0;
|
||||
const win = (id: string, host: string, pos: number, w: number, h: number, sill: number) =>
|
||||
openings.push({ id, type: "opening", hostWallId: host, categoryCode: "21", kind: "window", typeId: "wb-fe", position: pos, width: w, height: h, sillHeight: sill, mark: `F${String(++winNo).padStart(2, "0")}`, uValue: 0.9, isExternal: true });
|
||||
const door = (id: string, host: string, typeId: string, pos: number, w: number, h: number, extra: Partial<Opening> = {}) =>
|
||||
openings.push({ id, type: "opening", hostWallId: host, categoryCode: "21", kind: "door", typeId, position: pos, width: w, height: h, sillHeight: 0, mark: `T${String(++doorNo).padStart(2, "0")}`, swing: "left", hinge: "start", ...extra });
|
||||
for (const f of FLOORS) {
|
||||
const i = f.id;
|
||||
// Süd: zwei Wohnräume je Seite, Treppenhaus. Ost/West-Wände laufen im Gegenuhrzeigersinn (Ost von Süd nach Nord, West von Nord nach Süd).
|
||||
for (const [n, pos] of [[1, 2.2], [2, 5.8], [3, 10], [4, 14.2], [5, 17.8]] as const) win(`${i}-f-s${n}`, `${i}-aw-s`, pos, n === 3 ? 1.2 : 1.6, 1.5, 0.9);
|
||||
win(`${i}-f-o1`, `${i}-aw-o`, 3.5, 1.8, 1.5, 0.9);
|
||||
win(`${i}-f-o2`, `${i}-aw-o`, 9.5, 1.2, 1.4, 0.9);
|
||||
win(`${i}-f-w1`, `${i}-aw-w`, 2.5, 1.2, 1.4, 0.9);
|
||||
win(`${i}-f-w2`, `${i}-aw-w`, 8.5, 1.8, 1.5, 0.9);
|
||||
// Nord (Position von Osten): Zimmer Ost x = 18, Bad Ost 14, Abstell/Eingang 10, Bad West 6, Zimmer West 2.
|
||||
win(`${i}-f-n1`, `${i}-aw-n`, 2, 1.2, 1.4, 0.9);
|
||||
win(`${i}-f-n2`, `${i}-aw-n`, 6, 0.6, 0.9, 1.3);
|
||||
win(`${i}-f-n4`, `${i}-aw-n`, 14, 0.6, 0.9, 1.3);
|
||||
win(`${i}-f-n5`, `${i}-aw-n`, 18, 1.2, 1.4, 0.9);
|
||||
if (i === "eg") door("eg-t-haus", "eg-aw-n", "wb-tu-haus", 10, 1.2, 2.3, { isExternal: true, uValue: 1.2, hinge: "end" });
|
||||
else win(`${i}-f-n3`, `${i}-aw-n`, 10, 1.2, 1.4, 0.9);
|
||||
door(`${i}-t-th`, `${i}-iw-th`, "wb-tu", 2, 1.0, 2.1);
|
||||
door(`${i}-t-wohnung-w`, `${i}-iw-x8`, "wb-tu", 3.5, 0.9, 2.1, { fireRating: "EI30" });
|
||||
door(`${i}-t-wohnung-o`, `${i}-iw-x12`, "wb-tu", 3.5, 0.9, 2.1, { fireRating: "EI30" });
|
||||
}
|
||||
|
||||
// ── Decken, Treppen, Dach ───────────────────────────────────────────────────
|
||||
|
||||
const slab = [P(-HA, -HA), P(W + HA, -HA), P(W + HA, D + HA), P(-HA, D + HA)];
|
||||
const HOLE = [P(9.4, 1.3), P(10.6, 1.3), P(10.6, 5.8), P(9.4, 5.8)];
|
||||
const ceilings: NonNullable<Project["ceilings"]> = [
|
||||
{ id: "c-bodenplatte", type: "ceiling", floorId: "eg", categoryCode: "30", outline: slab, wallTypeId: "", ceilingTypeId: "wb-ct-bodenplatte", top: { mode: "floor", floorId: "eg", offset: 0 }, loadBearing: true },
|
||||
{ id: "c-eg", type: "ceiling", floorId: "eg", categoryCode: "30", outline: slab, openings: [HOLE], wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
{ id: "c-og1", type: "ceiling", floorId: "og1", categoryCode: "30", outline: slab, openings: [HOLE], wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
];
|
||||
const stairs: NonNullable<Project["stairs"]> = ["eg", "og1"].map((f) => ({
|
||||
id: `tr-${f}`, type: "stair" as const, floorId: f, categoryCode: "40", shape: "straight" as const, typeId: "wb-tr-beton", start: P(10, 1.4), dir: P(0, 1), runLength: 4.3, width: 1.1, totalRise: FH, stepCount: 17,
|
||||
}));
|
||||
const roofs: NonNullable<Project["roofs"]> = [
|
||||
{
|
||||
id: "dach-flach", type: "roof", floorId: "og2", categoryCode: "31", outline: slab, shape: "flach", pitchDeg: 0, overhang: 0, ridgeAxis: "x", thickness: 0.46, roofTypeId: "wb-rt-flach",
|
||||
// Attika: Betonbrüstung 50 cm über der Dachhaut.
|
||||
parapetHeight: 0.5, parapetWidth: 0.2, parapetComponentId: "std-c-stahlbeton",
|
||||
},
|
||||
];
|
||||
|
||||
// ── Kataster, Kontext, Baurecht ─────────────────────────────────────────────
|
||||
|
||||
const PARCEL = [P(-6, -6), P(28, -7), P(29, 19), P(-5, 20)];
|
||||
|
||||
function cadastre(): Drawing2D[] {
|
||||
const d: Drawing2D[] = [];
|
||||
const add = (id: string, geom: Drawing2DGeom, extra: Partial<Drawing2D> = {}) =>
|
||||
d.push({ id, type: "drawing2d", levelId: "eg", categoryCode: "01", geom, lineStyleId: "std-ls-grundstueck", weightMm: 0.35, ...extra });
|
||||
add("kat-parzelle", { shape: "polyline", pts: PARCEL, closed: true });
|
||||
add("kat-nachbar-w", { shape: "polyline", pts: [P(-5, 20), P(-30, 21), P(-31, -5), P(-6, -6)], closed: false }, { weightMm: 0.25 });
|
||||
add("kat-nachbar-o", { shape: "polyline", pts: [P(28, -7), P(52, -8), P(53, 18), P(29, 19)], closed: false }, { weightMm: 0.25 });
|
||||
add("kat-nachbar-s", { shape: "line", a: P(-6, -6), b: P(-5, -28) }, { weightMm: 0.25 });
|
||||
add("kat-nachbar-s2", { shape: "line", a: P(28, -7), b: P(29, -29) }, { weightMm: 0.25 });
|
||||
// Strasse im Norden.
|
||||
add("str-rand-s", { shape: "line", a: P(-30, 21.5), b: P(52, 19.5) }, { categoryCode: "11", lineStyleId: "std-ls-voll", weightMm: 0.25 });
|
||||
add("str-rand-n", { shape: "line", a: P(-30, 27.5), b: P(52, 25.5) }, { categoryCode: "11", lineStyleId: "std-ls-voll", weightMm: 0.25 });
|
||||
add("str-achse", { shape: "line", a: P(-30, 24.5), b: P(52, 22.5) }, { categoryCode: "11", lineStyleId: "std-ls-strichpunkt", weightMm: 0.13 });
|
||||
const label = (id: string, at: Vec2, text: string, h = 0.6) => add(id, { shape: "text", at, text, height: h, angle: 0 }, { lineStyleId: undefined });
|
||||
label("kat-nr", P(8, -4), "Kat.-Nr. 1187 (880 m²)");
|
||||
label("kat-nr-w", P(-26, 6), "Kat.-Nr. 1186");
|
||||
label("kat-nr-o", P(36, 6), "Kat.-Nr. 1188");
|
||||
label("str-name", P(20, 23.2), "Hofwiesenstrasse", 0.8);
|
||||
[P(-2, -3), P(25, -3), P(26, 16)].forEach((c, i) => add(`baum-${i + 1}`, { shape: "circle", center: c, r: 1.8 + (i % 2) * 0.5 }, { categoryCode: "13", lineStyleId: "std-ls-voll", weightMm: 0.13 }));
|
||||
return d;
|
||||
}
|
||||
|
||||
function neighbours() {
|
||||
const b = (pts: Vec2[], height: number): GeoFeature => ({ category: "building", pts, closed: true, height });
|
||||
const mesh = buildingsToMesh(
|
||||
[
|
||||
b([P(-26, 0), P(-14, 0), P(-14, 10), P(-26, 10)], 9),
|
||||
b([P(36, 0), P(46, 0), P(46, 12), P(36, 12)], 9),
|
||||
b([P(-4, 32), P(24, 32), P(24, 40), P(-4, 40)], 12),
|
||||
],
|
||||
"Kataster (fiktiv)",
|
||||
);
|
||||
if (!mesh) throw new Error("Wettbewerb: Nachbargebäude nicht erzeugt");
|
||||
return { ...mesh, id: "nachbarn", name: "Nachbargebäude" };
|
||||
}
|
||||
|
||||
// ── Kern-Befehle ────────────────────────────────────────────────────────────
|
||||
|
||||
let stampSeq = 0;
|
||||
function runCmd(p: Project, level: string, cmd: string, req: Record<string, unknown>, cat = "20"): Project {
|
||||
const lvl = p.drawingLevels.find((l) => l.id === level);
|
||||
const ops = withDocument(p, (d) => d.cmdOps({
|
||||
cmd, ...req, ctx: { level, floorHeight: lvl?.floorHeight ?? null, cat, wallType: "std-wt-iw-backstein" }, stamp: `wb${++stampSeq}`,
|
||||
}));
|
||||
return ops.length ? applyOps(p, ops) : p;
|
||||
}
|
||||
|
||||
type RoomDef = [at: Vec2, key: string, name: string, sia: SiaCategory];
|
||||
const ROOMS_PER_FLOOR: RoomDef[] = [
|
||||
[P(4, 3.5), "01", "Wohnen/Essen", "HNF"],
|
||||
[P(2, 9.5), "02", "Zimmer", "HNF"],
|
||||
[P(6, 8.2), "03", "Diele", "HNF"],
|
||||
[P(6, 10.8), "04", "Bad", "NNF"],
|
||||
[P(16, 3.5), "05", "Wohnen/Essen", "HNF"],
|
||||
[P(18, 9.5), "06", "Zimmer", "HNF"],
|
||||
[P(14, 8.2), "07", "Diele", "HNF"],
|
||||
[P(14, 10.8), "08", "Bad", "NNF"],
|
||||
[P(10, 6.5), "09", "Treppenhaus", "VF"],
|
||||
[P(10, 9.5), "10", "Abstellraum", "NNF"],
|
||||
];
|
||||
|
||||
function addRooms(p: Project): Project {
|
||||
const prefix = { eg: "E", og1: "1", og2: "2" } as const;
|
||||
for (const f of FLOORS) {
|
||||
for (const [at, key, baseName, sia] of ROOMS_PER_FLOOR) {
|
||||
const name = f.id === "eg" && key === "10" ? "Eingang" : baseName;
|
||||
const cat: SiaCategory = f.id === "eg" && key === "10" ? "VF" : sia;
|
||||
const nr = `${prefix[f.id]}.${key}`;
|
||||
const lvl = p.drawingLevels.find((l) => l.id === f.id);
|
||||
const ops = withDocument(p, (d) => d.cmdOps({ cmd: "room", at: [at.x, at.y], ctx: { level: f.id, floorHeight: lvl?.floorHeight ?? null, cat: "60", wallType: "" }, stamp: `raum${nr}` }));
|
||||
const made = ops.find((o) => o.kind === "add" && o.collection === "rooms");
|
||||
if (!made || made.kind !== "add") throw new Error(`Wettbewerb: Raum ${nr} nicht erkannt`);
|
||||
const stamp: RoomStamp = { number: nr, name, showFloorArea: true, showUsage: false, roundingStep: 0.1 };
|
||||
const room = { ...(made.items[0] as unknown as Room), id: `raum-${nr}`, name, siaCategory: cat, stamp };
|
||||
p = applyOps(p, [{ kind: "add", collection: "rooms", items: [room as unknown as { id: string }] } as CoreOp]);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
const codesOf = (ls: Project["layers"]): string[] => ls.flatMap((l) => [l.code, ...codesOf(l.children ?? [])]);
|
||||
const visHidden = (hidden: string[]): Record<string, boolean> => Object.fromEntries(codesOf(sampleProject.layers).map((c) => [c, !hidden.includes(c)]));
|
||||
/** Klassen, die die Situation ausblendet (wie `standards.rs::SITUATION_HIDDEN`). */
|
||||
const SITUATION_HIDDEN = ["00", "07", "20", "21", "22", "25", "30", "35", "40", "50", "60", "80", "81", "82", "85", "90", "91", "99"];
|
||||
const LEVEL_VIS: Record<string, boolean> = Object.fromEntries(LEVELS.map((l) => [l.id, true]));
|
||||
const pxPerMeterAt = (scale: number) => Math.round(((96 / 25.4) * 1000) / scale * 100) / 100;
|
||||
|
||||
/** Wettbewerb — neues Projekt (braucht den geladenen Kern). */
|
||||
export function buildWettbewerbSampleProject(): Project {
|
||||
stampSeq = 0;
|
||||
const base: Project = {
|
||||
id: "wettbewerb",
|
||||
name: "Wettbewerb Hofwiesen",
|
||||
projectNumber: "2701",
|
||||
lineStyles: [],
|
||||
hatches: [],
|
||||
components: [],
|
||||
wallTypes: [],
|
||||
ceilingTypes: CEILING_TYPES,
|
||||
roofTypes: ROOF_TYPES,
|
||||
windowTypes: WINDOW_TYPES,
|
||||
doorTypes: DOOR_TYPES,
|
||||
stairTypes: STAIR_TYPES,
|
||||
drawingLevels: LEVELS,
|
||||
layers: sampleProject.layers,
|
||||
scaleLineWeights: true,
|
||||
walls,
|
||||
openings,
|
||||
ceilings,
|
||||
roofs,
|
||||
stairs,
|
||||
rooms: [],
|
||||
drawings2d: cadastre(),
|
||||
context: [neighbours()],
|
||||
// Raumprogramm des Wettbewerbs (Soll); die Räume im Modell liefern das Ist.
|
||||
roomProgram: [
|
||||
{ name: "Wohnen/Essen", siaCategory: "HNF", area: 50, count: 6, group: "Wohnungen", note: "je Wohnung" },
|
||||
{ name: "Zimmer", siaCategory: "HNF", area: 20, count: 6, group: "Wohnungen" },
|
||||
{ name: "Diele", siaCategory: "HNF", area: 8, count: 6, group: "Wohnungen" },
|
||||
{ name: "Bad", siaCategory: "NNF", area: 8, count: 6, group: "Nasszellen" },
|
||||
{ name: "Treppenhaus", siaCategory: "VF", area: 25, count: 3, group: "Erschliessung" },
|
||||
{ name: "Eingang", siaCategory: "VF", area: 18, count: 1, group: "Erschliessung" },
|
||||
{ name: "Abstellraum", siaCategory: "NNF", area: 17, count: 2, group: "Nebenräume" },
|
||||
],
|
||||
roomProgramTolerance: 0.1,
|
||||
parcelArea: 880,
|
||||
sunStudy: { when: "2027-03-21T14:00:00Z", show: true },
|
||||
siteRules: {
|
||||
parcel: PARCEL,
|
||||
// Grenzabstände je Parzellenkante (Süd, Ost, Nord/Strasse, West).
|
||||
setbacks: [4, 4, 5, 4], defaultSetback: 4,
|
||||
maxHeight: 12, show: true, show3d: true,
|
||||
},
|
||||
referenceElevationMasl: 441.3,
|
||||
geoAnchor: { lv95: { e: 2697450, n: 1261800 }, height: 441.3, model: P(0, 0), label: "Hofwiesenstrasse, 8400 Winterthur (fiktiv)" },
|
||||
};
|
||||
|
||||
// Standard-Bibliothek SIA 400 (Baustoffe, Schraffuren, Linientypen, Aufbauten, Ansichtsvorlagen).
|
||||
let p = withStandards(base);
|
||||
p = addRooms(p);
|
||||
// Aussenbemassung (Massketten je Fassade), Klasse „81 Auto-Bemassung" (Befehl `autodim`).
|
||||
for (const f of FLOORS) p = runCmd(p, f.id, "autodim", {}, "80");
|
||||
|
||||
// Ansichten der Abgabe: Situation 1:500 (Standard-Vorlage) und Schnitte/Ansichten ohne Nachbargebäude.
|
||||
const noNeighbours = visHidden(["12"]);
|
||||
const snap = (id: string, name: string, level: string, scale: number, center: Vec2, extra: Record<string, unknown> = {}) => ({
|
||||
id, name, viewType: "grundriss" as const, view3d: "iso" as const, scaleDenominator: scale, detail: "mittel" as const, activeLevelId: level,
|
||||
layerVisibility: visHidden(["12"]), drawingVisibility: LEVEL_VIS, cameraCenter: center, cameraPxPerMeter: pxPerMeterAt(scale), ...extra,
|
||||
});
|
||||
p = {
|
||||
...p,
|
||||
viewSnapshots: [
|
||||
snap("vs-situation", "Situation 1:500", "eg", 500, P(10, 6), { detail: "grob", templateId: "std-vt-situation-wbw", templateLinked: true, layerVisibility: visHidden(SITUATION_HIDDEN) }),
|
||||
snap("vs-schnitt-a", "Schnitt A-A", "schnitt-a", 200, P(8, 4.5), { layerVisibility: noNeighbours }),
|
||||
snap("vs-schnitt-b", "Schnitt B-B", "schnitt-b", 200, P(8, 4.5), { layerVisibility: noNeighbours }),
|
||||
],
|
||||
layouts: [
|
||||
{ id: "lay-situation", name: "Situation 1:500", paper: "a3", orientation: "landscape", planNumber: "001", viewports: [{ id: "vp-situation", snapshotId: "vs-situation", xMm: 20, yMm: 20, widthMm: 380, heightMm: 260, scaleDenominator: 500 }] },
|
||||
],
|
||||
};
|
||||
|
||||
// Präsentationsplan A1 (Mappe → Präsentationsplan): Grundrisse, Ansichten und Schnitt A-A im gemeinsamen Massstab 1:200.
|
||||
const res = presentationSheetOps(
|
||||
p,
|
||||
{ ...presentationDefaults(p), scale: 200 },
|
||||
{ sheetName: "Präsentationsplan", masterName: "Planrahmen A1 quer", north: "N", northGroup: "Nordpfeil", scaleBarGroup: "Massstabsbalken" },
|
||||
"wb",
|
||||
);
|
||||
if (!res) throw new Error("Wettbewerb: Präsentationsplan nicht erzeugt");
|
||||
return applyOps(p, res.ops);
|
||||
}
|
||||
+18
-1
@@ -16,6 +16,7 @@ import { useEffect, useRef } from "react";
|
||||
import { isTauriRuntime } from "./projectFile";
|
||||
import { t } from "../i18n";
|
||||
import { openRenderDialog } from "../state/renderDialogHook";
|
||||
import { openShortcutOverview } from "../state/shortcutOverviewHook";
|
||||
import { openImageExportDialog } from "../state/imageExportDialogHook";
|
||||
import { APP_VERSION } from "../ui/TopBar";
|
||||
import type { View3d, ViewType } from "../model/viewTypes";
|
||||
@@ -26,6 +27,7 @@ export interface NativeAppMenuHandlers {
|
||||
onNewProject: () => void;
|
||||
onNewProjectFromSample: () => void;
|
||||
onNewProjectFromComplexSample: () => void;
|
||||
onNewProjectFromWettbewerbSample: () => void;
|
||||
onNewProjectFromTemplate: () => void;
|
||||
onOpenProject: () => void;
|
||||
onSaveProject: () => void;
|
||||
@@ -174,6 +176,10 @@ export function useNativeAppMenu(
|
||||
text: t("menu.native.newFromComplexSample"),
|
||||
action: () => handlersRef.current.onNewProjectFromComplexSample(),
|
||||
}),
|
||||
await MenuItem.new({
|
||||
text: t("menu.native.newFromWettbewerbSample"),
|
||||
action: () => handlersRef.current.onNewProjectFromWettbewerbSample(),
|
||||
}),
|
||||
await MenuItem.new({
|
||||
text: t("menu.native.newFromTemplateFile"),
|
||||
action: () => handlersRef.current.onNewProjectFromTemplate(),
|
||||
@@ -486,6 +492,17 @@ export function useNativeAppMenu(
|
||||
],
|
||||
});
|
||||
|
||||
// [210] Hilfe → Tastaturkürzel (Overlay-Dialog in der App).
|
||||
const helpMenu = await Submenu.new({
|
||||
text: t("menu.help"),
|
||||
items: [
|
||||
await MenuItem.new({
|
||||
text: t("menu.help.shortcuts"),
|
||||
action: () => openShortcutOverview(),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
// macOS: der allererste Eintrag ist das App-Menü (Über/Beenden). Ohne ihn
|
||||
// rutscht „Datei" an die Stelle, an der macOS sonst den App-Namen zeigt.
|
||||
// „Über dossier" nutzt das NATIVE macOS-Info-Fenster (PredefinedMenuItem
|
||||
@@ -518,7 +535,7 @@ export function useNativeAppMenu(
|
||||
|
||||
if (disposed) return;
|
||||
const menu = await Menu.new({
|
||||
items: [appMenu, fileMenu, editMenu, viewMenu, windowMenu],
|
||||
items: [appMenu, fileMenu, editMenu, viewMenu, windowMenu, helpMenu],
|
||||
});
|
||||
await menu.setAsAppMenu();
|
||||
})().catch((e) => {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildShortcutOverview } from "./shortcutOverview";
|
||||
import { ALIASES, COMMANDS } from "../commands/registry";
|
||||
import { SHORTCUT_DEFS } from "./keyboardShortcuts";
|
||||
import { t } from "../i18n";
|
||||
import type { TranslationKey } from "../i18n";
|
||||
|
||||
describe("[210] Kürzel-Übersicht", () => {
|
||||
const ov = buildShortcutOverview({}, {}, true);
|
||||
|
||||
it("listet jede Tastenkombination der Registry genau einmal", () => {
|
||||
const n = ov.combos.reduce((s, g) => s + g.rows.length, 0);
|
||||
expect(n).toBe(SHORTCUT_DEFS.length);
|
||||
const undo = ov.combos.flatMap((g) => g.rows).find((r) => r.labelKey === "shortcut.undo");
|
||||
expect(undo?.combo).toBe("⌘Z");
|
||||
});
|
||||
|
||||
it("zeigt Nutzer-Kombinationen statt der Vorgabe", () => {
|
||||
const o = buildShortcutOverview({ undo: "mod+u" }, {}, false);
|
||||
expect(o.combos.flatMap((g) => g.rows).find((r) => r.labelKey === "shortcut.undo")?.combo).toBe("Strg+U");
|
||||
});
|
||||
|
||||
it("gruppiert die Befehlskürzel je Befehl, nur bekannte Befehle", () => {
|
||||
const wall = ov.commands.find((c) => c.name === "wall");
|
||||
expect(wall?.aliases).toContain("w");
|
||||
expect(wall?.aliases).toContain("wand");
|
||||
for (const c of ov.commands) expect(COMMANDS[c.name]).toBeDefined();
|
||||
for (const [alias, name] of Object.entries(ALIASES)) {
|
||||
if (!COMMANDS[name] || COMMANDS[alias]) continue;
|
||||
expect(ov.commands.find((c) => c.name === name)?.aliases).toContain(alias);
|
||||
}
|
||||
});
|
||||
|
||||
it("Nutzer-Kürzel überschreiben eingebaute und stehen zuerst", () => {
|
||||
const o = buildShortcutOverview({}, { w: "line", zz: "wall" }, true);
|
||||
expect(o.commands.find((c) => c.name === "line")?.aliases[0]).toBe("w");
|
||||
expect(o.commands.find((c) => c.name === "wall")?.aliases).not.toContain("w");
|
||||
expect(o.commands.find((c) => c.name === "wall")?.aliases[0]).toBe("zz");
|
||||
});
|
||||
|
||||
it("alle Beschriftungen sind übersetzt", () => {
|
||||
for (const g of ov.combos) for (const r of g.rows) expect(t(r.labelKey as TranslationKey)).not.toBe(r.labelKey);
|
||||
for (const c of ov.commands) expect(t(c.labelKey as TranslationKey)).not.toBe(c.labelKey);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
// [210] Kürzel-Übersicht (Hilfe → Tastaturkürzel): leitet die Liste aus den echten Tabellen ab —
|
||||
// Tastenkombinationen aus `SHORTCUT_DEFS` (mit Nutzer-Übersteuerungen) und Befehlskürzel aus der Befehls-
|
||||
// Registry (`ALIASES` + Nutzer-Kürzel). Nichts wird von Hand gepflegt; neue Kürzel erscheinen von selbst.
|
||||
// Reine Funktion (kein React), Anzeige in `ui/ShortcutOverviewDialog.tsx`.
|
||||
|
||||
import { ALIASES, COMMANDS } from "../commands/registry";
|
||||
import {
|
||||
SHORTCUT_DEFS,
|
||||
formatCombo,
|
||||
resolveCombo,
|
||||
type ShortcutCategory,
|
||||
type ShortcutOverrides,
|
||||
} from "./keyboardShortcuts";
|
||||
|
||||
export interface ComboRow {
|
||||
/** i18n-Key der Aktion (`shortcut.<id>`). */
|
||||
labelKey: string;
|
||||
/** Anzeige der Kombination, plattformabhängig (⌘⇧Z / Strg+Umschalt+Z). */
|
||||
combo: string;
|
||||
}
|
||||
|
||||
export interface ComboGroup {
|
||||
category: ShortcutCategory;
|
||||
rows: ComboRow[];
|
||||
}
|
||||
|
||||
export interface CommandRow {
|
||||
/** Befehlsname (englisch, wie in der Befehlszeile getippt). */
|
||||
name: string;
|
||||
/** i18n-Key der Befehlsbezeichnung. */
|
||||
labelKey: string;
|
||||
/** Alle Kürzel (Nutzer-Kürzel zuerst), die zu diesem Befehl führen. */
|
||||
aliases: string[];
|
||||
}
|
||||
|
||||
export interface ShortcutOverview {
|
||||
combos: ComboGroup[];
|
||||
commands: CommandRow[];
|
||||
}
|
||||
|
||||
const CATEGORY_ORDER: ShortcutCategory[] = ["general", "selection", "edit", "boolean", "transform", "group", "tools", "navigation"];
|
||||
|
||||
export function buildShortcutOverview(
|
||||
comboOverrides: ShortcutOverrides = {},
|
||||
aliasOverrides: Record<string, string> = {},
|
||||
mac?: boolean,
|
||||
): ShortcutOverview {
|
||||
const combos: ComboGroup[] = CATEGORY_ORDER.map((category) => ({
|
||||
category,
|
||||
rows: SHORTCUT_DEFS.filter((d) => d.category === category).map((d) => ({
|
||||
labelKey: d.labelKey,
|
||||
combo: formatCombo(resolveCombo(d.id, comboOverrides), mac),
|
||||
})),
|
||||
})).filter((g) => g.rows.length > 0);
|
||||
|
||||
// Nutzer-Kürzel überschreiben eingebaute mit gleichem Schlüssel (wie `resolveCommand`).
|
||||
const merged: Record<string, string> = { ...ALIASES, ...aliasOverrides };
|
||||
const byCommand = new Map<string, string[]>();
|
||||
for (const [alias, name] of Object.entries(merged)) {
|
||||
// Kürzel, die selbst ein Befehlsname sind, kommen nicht in die Liste (der Name gewinnt in `resolveCommand`).
|
||||
if (!COMMANDS[name] || COMMANDS[alias]) continue;
|
||||
const list = byCommand.get(name) ?? [];
|
||||
list.push(alias);
|
||||
byCommand.set(name, list);
|
||||
}
|
||||
const rank = (a: string) => (a in aliasOverrides ? 0 : 1);
|
||||
const commands: CommandRow[] = [...byCommand.entries()]
|
||||
.map(([name, aliases]) => ({
|
||||
name,
|
||||
labelKey: COMMANDS[name].labelKey as string,
|
||||
aliases: aliases.sort((a, b) => rank(a) - rank(b) || a.length - b.length || a.localeCompare(b)),
|
||||
}))
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
return { combos, commands };
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// [210] Modul-Hook: App registriert den Öffner der Kürzel-Übersicht (Hilfe → Tastaturkürzel); Menüs rufen ihn auf,
|
||||
// ohne an React/App gekoppelt zu sein (Muster `renderDialogHook`).
|
||||
|
||||
let opener: (() => void) | null = null;
|
||||
|
||||
/** App registriert hier den Öffner (oder hebt ihn beim Unmount auf). */
|
||||
export function setShortcutOverviewOpener(fn: (() => void) | null): void {
|
||||
opener = fn;
|
||||
}
|
||||
|
||||
/** Öffnet die Kürzel-Übersicht, falls App sie registriert hat. */
|
||||
export function openShortcutOverview(): void {
|
||||
opener?.();
|
||||
}
|
||||
@@ -87,6 +87,7 @@ export function useNativeMenu(opts: {
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
onNewProjectFromWettbewerbSample,
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
@@ -114,6 +115,7 @@ export function useNativeMenu(opts: {
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
onNewProjectFromWettbewerbSample,
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
|
||||
@@ -43,6 +43,7 @@ import type { LockInfo } from "../native/projectFile";
|
||||
import { addRecentProject, removeRecentProject } from "./recentProjects";
|
||||
import { emptyProject, sampleProject } from "../model/sampleProject";
|
||||
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
import { buildWettbewerbSampleProject } from "../model/sampleProjectWettbewerb";
|
||||
import { withStandards } from "../model/standards";
|
||||
import type { Project } from "../model/types";
|
||||
import type { PlanViewHandle } from "../views/plan/PlanView";
|
||||
@@ -460,6 +461,14 @@ export function useProjectFileActions(
|
||||
getState().loadProject(next);
|
||||
lastSavedProjectRef.current = next;
|
||||
});
|
||||
// [210] „Neu aus Vorlage: Wettbewerb" — Mehrfamilienhaus mit Baurecht, Raumprogramm, Schnitten und Präsentationsplan
|
||||
// (model/sampleProjectWettbewerb.ts), Vorlage zur Kurzanleitung; frisch erzeugt (Kern-Befehle).
|
||||
const onNewProjectFromWettbewerbSample = () => guardDiscard(() => {
|
||||
releaseCurrentProjectLock();
|
||||
const next = buildWettbewerbSampleProject();
|
||||
getState().loadProject(next);
|
||||
lastSavedProjectRef.current = next;
|
||||
});
|
||||
// „Neu aus Vorlage: Datei wählen…" — native `.obpt`-Dialog unter Tauri, sonst
|
||||
// das versteckte `<input type=file>` (projectTemplateFileInputRef).
|
||||
const onNewProjectFromTemplate = () => {
|
||||
@@ -722,6 +731,7 @@ export function useProjectFileActions(
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
onNewProjectFromWettbewerbSample,
|
||||
onNewProjectFromTemplate,
|
||||
onProjectTemplateFileChosen,
|
||||
releaseCurrentProjectLock,
|
||||
|
||||
@@ -30,6 +30,7 @@ import { LockConflictDialog } from "./LockConflictDialog";
|
||||
import { PresentationDialogHost } from "./PresentationDialog";
|
||||
import { RenderDialogHost } from "./RenderDialog";
|
||||
import { ImageExportDialogHost } from "./ImageExportDialog";
|
||||
import { ShortcutOverviewDialogHost } from "./ShortcutOverviewDialog";
|
||||
import { PromptDialog } from "./PromptDialog";
|
||||
import { RecoverAutosaveDialog } from "./RecoverAutosaveDialog";
|
||||
import { ResourceManager, type ResourceManagerHandlers } from "./ResourceManager";
|
||||
@@ -163,6 +164,8 @@ export function AppDialogs(props: {
|
||||
<RenderDialogHost />
|
||||
{/* [223] 3D-Bild exportieren (Befehl `bild3d`, Menü Ansicht) */}
|
||||
<ImageExportDialogHost />
|
||||
{/* [210] Kürzel-Übersicht (Menü Hilfe) */}
|
||||
<ShortcutOverviewDialogHost />
|
||||
{importState && (
|
||||
<ImportDialog
|
||||
fileName={importState.fileName}
|
||||
|
||||
@@ -12,6 +12,7 @@ import type { DropdownItem } from "./Dropdown";
|
||||
import { t } from "../i18n";
|
||||
import type { View3d, ViewType } from "../model/viewTypes";
|
||||
import { openRenderDialog } from "../state/renderDialogHook";
|
||||
import { openShortcutOverview } from "../state/shortcutOverviewHook";
|
||||
import { openImageExportDialog } from "../state/imageExportDialogHook";
|
||||
|
||||
export interface AppMenuBarProps {
|
||||
@@ -19,6 +20,7 @@ export interface AppMenuBarProps {
|
||||
onNewProject: () => void;
|
||||
onNewProjectFromSample: () => void;
|
||||
onNewProjectFromComplexSample: () => void;
|
||||
onNewProjectFromWettbewerbSample: () => void;
|
||||
onNewProjectFromTemplate: () => void;
|
||||
onOpenProject: () => void;
|
||||
onSaveProject: () => void;
|
||||
@@ -65,6 +67,7 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
onNewProjectFromWettbewerbSample,
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
@@ -98,6 +101,7 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
{ label: t("file.new"), onSelect: onNewProject },
|
||||
{ label: t("file.newFromSample"), onSelect: onNewProjectFromSample },
|
||||
{ label: t("file.newFromComplexSample"), onSelect: onNewProjectFromComplexSample },
|
||||
{ label: t("file.newFromWettbewerbSample"), onSelect: onNewProjectFromWettbewerbSample },
|
||||
{ label: t("file.newFromTemplateFile"), onSelect: onNewProjectFromTemplate },
|
||||
{ divider: true },
|
||||
{ label: t("file.open"), onSelect: onOpenProject },
|
||||
@@ -177,6 +181,8 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
{ label: t("menu.window.settings"), onSelect: onOpenSettings },
|
||||
];
|
||||
|
||||
const helpItems: DropdownItem[] = [{ label: t("menu.help.shortcuts"), onSelect: openShortcutOverview }];
|
||||
|
||||
return (
|
||||
<div className="tb-menubar" role="menubar">
|
||||
<Dropdown
|
||||
@@ -203,6 +209,12 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
title={t("menu.window")}
|
||||
triggerClassName="tb-menubar-item"
|
||||
/>
|
||||
<Dropdown
|
||||
items={helpItems}
|
||||
placeholder={t("menu.help")}
|
||||
title={t("menu.help")}
|
||||
triggerClassName="tb-menubar-item"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,92 @@
|
||||
// [210] Overlay-Dialog „Tastaturkürzel" (Menü Hilfe): alle Tastenkombinationen und Befehlskürzel, abgeleitet aus den
|
||||
// Registries (`state/shortcutOverview.ts`), samt Nutzer-Übersteuerungen aus den Einstellungen. Kein window.alert.
|
||||
|
||||
import { memo, useEffect, useMemo, useState } from "react";
|
||||
import { t, type TranslationKey } from "../i18n";
|
||||
import { setShortcutOverviewOpener } from "../state/shortcutOverviewHook";
|
||||
import { buildShortcutOverview } from "../state/shortcutOverview";
|
||||
import { loadShortcutOverrides } from "../state/keyboardShortcuts";
|
||||
import { loadAliasOverrides } from "../state/commandAliasOverrides";
|
||||
|
||||
export const ShortcutOverviewDialogHost = memo(function ShortcutOverviewDialogHost() {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [filter, setFilter] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
setShortcutOverviewOpener(() => {
|
||||
setFilter("");
|
||||
setOpen(true);
|
||||
});
|
||||
return () => setShortcutOverviewOpener(null);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") setOpen(false);
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [open]);
|
||||
|
||||
const overview = useMemo(() => (open ? buildShortcutOverview(loadShortcutOverrides(), loadAliasOverrides()) : null), [open]);
|
||||
if (!open || !overview) return null;
|
||||
|
||||
const q = filter.trim().toLowerCase();
|
||||
const tr = (k: string) => t(k as TranslationKey);
|
||||
const combos = overview.combos
|
||||
.map((g) => ({ ...g, rows: g.rows.filter((r) => !q || tr(r.labelKey).toLowerCase().includes(q) || r.combo.toLowerCase().includes(q)) }))
|
||||
.filter((g) => g.rows.length > 0);
|
||||
const commands = overview.commands.filter(
|
||||
(c) => !q || c.name.includes(q) || tr(c.labelKey).toLowerCase().includes(q) || c.aliases.some((a) => a.toLowerCase().includes(q)),
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="imp-overlay" onClick={() => setOpen(false)}>
|
||||
<div className="imp-dialog" role="dialog" aria-modal="true" aria-label={t("help.shortcuts.title")} data-testid="shortcut-overview" onClick={(e) => e.stopPropagation()}>
|
||||
<header className="imp-head">
|
||||
<span className="imp-head-title">{t("help.shortcuts.title")}</span>
|
||||
<button className="imp-close" onClick={() => setOpen(false)} aria-label={t("export.close")}>
|
||||
×
|
||||
</button>
|
||||
</header>
|
||||
<div className="imp-body" style={{ maxHeight: "70vh", overflowY: "auto" }}>
|
||||
<p className="imp-note">{t("help.shortcuts.intro")}</p>
|
||||
<input
|
||||
className="imp-input"
|
||||
type="search"
|
||||
autoFocus
|
||||
value={filter}
|
||||
placeholder={t("help.shortcuts.filter")}
|
||||
aria-label={t("help.shortcuts.filter")}
|
||||
onChange={(e) => setFilter(e.target.value)}
|
||||
/>
|
||||
<section className="imp-section">
|
||||
<div className="imp-section-title">{t("help.shortcuts.keys")}</div>
|
||||
{combos.map((g) => (
|
||||
<div className="settings-shortcut-category" key={g.category}>
|
||||
<div className="settings-shortcut-category-title">{tr(`settings.keyboardShortcuts.category.${g.category}`)}</div>
|
||||
{g.rows.map((r) => (
|
||||
<div className="settings-alias-row" key={r.labelKey}>
|
||||
<span style={{ flex: 1 }}>{tr(r.labelKey)}</span>
|
||||
<kbd>{r.combo}</kbd>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
<section className="imp-section">
|
||||
<div className="imp-section-title">{t("help.shortcuts.commands")}</div>
|
||||
<p className="imp-note">{t("help.shortcuts.commandsHint")}</p>
|
||||
{commands.map((c) => (
|
||||
<div className="settings-alias-row" key={c.name}>
|
||||
<span style={{ flex: 1 }}>{tr(c.labelKey)}</span>
|
||||
<kbd>{c.aliases.join(" · ")}</kbd>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
@@ -28,6 +28,7 @@ export type TopBarEvents = Required<
|
||||
| "onNewProject"
|
||||
| "onNewProjectFromSample"
|
||||
| "onNewProjectFromComplexSample"
|
||||
| "onNewProjectFromWettbewerbSample"
|
||||
| "onNewProjectFromTemplate"
|
||||
| "onOpenProject"
|
||||
| "onSaveProject"
|
||||
@@ -128,6 +129,7 @@ export function useTopBarElements(opts: {
|
||||
onNewProject={ev.onNewProject}
|
||||
onNewProjectFromSample={ev.onNewProjectFromSample}
|
||||
onNewProjectFromComplexSample={ev.onNewProjectFromComplexSample}
|
||||
onNewProjectFromWettbewerbSample={ev.onNewProjectFromWettbewerbSample}
|
||||
onNewProjectFromTemplate={ev.onNewProjectFromTemplate}
|
||||
onOpenProject={ev.onOpenProject}
|
||||
onSaveProject={ev.onSaveProject}
|
||||
|
||||
Reference in new issue
Block a user