[285] Plakat: Massstab-Vorschlag im Dialog, Situation um die eigene Parzelle, Wohnungsspiegel auf dem Plakat
Massstab: der Dialog bietet den feineren Massstab (finerPresentationScale, nicht unter 1:100) mit Knopf an, statt nur nach dem Anlegen zu melden; kleinste Lösung, Anordnung/Spaltenraster bleibt. Situation: Ausschnitt = Haus ∪ Parzellenring (Baurecht) ± 10 m statt Haus ± 40 m, damit nicht alle Kataster-Parzellen als Kacheln erscheinen; ohne Parzelle Haus ± 30 m. Wohnungsspiegel (unitSchedule) als Plakat-Tabelle, wenn das Projekt Einheiten hat.
This commit is contained in:
10 files changed
+109
-13
No files matched your search
@@ -55,7 +55,7 @@ Raumprogramm gegen Modell → Grundrisse/Schnitte/Ansichten 1:200 (Vorprojekt 1:
|
||||
Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
|
||||
- ◐ **[266]** Wettbewerb einmal ganz durchgespielt (16.11., Chromium/Linux, Bilder `doc/review-266/`); alle Befunde behoben bis auf: GV (18.11., `flaechen.rs`): Studienkörper (frei, ≥ 9 m² Grundfläche und ≥ 2.4 m hoch) zählen, aber nur ausserhalb der Geschossgrundrisse (innerhalb sonst doppelt); Bodenplatte = Decke unter dem untersten Geschoss zählt von ihrer UK bis Fertigboden (SIA 416: untere Begrenzung = Unterseite der untersten Bodenkonstruktion; Fundamente/Kies/Magerbeton nicht) — FRAGE: SIA-416-Wortlaut zu Fundamenten/Sauberkeitsschicht nicht im Repo, gegen die Norm prüfen; Schwellen 9 m²/2.4 m sind Annahmen (Alternative: Merkmal „Gebäudekörper" am Körper); Aufstockungen über dem Haus als Geschoss modellieren, nicht als Körper. Offen: Innenhöfe ohne Dach werden im Dachraum gefüllt (`core/building_volume.rs`); Tabellen wandern aufs 2. Blatt trotz freier Spalten oben (`presentation_poster.rs`); Schnittmarken im Plakat: Marken ungewählter Schnitte erscheinen mit, Linien > 40 mm Papier vom Haus beschnitten, beim Blatt ohne Plakat keine Marken; Plakat-Grundrisse zeigen alle Bemassungsketten statt nur Gesamtmass; Situation: eigenständige Layouts „Situation WBW“ setzen Nordpfeil/Massstab weiter unter die Lage, Kataster-Gebäude unter eigenem Fussabdruck nicht ausgeblendet; Wendeltreppen und Treppen nach unten/Teilhöhe bekommen kein Deckenloch automatisch (`stair_hole_ops`, `cmd_solid.rs`); 3D-Dokument ([266]/12, `plan/axo.rs`): nicht auf dem Mac geprüft (passt die Zeichnung zur 3D-Kamera?), kein eigener Reiter (nur Blatt-Viewport), kein Live-Schnitt, Fenster als Löcher ohne Rahmen/Glas, keine Rückseiten verdeckter Flächen, Gelände nicht, Kontext-Netze nur mit `context`, Flächen < 1/1200 Bildbreite ungetönt. Nicht geprüft: Tauri-App/Mac (Metal, 3D-Bild, Schatten, Rendering), Mausbedienung, Druck des A1-Plakats, DXF/IFC in Fremdsoftware. · M
|
||||
- ◐ **[285]** Referenz-Ablauf zum zweiten Mal durchgespielt (18.11., Chromium/Linux, Haus 18 × 11 m, 2 Geschosse, 4 Wohnungen, Bilder `doc/review-285/`; nicht auf dem Mac, kein 3D-Live/Rendering/Druck). Behoben: Gesamthöhe (Baurecht, Kennzahlen) zählt die Attika (`site_rules.rs` `model_top`; vorher 5.80 statt Oberkante Attika, Ansicht zeigte +6.30; `KURZANLEITUNG` „Höhe 9.50" nicht neu geprüft). Offen, nach Schritt: Baurecht: Meldung „Gebäude innerhalb der zulässigen Fläche" steht grün schon ohne Bauteil (`panels/SiteRulesSection.tsx`) · S. Volumen: `decke` setzt die Decke immer oben ans aktive Geschoss, Bodenplatte unter EG und Balkonplatte brauchen je 6 Schritte in der Objekt-Info (OK/UK „Eigene"), kein Befehl/Option dafür (`cmds/ceiling.ts`) · S; `wand` hat keine Wandtyp-Option (Innenwände nachträglich umstellen) und setzt „Aussenbauteil"/„Tragend" nie, dadurch kein IsExternal an Aussenwänden im IFC und U-Wert „unvollständig (4 Schicht(en) ohne λ)" für den Standardaufbau (`cmds/wall.ts`, Standard-Wandtypen) · S; Zeichnungsebene „kataster" liegt im Arbeitsgrundriss über den neuen Wänden (Kataster-Gebäude deckt sie zu, bis man die Ebene ausblendet) · S; Fenster-Befehl: eine Zahl bei „Position entlang der Wand (Abstand tippen)" setzt stillschweigend die Breite (3 m statt Abstand 3 m, `cmds/opening.ts`) · S; Rampe: falsche Richtung (Anfang aussen, +6 %) hebt die Rampe über Geschosshöhe ohne Hinweis (`cmds/ramp.ts`) · S. Räume/Einheiten: `raum` legt je Aufruf nur einen Raum an, Name/Nutzung/Kategorie je Raum einzeln (10 Räume ≈ 40 Eingaben) · M; Einheit löschen/verschieben lässt leere Einheiten („0 Zi · 0.0 m²") und zählt Nummern weiter (Whg 5, 6) · S; Statusleiste: Feld „Ebene" zeigt die Klasse („20 Wände"), „Geschoss" die Zeichnungsebene (Bezeichnungen nach [180] vereinheitlichen, `ui/StatusBar.tsx`) · S; Projektname bleibt „Leeres Projekt" (Titel von Plakat/Spiegel), bis er im Mappe-Panel gesetzt wird · S. Abgabe: Präsentationsplan A1 quer lässt bei 18 m Hauslänge über die Hälfte leer (Vorgabe 1:200, Tabellen fix unten rechts, Spalten fix; „automatisch" wäre ≈ 1:100) · M; Wohnungsspiegel fehlt auf dem Plakat (nur Kennzahlen + Baurecht, `presentation_poster.rs`) · S; Situation auf dem Plakat zeigt alle vier Kataster-Parzellen als kleine Kacheln statt Ausschnitt um die eigene · M; Axo: Bäume fehlen (Entourage-Objekte da), Rampe/Haustür auf der abgewandten Seite nicht zu sehen (`plan/axo.rs`) · S. Geprüft ok: Kataster-Import und Baurecht-Zahlen (484 m² zulässig, AZ 0.41, ÜZ 0.23), GV mit Bodenplatte (686.8 = 603.5 + 83.3 m³), Wohnungsspiegel CSV/SVG, Kosten (1'094 CHF/m³), Plakat anonym (Kennwort im Titel, Projektname nirgends im PDF), PDF-Ebenen (17 OCG), IFC (Geländer, Träger, Rampe, Treppe, Dach, Räume), DXF. Nicht durchgespielt: Umbau (Abbruch Kataster-Bestand) und Varianten (nur Hinweise „noch kein Variantensatz"/„Zuerst Bauteile wählen" gesehen), Rendering-Fenster, Mac. · M
|
||||
- ◐ **[285]** Referenz-Ablauf zum zweiten Mal durchgespielt (18.11., Chromium/Linux, Haus 18 × 11 m, 2 Geschosse, 4 Wohnungen, Bilder `doc/review-285/`; nicht auf dem Mac, kein 3D-Live/Rendering/Druck). Behoben: Gesamthöhe (Baurecht, Kennzahlen) zählt die Attika (`site_rules.rs` `model_top`; vorher 5.80 statt Oberkante Attika, Ansicht zeigte +6.30; `KURZANLEITUNG` „Höhe 9.50" nicht neu geprüft). Offen, nach Schritt: Baurecht: Meldung „Gebäude innerhalb der zulässigen Fläche" steht grün schon ohne Bauteil (`panels/SiteRulesSection.tsx`) · S. Volumen: `decke` setzt die Decke immer oben ans aktive Geschoss, Bodenplatte unter EG und Balkonplatte brauchen je 6 Schritte in der Objekt-Info (OK/UK „Eigene"), kein Befehl/Option dafür (`cmds/ceiling.ts`) · S; `wand` hat keine Wandtyp-Option (Innenwände nachträglich umstellen) und setzt „Aussenbauteil"/„Tragend" nie, dadurch kein IsExternal an Aussenwänden im IFC und U-Wert „unvollständig (4 Schicht(en) ohne λ)" für den Standardaufbau (`cmds/wall.ts`, Standard-Wandtypen) · S; Zeichnungsebene „kataster" liegt im Arbeitsgrundriss über den neuen Wänden (Kataster-Gebäude deckt sie zu, bis man die Ebene ausblendet) · S; Fenster-Befehl: eine Zahl bei „Position entlang der Wand (Abstand tippen)" setzt stillschweigend die Breite (3 m statt Abstand 3 m, `cmds/opening.ts`) · S; Rampe: falsche Richtung (Anfang aussen, +6 %) hebt die Rampe über Geschosshöhe ohne Hinweis (`cmds/ramp.ts`) · S. Räume/Einheiten: `raum` legt je Aufruf nur einen Raum an, Name/Nutzung/Kategorie je Raum einzeln (10 Räume ≈ 40 Eingaben) · M; Einheit löschen/verschieben lässt leere Einheiten („0 Zi · 0.0 m²") und zählt Nummern weiter (Whg 5, 6) · S; Statusleiste: Feld „Ebene" zeigt die Klasse („20 Wände"), „Geschoss" die Zeichnungsebene (Bezeichnungen nach [180] vereinheitlichen, `ui/StatusBar.tsx`) · S; Projektname bleibt „Leeres Projekt" (Titel von Plakat/Spiegel), bis er im Mappe-Panel gesetzt wird · S. Abgabe (18.11. behoben, `presentation_sheet.rs`/`presentationSheet.ts`/`PresentationDialog.tsx`: Dialog bietet feineren Massstab (≥ 1:100) mit Knopf an, wenn er aufs Blatt passt; Situation = Parzelle (`siteRules.parcel`) ∪ Haus ± 10 m statt Haus ± 40 m, ohne Parzelle ± 30 m; Wohnungsspiegel als dritte Plakat-Tabelle bei Projekten mit Einheiten (`posterExtrasDefault`); nur Chromium/Vitest geprüft, Prüfbild `doc/review-285/r4-plakat-nachher.png` ist eine Rahmen-Skizze der Anordnung, kein gerenderter Plan; Tabellen füllen das Blatt weiter nur rechts neben der letzten Zeile, bei 3 Tabellen im Beispiel 2. Blatt; Axo-Bild bleibt auf die Grösse des grössten Grundrisses begrenzt) · Axo: Bäume fehlen (Entourage-Objekte da), Rampe/Haustür auf der abgewandten Seite nicht zu sehen (`plan/axo.rs`) · S. Geprüft ok: Kataster-Import und Baurecht-Zahlen (484 m² zulässig, AZ 0.41, ÜZ 0.23), GV mit Bodenplatte (686.8 = 603.5 + 83.3 m³), Wohnungsspiegel CSV/SVG, Kosten (1'094 CHF/m³), Plakat anonym (Kennwort im Titel, Projektname nirgends im PDF), PDF-Ebenen (17 OCG), IFC (Geländer, Träger, Rampe, Treppe, Dach, Räume), DXF. Nicht durchgespielt: Umbau (Abbruch Kataster-Bestand) und Varianten (nur Hinweise „noch kein Variantensatz"/„Zuerst Bauteile wählen" gesehen), Rendering-Fenster, Mac. · M
|
||||
- ◐ **[270]** Blickrichtungen überall gleich (3D-Spiegelung behoben, Marken weichen aus; 17.11.). Offen: 3D-Bild nur numerisch (Kameramatrix, Pick-Strahl) geprüft, kein Bild aus render3d unter Linux, nicht auf dem Mac/Metal (`doc/RELEASE-1.0.md` 13.36); natives Spike-Fenster `src-tauri/src/native.rs` (Orbit-Richtung) nicht angepasst. · M
|
||||
- ◐ **[279]** Geländer als eigenes Bauteil (18.11.; Lücke 7 `doc/VERGLEICH-1.0.md`; Linux/Chromium, nicht auf dem Mac geprüft): Modell, Grundriss, Schnitt/Ansicht/3D, IFC, DXF, Befehl `gelaender` umgesetzt (`railing.rs`, `plan/railings.rs`). Nachgeführt 18.11.: Glas in Ansicht und 3D-Dokument durchscheinend (helle Füllung wie Fensterglas, Deckkraft 0.4, verdeckt nichts; Schnitt unverändert), Objektfang auf Achse (und Längskanten dicker Brüstungen), Schatten der Sonnenstudie (Prismen aus `railing::pieces`, ab 400 Teilen ohne Stäbe/Pfosten). Offen: Lochblech ohne Lochmuster; Handlauf über Schnitthöhe im Grundriss nicht eigens gestrichelt; kein IfcRailing-Import; Loggia-Brüstung an Wänden bleibt Wand. · M
|
||||
- ◐ **[278]** Nutzungseinheiten und Wohnungsspiegel (17.11.; Lücke 6; nicht auf dem Mac geprüft): `unit_schedule.rs`, Panel Flächenbilanz „Nutzungseinheiten“, CLI `--wohnungsspiegel` umgesetzt. Offen: Einheiten im Grundriss als farbige Fläche/Stempel auf eigener Klasse ([180]; `Unit.color` ist da); Summen je Typ/Geschoss nicht als eigene Blatt-Tabelle; Mindestfläche Zimmer und NWF nach kantonaler Definition fehlen; Einheit nicht in IFC/DXF; Spiegel im schmalen Dock als Karten. · M
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -318,8 +318,11 @@ pub const PLAN_MARGIN_MM: f64 = 20.0;
|
||||
pub const MARKS_MARGIN_MM: f64 = 12.0;
|
||||
/// [266] So weit (Papier-mm) darf der Ausschnitt eines Grundrisses wegen der Marken höchstens über die Bauteile hinauswachsen.
|
||||
pub const MARKS_REACH_MM: f64 = 40.0;
|
||||
/// [208] Rand um das Haus im Situationsplan (Papier-mm; 1:500 ⇒ 40 m Umgebung).
|
||||
pub const SITUATION_MARGIN_MM: f64 = 80.0;
|
||||
/// [208] Rand um das Haus im Situationsplan (Papier-mm; 1:500 ⇒ 30 m Umgebung), wenn keine Parzelle bekannt ist.
|
||||
pub const SITUATION_MARGIN_MM: f64 = 60.0;
|
||||
/// [285] Rand um Baufeld (Parzelle samt Haus) im Situationsplan (Papier-mm; 1:500 ⇒ 10 m): der Ausschnitt zeigt die eigene Parzelle
|
||||
/// mit einem Streifen Nachbarschaft und Strasse, nicht alle Parzellen des Katasters als Kacheln.
|
||||
pub const SITUATION_PARCEL_MARGIN_MM: f64 = 20.0;
|
||||
|
||||
/// [208] Ausschnitt eines Inhalts (Modell-Meter): das Ausmass `b`, beschnitten auf die Bauteile `house` ± `margin`;
|
||||
/// ohne Bauteile (Schnitt/Ansicht) das ganze Ausmass.
|
||||
@@ -333,6 +336,17 @@ pub fn crop(b: [f64; 4], house: Option<[f64; 4]>, margin: f64) -> [f64; 4] {
|
||||
}
|
||||
}
|
||||
|
||||
/// [285] Baufeld des Situationsplans (Modell-Meter) und sein Rand (Papier-mm): Haus ∪ Parzellenring, mit dem kleineren Rand um
|
||||
/// die Parzelle; ohne brauchbare Parzelle das Haus mit dem grösseren Rand.
|
||||
fn situation_focus(house: Option<[f64; 4]>, parcel: Option<&[crate::model::Vec2]>) -> (Option<[f64; 4]>, f64) {
|
||||
let pts: Vec<&crate::model::Vec2> = parcel.into_iter().flatten().filter(|q| q.x.is_finite() && q.y.is_finite()).collect();
|
||||
if pts.len() < 3 {
|
||||
return (house, SITUATION_MARGIN_MM);
|
||||
}
|
||||
let bb = pts.iter().fold([f64::MAX, f64::MAX, f64::MIN, f64::MIN], |m, q| [m[0].min(q.x), m[1].min(q.y), m[2].max(q.x), m[3].max(q.y)]);
|
||||
(Some(union(house, bb)), SITUATION_PARCEL_MARGIN_MM)
|
||||
}
|
||||
|
||||
fn union(a: Option<[f64; 4]>, b: [f64; 4]) -> [f64; 4] {
|
||||
match a {
|
||||
Some(a) => [a[0].min(b[0]), a[1].min(b[1]), a[2].max(b[2]), a[3].max(b[3])],
|
||||
@@ -446,7 +460,9 @@ fn poster_plan(p: &Project, req: &Request, po: &PosterReq, sheet: &Sheet, kept:
|
||||
if !b.iter().all(|v| v.is_finite()) {
|
||||
return None;
|
||||
}
|
||||
let mut f = Frame::of(crop(b, house, SITUATION_MARGIN_MM * s.scale / 1000.0), s.scale);
|
||||
// [285] Baufeld = Haus ∪ Parzellenring der Baurecht-Angaben (sonst nur das Haus).
|
||||
let (focus, margin_mm) = situation_focus(house, p.site_rules.as_ref().map(|r| r.parcel.as_slice()));
|
||||
let mut f = Frame::of(crop(b, focus, margin_mm * s.scale / 1000.0), s.scale);
|
||||
// Höchstens die halbe Breite und knapp die halbe Höhe des Satzspiegels; beschnitten bleibt das Haus in der Mitte.
|
||||
let (max_w, max_h) = (g.span_w(g.cols.div_ceil(2)) - 2.0 * FRAME_PAD_MM, (g.height() - g.band) * 0.45 - 2.0 * FRAME_PAD_MM);
|
||||
let hc = house.map(|h| ((h[0] + h[2]) / 2.0, (h[1] + h[3]) / 2.0));
|
||||
@@ -535,6 +551,23 @@ fn poster_plan(p: &Project, req: &Request, po: &PosterReq, sheet: &Sheet, kept:
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn situation_baufeld_parzelle_mit_kleinem_rand() {
|
||||
let v = |x: f64, y: f64| crate::model::Vec2 { x, y };
|
||||
let house = Some([10.0, 10.0, 28.0, 21.0]);
|
||||
// Ohne Parzelle: Haus mit dem grossen Rand.
|
||||
assert_eq!(situation_focus(house, None), (house, SITUATION_MARGIN_MM));
|
||||
assert_eq!(situation_focus(house, Some(&[v(0.0, 0.0), v(1.0, 0.0)])), (house, SITUATION_MARGIN_MM));
|
||||
// Mit Parzelle: Haus ∪ Parzelle, kleiner Rand.
|
||||
let ring = [v(0.0, 0.0), v(40.0, 0.0), v(40.0, 30.0), v(0.0, 30.0)];
|
||||
let (f, m) = situation_focus(house, Some(&ring));
|
||||
assert_eq!(f, Some([0.0, 0.0, 40.0, 30.0]));
|
||||
assert_eq!(m, SITUATION_PARCEL_MARGIN_MM);
|
||||
// Ausmass (Kataster mit vier Parzellen, 200 m breit) wird auf Parzelle ± 10 m beschnitten.
|
||||
let c = crop([-100.0, -100.0, 100.0, 100.0], f, m * 500.0 / 1000.0);
|
||||
assert_eq!(c, [-10.0, -10.0, 50.0, 40.0]);
|
||||
}
|
||||
|
||||
fn inside(r: &Rect, s: &Sheet) -> bool {
|
||||
r.x_mm >= MARGIN_MM - 1e-9
|
||||
&& r.y_mm >= MARGIN_MM - 1e-9
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ export { AI_TOOLS, AI_BRIDGE_DEFAULT_PORT, aiText, aiToolDef, hmacHex, randomHex
|
||||
export type { AiToolDef, AiToolResult, AiBridgeMsg } from "./aiToolDefs";
|
||||
export { callAiTool } from "./aiTools";
|
||||
export type { AiHost } from "./aiTools";
|
||||
export { PRESENTATION_SCALES, POSTER_EXTRAS_DEFAULT, POSTER_SITUATION_SCALE, PRESENTATION_DEFAULT_SCALE, levelHasContent, PRESENTATION_TEMPLATE_ID, presentationDefaults, presentationSheetOps, planPresentationSheet, fittingPresentationScale, finerPresentationScale } from "../plan/presentationSheet";
|
||||
export { PRESENTATION_SCALES, POSTER_EXTRAS_DEFAULT, posterExtrasDefault, POSTER_SITUATION_SCALE, PRESENTATION_DEFAULT_SCALE, levelHasContent, PRESENTATION_TEMPLATE_ID, presentationDefaults, presentationSheetOps, planPresentationSheet, fittingPresentationScale, finerPresentationScale } from "../plan/presentationSheet";
|
||||
export type { PresentationOptions, PosterExtras, PosterTableKind, PresentationPlan, PresentationLabels } from "../plan/presentationSheet";
|
||||
export { lineEndsOf, lineEndsCode, lineEndsFromCode, lineEndsSvgAttrs, planLineEndsProps, MITER_LIMIT as LINE_MITER_LIMIT } from "../model/lineEnds";
|
||||
export type { LineEnds } from "../model/lineEnds";
|
||||
|
||||
@@ -4196,9 +4196,13 @@ export const de = {
|
||||
"presentation.extras.areas": "Kennzahlen (SIA 416)",
|
||||
"presentation.extras.siteProof": "Baurecht-Nachweis",
|
||||
"presentation.extras.image": "Rahmen fürs 3D-Bild",
|
||||
"presentation.extras.units": "Wohnungsspiegel",
|
||||
"presentation.situation": "Situation",
|
||||
"presentation.table.areas": "Kennzahlen (SIA 416)",
|
||||
"presentation.table.siteProof": "Baurecht-Nachweis",
|
||||
"presentation.table.units": "Wohnungsspiegel",
|
||||
"presentation.finerSuggest": "Tipp: 1:{finer} passt auch aufs Blatt und füllt es besser als 1:{scale}",
|
||||
"presentation.finerApply": "1:{finer} übernehmen",
|
||||
"presentation.image.placeholder": "3D-Bild hier einsetzen",
|
||||
"presentation.image.hint": "Rendering-Dialog: „Ins Layout einsetzen“, oder Knopf „Bild“ im Blatt",
|
||||
"presentation.axo": "Axonometrie",
|
||||
|
||||
@@ -4182,9 +4182,13 @@ export const en: Record<TranslationKey, string> = {
|
||||
"presentation.extras.areas": "Key figures (SIA 416)",
|
||||
"presentation.extras.siteProof": "Zoning compliance",
|
||||
"presentation.extras.image": "Frame for the 3D image",
|
||||
"presentation.extras.units": "Unit schedule",
|
||||
"presentation.situation": "Site plan",
|
||||
"presentation.table.areas": "Key figures (SIA 416)",
|
||||
"presentation.table.siteProof": "Zoning compliance",
|
||||
"presentation.table.units": "Unit schedule",
|
||||
"presentation.finerSuggest": "Tip: 1:{finer} also fits and fills the sheet better than 1:{scale}",
|
||||
"presentation.finerApply": "Use 1:{finer}",
|
||||
"presentation.image.placeholder": "Insert 3D image here",
|
||||
"presentation.image.hint": "Rendering dialog: \"Insert into layout\", or the \"Image\" button on the sheet",
|
||||
"presentation.axo": "Axonometric",
|
||||
|
||||
@@ -5,7 +5,7 @@ import { generatePlan } from "./generatePlan";
|
||||
import { getState } from "../state/appStore";
|
||||
import { sheetSizeMm } from "../model/layoutModel";
|
||||
import { posterMetrics } from "../model/posterTemplates";
|
||||
import { finerPresentationScale, fittingPresentationScale, POSTER_EXTRAS_DEFAULT, PRESENTATION_TEMPLATE_ID, levelHasContent, planPresentationSheet, presentationDefaults, presentationSheetOps } from "./presentationSheet";
|
||||
import { finerPresentationScale, fittingPresentationScale, POSTER_EXTRAS_DEFAULT, posterExtrasDefault, PRESENTATION_TEMPLATE_ID, levelHasContent, planPresentationSheet, presentationDefaults, presentationSheetOps } from "./presentationSheet";
|
||||
import type { Project } from "../model/types";
|
||||
|
||||
const LABELS = {
|
||||
@@ -17,6 +17,7 @@ const LABELS = {
|
||||
situation: "Situation",
|
||||
tableAreas: "Kennzahlen (SIA 416)",
|
||||
tableSiteProof: "Baurecht-Nachweis",
|
||||
tableUnits: "Wohnungsspiegel",
|
||||
imagePlaceholder: "3D-Bild hier einsetzen",
|
||||
imageHint: "Hinweis",
|
||||
};
|
||||
@@ -467,4 +468,34 @@ describe("[66] Präsentationsplan", () => {
|
||||
expect(finerPresentationScale(p, { ...o, scale: 100 })).toBeNull();
|
||||
expect(finerPresentationScale(p, { ...o, paper: "a4" as const, scale: 50 })).toBeNull();
|
||||
}, 60_000);
|
||||
|
||||
// [285] Plakat: Situation um Baufeld statt alle Kataster-Parzellen, Wohnungsspiegel, Vorschlag 1:100.
|
||||
it("[285] Situation: Ausschnitt um die eigene Parzelle mit Rand, nicht um das ganze Ausmass", () => {
|
||||
st().loadProject(buildWettbewerbSampleProject());
|
||||
const p = st().project;
|
||||
const ring = p.siteRules!.parcel;
|
||||
const w = Math.max(...ring.map((q) => q.x)) - Math.min(...ring.map((q) => q.x));
|
||||
const h = Math.max(...ring.map((q) => q.y)) - Math.min(...ring.map((q) => q.y));
|
||||
const o = { ...presentationDefaults(p), scale: 200, poster: "poster-a1-landscape", extras: POSTER_EXTRAS_DEFAULT };
|
||||
const sit = planPresentationSheet(p, o).items.find((i) => i.kind === "situation")!;
|
||||
// Parzelle ± 10 m bei 1:500 (Papier-mm = Meter × 2) plus Rahmenrand 2 × 4 mm; weiter reicht der Ausschnitt nicht.
|
||||
expect(sit.widthMm).toBeLessThanOrEqual((w + 20) * 2 + 8 + 1e-6);
|
||||
expect(sit.heightMm).toBeLessThanOrEqual((h + 20) * 2 + 8 + 1e-6);
|
||||
}, 60_000);
|
||||
|
||||
it("[285] Wohnungsspiegel kommt aufs Plakat, wenn das Projekt Einheiten hat", () => {
|
||||
st().loadProject(buildWettbewerbSampleProject());
|
||||
const p = st().project;
|
||||
expect(p.units!.length).toBeGreaterThan(0);
|
||||
const ex = posterExtrasDefault(p);
|
||||
expect(ex.tables).toEqual(["areas", "siteProof", "unitSchedule"]);
|
||||
const plan = planPresentationSheet(p, { ...presentationDefaults(p), scale: 200, poster: "poster-a1-landscape", extras: ex });
|
||||
expect(plan.tables!.map((t) => t.id)).toEqual(["areas", "siteProof", "unitSchedule"]);
|
||||
const res = presentationSheetOps(p, { ...presentationDefaults(p), scale: 200, poster: "poster-a1-landscape", extras: ex }, LABELS, "u1")!;
|
||||
st().applyChange(res.ops);
|
||||
const sources = st().project.layouts!.filter((l) => res.layoutIds.includes(l.id)).flatMap((l) => (l.tables ?? []).map((t) => t.source));
|
||||
expect(sources).toEqual(["areas", "siteProof", "unitSchedule"]);
|
||||
// Ohne Einheiten keine Tabelle.
|
||||
expect(posterExtrasDefault({ ...p, units: [] }).tables).toEqual(["areas", "siteProof"]);
|
||||
}, 60_000);
|
||||
});
|
||||
@@ -61,7 +61,7 @@ export interface PresentationOptions {
|
||||
}
|
||||
|
||||
/** Kennzahlen (SIA 416) und Baurecht-Nachweis als Blatt-Tabellen. */
|
||||
export type PosterTableKind = "areas" | "siteProof";
|
||||
export type PosterTableKind = "areas" | "siteProof" | "unitSchedule";
|
||||
|
||||
export interface PosterExtras {
|
||||
/** Situationsplan 1:500 (Vorlage „Situation WBW“, Nordpfeil und Massstabsbalken aus der Modelldarstellung). */
|
||||
@@ -73,6 +73,10 @@ export interface PosterExtras {
|
||||
|
||||
/** Vorgabe beim Wählen einer Plakat-Vorlage: alles, was zu einer Wettbewerbs-Abgabe gehört. */
|
||||
export const POSTER_EXTRAS_DEFAULT: PosterExtras = { situation: true, tables: ["areas", "siteProof"], image: true };
|
||||
/** [285] Vorgabe je Projekt: mit Einheiten (Wohnungen) gehört der Wohnungsspiegel zum Plakat. */
|
||||
export function posterExtrasDefault(project: Project): PosterExtras {
|
||||
return (project.units ?? []).length > 0 ? { ...POSTER_EXTRAS_DEFAULT, tables: [...POSTER_EXTRAS_DEFAULT.tables, "unitSchedule"] } : { ...POSTER_EXTRAS_DEFAULT };
|
||||
}
|
||||
/** Massstab der Situation auf dem Plakat. */
|
||||
export const POSTER_SITUATION_SCALE = 500;
|
||||
/** Id der Standard-Ansichtsvorlage „Situation WBW 1:500“ und ihrer Modelldarstellung (`standards.rs`). */
|
||||
@@ -146,6 +150,8 @@ export interface PresentationLabels {
|
||||
situation?: string;
|
||||
tableAreas?: string;
|
||||
tableSiteProof?: string;
|
||||
/** [285] Titel des Wohnungsspiegels. */
|
||||
tableUnits?: string;
|
||||
imagePlaceholder?: string;
|
||||
imageHint?: string;
|
||||
/** [266] Name des 3D-Dokuments (Axonometrie) im Bild-Rahmen. */
|
||||
@@ -673,7 +679,7 @@ export function presentationSheetOps(
|
||||
const fontPt = posterTextMetrics(size).tablePt;
|
||||
for (const tb of plan.tables ?? []) {
|
||||
const lvl = sheetLevels[tb.page].id;
|
||||
const title = tb.id === "areas" ? labels.tableAreas : labels.tableSiteProof;
|
||||
const title = tb.id === "areas" ? labels.tableAreas : tb.id === "unitSchedule" ? labels.tableUnits : labels.tableSiteProof;
|
||||
if (title) drawings.push(sheetText(`d-pres-${stamp}-tt-${tb.id}`, lvl, cat, tb.xMm, tb.yMm + labelM.sizeMm * 1.1, title, labelM.sizeMm, true));
|
||||
tables[tb.page].push({
|
||||
id: `tbl-pres-${stamp}-${tb.id}`,
|
||||
|
||||
@@ -12,7 +12,7 @@ export function createPresentationSheet(o: PresentationOptions): string | null {
|
||||
const res = presentationSheetOps(
|
||||
st.project,
|
||||
o,
|
||||
{ sheetName: t("presentation.sheetName"), masterName: t("presentation.masterName", { format }), north: t("presentation.north"), northGroup: t("presentation.northGroup"), scaleBarGroup: t("presentation.scaleBarGroup"), situation: t("presentation.situation"), tableAreas: t("presentation.table.areas"), tableSiteProof: t("presentation.table.siteProof"), imagePlaceholder: t("presentation.image.placeholder"), imageHint: t("presentation.image.hint"), axo: t("presentation.axo") },
|
||||
{ sheetName: t("presentation.sheetName"), masterName: t("presentation.masterName", { format }), north: t("presentation.north"), northGroup: t("presentation.northGroup"), scaleBarGroup: t("presentation.scaleBarGroup"), situation: t("presentation.situation"), tableAreas: t("presentation.table.areas"), tableSiteProof: t("presentation.table.siteProof"), tableUnits: t("presentation.table.units"), imagePlaceholder: t("presentation.image.placeholder"), imageHint: t("presentation.image.hint"), axo: t("presentation.axo") },
|
||||
String(Date.now()),
|
||||
);
|
||||
if (!res) {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
// Layouts-Panel ihn öffnen. Beim Bestätigen entsteht das Blatt in EINEM Undo-Schritt
|
||||
// (`state/presentationSheet.ts`); `onCreated` öffnet es. Overlay wie `LayoutCreateDialogs` (kein window.prompt).
|
||||
|
||||
import { memo, useCallback, useEffect, useState } from "react";
|
||||
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import { enterConfirmsDialog, useModalFocus } from "./modalFocus";
|
||||
import { POSTER_EXTRAS_DEFAULT, PRESENTATION_SCALES, levelHasContent, presentationDefaults, type PosterTableKind, type PresentationOptions } from "../core";
|
||||
import { finerPresentationScale, posterExtrasDefault, PRESENTATION_SCALES, levelHasContent, presentationDefaults, type PosterTableKind, type PresentationOptions } from "../core";
|
||||
import type { LayoutOrientation, LayoutPaperFormat } from "../model/types";
|
||||
import { PAPER_FORMAT_GROUPS } from "../model/layoutModel";
|
||||
import { POSTER_TEMPLATES, posterTemplateLabel } from "../model/posterTemplates";
|
||||
@@ -52,6 +52,15 @@ export const PresentationDialogHost = memo(function PresentationDialogHost({
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [opts, close, confirm]);
|
||||
|
||||
// [285] Passt ein feinerer Massstab (≥ 1:100) auch aufs Blatt, wird er angeboten: sonst bleibt das Blatt eines kleinen Hauses halb leer.
|
||||
const finer = useMemo(() => {
|
||||
if (!opts?.scale || (opts.floors.length === 0 && opts.elevationIds.length === 0 && opts.sectionIds.length === 0)) return null;
|
||||
try {
|
||||
return finerPresentationScale(project, opts);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}, [project, opts]);
|
||||
if (!opts) return null;
|
||||
const floors = drawingLevels.filter((l) => l.kind === "floor" && !l.layoutId);
|
||||
const sections = drawingLevels.filter((l) => l.kind === "section");
|
||||
@@ -65,7 +74,7 @@ export const PresentationDialogHost = memo(function PresentationDialogHost({
|
||||
const toggleSection = (id: string, on: boolean) =>
|
||||
set({ sectionIds: sections.map((x) => x.id).filter((x) => (x === id ? on : opts.sectionIds.includes(x))) });
|
||||
const toggleTable = (kind: PosterTableKind, on: boolean): PosterTableKind[] =>
|
||||
(["areas", "siteProof"] as const).filter((k) => (k === kind ? on : (opts.extras?.tables ?? []).includes(k)));
|
||||
(["areas", "siteProof", "unitSchedule"] as const).filter((k) => (k === kind ? on : (opts.extras?.tables ?? []).includes(k)));
|
||||
const empty = opts.floors.length === 0 && opts.elevationIds.length === 0 && opts.sectionIds.length === 0;
|
||||
// [224] Massstab je Viewport: "" = gemeinsamer Massstab.
|
||||
const scaleOf = (id: string) => String(opts.scales?.[id] ?? "");
|
||||
@@ -158,7 +167,7 @@ export const PresentationDialogHost = memo(function PresentationDialogHost({
|
||||
data-testid="presentation-target"
|
||||
aria-label={t("presentation.sheet")}
|
||||
value={opts.poster ?? ""}
|
||||
onChange={(e) => set({ poster: e.target.value || undefined, extras: e.target.value ? (opts.extras ?? POSTER_EXTRAS_DEFAULT) : undefined })}
|
||||
onChange={(e) => set({ poster: e.target.value || undefined, extras: e.target.value ? (opts.extras ?? posterExtrasDefault(project)) : undefined })}
|
||||
>
|
||||
<option value="">{t("presentation.target.sheet")}</option>
|
||||
{POSTER_TEMPLATES.map((tpl) => (
|
||||
@@ -180,6 +189,14 @@ export const PresentationDialogHost = memo(function PresentationDialogHost({
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
{finer && (
|
||||
<div style={{ display: "flex", gap: 8, alignItems: "center", marginBottom: 6, fontSize: 12 }} data-testid="presentation-finer">
|
||||
<span>{t("presentation.finerSuggest", { scale: opts.scale!, finer })}</span>
|
||||
<button type="button" className="imp-btn" data-testid="presentation-finer-apply" onClick={() => set({ scale: finer })}>
|
||||
{t("presentation.finerApply", { finer })}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<div style={{ display: "flex", gap: 8, alignItems: "center", opacity: poster ? 0.5 : 1 }}>
|
||||
<select
|
||||
className="imp-select"
|
||||
@@ -218,6 +235,7 @@ export const PresentationDialogHost = memo(function PresentationDialogHost({
|
||||
["situation", t("presentation.extras.situation"), opts.extras.situation, (on: boolean) => ({ situation: on })],
|
||||
["areas", t("presentation.extras.areas"), opts.extras.tables.includes("areas"), (on: boolean) => ({ tables: toggleTable("areas", on) })],
|
||||
["siteProof", t("presentation.extras.siteProof"), opts.extras.tables.includes("siteProof"), (on: boolean) => ({ tables: toggleTable("siteProof", on) })],
|
||||
...((project.units ?? []).length > 0 ? ([["unitSchedule", t("presentation.extras.units"), opts.extras.tables.includes("unitSchedule"), (on: boolean) => ({ tables: toggleTable("unitSchedule", on) })]] as const) : []),
|
||||
["image", t("presentation.extras.image"), opts.extras.image, (on: boolean) => ({ image: on })],
|
||||
] as const
|
||||
).map(([key, label, on, patch]) => (
|
||||
|
||||
Reference in new issue
Block a user