[323] CLI: Befehl sheet (Layout-Blatt/Präsentationsblatt/Plakat als SVG, headless); Präsentationsplan-Rahmen mit 8 mm Rand (Achskreise/Gesamtmass oben nicht mehr abgeschnitten); Review-Bilder
This commit is contained in:
15 files changed
+379
-32
No files matched your search
@@ -35,6 +35,27 @@ describe("[66] Präsentationsplan", () => {
|
||||
project = st().project;
|
||||
});
|
||||
|
||||
// [323] Achskreise und Masszahlen der Aussenbemassung ragen über das Plan-Ausmass hinaus: der Rahmen lässt 8 mm Rand, nicht 4.
|
||||
it("[323] Präsentationsplan: Rahmen der Grundrisse mit 8 mm Rand um das gemeinsame Ausmass", () => {
|
||||
const o = { ...presentationDefaults(project), scale: 200 };
|
||||
const plan = planPresentationSheet(project, o);
|
||||
const res = presentationSheetOps(project, o, LABELS, "p323")!;
|
||||
st().applyChange(res.ops);
|
||||
const q = st().project;
|
||||
let h = 0;
|
||||
let w = 0;
|
||||
for (const f of plan.items.filter((i) => q.drawingLevels.find((l) => l.id === i.levelId)?.kind === "floor")) {
|
||||
const snap = q.viewSnapshots!.find((v) => v.id === `vs-pres-p323-${plan.items.indexOf(f)}`)!;
|
||||
const vis = new Set(Object.entries(snap.layerVisibility).filter(([, v]) => v).map(([k]) => k));
|
||||
const b = generatePlan(q, f.levelId, vis, undefined, snap.detail, false, true, true, 200, false, false).bounds;
|
||||
h = Math.max(h, ((b.maxY - b.minY) * 1000) / 200);
|
||||
w = Math.max(w, ((b.maxX - b.minX) * 1000) / 200);
|
||||
}
|
||||
const eg = plan.items.find((i) => q.drawingLevels.find((l) => l.id === i.levelId)?.kind === "floor")!;
|
||||
expect(eg.heightMm).toBeGreaterThanOrEqual(h + 16 - 1e-6);
|
||||
expect(eg.widthMm).toBeGreaterThanOrEqual(w + 16 - 1e-6);
|
||||
});
|
||||
|
||||
it("Vorschlag: alle Geschosse, Ansichten, ein Schnitt, A1 quer (Master)", () => {
|
||||
const d = presentationDefaults(project);
|
||||
expect(d.floors.length).toBeGreaterThanOrEqual(4);
|
||||
|
||||
@@ -37,6 +37,8 @@ import { generateAxoPlan } from "./toAxo";
|
||||
export const PRESENTATION_TEMPLATE_ID = "std-vt-praesentation";
|
||||
/** Rand zwischen Inhalt und Rahmen (mm, wie `FRAME_PAD_MM` im Kern). */
|
||||
const FRAME_PAD_MM = 4;
|
||||
/** [323] Rand im Präsentationsplan ohne Plakat (`SHEET_PAD_MM` im Kern). */
|
||||
const SHEET_PAD_MM = 8;
|
||||
|
||||
export interface PresentationOptions {
|
||||
/** Geschosse (Ebenen der Art `floor`) in Blattreihenfolge. */
|
||||
@@ -661,7 +663,7 @@ export function presentationSheetOps(
|
||||
drawings.push(
|
||||
tpl
|
||||
? sheetText(`d-pres-${stamp}-t${i}`, sheetLevels[page].id, cat, it.xMm + labelM.sizeMm * 3.6, it.yMm + it.heightMm + labelM.dyMm, title, labelM.sizeMm, true)
|
||||
: sheetText(`d-pres-${stamp}-t${i}`, sheetLevels[page].id, cat, it.xMm + FRAME_PAD_MM, it.yMm + it.heightMm + 6, `${title} 1:${it.scale}`, 4, true),
|
||||
: sheetText(`d-pres-${stamp}-t${i}`, sheetLevels[page].id, cat, it.xMm + SHEET_PAD_MM, it.yMm + it.heightMm + 6, `${title} 1:${it.scale}`, 4, true),
|
||||
);
|
||||
});
|
||||
// Nordpfeil rechts neben dem Titel des ersten Grundrisses, Massstabsbalken links davon, sofern er den Titel nicht berührt
|
||||
@@ -672,7 +674,7 @@ export function presentationSheetOps(
|
||||
const lvl = sheetLevels[it.page ?? 0].id;
|
||||
const titleEnd = tpl
|
||||
? it.xMm + labelM.sizeMm * 3.6 + title.length * labelM.sizeMm * 0.65
|
||||
: it.xMm + FRAME_PAD_MM + (title.length + 8) * 4 * 0.65;
|
||||
: it.xMm + SHEET_PAD_MM + (title.length + 8) * 4 * 0.65;
|
||||
const cx = it.xMm + it.widthMm - 8;
|
||||
const beside = cx - 8 > titleEnd;
|
||||
const cy = beside ? it.yMm + it.heightMm + 4.8 : it.yMm + 8;
|
||||
|
||||
Reference in new issue
Block a user