[256] Plan-Review Runde 4 (1:100 Vorprojekt): Raumstempel-Ersatz bleibt fett, Höhenkoten ohne Nachbargebäude und vor dem Gebauten, DG bemasst, Wettbewerb mit Innentüren

- Raumstempel: Ersatzvarianten (Grundschrift, umbrochen, nur Nummer, gekürzt) behalten die Marken je Zeile
  (Name fett, Zeile 2 kursiv), nur die eigene Grösse entfällt (fit_room_stamp_with).
- Höhenkoten Schnitt/Ansicht: Kontext-Netze auf Umgebungsklassen (Nachbargebäude) zählen nicht zum Gebauten
  (Kern level_marker_bounds, TS levelMarkers.ts); oberste Kote Wettbewerb +9.50 statt +12.00, Kotenturm am Haus.
- Kotenreihe rückt um die Textbreite: ±0.00 = 441.30 läuft nicht mehr in die Wand.
- Musterhaus komplex: Aussenbemassung auch im DG; Wettbewerb: Innentüren (Diele, Zimmer, Bad), Wohnungstür Ost schlägt in die Wohnung.
- Goldens komplex EG/OG/DG nachgeführt (Fett-Attribut, DG-Massketten).

Geprüft: cargo test Kern (1645), vitest ganz, tsc, CLI-SVG in Chromium (Linux). Nicht auf dem Mac/in der Tauri-App.
This commit is contained in:
Claude committed 2026-11-14 02:59:42 +00:00
1 parent 4d8500104d
commit e7ba69b693
12 files changed
+251 -34

No files matched your search

