[171] Plan-Review Runde 2: Schatten nur im Ansichtsbereich, Flächenzeile nach Rundungsschritt, Rundfenster in Schnitt und Ansicht, Wand unter Rohdecke, OG-Ecken in der Ansicht, Höhenkoten neben dem Gebauten

Tests je Fix (sun.rs, domains.rs, section/tests.rs, elevation/tests.rs, viewportPlan.test.ts),
Goldens Plan/CLI neu (OG/DG Schatten, Schnitt A, Ansicht Süd). TODO.md [171] mit offenen Befunden.
This commit is contained in:
Claude committed 2026-11-10 10:57:33 +00:00
1 parent 977cbee260
commit 0fbbcf1f6f
24 files changed
+334 -59

No files matched your search

@@ -1,11 +1,11 @@
viewBox -4.2 0 37.045 17.378
bytes 193364
bytes 195265
circle 4
g 1
line 556
polygon 1026
polyline 44
line 447
polygon 1025
polyline 154
rect 1
svg 1
text 4
hash 32b9045a8708e6ad
hash d0400a1b0daa1e56
@@ -1,12 +1,12 @@
viewBox -12.8 0 37.6 33.6
bytes 23004
bytes 22835
circle 14
g 1
line 91
polygon 22
polygon 21
polyline 22
rect 1
svg 1
text 34
tspan 9
hash f0bc37741422757a
hash b98be8a32c279efc
@@ -1,12 +1,12 @@
viewBox -12.65 0 37.3 33.3
bytes 324678
bytes 324510
circle 14
g 1
line 3206
polygon 68
polygon 67
polyline 80
rect 1
svg 1
text 36
tspan 12
hash a1ffcd11fb447e54
hash 9f01cf4af3bc2c65
@@ -1,13 +1,13 @@
viewBox -12.8 0 37.6 33.6
bytes 47861
bytes 47692
circle 14
g 1
line 142
path 8
polygon 45
polygon 44
polyline 106
rect 1
svg 1
text 86
tspan 19
hash b6f8babd12e53947
hash 7557aa5041a40ed1
@@ -1,13 +1,13 @@
viewBox -12.65 0 37.3 33.3
bytes 359467
bytes 359299
circle 14
g 1
line 3238
path 36
polygon 145
polygon 144
polyline 175
rect 1
svg 1
text 89
tspan 24
hash 169dd2e0a69081af
hash 101818006ae26a68
@@ -1,11 +1,11 @@
viewBox 4.457 0 21.343 17.378
bytes 34204
bytes 33634
circle 4
g 1
line 42
polygon 182
line 44
polygon 176
polyline 17
rect 1
svg 1
text 3
hash bd6c402b78964222
hash 0ac408ec72d00b90
@@ -1,9 +1,9 @@
viewBox 0.1 0 6.8 7.586
bytes 7959
bytes 7833
g 1
line 7
polygon 57
polyline 6
polyline 4
rect 1
svg 1
hash 2b77ecb148e762fe
hash 1a97bd708a69f1c8
@@ -1,9 +1,9 @@
viewBox 0.1 0 6.8 7.586
bytes 6668
bytes 6317
g 1
line 21
polygon 34
polygon 31
polyline 4
rect 1
svg 1
hash 405920d4c0d4ea97
hash ab081d72649b8b18
+20 -1
View File
@@ -22,7 +22,26 @@ export function levelMarksEnabled(level: DrawingLevel): boolean {
export function levelMarkerPrimitives(
project: Project,
bounds: { minX: number; minY: number; maxX: number; maxY: number },
primitives?: readonly Primitive[],
): Primitive[] {
if (!(bounds.maxX > bounds.minX) || !(bounds.maxY > bounds.minY)) return [];
return decodePlanBuf(documentFor(project).queryBin("levelMarkers", [bounds.minX, bounds.minY, bounds.maxX, bounds.maxY])).prims;
const minX = primitives ? Math.max(bounds.minX, builtMinX(project, primitives)) : bounds.minX;
return decodePlanBuf(documentFor(project).queryBin("levelMarkers", [minX < bounds.maxX ? minX : bounds.minX, bounds.minY, bounds.maxX, bounds.maxY])).prims;
}
// [171] Gelände (Schnittfläche, Profil- und Grundlinie) zählt nicht zur Lage der Koten: sie stehen neben dem
// Gebauten (Haus, Carport, Körper), nicht links vom ganzen Geländeschnitt (Musterhaus komplex: ~15 m weiter).
const TERRAIN_CLS = new Set(["section-terrain", "elevation-terrain", "section-ground", "elevation-ground"]);
function builtMinX(project: Project, primitives: readonly Primitive[]): number {
const site = new Set((project.context ?? []).filter((c) => c.type === "terrainMesh" || c.type === "excavation" || c.type === "contourSet").map((c) => c.id));
let minX = Infinity;
for (const q of primitives) {
if (q.kind === "line") {
if (!TERRAIN_CLS.has(q.cls)) minX = Math.min(minX, q.a.x, q.b.x);
} else if (q.kind === "polygon") {
if (!(q.contextObjectId && site.has(q.contextObjectId))) for (const v of q.pts) minX = Math.min(minX, v.x);
}
}
return minX;
}
+15
View File
@@ -16,6 +16,21 @@ describe("viewportLevelPlan", () => {
expect(plan.bounds.maxY - plan.bounds.minY).toBeGreaterThan(8);
});
// [171] Höhenkoten neben dem Gebäude, nicht links vom ganzen Geländeschnitt (Musterhaus komplex: ~15 m weiter).
it("Schnitt: Höhenkoten nahe beim Gebäude, nicht links vom Gelände", async () => {
const plan = await viewportLevelPlan(p, "schnitt-a", codes, "mittel", 100);
const xsOf = (q: (typeof plan.primitives)[number]): number[] =>
q.kind === "polygon" ? q.pts.map((v) => v.x) : q.kind === "line" ? [q.a.x, q.b.x] : [];
const terrainX = Math.min(...plan.primitives.filter((q) => q.kind === "line" && q.cls === "section-terrain").flatMap(xsOf));
const wallX = Math.min(...plan.primitives.filter((q) => q.kind === "polygon" && q.wallId).flatMap(xsOf));
const leaders = plan.primitives.filter((q) => q.kind === "line" && q.cls === "section-level-leader");
expect(leaders.length).toBeGreaterThan(2);
const markX = Math.min(...leaders.flatMap(xsOf));
expect(terrainX).toBeLessThan(wallX - 8);
expect(markX).toBeGreaterThan(terrainX + 2);
expect(markX).toBeLessThan(wallX);
});
it("Ansicht: Fassade", async () => {
const plan = await viewportLevelPlan(p, "ansicht-sued", codes, "mittel", 100);
expect(plan.primitives.length).toBeGreaterThan(100);
+1 -1
View File
@@ -66,7 +66,7 @@ export async function viewportLevelPlan(
}
if (!raw || raw.primitives.length === 0) return EMPTY;
const own = generatePlan(project, level.id, visibleCodes, undefined, detail, false, mono, false, scaleDenominator, forPrint, false, overrideRuleIds);
const marks = levelMarksEnabled(level) ? levelMarkerPrimitives(project, raw.bounds) : [];
const marks = levelMarksEnabled(level) ? levelMarkerPrimitives(project, raw.bounds, raw.primitives) : [];
const b = { ...raw.bounds };
const grow = (x: number, y: number) => {
b.minX = Math.min(b.minX, x);