Merge branch 'worktree-agent-add22047322fc40b9' into claude/practical-noether-1hb2s1

This commit is contained in:
Claude committed 2026-11-14 05:15:07 +00:00
commit 566aaa9c8f
31 files changed
+333 -72

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@
<line x1="3.2" y1="1.7125" x2="4.2" y2="1.7125" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.05"/>
<line x1="3.2" y1="1.49917" x2="4.2" y2="1.49917" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.05"/>
<line x1="3.2" y1="1.28583" x2="4.2" y2="1.28583" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.05"/>
<polygon points="3.78,3.09917 3.72667,3.15917 3.67333,3.03917 3.62,3.09917 3.2,3.09917 3.2,4.2725 4.2,4.2725 4.2,3.09917" fill="none" stroke="#1a1a1a" stroke-width="0.013"/>
<polygon points="3.9,3.09917 3.76667,3.24917 3.63333,2.94917 3.5,3.09917 3.2,3.09917 3.2,4.2725 4.2,4.2725 4.2,3.09917" fill="none" stroke="#1a1a1a" stroke-width="0.013"/>
<line x1="3.7" y1="4.2725" x2="3.7" y2="3.09917" stroke="#1a1a1a" stroke-width="0.01"/>
<line x1="3.7" y1="3.09917" x2="3.7" y2="1.0725" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.13667"/>
<polyline points="3.579,1.2925 3.7,1.0725 3.821,1.2925" fill="none" stroke="#1a1a1a" stroke-width="0.01"/>

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

