[208] Abgabe-Review: Plakat-Grundriss nicht mehr beschnitten (Schattenstudie, Vorlage im Rahmen), Massstab und Titel überlagern sich nicht; Befunde in TODO
This commit is contained in:
5 files changed
+71
-6
No files matched your search
@@ -96,6 +96,12 @@ export function posterHeaderItems(project: Project, layout: Layout, master: Mast
|
||||
return out === "" ? [] : (JSON.parse(out) as HeaderItem[]);
|
||||
}
|
||||
|
||||
/** Schrifthöhe und Abstand der Grundlinie unter dem Viewport-Rahmen (Papier-mm) der Massstabsangabe. */
|
||||
export function scaleLabelMetrics(sheet: { w: number; h: number }): { sizeMm: number; dyMm: number } {
|
||||
const sizeMm = Math.max(3, Math.min(sheet.w, sheet.h) / 140);
|
||||
return { sizeMm, dyMm: sizeMm * 1.3 };
|
||||
}
|
||||
|
||||
/** Massstabsangabe unter einem Viewport: Text, Lage (Papier-mm, Grundlinie) und Schrifthöhe. */
|
||||
export function viewportScaleLabel(
|
||||
project: Project,
|
||||
@@ -106,6 +112,6 @@ export function viewportScaleLabel(
|
||||
const snap = findSnapshot(project, vp.snapshotId);
|
||||
if (!snap) return null;
|
||||
const n = scaleOverride ?? resolveViewportScale(vp, snap);
|
||||
const sizeMm = Math.max(3, Math.min(sheet.w, sheet.h) / 140);
|
||||
return { text: `1:${n}`, x: vp.xMm, y: vp.yMm + vp.heightMm + sizeMm * 1.3, sizeMm };
|
||||
const { sizeMm, dyMm } = scaleLabelMetrics(sheet);
|
||||
return { text: `1:${n}`, x: vp.xMm, y: vp.yMm + vp.heightMm + dyMm, sizeMm };
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
import { buildWettbewerbSampleProject } from "../model/sampleProjectWettbewerb";
|
||||
import { generatePlan } from "./generatePlan";
|
||||
import { getState } from "../state/appStore";
|
||||
import { sheetSizeMm } from "../model/layoutModel";
|
||||
import { posterMetrics } from "../model/posterTemplates";
|
||||
@@ -130,4 +132,23 @@ describe("[66] Präsentationsplan", () => {
|
||||
const top = posterMetrics(841, 594).contentTopMm;
|
||||
for (const v of lay.viewports) expect(v.yMm).toBeGreaterThanOrEqual(top - 1e-6);
|
||||
}, 60_000);
|
||||
|
||||
// Abgabe-Review [208]: Der Rahmen eines Grundrisses muss den ganzen Inhalt umfassen, auch die Schattenstudie des Projekts
|
||||
// (Wettbewerb-Beispiel: Studie eingeschaltet) — sonst wird der Grundriss im Viewport links/oben beschnitten.
|
||||
it("[208] Rahmen der Grundrisse umfasst Inhalt samt Schattenstudie", () => {
|
||||
st().loadProject(buildWettbewerbSampleProject());
|
||||
const p = st().project;
|
||||
expect(p.sunStudy?.show).toBe(true);
|
||||
const o = { ...presentationDefaults(p), scale: 200, poster: "poster-a1-landscape" };
|
||||
const res = presentationSheetOps(p, o, LABELS, "t6")!;
|
||||
st().applyChange(res.ops);
|
||||
const q = st().project;
|
||||
const tpl = q.viewTemplates!.find((t) => t.id === PRESENTATION_TEMPLATE_ID)!;
|
||||
const show = new Set(Object.entries(q.viewSnapshots!.find((v) => v.id === "vs-pres-t6-0")!.layerVisibility).filter(([, v]) => v).map(([k]) => k));
|
||||
for (const it of res.plan.items.filter((i) => i.group === 0)) {
|
||||
const b = generatePlan(q, it.levelId, show, undefined, tpl.detail, false, true, true, 200, false, false).bounds;
|
||||
expect(it.widthMm).toBeGreaterThanOrEqual(((b.maxX - b.minX) * 1000) / 200 - 1e-6);
|
||||
expect(it.heightMm).toBeGreaterThanOrEqual(((b.maxY - b.minY) * 1000) / 200 - 1e-6);
|
||||
}
|
||||
}, 60_000);
|
||||
});
|
||||
@@ -25,7 +25,8 @@ import { documentFor } from "../core/document";
|
||||
import { addedItems, addItems, patchItem } from "../core/opsBuild";
|
||||
import { standardsMergeOps } from "../model/standards";
|
||||
import { createLayout, createMasterLayout, createSheetLevel, sheetMmToModel, sheetSizeMm } from "../model/layoutModel";
|
||||
import { createPosterMaster, findPosterMaster, posterMetrics, posterTemplate } from "../model/posterTemplates";
|
||||
import { SHADOW_CATEGORY } from "../model/derivedCategories";
|
||||
import { createPosterMaster, findPosterMaster, posterMetrics, posterTemplate, scaleLabelMetrics } from "../model/posterTemplates";
|
||||
|
||||
/** Id der Standard-Ansichtsvorlage „Präsentation" (`standards.rs`). */
|
||||
export const PRESENTATION_TEMPLATE_ID = "std-vt-praesentation";
|
||||
@@ -208,6 +209,7 @@ export function planPresentationSheet(project: Project, o: PresentationOptions):
|
||||
sheetH: size.h,
|
||||
titleBlock: !poster,
|
||||
shadows: template.shadows ?? false,
|
||||
template,
|
||||
...(o.scale ? { scale: o.scale } : {}),
|
||||
scales: o.scales ?? {},
|
||||
...(poster ? { marginMm: poster.marginMm, topMm: poster.contentTopMm } : {}),
|
||||
@@ -309,6 +311,7 @@ export function presentationSheetOps(
|
||||
const layout: Layout = { ...createLayout(layoutId, labels.sheetName, sheet.paper, sheet.orientation), masterId: master.id };
|
||||
const sheetLevel = createSheetLevel(`sheet-${layoutId}`, layout);
|
||||
const vis = presentationVisibility(project, template);
|
||||
const labelM = scaleLabelMetrics(sheetSizeMm(sheet.paper, sheet.orientation));
|
||||
const cat = annotationCategory(project);
|
||||
const byId = new Map(project.drawingLevels.map((l) => [l.id, l]));
|
||||
const snaps: ViewSnapshot[] = [];
|
||||
@@ -329,15 +332,21 @@ export function presentationSheetOps(
|
||||
scaleDenominator: it.scale,
|
||||
detail: template.detail ?? "mittel",
|
||||
activeLevelId: level.id,
|
||||
layerVisibility: vis,
|
||||
// Grundrisse ohne die Schattenstudie des Projekts (Klasse „Schatten"): ihr Wurf läge über den Rahmen hinaus und
|
||||
// würde beschnitten; die Schatten der Ansichten (Vorlage) bleiben.
|
||||
layerVisibility: it.group === 0 ? { ...vis, [SHADOW_CATEGORY]: false } : vis,
|
||||
drawingVisibility: {},
|
||||
...(template.enabledOverrideRuleIds ? { enabledOverrideRuleIds: [...template.enabledOverrideRuleIds] } : {}),
|
||||
templateId: template.id,
|
||||
templateLinked: true,
|
||||
} as ViewSnapshot);
|
||||
vps.push({ id: `vp-pres-${stamp}-${i}`, snapshotId: snapId, xMm: it.xMm, yMm: it.yMm, widthMm: it.widthMm, heightMm: it.heightMm, scaleDenominator: it.scale });
|
||||
// Plakat: die Massstabsangabe des Masters steht links unter dem Viewport (Grundlinie `scaleLabelMetrics`);
|
||||
// der Titel folgt rechts daneben auf derselben Linie, sonst überdecken sich beide.
|
||||
drawings.push(
|
||||
sheetText(`d-pres-${stamp}-t${i}`, sheetLevel.id, cat, it.xMm + FRAME_PAD_MM, it.yMm + it.heightMm + 6, tpl ? level.name : `${level.name} 1:${it.scale}`, 4, true),
|
||||
tpl
|
||||
? sheetText(`d-pres-${stamp}-t${i}`, sheetLevel.id, cat, it.xMm + labelM.sizeMm * 3.6, it.yMm + it.heightMm + labelM.dyMm, level.name, 4, true)
|
||||
: sheetText(`d-pres-${stamp}-t${i}`, sheetLevel.id, cat, it.xMm + FRAME_PAD_MM, it.yMm + it.heightMm + 6, `${level.name} 1:${it.scale}`, 4, true),
|
||||
);
|
||||
});
|
||||
// Nordpfeil rechts neben dem Titel des ersten Grundrisses.
|
||||
|
||||
Reference in new issue
Block a user