[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:
Claude committed 2026-11-18 13:09:18 +00:00
1 parent ad75e410e3
commit 5116590751
10 files changed
+109 -13

No files matched your search

+32 -1
View File
@@ -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);
});
+8 -2
View File
@@ -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}`,