[140] Merge: Plandarstellung Teil 3 – Tusche als Standard, Schichten im Schnitt, Blasen, grob: Türbogen/Fenster 2 Striche, Raumstempel

This commit is contained in:
Claude committed 2026-11-06 09:34:57 +00:00
commit 000a2f9e1a
32 files changed
+546 -132

No files matched your search

+17 -16
View File
@@ -2,24 +2,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0.1 0 6.8 7.58564" width="68mm" height="75.85641mm">
<rect x="0.1" y="0" width="6.8" height="7.58564" fill="#ffffff"/>
<g stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4">
<polygon points="5.8275,4.78564 5.8425,4.78564 5.8425,7.08564 5.8275,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.8425,4.78564 5.9925,4.78564 5.9925,7.08564 5.8425,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.8275,4.78564 5.8275,7.08564 5.9925,7.08564 5.9925,4.78564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.8425,1.88564 5.9925,1.88564 5.9925,4.58564 5.8425,4.58564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="6,4.48564 6.1525,4.48564 6.1525,7.08564 6,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.9925,4.78564 6,4.78564 6,7.08564 5.9925,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.9925,4.54564 6,4.54564 6,4.58564 5.9925,4.58564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="6.1525,1.88564 6.1725,1.88564 6.1725,7.08564 6.1525,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="0.8275,1.88564 0.8475,1.88564 0.8475,7.08564 0.8275,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="0.8475,4.48564 1,4.48564 1,7.08564 0.8475,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1,4.78564 1.0075,4.78564 1.0075,7.08564 1,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1,4.54564 1.0075,4.54564 1.0075,4.58564 1,4.58564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1.0075,4.78564 1.1575,4.78564 1.1575,7.08564 1.0075,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.9925,4.78564 5.9925,7.08564 6.1725,7.08564 6.1725,1.88564 6.1525,1.88564 6.1525,4.48564 6,4.48564 6,4.54564 5.9925,4.54564 5.9925,4.58564 6,4.58564 6,4.78564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="0.8275,1.88564 0.8275,7.08564 1.0075,7.08564 1.0075,4.78564 1,4.78564 1,4.58564 1.0075,4.58564 1.0075,4.54564 1,4.54564 1,4.48564 0.8475,4.48564 0.8475,1.88564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1.0075,4.78564 1.0075,7.08564 1.1725,7.08564 1.1725,4.78564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1.0075,1.88564 1.1575,1.88564 1.1575,4.58564 1.0075,4.58564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="1.1575,4.78564 1.1725,4.78564 1.1725,7.08564 1.1575,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="3.325,4.78564 3.34,4.78564 3.34,7.08564 3.325,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="3.34,4.78564 3.46,4.78564 3.46,7.08564 3.34,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="3.325,4.78564 3.325,7.08564 3.475,7.08564 3.475,4.78564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="3.34,4.48564 3.46,4.48564 3.46,4.58564 3.34,4.58564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="3.46,4.78564 3.475,4.78564 3.475,7.08564 3.46,7.08564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.8275,1.88564 5.8425,1.88564 5.8425,4.48564 5.8275,4.48564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="5.9925,1.88564 6.1525,1.88564 6.1525,4.48564 5.9925,4.48564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="0.8475,1.88564 1.0075,1.88564 1.0075,4.48564 0.8475,4.48564" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
@@ -34,7 +24,18 @@
<polygon points="0.6,0.5 6.4,0.5 6.4,0.73094 0.6,0.73094" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="4.2,5.69897 4.2,5.99364 5.2,5.99364 5.2,5.69897" fill="#f0f0f0" stroke="#1f242c" stroke-width="0.013"/>
<polygon points="0.6,0.5 0.6,0.73094 6.4,0.73094 6.4,0.5" fill="none" stroke="#1f242c" stroke-width="0.025"/>
<polygon points="0.8275,1.88564 0.8275,7.08564 1.1725,7.08564 1.1725,4.78564 3.325,4.78564 3.325,7.08564 3.475,7.08564 3.475,4.78564 5.8275,4.78564 5.8275,7.08564 6.1725,7.08564 6.1725,1.88564 5.8275,1.88564 5.8275,4.48564 1.1725,4.48564 1.1725,1.88564" fill="none" stroke="#1f242c" stroke-width="0.025"/>
<line x1="1.0075" y1="7.08564" x2="1.0075" y2="7.08564" stroke="#1f242c" stroke-width="0.025"/>
<polyline points="1.0075,7.08564 1.1725,7.08564 1.1725,4.78564 3.325,4.78564 3.325,7.08564 3.475,7.08564 3.475,4.78564 5.8275,4.78564 5.8275,7.08564 5.9925,7.08564" fill="none" stroke="#1f242c" stroke-width="0.025"/>
<line x1="5.9925" y1="7.08564" x2="5.9925" y2="7.08564" stroke="#1f242c" stroke-width="0.025"/>
<polyline points="5.9925,7.08564 6.1725,7.08564 6.1725,1.88564 5.8275,1.88564 5.8275,4.48564 1.1725,4.48564 1.1725,1.88564 0.8275,1.88564 0.8275,7.08564 1.0075,7.08564" fill="none" stroke="#1f242c" stroke-width="0.025"/>
<line x1="1" y1="4.54564" x2="1" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="1" y1="4.54564" x2="1.0075" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="1.0075" y1="4.54564" x2="1.0075" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="1.0075" y1="4.54564" x2="1" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="5.9925" y1="4.54564" x2="5.9925" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="5.9925" y1="4.54564" x2="6" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="6" y1="4.54564" x2="6" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<line x1="6" y1="4.54564" x2="5.9925" y2="4.54564" stroke="#1f242c" stroke-width="0.025"/>
<polygon points="4.2,5.69897 4.2,5.99364 5.2,5.99364 5.2,5.69897" fill="none" stroke="#1f242c" stroke-width="0.025"/>
<polyline points="5.8275,7.08564 5.4,7.08564 4,7.08564 3.475,7.08564" fill="none" stroke="#2b3039" stroke-width="0.018"/>
<line x1="3.325" y1="7.08564" x2="1.1725" y2="7.08564" stroke="#2b3039" stroke-width="0.018"/>

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

