From 6e22c0e15ea6e27c2f2b61327be8fb9b50054e7e Mon Sep 17 00:00:00 2001 From: karim Date: Fri, 23 Oct 2026 11:51:28 +0200 Subject: [PATCH] 3D: Parallel-/Kreuzschraffur der Wand-Oberseite um 90 Grad an die 2D-Kachel angeglichen (Daemmungslinien stehen quer zur Wand) --- src/plan/toWalls3d.test.ts | 6 +++--- src/plan/toWalls3d/bands.ts | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plan/toWalls3d.test.ts b/src/plan/toWalls3d.test.ts index 60501813..8bc3967d 100644 --- a/src/plan/toWalls3d.test.ts +++ b/src/plan/toWalls3d.test.ts @@ -2765,7 +2765,7 @@ describe("emitStairs — gerade Betontreppe im Schnitt: glatte Soffit-Untersicht }); describe("Wand-Schraffur in der Draufsicht (topAngle)", () => { - it("relativeToWall-Muster folgt der Wandachse: Wand längs x → 0°, längs y → 90°", () => { + it("relativeToWall-Muster folgt der Wandachse: Dämmungs-Linien stehen QUER zur Wand (wie im 2D): längs x → 90°, längs y → 0°", () => { const p: Project = { ...sampleProject, hatches: sampleProject.hatches.map((h) => @@ -2780,7 +2780,7 @@ describe("Wand-Schraffur in der Draufsicht (topAngle)", () => { const alongY = ins.filter((w) => along(w, 1)); expect(alongX.length).toBeGreaterThan(0); expect(alongY.length).toBeGreaterThan(0); - for (const w of alongX) expect(Math.abs(((w.hatch!.topAngle ?? 99) + 360) % 180)).toBeLessThan(1e-6); - for (const w of alongY) expect(Math.abs((((w.hatch!.topAngle ?? 0) % 180) + 180) % 180 - 90)).toBeLessThan(1e-6); + for (const w of alongX) expect(Math.abs((((w.hatch!.topAngle ?? 0) % 180) + 180) % 180 - 90)).toBeLessThan(1e-6); + for (const w of alongY) expect((((w.hatch!.topAngle ?? 99) % 180) + 180) % 180).toBeLessThan(1e-6); }); }); diff --git a/src/plan/toWalls3d/bands.ts b/src/plan/toWalls3d/bands.ts index 9740cd23..705f3bec 100644 --- a/src/plan/toWalls3d/bands.ts +++ b/src/plan/toWalls3d/bands.ts @@ -191,7 +191,11 @@ function withTopAngle(h: RHatch, dx: number, dy: number): RHatch { if (h.baseAngle === undefined) return h; const wallAngle = (Math.atan2(dy, dx) * 180) / Math.PI; const svgAngle = h.relativeToWall ? h.baseAngle - wallAngle : h.baseAngle; - return { ...h, topAngle: -svgAngle }; + // Parallel-/Kreuzschar (diagonal=2, crosshatch=3): die 2D-Kachel trägt bei Winkel 0 eine + // SENKRECHTE Musterlinie (glPlanHatch: Basisrichtung (0,−1)), der 3D-Shader bei Winkel 0 + // eine HORIZONTALE → um 90° versetzen. Die Dämmungs-Welle (4) läuft in beiden entlang u. + const quarter = h.pattern === 2 || h.pattern === 3 ? 90 : 0; + return { ...h, topAngle: -svgAngle + quarter }; } /**