[100] Deckenspiegel: Leuchten (Symbol Deckenleuchte, Kategorie 65), Deckenspiegel im Layout-Viewport geprüft
This commit is contained in:
8 files changed
+117
-3
No files matched your search
@@ -1425,6 +1425,7 @@ export const de = {
|
||||
"resources.loadStandards.n.viewTemplates": "{n} Ansichtsvorlagen",
|
||||
"resources.loadStandards.n.hatches": "{n} Schraffuren",
|
||||
"resources.loadStandards.n.lineStyles": "{n} Linientypen",
|
||||
"resources.loadStandards.n.blockDefs": "{n} Symbole",
|
||||
"resources.col.lambda": "Wärmeleitfähigkeit λ [W/mK]",
|
||||
"resources.col.density": "Rohdichte [kg/m³]",
|
||||
"resources.col.fireClass": "Brandverhalten (VKF)",
|
||||
|
||||
@@ -1418,6 +1418,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"resources.loadStandards.n.viewTemplates": "{n} view templates",
|
||||
"resources.loadStandards.n.hatches": "{n} hatches",
|
||||
"resources.loadStandards.n.lineStyles": "{n} line types",
|
||||
"resources.loadStandards.n.blockDefs": "{n} symbols",
|
||||
"resources.col.lambda": "Thermal conductivity λ [W/mK]",
|
||||
"resources.col.density": "Density [kg/m³]",
|
||||
"resources.col.fireClass": "Reaction to fire (VKF)",
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("Standard-Bibliothek ([100]–[102])", () => {
|
||||
expect(c.components).toBe(35);
|
||||
expect(c.lineStyles).toBeGreaterThan(5);
|
||||
expect(c.wallTypes + c.ceilingTypes + c.roofTypes).toBe(5);
|
||||
expect(standardsMergeCounts(standardsMergeOps(withStandards(empty)))).toEqual({ lineStyles: 0, hatches: 0, components: 0, wallTypes: 0, ceilingTypes: 0, roofTypes: 0, viewTemplates: 0 });
|
||||
expect(standardsMergeCounts(standardsMergeOps(withStandards(empty)))).toEqual({ lineStyles: 0, hatches: 0, components: 0, wallTypes: 0, ceilingTypes: 0, roofTypes: 0, viewTemplates: 0, blockDefs: 0 });
|
||||
});
|
||||
|
||||
it("Sinnbilder nach SIA 400 Fig. 34: Putz leer, Dämmung quer, Beton gekreuzt", () => {
|
||||
|
||||
@@ -27,10 +27,12 @@ export interface StandardsMergeCounts {
|
||||
ceilingTypes: number;
|
||||
roofTypes: number;
|
||||
viewTemplates: number;
|
||||
/** Symbole (2D-Blöcke, z. B. Deckenleuchte [100]). */
|
||||
blockDefs: number;
|
||||
}
|
||||
|
||||
export function standardsMergeCounts(ops: readonly CoreOp[]): StandardsMergeCounts {
|
||||
const out: StandardsMergeCounts = { lineStyles: 0, hatches: 0, components: 0, wallTypes: 0, ceilingTypes: 0, roofTypes: 0, viewTemplates: 0 };
|
||||
const out: StandardsMergeCounts = { lineStyles: 0, hatches: 0, components: 0, wallTypes: 0, ceilingTypes: 0, roofTypes: 0, viewTemplates: 0, blockDefs: 0 };
|
||||
for (const op of ops) {
|
||||
const key = op.kind === "add" ? op.collection : op.kind === "setField" ? op.key : null;
|
||||
const n = op.kind === "add" ? op.items.length : op.kind === "setField" && Array.isArray(op.value) ? op.value.length : 0;
|
||||
|
||||
@@ -31,3 +31,35 @@ describe("viewportLevelPlan", () => {
|
||||
expect(plan.primitives.length).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
// [100] Deckenspiegel auf dem Blatt: derselbe Plan wie die Deckenspiegel-Ebene (Blattansicht und PDF rufen
|
||||
// beide `viewportLevelPlan`), Strichstärken der geschnittenen Wände wie im Grundriss.
|
||||
describe("viewportLevelPlan: Deckenspiegel ([100])", () => {
|
||||
const q = structuredClone(p);
|
||||
q.drawingLevels.push({ id: "ds-og", name: "Deckenspiegel OG", kind: "ceiling", visible: true, locked: false, ceilingOfId: "og" });
|
||||
type Prim = { kind: string; wallId?: string; ceilingId?: string; cls?: string; weightMm?: number; a?: { x: number; y: number }; b?: { x: number; y: number } };
|
||||
|
||||
it("gleicher Inhalt wie die Ebene, auch im Druck", async () => {
|
||||
for (const forPrint of [false, true]) {
|
||||
const vp = await viewportLevelPlan(q, "ds-og", codes, "mittel", 50, forPrint);
|
||||
const own = generatePlan(q, "ds-og", codes, undefined, "mittel", false, false, true, 50, forPrint);
|
||||
expect(vp.primitives.length).toBe(own.primitives.length);
|
||||
expect(vp.bounds).toEqual(own.bounds);
|
||||
const prims = vp.primitives as Prim[];
|
||||
expect(prims.some((x) => x.wallId)).toBe(true);
|
||||
expect(prims.some((x) => x.ceilingId || x.cls === "roof-eaves")).toBe(true);
|
||||
expect(prims.some((x) => x.cls === "door-swing" || x.cls === "door-leaf")).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it("Wand-Strichstärken wie im Grundriss (gleicher Massstab)", async () => {
|
||||
const ds = (await viewportLevelPlan(q, "ds-og", codes, "mittel", 50, true)).primitives as Prim[];
|
||||
const gr = (await viewportLevelPlan(q, "og", codes, "mittel", 50, true)).primitives as Prim[];
|
||||
const wallLine = (x: Prim) => x.kind === "line" && (x.cls === "wall-outline" || x.cls === "layer-joint");
|
||||
const key = (x: Prim) => `${x.cls}|${x.a?.x.toFixed(4)}|${x.a?.y.toFixed(4)}|${x.b?.x.toFixed(4)}|${x.b?.y.toFixed(4)}`;
|
||||
const widths = new Map(gr.filter(wallLine).map((x) => [key(x), x.weightMm]));
|
||||
const shared = ds.filter((x) => wallLine(x) && widths.has(key(x)));
|
||||
expect(shared.length).toBeGreaterThan(100);
|
||||
for (const x of shared) expect(x.weightMm, key(x)).toBe(widths.get(key(x)));
|
||||
});
|
||||
});
|
||||
@@ -1055,7 +1055,7 @@ export function createProjectSlice(
|
||||
// Rückmeldung, was hinzukam ([101]); ein Undo-Schritt.
|
||||
const ops = standardsMergeOps(get().project);
|
||||
const c = standardsMergeCounts(ops);
|
||||
const parts = (["components", "wallTypes", "ceilingTypes", "roofTypes", "hatches", "lineStyles", "viewTemplates"] as const)
|
||||
const parts = (["components", "wallTypes", "ceilingTypes", "roofTypes", "hatches", "lineStyles", "viewTemplates", "blockDefs"] as const)
|
||||
.filter((k) => c[k] > 0)
|
||||
.map((k) => t(`resources.loadStandards.n.${k}`, { n: c[k] }));
|
||||
if (ops.length) applyChange(ops);
|
||||
|
||||
Reference in new issue
Block a user