+2 -2
View File
@@ -930,8 +930,8 @@ export function buildComplexSampleProject(): Project {
// Räume per Raumerkennung (Umriss = Innenkontur der Wände).
p = addRooms(p);
// Aussenbemassung (Massketten je Fassade) in UG, EG, OG.
// Aussenbemassung (Massketten je Fassade) in allen Geschossen ([256]: auch DG — Vorprojekt 1:100 bemasst jedes Geschoss).
// [180] Die Ketten landen auf der Klasse „81 Auto-Bemassung" (Befehl `autodim`), nicht auf der aktiven.
for (const f of ["ug", "eg", "og"]) p = runCmd(p, f, "autodim", {}, "80").project;
for (const f of ["ug", "eg", "og", "dg"]) p = runCmd(p, f, "autodim", {}, "80").project;
return p;
}
+9 -1
View File
@@ -72,6 +72,7 @@ const WINDOW_TYPES: WindowType[] = [
];
const DOOR_TYPES: DoorType[] = [
{ id: "wb-tu", name: "Wohnungstür", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.05, frameKind: "umfassungszarge", frameWidth: 0.05, defaultWidth: 0.9, defaultHeight: 2.1 },
{ id: "wb-tu-innen", name: "Zimmertür", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.05, frameKind: "umfassungszarge", frameWidth: 0.05, defaultWidth: 0.8, defaultHeight: 2.1 },
{ id: "wb-tu-haus", name: "Haustür Glas", kind: "dreh", leafCount: 1, leafStyle: "glas", glazingRatio: 0.4, frameThickness: 0.08, frameKind: "blockrahmen", frameWidth: 0.09, threshold: true, defaultWidth: 1.2, defaultHeight: 2.3 },
];
const STAIR_TYPES = [{ id: "wb-tr-beton", name: "Ortbetontreppe mit Geländer rechts", structure: "beton" as const, closedRisers: true, treadThickness: 0.03, nosing: 0.02, railing: "rechts" as const, defaultWidth: 1.1 }];
@@ -127,7 +128,14 @@ for (const f of FLOORS) {
else win(`${i}-f-n3`, `${i}-aw-n`, 10, 1.2, 1.4, 0.9);
door(`${i}-t-th`, `${i}-iw-th`, "wb-tu", 2, 1.0, 2.1);
door(`${i}-t-wohnung-w`, `${i}-iw-x8`, "wb-tu", 3.5, 0.9, 2.1, { fireRating: "EI30" });
door(`${i}-t-wohnung-o`, `${i}-iw-x12`, "wb-tu", 3.5, 0.9, 2.1, { fireRating: "EI30" });
door(`${i}-t-wohnung-o`, `${i}-iw-x12`, "wb-tu", 3.5, 0.9, 2.1, { fireRating: "EI30", swing: "right" });
// [256] Innentüren je Wohnung: Wohnen → Diele, Diele → Zimmer und Bad (Plan-Review 1:100: Zimmer/Bad ohne Zugang).
for (const side of ["w", "o"] as const) {
const o = side === "o";
door(`${i}-t-${side}-diele`, `${i}-iw-${side}-y7`, "wb-tu-innen", o ? 2 : 6, 0.9, 2.1);
door(`${i}-t-${side}-zimmer`, `${i}-iw-${side}-zimmer`, "wb-tu-innen", 1.25, 0.8, 2.1, o ? { swing: "right" } : {});
door(`${i}-t-${side}-bad`, `${i}-iw-${side}-bad`, "wb-tu-innen", 2, 0.8, 2.1, o ? { swing: "right" } : {});
}
}
// ── Decken, Treppen, Dach ───────────────────────────────────────────────────
@@ -1,12 +1,12 @@
viewBox -13.448 0 38.615 33.813
bytes 19729
bytes 26057
circle 14
g 1
line 63
line 97
polygon 30
polyline 9
polyline 21
rect 1
svg 1
text 32
text 42
tspan 9
hash b023ae6c031415a4
hash 6a884edea26dcb58
@@ -1,12 +1,12 @@
viewBox -12.974 0 37.808 33.406
bytes 318555
bytes 324873
circle 14
g 1
line 3209
line 3243
polygon 80
polyline 69
polyline 81
rect 1
svg 1
text 32
text 42
tspan 9
hash ef48702388970349
hash d245c556b1d94444
@@ -1,5 +1,5 @@
viewBox -41.5 0 95 63.6
bytes 68330
bytes 68381
circle 16
g 1
line 141
@@ -10,4 +10,4 @@ rect 1
svg 1
text 116
tspan 25
hash 4ff6f95d0f8fb3dd
hash 680e9c7d98703234
@@ -1,5 +1,5 @@
viewBox -13.448 0 38.615 33.813
bytes 45051
bytes 45105
circle 14
g 1
line 114
@@ -10,4 +10,4 @@ rect 1
svg 1
text 87
tspan 19
hash 1c84c9ae17eb227f
hash 627997a99a81b806
+15
View File
@@ -34,6 +34,21 @@ describe("levelMarkerPrimitives", () => {
expect(texts(marks)).toEqual(["±0.00", "+2.60", "+6.20"]);
});
it("[256] Nachbargebäude (Kontext-Netz auf Klasse 12 Gebäude) zählen nicht zum Gebauten, ein Netz auf eigener Klasse schon", () => {
const mesh = (id: string, categoryCode: string) => ({ type: "importedMesh", id, name: id, categoryCode, positions: [], indices: [] });
const project = { ...sampleProject, context: [...(sampleProject.context ?? []), mesh("nachbarn", "12"), mesh("ifc", "60")] } as typeof sampleProject;
const poly = (x0: number, x1: number, top: number, contextObjectId?: string): Primitive =>
({ kind: "polygon", pts: [{ x: x0, y: 0 }, { x: x1, y: 0 }, { x: x1, y: top }, { x: x0, y: top }], fill: "#000", stroke: "#000", strokeWidthMm: 0.5, contextObjectId }) as unknown as Primitive;
const line = (ax: number, ay: number, bx: number, by: number): Primitive =>
({ kind: "line", a: { x: ax, y: ay }, b: { x: bx, y: by }, cls: "section-cut-outline", weightMm: 0.5 }) as unknown as Primitive;
const house = poly(0, 5, 6.2);
const marks = levelMarkerPrimitives(project, { minX: -20, minY: -0.3, maxX: 5, maxY: 9 }, [house, poly(-20, -8, 9, "nachbarn"), line(-20, 9, -8, 9)]);
expect(texts(marks)).toEqual(["±0.00", "+2.60", "+6.20"]);
for (const p of marks) if (p.kind === "line") expect(Math.min(p.a.x, p.b.x)).toBeGreaterThan(-3);
const own = levelMarkerPrimitives(project, { minX: -20, minY: -0.3, maxX: 5, maxY: 9 }, [house, poly(-3, -1, 9, "ifc")]);
expect(texts(own)).toEqual(["±0.00", "+2.60", "+9.00"]);
});
it("standardmässig an, abschaltbar", () => {
const lv = sampleProject.drawingLevels.find((l) => l.kind === "section")!;
expect(levelMarksEnabled(lv)).toBe(true);
+34
View File
@@ -11,6 +11,14 @@ import type { Primitive } from "./generatePlan";
import { documentFor } from "../core/document";
import { decodePlanBuf } from "./planBuf";
import { derivedVisible, LEVEL_MARK_CATEGORY } from "../model/derivedCategories";
import {
CONTEXT_PARENT_CATEGORY,
EXCAVATION_CATEGORY,
GENERIC_IMPORT_CATEGORY,
GEO_CATEGORY_DEFS,
IMAGE_CATEGORY,
TERRAIN_CATEGORY,
} from "../model/contextCategories";
/**
* Ob eine Ebene automatische Koten trägt: Ebene > [173] Modelldarstellung der Ebene (`dimensions.levelMarks`,
@@ -53,10 +61,34 @@ function siteIds(project: Project): Set<string> {
return new Set((project.context ?? []).filter((c) => c.type === "terrainMesh" || c.type === "excavation" || c.type === "contourSet").map((c) => c.id));
}
// [256] Umgebungsklassen (Kern `import_context::is_context_class`): Netze darauf sind Nachbarn/Kataster, nicht das eigene Gebäude.
const CONTEXT_CLASSES = new Set([CONTEXT_PARENT_CATEGORY, TERRAIN_CATEGORY, IMAGE_CATEGORY, EXCAVATION_CATEGORY, GENERIC_IMPORT_CATEGORY, ...Object.values(GEO_CATEGORY_DEFS)].map((d) => d.code));
/**
* [256] Nachbargebäude (wie Kern `drawings::level_marker_bounds`): Flächen der Kontext-Netze auf einer Umgebungsklasse und
* Linien ganz in ihrem Ausmass (Umriss, Schnittkante) zählen nicht zum Gebauten.
*/
function neighbourFilter(project: Project, primitives: readonly Primitive[]): (q: Primitive) => boolean {
const ids = new Set((project.context ?? []).filter((c) => c.type === "importedMesh" && CONTEXT_CLASSES.has(c.categoryCode)).map((c) => c.id));
if (ids.size === 0) return () => false;
const boxes: [number, number, number, number][] = [];
for (const q of primitives) {
if (q.kind === "polygon" && q.contextObjectId && ids.has(q.contextObjectId)) {
const b: [number, number, number, number] = [Infinity, Infinity, -Infinity, -Infinity];
for (const v of q.pts) [b[0], b[1], b[2], b[3]] = [Math.min(b[0], v.x), Math.min(b[1], v.y), Math.max(b[2], v.x), Math.max(b[3], v.y)];
boxes.push(b);
}
}
const inBox = (v: { x: number; y: number }) => boxes.some((b) => v.x >= b[0] - 1e-6 && v.x <= b[2] + 1e-6 && v.y >= b[1] - 1e-6 && v.y <= b[3] + 1e-6);
return (q) => (q.kind === "polygon" ? !!q.contextObjectId && ids.has(q.contextObjectId) : q.kind === "line" && inBox(q.a) && inBox(q.b));
}
function builtMinX(project: Project, primitives: readonly Primitive[]): number {
const site = siteIds(project);
const neighbour = neighbourFilter(project, primitives);
let minX = Infinity;
for (const q of primitives) {
if (neighbour(q)) continue;
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") {
@@ -72,8 +104,10 @@ const TREE_PICK_PREFIX = "@tree:"; // Kern `tree::TREE_PICK_PREFIX`
function builtMaxY(project: Project, primitives: readonly Primitive[]): number {
const site = siteIds(project);
const neighbour = neighbourFilter(project, primitives);
let maxY = -Infinity;
for (const q of primitives) {
if (neighbour(q)) continue;
if (q.kind === "line") {
if (!NOT_BUILT_TOP.has(q.cls)) maxY = Math.max(maxY, q.a.y, q.b.y);
} else if (q.kind === "polygon") {