[140] Plandarstellung Teil 5: Schnittflächen 1:100 schwarz, dünne Schichten, Raumstempel im L-Raum

- Schnittflächen ab 1:100 (mittel; grob immer) als schwarze Fläche ohne Fugen/Schraffur, nur Umriss:
  Wände, Stützen, Körper im Grundriss, alle geschnittenen Bauteile im Schnitt (style::solid_cut).
  1:50 und „fein" schraffiert; Feld cutHatch an Ebene/Ansichtsvorlage übersteuert das 1:100.
- Dünne Schichten: gemeinsame Regel in plan/style.rs (unter 0.5 mm Papier, ab 1:50, nicht „fein")
  für Wände im Grundriss, Schnitt-Schichten und dünne Dämmung.
- Raumstempel: Anker = Pol der Unzugänglichkeit (room_area::label_point), Platz aus dem Raumumriss
  (rect_in_ring) statt Bounding-Box, Ausweichen im Raum, Breite aus Inter-Schriftmetrik
  (text_layout::text_width_em, stamp_block_size); neue Räume ohne festen Anker.
- Goldens neu, TODO.md nachgeführt.
This commit is contained in:
Claude committed 2026-11-06 15:39:04 +00:00
1 parent 6d41a84511
commit ce631273a6
50 files changed
+829 -268

No files matched your search

+13 -1
View File
@@ -3,7 +3,7 @@
import { describe, expect, it } from "vitest";
import { core } from "../engine/coreWasm";
import { balance, centroid, evaluateRoom, polygonArea, roomsToCsv, SIA_CATEGORIES, siaLabel } from "./roomArea";
import { balance, centroid, evaluateRoom, polygonArea, roomLabelPoint, roomsToCsv, SIA_CATEGORIES, siaLabel } from "./roomArea";
describe("Kern-Anbindung", () => {
it("Kategorie-Namen und -Reihenfolge stimmen mit dem Rust-Kern überein", () => {
@@ -123,3 +123,15 @@ describe("roomsToCsv() — Bilanzblock mit AGF", () => {
expect(gfLine).toContain("26.00");
});
});
describe("roomLabelPoint", () => {
it("[140] liegt im L-Raum, nicht am Schwerpunkt ausserhalb", () => {
// schmales L: Schwerpunkt (≈ 1.4/1.4) liegt ausserhalb
const l = [{ x: 0, y: 0 }, { x: 6, y: 0 }, { x: 6, y: 1 }, { x: 1, y: 1 }, { x: 1, y: 6 }, { x: 0, y: 6 }];
const c = centroid(l);
expect(c.x > 1 && c.y > 1).toBe(true);
const q = roomLabelPoint(l);
expect((q.x < 1 && q.y > 0 && q.y < 6) || (q.y < 1 && q.x > 0 && q.x < 6)).toBe(true);
expect(roomLabelPoint([{ x: 0, y: 0 }, { x: 4, y: 0 }, { x: 4, y: 2 }, { x: 0, y: 2 }])).toEqual({ x: 2, y: 1 });
});
});
+10
View File
@@ -34,6 +34,16 @@ export function centroid(pts: Vec2[]): Vec2 {
return { x: c[0], y: c[1] };
}
/**
* [140] Ankerpunkt des Raumstempels ohne eigenen Anker: Pol der Unzugänglichkeit (Kern
* `room_area::label_point`) — liegt auch in L-förmigen/konkaven Räumen im Raum, bei
* Rechtecken in der Mitte. Gleicher Punkt wie Plan, Griff und Fang.
*/
export function roomLabelPoint(pts: Vec2[]): Vec2 {
const c = core().room_label_point(new FlatWriter().pts(pts).done());
return { x: c[0], y: c[1] };
}
// ── SIA-416-Kategorie-Hierarchie ─────────────────────────────────────────────
//
// SIA 416 gliedert die Geschossfläche (GF) eines Gebäudes hierarchisch: