[140] Raumstempel ab 1:200 kleiner und ohne SIA-Zeile; Tests an neue Defaults angepasst

This commit is contained in:
Claude committed 2026-11-05 17:10:30 +00:00
1 parent 911ee218b0
commit 81a5d6fd74
7 files changed
+45 -25

No files matched your search

+2 -2
View File
@@ -124,8 +124,8 @@ describe.skipIf(!hasEzdxf)("Fachplaner-Export gegen ezdxf", { timeout: 60_000 },
}
const st = r.dimstyles["DOSSIER_1-100"];
expect(st).toMatchObject({ dimscale: 100, dimtad: 1, dimdec: 2, dimlfac: 1, dimtxsty: "DOSSIER" });
expect(st.dimtxt as number).toBeCloseTo(0.004, 9); // 4 mm Papier
expect(st.dimtsz as number).toBeCloseTo(0.0015, 9); // Architekturstrich 3 mm
expect(st.dimtxt as number).toBeCloseTo(0.0025, 9); // 2.5 mm Papier ([140])
expect(st.dimtsz as number).toBeCloseTo(0.001, 9); // Architekturstrich 2 mm ([140])
});
it("Bemassungsstil im Massstab 1:50 und in cm", () => {
+2 -2
View File
@@ -131,10 +131,10 @@ describe("Druck-SVG: Textgrössen in Papier-mm", () => {
expect(t.xs[0] - t.xs[1]).toBeCloseTo((4 * K) / 2, 3);
});
it("Masszahl in der Papier-Schrifthöhe (4 mm), Höhenkote lesbar gross", () => {
it("Masszahl in der Papier-Schrifthöhe (2.5 mm, [140]), Höhenkote lesbar gross", () => {
const all = print();
const dim = all.find((x) => x.text === "5.00")!;
expect(dim.sizes[0]).toBeCloseTo(4, 3);
expect(dim.sizes[0]).toBeCloseTo(2.5, 3);
const kote = all.find((x) => /0[.,]00/.test(x.text) && x !== dim);
expect(kote).toBeDefined();
expect(kote!.sizes[0]).toBeGreaterThan(1);
+2 -2
View File
@@ -633,8 +633,8 @@ describe("2D-Zeichnung — Bemassung: Papier-mm statt Modellmass", () => {
const lens = out
.filter((p) => p.kind === "line")
.map((p) => (p.kind === "line" ? Math.hypot(p.b.x - p.a.x, p.b.y - p.a.y) : 0));
// Default 3 mm bei 1:50 = 0.15 m (der frühere feste Modellwert).
expect(Math.min(...lens)).toBeCloseTo(0.15, 9);
// Default 2 mm bei 1:50 = 0.1 m ([140], vorher 3 mm).
expect(Math.min(...lens)).toBeCloseTo(0.1, 9);
});
});
+2 -2
View File
@@ -134,11 +134,11 @@ describe("generatePlan — Schichtfugen als stilisierbare Linien", () => {
expect(joints[0].dash ?? null).toBeNull();
});
it("fällt ohne Zuweisung auf die Haarlinie (0.02 mm) in Wandfarbe zurück", () => {
it("fällt ohne Zuweisung auf die feine Fuge (0.09 mm, [140]) in Wandfarbe zurück", () => {
const proj = cornerProject();
proj.walls = [proj.walls[0]];
const joints = jointLines(proj);
expect(joints.length).toBe(1);
expect(joints[0].weightMm).toBeCloseTo(0.02, 6);
expect(joints[0].weightMm).toBeCloseTo(0.09, 6);
});
});
+10 -7
View File
@@ -12,6 +12,9 @@ import type { Primitive } from "./generatePlan/shared";
const ALL = new Set(flattenCategories(sampleProject.layers).map((c) => c.code));
const on: Project = { ...sampleProject, scaleLineWeights: true };
const off: Project = { ...sampleProject, scaleLineWeights: false };
// [140] Kern `scale_weight`: nur der Anteil über 0.09 mm skaliert (1:200: Faktor √½).
const scaledWeight = (w: number, f: number) => (w > 0.09 ? 0.09 + (w - 0.09) * f : w);
const weights = (ps: Primitive[]) =>
ps.flatMap((p) => (p.kind === "polygon" ? [p.strokeWidthMm] : "weightMm" in p && typeof p.weightMm === "number" ? [p.weightMm] : []));
const plan = (p: Project, n: number, compact = false) =>
@@ -19,18 +22,18 @@ const plan = (p: Project, n: number, compact = false) =>
describe("Strichstärken nach Massstab", () => {
// Der Faktor selbst (Grenzen, ungültiger Massstab) ist im Kern geprüft (`plan/extras.rs`).
it("Grundriss 1:200: jede Stärke × Faktor, aus → unverändert", () => {
const base = weights(plan(sampleProject, 200).primitives);
it("Grundriss 1:200: jede Stärke über dem Sockel × Faktor, aus → unverändert", () => {
const base = weights(plan(off, 200).primitives);
const scaled = weights(plan(on, 200).primitives);
expect(scaled.length).toBe(base.length);
const f = 0.5 ** 0.25;
scaled.forEach((w, i) => expect(w).toBeCloseTo(base[i] * f, 9));
expect(scaled).not.toEqual(base);
scaled.forEach((w, i) => expect(w).toBeCloseTo(scaledWeight(base[i], Math.SQRT1_2), 9));
});
it("auch die kompakte Linien-Unterlage (GPU-Ansicht) wird skaliert", () => {
const base = weights(plan(sampleProject, 200, true).primitives);
const base = weights(plan(off, 200, true).primitives);
const scaled = weights(plan(on, 200, true).primitives);
expect(scaled.length).toBe(base.length);
scaled.forEach((w, i) => expect(w).toBeCloseTo(base[i] * 0.5 ** 0.25, 9));
scaled.forEach((w, i) => expect(w).toBeCloseTo(scaledWeight(base[i], Math.SQRT1_2), 9));
});
it("gleiche Eingabe → gleiche Inhalts-Hashes der Kern-Abschnitte (GPU-Cache), auch mit Massstab", () => {
const line = {
@@ -41,7 +44,7 @@ describe("Strichstärken nach Massstab", () => {
const pl = generatePlan(p, "eg", ALL, undefined, "mittel", false, false, true, 200);
return (pl.bufRuns ?? []).flatMap((r) => Array.from(r.buf.hashes!.subarray(r.from, r.to)));
};
const base = { ...sampleProject, drawings2d: [...sampleProject.drawings2d, line] };
const base = { ...off, drawings2d: [...sampleProject.drawings2d, line] };
const a = hashes(base);
expect(a.length).toBeGreaterThan(0);
expect(hashes(base)).toEqual(a);
+2 -2
View File
@@ -340,11 +340,11 @@ describe("generatePlan — Linien-Übersteuerung je Kategorie (Opening.frameLine
sillLine: { faces: "aussen", view: "auf" },
};
it("ohne Übersteuerung: Stulp-/Sash-/Sims-Linien nutzen den Default (Opening.color bzw. Haarlinie)", () => {
it("ohne Übersteuerung: Stulp-/Sash-/Sims-Linien nutzen den Default (Opening.color bzw. feine Linie 0.13, [140])", () => {
const p = project({ ...baseWindow, typeId: "wt1" }, [twoSashType]);
const stulp = linesOfClass(p, "window-stulp", "mittel");
expect(stulp.length).toBeGreaterThan(0);
for (const l of stulp) expect(l.kind === "line" && l.weightMm).toBeCloseTo(0.02, 6);
for (const l of stulp) expect(l.kind === "line" && l.weightMm).toBeCloseTo(0.13, 6);
});
it("frameLine übersteuert Farbe+Stärke der Laibungs-Blöcke (window-stulp, einflügliges Fenster ohne Flügelstoss)", () => {