+1 -1
View File
@@ -111,7 +111,7 @@ describe("ensureContextCategories", () => {
it("Tabelle im Kern = Definitionen hier (alle Codes)", () => {
const nested = [TERRAIN_CATEGORY, IMAGE_CATEGORY, GENERIC_IMPORT_CATEGORY, ...Object.values(GEO_CATEGORY_DEFS)];
const cat = (c: { code: string; name: string; color: string; lw: number }) => ({ code: c.code, name: c.name, color: c.color, lw: c.lw, visible: true, locked: false });
const cat = (c: { code: string; name: string; color: string; lw: number; fill?: string }) => ({ code: c.code, name: c.name, color: c.color, lw: c.lw, visible: true, locked: false, ...(c.fill ? { fill: c.fill } : {}) });
const out = ensureContextCategories([], [...nested.map((c) => c.code), IMPORTED_ROOF_CATEGORY.code]);
expect(out).toEqual([{ ...cat(CONTEXT_PARENT_CATEGORY), children: nested.map(cat) }, cat(IMPORTED_ROOF_CATEGORY)]);
});
+3 -1
View File
@@ -32,6 +32,8 @@ export interface ContextCategoryDef {
name: string;
color: string;
lw: number;
/** [256] Vorgabe-Füllung der Klasse (geschnittene Netze, z. B. Nachbargebäude hellgrau). */
fill?: string;
}
/**
@@ -105,7 +107,7 @@ export const IMPORTED_ROOF_CATEGORY: ContextCategoryDef = {
* als auch die echten swissBUILDINGS3D-Meshes ab (`building`).
*/
export const GEO_CATEGORY_DEFS: Record<GeoCategory, ContextCategoryDef> = {
building: { code: "12", name: "Gebäude", color: "#888888", lw: 0.25 },
building: { code: "12", name: "Gebäude", color: "#888888", lw: 0.25, fill: "#d9d9d9" },
road: { code: "11", name: "Strasse", color: "#808080", lw: 0.18 },
forest: { code: "04", name: "Wald", color: "#909090", lw: 0.13 },
parking: { code: "15", name: "Parkplätze", color: "#a0a0a0", lw: 0.13 },
+1 -1
View File
@@ -386,7 +386,7 @@ export const sampleProject: Project = {
children: [
{ code: "10", name: "Situation", color: "#909090", lw: 0.18, visible: true, locked: false },
{ code: "11", name: "Strasse", color: "#808080", lw: 0.18, visible: true, locked: false },
{ code: "12", name: "Gebäude", color: "#888888", lw: 0.18, visible: true, locked: false },
{ code: "12", name: "Gebäude", color: "#888888", lw: 0.18, fill: "#d9d9d9", visible: true, locked: false },
{ code: "13", name: "Bäume", color: "#808080", lw: 0.13, visible: true, locked: false },
{ code: "14", name: "Höhenlinien", color: "#808080", lw: 0.18, visible: true, locked: false },
],
+15
View File
@@ -74,6 +74,21 @@ describe("Musterhaus komplex", () => {
}
});
it("[256] EG 1:100: Geländekote und Revisionstext stehen nicht auf Masszahlen", () => {
const plan = generatePlan(p, "eg", codes, undefined, "mittel", false, false, true, 100);
const texts = plan.primitives.flatMap((q) => (q.kind === "drawingText" ? [q] : []));
// Grosszügige Box (Anker unbekannt: links, Mitte oder rechts) um den Text.
const box = (t: (typeof texts)[number]) => {
const w = 0.6 * t.heightM * t.text.length;
return [t.at.x - w, t.at.y - t.heightM, t.at.x + w, t.at.y + t.heightM];
};
const hit = (a: number[], b: number[]) => a[0] < b[2] && b[0] < a[2] && a[1] < b[3] && b[1] < a[3];
const dims = texts.filter((t) => /^\d+\.\d\d$/.test(t.text)).map(box);
const labels = texts.filter((t) => t.text.includes("Pfosten-Riegel") || /^[-+]\d+\.\d\d$/.test(t.text));
expect(labels.length).toBeGreaterThanOrEqual(2);
for (const t of labels) expect(dims.some((d) => hit(box(t), d)), t.text).toBe(false);
});
it("Schnitte und Ansichten rechnen", async () => {
for (const l of p.drawingLevels.filter((x) => x.kind === "section")) {
const o = await computeSection(p, l);
+11 -6
View File
@@ -609,7 +609,8 @@ function annotations(): Drawing2D[] {
// Höhenkoten (absolut, wie die Koten in Schnitt/Ansicht).
add("kote-eg", "eg", "80", { shape: "kote", at: P(3, 2.5), value: Z.eg, kind: "okFertig", rotation: 0 });
add("kote-eg-terrain", "eg", "80", { shape: "kote", at: P(8.5, -3), value: r3(terrainZ(8.5, -1)), kind: "okFertig", rotation: 0 });
// [256] Geländekote unter den Massketten und Achsblasen (vorher auf der Gesamtmasszahl „17.39“).
add("kote-eg-terrain", "eg", "80", { shape: "kote", at: P(12.5, -5.6), value: r3(terrainZ(12.5, -5.6)), kind: "okFertig", rotation: 0 });
add("kote-ug", "ug", "80", { shape: "kote", at: P(3, 2.5), value: Z.ug, kind: "okFertig", rotation: 0 });
add("kote-og", "og", "80", { shape: "kote", at: P(3, 2.5), value: Z.og, kind: "okFertig", rotation: 0 });
add("kote-dg", "dg", "80", { shape: "kote", at: P(3, 3.5), value: Z.dg, kind: "okFertig", rotation: 0 });
@@ -629,7 +630,8 @@ function annotations(): Drawing2D[] {
// Revisionswolke (Bögen nach aussen: negativer Bulge bei Gegenuhrzeigersinn).
const cloud = [...arcPts(P(12.6, 0), 1.9, -Math.PI, Math.PI, 18).slice(0, 18)].map((q) => P(q.x, r3(q.y * 0.6)));
add("revision-a", "eg", "90", { shape: "polyline", closed: true, pts: cloud, bulge: cloud.map(() => -0.45) }, { color: "#c0392b", weightMm: 0.35 });
add("revision-a-text", "eg", "90", { shape: "text", at: P(14.6, -1.4), text: "△A Pfosten-Riegel statt Fenstertür", height: 0.22, angle: 0 }, { color: "#c0392b" });
// [256] Revisionstext neben dem Hinweis unter den Massketten (vorher auf den Masszahlen der zweiten Kette).
add("revision-a-text", "eg", "90", { shape: "text", at: P(11.5, -4.5), text: "△A Pfosten-Riegel statt Fenstertür", height: 0.22, angle: 0 }, { color: "#c0392b" });
// [157] Nordpfeil am Ostrand der Parzelle zwischen den Bäumen (vorher auf „Kat.-Nr. 2417“ und der Ansichtslinie Ost).
add("nordpfeil", "eg", "50", { shape: "block", blockDefId: "blk-nord", at: P(26.8, 2.5), rotation: 0, scale: 1.2 });
@@ -722,12 +724,14 @@ const NO_NEIGHBOURS = vis(["12"]);
/** [207] Klassen, die ein Kataster-Import anlegt (Gewässer „17"): im Ausschnitt eingeblendet, auch wenn es sie im Beispiel noch nicht gibt (fehlender Code = aus). */
const KATASTER_VISIBLE: Record<string, boolean> = { "17": true };
/** [207] Klassen, die die Ansichtsvorlage „Situation WBW" ausblendet (`standards.rs::SITUATION_HIDDEN`; Test `sampleProjectComplex.situation.test.ts`). */
const SITUATION_HIDDEN = ["00", "07", "20", "21", "22", "25", "30", "35", "40", "50", "60", "80", "81", "82", "85", "90", "91", "99"];
const SITUATION_HIDDEN = ["00", "07", "20", "21", "22", "25", "30", "35", "40", "50", "60", "80", "81", "82", "85", "90", "91", "92", "99"];
const LEVEL_VIS: Record<string, boolean> = Object.fromEntries(LEVELS.map((l) => [l.id, true]));
/** Grundrisse auf Blättern: ohne Kataster, Strasse, Höhenlinien und Gelände. */
const PLAN_VIS = vis(["01", "02", "10", "11", "13", "14"]);
/** Kontext (Gelände, Baugrube, Höhenlinien, Kataster, Raster) aus — für das Detail. */
const HIDE_SITE = vis(["00", "01", "02", "07", "10", "11", "13", "14"]);
/** [256] Vorlagen der Arbeits-/Abgabepläne: Sonnenschatten (08) und Kameras (92) aus. */
const NO_SUN_CAMERA: Record<string, boolean> = { "08": false, "92": false };
/** Bildschirm-px je Meter, bei denen die Ansicht genau im Papier-Massstab 1:`scale` steht (96 dpi, wie `geometry.ts::dpi`). */
const pxPerMeterAt = (scale: number) => Math.round((96 / 25.4) * 1000 / scale * 100) / 100;
const snap = (id: string, name: string, level: string, scale: number, center: Vec2, extra: Partial<NonNullable<Project["viewSnapshots"]>[number]> = {}) => ({
@@ -741,13 +745,14 @@ function views(): Pick<Project, "viewTemplates" | "viewSnapshots" | "viewSnapsho
{ id: "or-brand", name: "Brandschutztüren rot", enabled: false, condition: { type: "layer_name", operator: "contains", value: "Türen" }, actions: { color: "#c0392b", lineweight: 0.35 } },
],
viewTemplates: [
{ id: "vt-gr100", name: "Grundriss 1:100", detail: "mittel", scaleDenominator: 100, scaleLineWeights: true, cutHeight: 1.0 },
{ id: "vt-gr50", name: "Grundriss 1:50 fein", detail: "fein", scaleDenominator: 50, scaleLineWeights: true },
// [256] Arbeits-/Vorprojekt-Grundrisse ohne Sonnenschatten (08) und Kamera-Sichtkegel (92); beides zeigt der Arbeitsplan ohne Vorlage.
{ id: "vt-gr100", name: "Grundriss 1:100", detail: "mittel", scaleDenominator: 100, scaleLineWeights: true, cutHeight: 1.0, layerVisibility: NO_SUN_CAMERA },
{ id: "vt-gr50", name: "Grundriss 1:50 fein", detail: "fein", scaleDenominator: 50, scaleLineWeights: true, layerVisibility: NO_SUN_CAMERA },
// [157] Schnitte zeigen nur die sichtbare Projektion; verdeckte Kanten über die eigene Vorlage.
{ id: "vt-schnitt", name: "Schnitt 1:100", detail: "mittel", scaleDenominator: 100 },
{ id: "vt-schnitt-verdeckt", name: "Schnitt mit verdeckten Kanten", detail: "mittel", scaleDenominator: 100, hiddenLines: true },
{ id: "vt-ansicht", name: "Ansicht 1:100 mit Schatten", detail: "mittel", scaleDenominator: 100, shadows: true },
{ id: "vt-brand", name: "Brandschutzplan", detail: "grob", scaleDenominator: 100, enabledOverrideRuleIds: ["or-brand"], mono: true },
{ id: "vt-brand", name: "Brandschutzplan", detail: "grob", scaleDenominator: 100, enabledOverrideRuleIds: ["or-brand"], mono: true, layerVisibility: NO_SUN_CAMERA },
],
viewSnapshotFolders: [{ id: "vf-gr", name: "Grundrisse" }, { id: "vf-sa", name: "Schnitte und Ansichten" }, { id: "vf-3d", name: "3D" }],
viewSnapshots: [
+1 -1
View File
@@ -245,7 +245,7 @@ function addRooms(p: Project): Project {
const codesOf = (ls: Project["layers"]): string[] => ls.flatMap((l) => [l.code, ...codesOf(l.children ?? [])]);
const visHidden = (hidden: string[]): Record<string, boolean> => Object.fromEntries(codesOf(sampleProject.layers).map((c) => [c, !hidden.includes(c)]));
/** Klassen, die die Situation ausblendet (wie `standards.rs::SITUATION_HIDDEN`). */
const SITUATION_HIDDEN = ["00", "07", "20", "21", "22", "25", "30", "35", "40", "50", "60", "80", "81", "82", "85", "90", "91", "99"];
const SITUATION_HIDDEN = ["00", "07", "20", "21", "22", "25", "30", "35", "40", "50", "60", "80", "81", "82", "85", "90", "91", "92", "99"];
const LEVEL_VIS: Record<string, boolean> = Object.fromEntries(LEVELS.map((l) => [l.id, true]));
const pxPerMeterAt = (scale: number) => Math.round(((96 / 25.4) * 1000) / scale * 100) / 100;
+6
View File
@@ -1826,6 +1826,12 @@ export type LayerCategory = {
locked: boolean;
/** Optionale Standard-Schraffur der Kategorie. */
hatch?: string;
/**
* [256] Füllfarbe der Klasse (hex) für geschnittene Netzkörper ohne eigene Regel (Grundriss und Schnitt),
* mit Umriss in Klassenfarbe und -stärke — z. B. Nachbargebäude „12 Gebäude" hellgrau statt schwarz.
* Fehlt sie, gilt die Körper-Konvention (ab 1:100 schwarz). Situation/Schwarzplan färben selbst ([207]).
*/
fill?: string;
/** Unterkategorien (Baum). */
children?: Array<LayerCategory>;
};
@@ -1,5 +1,5 @@
viewBox -41.5 0 95 63.6
bytes 68381
bytes 68384
circle 16
g 1
line 141
@@ -10,4 +10,4 @@ rect 1
svg 1
text 116
tspan 25
hash 680e9c7d98703234
hash 73ca22505d4b088b
@@ -1,5 +1,5 @@
viewBox -41.5 0 95 63.6
bytes 110542
bytes 110549
circle 16
g 1
line 365
@@ -10,4 +10,4 @@ rect 1
svg 1
text 116
tspan 25
hash 7648bcf107ccdde3
hash 757bff4a0a52194b
@@ -10,4 +10,4 @@ rect 1
svg 1
text 87
tspan 19
hash 627997a99a81b806
hash c7704fd40741d5cc
@@ -10,4 +10,4 @@ rect 1
svg 1
text 86
tspan 18
hash a90f35ea4563ac99
hash 7003cc6954740f63
@@ -10,4 +10,4 @@ rect 1
svg 1
text 71
tspan 15
hash f4ea57ac9b383644
hash 140af5eec3465b69
@@ -1,5 +1,5 @@
viewBox -13.693 0 38.527 33.406
bytes 48749
bytes 48751
circle 16
g 1
line 94
@@ -10,4 +10,4 @@ rect 1
svg 1
text 71
tspan 15
hash 77b2b13a58b74fb9
hash 4aa844c87458df0d
@@ -1,12 +1,11 @@
viewBox -41.5 0 95 63.6
bytes 5218
bytes 3579
g 1
line 7
line 3
path 1
polygon 18
polyline 3
polygon 10
polyline 2
rect 1
svg 1
text 9
tspan 1
hash 3d1684b3659e8901
text 8
hash c546873f54a3e7ff
@@ -1,12 +1,11 @@
viewBox -41.5 0 95 63.6
bytes 5218
bytes 3579
g 1
line 7
line 3
path 1
polygon 18
polyline 3
polygon 10
polyline 2
rect 1
svg 1
text 9
tspan 1
hash 3d1684b3659e8901
text 8
hash c546873f54a3e7ff
@@ -1,5 +1,5 @@
viewBox -1.621 0 8.242 7.535
bytes 5719
bytes 5717
g 1
line 17
polygon 19
@@ -8,4 +8,4 @@ rect 1
svg 1
text 5
tspan 2
hash 5c5454d2e7f9a18c
hash a49bed6c6d82f6b1
@@ -1,5 +1,5 @@
viewBox -1.56 0 8.121 7.354
bytes 9304
bytes 9302
g 1
line 18
polygon 49
@@ -8,4 +8,4 @@ rect 1
svg 1
text 5
tspan 2
hash 545b18572ba9c27a
hash 571259b69c30c68a