+12 -6
View File
@@ -5,10 +5,11 @@
// dossier-cli <projekt.obp> info
// dossier-cli <projekt.obp> validate
// dossier-cli <projekt.obp> migrate [--out neu.obp]
// dossier-cli <projekt.obp> plan [--level EG] [--ceiling] [--scale 100] [--sketch] [--hatch] [--format svg|json] [--out eg.svg]
// dossier-cli <projekt.obp> plan [--level EG] [--ceiling] [--scale 100] [--sketch] [--hatch] [--color] [--format svg|json] [--out eg.svg]
// json = render2d-Szene (planToRenderScene)
// dossier-cli <projekt.obp> section <Name> [--sketch] [--hatch] [--out schnitt.svg] (--format json: render2d-Szene)
// dossier-cli <projekt.obp> elevation <Name> [--sketch] [--hatch] [--out ansicht.svg] (--sketch: Skizzenstil [67])
// dossier-cli <projekt.obp> section <Name> [--sketch] [--hatch] [--color] [--out schnitt.svg] (--format json: render2d-Szene)
// dossier-cli <projekt.obp> elevation <Name> [--sketch] [--hatch] [--color] [--out ansicht.svg] (--sketch: Skizzenstil [67])
// --color: Darstellung „Farbig" statt Tusche (Standard, [140])
// dossier-cli <projekt.obp> ifc [--ebkph] [--ebenen] (IFC mit eBKP-H-Hauptgruppen bzw. Modell-Ebenen als Klassifikation)
// --schema 4|2x3: IFC4 (Standard) oder IFC2x3 (Coordination View 2.0)
// dossier-cli <projekt.obp> dxf [--binary] [--scale 100] [--dim-unit cm] [--layout]|dwg|ifc|step|obj|stl|glb|gltf|schedule [--openings|--elements] [--format json|csv|svg|pdf]|kennzahlen [--sia416] [--ivhb] [--format json|csv|svg|pdf] [--agsf m2] [--gruenflaeche m2] [--agf-basis gf|ngf|nf] [--untergeschosse]|raumprogramm [--import tabelle] [--sheet name|nr] [--mode replace|append] [--tolerance %] [--generate] [--format json|csv|svg|pdf] [--save projekt.obp]|sun [--level EG] [--out datei]
@@ -446,6 +447,11 @@ async function importAny(path: string, args: Args): Promise<Project> {
return fail(`Eingabeformat nicht unterstützt: .${ext} (obp, dxf, dwg, ifc, pdf, obj, stl, gltf, glb, ply)`);
}
/** [140] Darstellung wie der App-Standard „Tusche" (Schwarz-Weiss); `--color` = „Farbig". */
function inkArg(args: Args): boolean {
return !(args.flags.has("color") && args.flags.get("color") !== "false");
}
/** `convert <eingabe> <ausgabe>`: Eingabe nach Endung lesen, Ausgabe nach Endung schreiben, dann `--cmd` ausführen. */
async function convert(input: string | undefined, output: string | undefined, args: Args): Promise<number> {
if (!input || !output) {
@@ -606,7 +612,7 @@ async function execute(project: Project, file: string, command: string, rest: st
if (!own) planProject = { ...project, drawingLevels: [...project.drawingLevels, lvl] };
}
// Massstab geht in die Plan-Erzeugung ein (Bemassung in Papier-mm, Strichstärken nach Massstab).
const plan = generatePlan(withSketch(planProject, lvl.id, args), lvl.id, allCodes, undefined, "mittel", false, false, true, scale);
const plan = generatePlan(withSketch(planProject, lvl.id, args), lvl.id, allCodes, undefined, "mittel", false, inkArg(args), true, scale);
if (args.flags.get("format") === "json") {
out(args, JSON.stringify(planToRenderScene(plan, scale)), `${lvl.name}.scene.json`);
return 0;
@@ -628,9 +634,9 @@ async function execute(project: Project, file: string, command: string, rest: st
const o = await computeSection(sp, lvl);
if (!o) fail("keine gültige Schnittlinie");
// Wie die App: verdeckte Kanten nach der Ebene, geschnittene Fenster/Türen.
plan = generateSectionPlan(o, false, { visibleCodes: allCodes, hiddenLines: lvl.hiddenLines, openings: true, scaleDenominator: scale });
plan = generateSectionPlan(o, inkArg(args), { visibleCodes: allCodes, hiddenLines: lvl.hiddenLines, openings: true, scaleDenominator: scale });
} else {
plan = generateElevationPlan(sp, lvl, { scaleDenominator: scale });
plan = generateElevationPlan(sp, lvl, { scaleDenominator: scale, mono: inkArg(args) });
if (!plan) fail("keine gültige Ansichtslinie");
}
if (args.flags.get("format") === "json") {
+1 -1
View File
@@ -545,7 +545,7 @@ function annotations(): Drawing2D[] {
shape: "grid", origin: P(0, 0), angle: 0,
a: [{ label: "1", pos: 0 }, { label: "2", pos: 6 }, { label: "3", pos: 10 }, { label: "4", pos: 15 }],
b: [{ label: "A", pos: 0 }, { label: "B", pos: 5 }, { label: "C", pos: 10 }],
extend: 2.5, bubbles: "both", bubbleMm: 6, levels: ["ug", "eg", "og", "dg"], show3d: true,
extend: 2.5, bubbles: "both", levels: ["ug", "eg", "og", "dg"], show3d: true,
}, { lineStyleId: "std-ls-strichpunkt" });
// Assoziative Bemassung: Innenmasse an Wandflächen (Schichtgrenze 0/letzte) und Öffnungsleibungen.
+1 -1
View File
@@ -523,7 +523,7 @@ export function AttributesPanel() {
</span>
<span className="attr-key">{t("attr.grid.bubbleMm")}</span>
<span className="attr-val">
<input className="attr-num" style={{ width: 72 }} type="number" step={0.5} min={2} value={geom.bubbleMm ?? 8}
<input className="attr-num" style={{ width: 72 }} type="number" step={0.5} min={2} value={geom.bubbleMm ?? 5}
onChange={(e) => { const v = Number(e.target.value); if (Number.isFinite(v) && v >= 2) host.onSetGridProps(drawing.id, { bubbleMm: v }); }} />
</span>
<span className="attr-key">{t("attr.grid.show3d")}</span>
@@ -1,5 +1,5 @@
viewBox -4.2 0 37.045 17.778
bytes 265283
viewBox -4.2 0 37.045 17.678
bytes 265288
circle 4
g 1
line 615
@@ -8,4 +8,4 @@ polyline 68
rect 1
svg 1
text 4
hash 18d42b37d5c973f7
hash bc4a285700382759
@@ -1,5 +1,5 @@
viewBox -4 0 23 18
bytes 317361
bytes 317431
circle 14
g 1
line 3227
@@ -8,4 +8,4 @@ polyline 73
rect 1
svg 1
text 36
hash b639c8605f1c4c9d
hash 008b41292083538c
@@ -1,5 +1,5 @@
viewBox -4 0 23 18
bytes 323049
bytes 323091
circle 14
g 1
line 3240
@@ -8,4 +8,4 @@ polyline 84
rect 1
svg 1
text 36
hash 67469479cfe01b3d
hash 92ee43948feacb35
@@ -1,5 +1,5 @@
viewBox -41.5 0 95 63.6
bytes 113333
bytes 112696
circle 16
g 1
line 338
@@ -8,5 +8,5 @@ polygon 266
polyline 126
rect 1
svg 1
text 121
hash 1cac5c48dbd17ac3
text 115
hash 9f8c7f5a07987cc3
@@ -1,5 +1,5 @@
viewBox -41.5 0 95 63.6
bytes 118162
bytes 117868
circle 16
g 1
line 349
@@ -8,5 +8,5 @@ polygon 266
polyline 151
rect 1
svg 1
text 121
hash 7c1dabfc3b60dd70
text 118
hash 8dff669ded19d82b
@@ -1,5 +1,5 @@
viewBox -4.055 0 25.109 23.11
bytes 366491
bytes 366321
circle 14
g 1
line 3333
@@ -8,5 +8,5 @@ polygon 227
polyline 169
rect 1
svg 1
text 91
hash 48bd54ad5e8b1c20
text 89
hash 3e20e7dadb42197b
@@ -1,5 +1,5 @@
viewBox -4.055 0 25.109 23.11
bytes 374934
bytes 374960
circle 14
g 1
line 3350
@@ -9,4 +9,4 @@ polyline 195
rect 1
svg 1
text 91
hash 7bd001e733642672
hash 6e48062b617631c7
@@ -1,5 +1,5 @@
viewBox -10.004 0 31.058 26.958
bytes 61153
bytes 61113
circle 14
g 1
line 171
@@ -8,5 +8,5 @@ polygon 105
polyline 77
rect 1
svg 1
text 75
hash d31704c307ac309d
text 74
hash c64f09735f82df1e
@@ -1,5 +1,5 @@
viewBox -10.004 0 31.058 26.958
bytes 62007
bytes 62033
circle 14
g 1
line 173
@@ -9,4 +9,4 @@ polyline 80
rect 1
svg 1
text 75
hash eba7b491c822b768
hash 47cb320915d63e7a
@@ -1,11 +1,11 @@
viewBox 4.457 0 21.343 17.778
bytes 41694
viewBox 4.457 0 21.343 17.678
bytes 36282
circle 3
g 1
line 96
polygon 186
polyline 13
line 105
polygon 136
polyline 14
rect 1
svg 1
text 3
hash 471491b0c51f190a
hash ff9a1be90fae7d83
@@ -1,9 +1,9 @@
viewBox 0.1 0 6.8 7.586
bytes 6668
bytes 6662
g 1
line 21
polygon 34
polyline 4
line 31
polygon 23
polyline 6
rect 1
svg 1
hash 8ce8b71fc217069c
hash 68fbe08143832562
+2 -2
View File
@@ -224,7 +224,7 @@ describe("generatePlan — Luftbild (ContextImage)", () => {
expect(plan.backgroundImages![0].filters).toBeUndefined();
});
it("im Mono-Modus wird das Luftbild ausgeblendet (reiner S/W-Plan)", () => {
it("[140] auch im Schwarz-Weiss-Modus (Tusche-Standard) bleibt das Luftbild", () => {
const p = projectWith([
{
id: "IMG1",
@@ -236,7 +236,7 @@ describe("generatePlan — Luftbild (ContextImage)", () => {
},
]);
const plan = generatePlan(p, "eg", visible, undefined, "mittel", false, true);
expect(plan.backgroundImages).toHaveLength(0);
expect(plan.backgroundImages).toHaveLength(1);
});
});
+15 -5
View File
@@ -171,13 +171,23 @@ describe("generatePlan — Opening.detailLevel (Per-Element-Übersteuerung der A
(pr) => pr.kind === "arc",
).length;
/** Anschlagstriche der Tür (cls "door-frame", nur Detailgrad fein). */
const doorRevealCount = (opening: Opening, viewDetail: "grob" | "mittel" | "fein") =>
generatePlan(projectWithOpening(opening), "eg", visible, undefined, viewDetail).primitives.filter(
(pr) => pr.kind === "line" && pr.cls === "door-frame",
).length;
it("ohne detailLevel gilt weiterhin die Ansichts-Detailstufe (rückwärtskompatibel)", () => {
expect(doorArcCount(baseDoor, "grob")).toBe(0); // grob: kein Schwenkbogen
expect(doorArcCount(baseDoor, "mittel")).toBe(1); // mittel+: Schwenkbogen
// [140] grob (auch automatisch ab 1:200) mit Schwenkbogen, erst 1:500 ohne.
expect(doorArcCount(baseDoor, "grob")).toBe(1);
expect(doorArcCount(baseDoor, "mittel")).toBe(1);
expect(generatePlan(projectWithOpening(baseDoor), "eg", visible, undefined, "grob", false, false, true, 500).primitives.filter((pr) => pr.kind === "arc").length).toBe(0);
expect(doorRevealCount(baseDoor, "fein")).toBe(2);
expect(doorRevealCount(baseDoor, "mittel")).toBe(0);
});
it("detailLevel='grob' unterdrückt den Schwenkbogen, AUCH wenn die Ansicht 'fein' zeigt", () => {
expect(doorArcCount({ ...baseDoor, detailLevel: "grob" }, "fein")).toBe(0);
it("detailLevel='grob' zeichnet grob (ohne Anschlagstriche), AUCH wenn die Ansicht 'fein' zeigt", () => {
expect(doorRevealCount({ ...baseDoor, detailLevel: "grob" }, "fein")).toBe(0);
});
it("detailLevel='fein' zeigt den Schwenkbogen, AUCH wenn die Ansicht 'grob' zeigt", () => {
@@ -199,6 +209,6 @@ describe("generatePlan — Opening.detailLevel (Per-Element-Übersteuerung der A
const doorPlain: Opening = { ...baseDoor, id: "T2", position: 3.0 };
const p: Project = { ...projectWithOpening(doorFein), walls: [wall], openings: [doorFein, doorPlain] };
const plan = generatePlan(p, "eg", visible, undefined, "grob");
expect(plan.primitives.filter((pr) => pr.kind === "arc").length).toBe(1);
expect(plan.primitives.filter((pr) => pr.kind === "line" && pr.cls === "door-frame").length).toBe(2);
});
});
+9 -8
View File
@@ -243,11 +243,11 @@ export function generatePlan(
/**
* Kompakte Linien-Unterlage statt dauerhafter 'line'-Primitive (s.
* {@link UnderlayGroup}) — NUR für die interaktive GPU-Ansicht. Aus bei
* Export/mono (reiner Schwarz-Weiss-Plan ohne Unterlage).
* Export/Druck.
*/
compactUnderlay = false,
): Plan {
const compact = compactUnderlay && !mono && !forPrint;
const compact = compactUnderlay && !forPrint;
// Blatt-Ebene eines Layouts (Papier 1:1): ohne projektglobale Zutaten (Kontext, Luftbilder,
// Schnittlinien, Schatten, Baurecht) — die gehören zum Modell, nicht aufs Papier.
if (project.drawingLevels.some((l) => l.id === floorId && l.layoutId)) includeGlobal = false;
@@ -275,12 +275,12 @@ export function generatePlan(
// Kompakte Linien-Unterlage (s. {@link UnderlayGroup}): die Linien einfacher Zeichnungen fehlen
// im Puffer und entstehen erst bei Bedarf, PRO KATEGORIE gruppiert — das Ein-/Ausblenden einer
// Ebene entfernt dann nur deren Gruppe, die Chunks aller anderen Ebenen bleiben gültig.
const underlay = compact ? underlayGroups(project, dom, scaleDenominator) : [];
const underlay = compact ? underlayGroups(project, dom, scaleDenominator, mono) : [];
// Georeferenzierte Luftbilder als Hintergrund-Ebenen (nur interaktive Ansicht,
// nicht Teil der Vektor-Primitive) — im Mono-Modus ausgeblendet (reiner S/W-Plan).
// nicht Teil der Vektor-Primitive) — auch in Schwarz-Weiss, dem Standard ([140]).
// Projektglobal (nicht je Geschoss), s. `includeGlobal` oben.
const backgroundImages: PlanImage[] = !includeGlobal || mono
const backgroundImages: PlanImage[] = !includeGlobal
? []
: (project.context ?? [])
.filter((o): o is Extract<ContextObject, { type: "image" }> => o.type === "image")
@@ -599,7 +599,7 @@ function readPlanMulti(
* Domäne der 2D-Zeichnungen): je (gedimmt, Ebene) die Zeichnungen, deren Linien der Plan-Puffer
* nicht enthält. `build` holt die Linien einer Teilmenge bei Bedarf (`drawingLines`).
*/
function underlayGroups(project: Project, dom: DomainPrims, scaleDenominator: number): UnderlayGroup[] {
function underlayGroups(project: Project, dom: DomainPrims, scaleDenominator: number, mono: boolean): UnderlayGroup[] {
const bytes = documentFor(project).queryBin("drawingUnderlay", [1], dom.args);
if (bytes.byteLength % 8 !== 0) throw new Error("drawingUnderlay: unerwartete Antwort");
const f = new Float64Array(bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength));
@@ -614,7 +614,7 @@ function underlayGroups(project: Project, dom: DomainPrims, scaleDenominator: nu
return index.get(d);
};
// Alles, wovon `build` abhängt: ändert sich eine davon, werden die GPU-Chunks neu erzeugt.
const ctx = [project.lineStyles, project.hatches, layersStyleSig(project.layers), scaleDenominator, project.overrideRules, project.scaleLineWeights];
const ctx = [project.lineStyles, project.hatches, layersStyleSig(project.layers), scaleDenominator, project.overrideRules, project.scaleLineWeights, mono];
const out: UnderlayGroup[] = [];
let k = 1;
for (let g = 0; g < f[0]; g++) {
@@ -624,7 +624,8 @@ function underlayGroups(project: Project, dom: DomainPrims, scaleDenominator: nu
for (let i = 0; i < n; i++) drawings[i] = all[f[k + 2 + i]];
k += 2 + n;
const buildBuf = (list: Drawing2D[]): DecodedPlanBuf => {
const args = [scaleDenominator, catGreyed ? 1 : 0];
// Schalter: Bit 1 = gedimmt, Bit 2 = Schwarz-Weiss ([140]).
const args = [scaleDenominator, (catGreyed ? 1 : 0) + (mono ? 2 : 0)];
for (const d of list) {
const i = indexOf(d);
if (i !== undefined) args.push(i);
+9 -2
View File
@@ -80,9 +80,16 @@ describe("kompakte Linien-Unterlage", () => {
expect(compact.primitives.some((q) => q.kind === "polygon" && (q as any).drawingId === "filled")).toBe(true);
});
it("mono und Export (forPrint) bleiben beim normalen Pfad", () => {
it("Export (forPrint) bleibt beim normalen Pfad; Schwarz-Weiss ([140] Standard) nutzt die Unterlage in Tinte", () => {
const p = project(drawings);
expect(generatePlan(p, "L1", visible, undefined, "mittel", false, true, true, 100, false, true).underlay).toBeUndefined();
const mono = generatePlan(p, "L1", visible, undefined, "mittel", false, true, true, 100, false, true);
expect(mono.underlay).toBeDefined();
const lines = mono.underlay!.flatMap((g) => g.build(g.drawings));
expect(lines.length).toBeGreaterThan(0);
// Kategorie „Rot" (61) wird Tinte.
expect(JSON.stringify(lines)).not.toContain("#ff0000");
const color = generatePlan(p, "L1", visible, undefined, "mittel", false, false, true, 100, false, true);
expect(JSON.stringify(color.underlay!.flatMap((g) => g.build(g.drawings)))).toContain("#ff0000");
expect(generatePlan(p, "L1", visible, undefined, "mittel", false, false, true, 100, true, true).underlay).toBeUndefined();
});
+11 -9
View File
@@ -201,17 +201,18 @@ describe("generatePlan — Verglasung glazingPanes (Item 2)", () => {
expect(glassLineCount(p1, "fein")).toBe(0);
});
it("ohne typeId bleibt die alte Detailgrad-Regel (grob/mittel=1, fein=2) unverändert — Regression", () => {
it("ohne typeId: mittel=1, fein=2 Glaslinien; grob keine ([140]: zwei Striche in der Wandflucht)", () => {
const p = project({ ...baseWindow });
expect(glassLineCount(p, "grob")).toBe(1);
expect(glassLineCount(p, "grob")).toBe(0);
expect(glassLineCount(p, "mittel")).toBe(1);
expect(glassLineCount(p, "fein")).toBe(2);
});
it("glazingPanes wirkt bei 'grob' NICHT (bleibt bei 1 Glaslinie)", () => {
it("glazingPanes wirkt bei 'grob' NICHT (keine Glaslinie, nur die zwei Striche)", () => {
const wt: WindowType = { ...baseWindowType, glazingPanes: 3 };
const p = project({ ...baseWindow, typeId: "wt1" }, [wt]);
expect(glassLineCount(p, "grob")).toBe(1);
expect(glassLineCount(p, "grob")).toBe(0);
expect(linesOfClass(p, "window-frame", "grob").length).toBe(2);
});
});
@@ -432,14 +433,15 @@ describe("generatePlan — Linien-Übersteuerung je Kategorie (Opening.frameLine
}
});
it("sashLine wirkt auch bei 'grob' (1:100) auf die einzige dort sichtbare Glaslinie", () => {
it("frameLine wirkt bei 'grob' (1:100) auf die zwei Striche in der Wandflucht ([140])", () => {
const p = project(
{ ...baseWindow, typeId: "wt1", sashLine: { color: "#00ff00", weight: 0.3 } },
{ ...baseWindow, typeId: "wt1", frameLine: { color: "#00ff00", weight: 0.3 } },
[twoSashType],
);
const g = linesOfClass(p, "window-glass", "grob");
expect(g.length).toBe(1);
expect(g[0].kind === "line" && g[0].color).toBe("#00ff00");
expect(linesOfClass(p, "window-glass", "grob").length).toBe(0);
const g = linesOfClass(p, "window-frame", "grob");
expect(g.length).toBe(2);
expect(g.every((q) => q.kind === "line" && q.color === "#00ff00")).toBe(true);
expect(g[0].kind === "line" && g[0].weightMm).toBeCloseTo(0.3, 6);
});
});
+3 -3
View File
@@ -41,8 +41,8 @@ export interface ViewSlice {
// nicht im Projekt) und der Abstand je Geschoss in Metern.
explode3d: boolean;
explode3dGap: number;
// Farb-Modus des Grundrisses: "color" = Kategorie-/Element-Farben (heute),
// "mono" = reiner Schwarz-Weiss-Plan (Tinte, keine Farb-/Schraffurfarben).
// Farb-Modus von Grundriss/Schnitt/Ansicht: "mono" = Tusche (Standard, [140]: Schwarz/Grau, bunte
// Farben werden Tinte bzw. Papier, Grautöne wie Schatten bleiben), "color" = „Farbig" (Materialfarben).
planColorMode: "color" | "mono";
// Wand-Achslinien im Grundriss.
referenceLines: boolean;
@@ -97,7 +97,7 @@ export function createViewSlice(api: StoreApi<ViewSlice>): ViewSlice {
grid3dVisible: true,
explode3d: false,
explode3dGap: 3,
planColorMode: "color",
planColorMode: "mono",
referenceLines: false,
lineMode: "display",
scaleDenominator: 100,