Merge branch 'worktree-agent-aff5338e4491688d0' into claude/practical-noether-1hb2s1
# Conflicts: # TODO.md
This commit is contained in:
11 files changed
+765
-155
No files matched your search
@@ -94,3 +94,29 @@ describe("Schatten in eine Richtung (Musterhaus komplex)", () => {
|
||||
expect(Math.min(...pts.map(dot))).toBeLessThan(Math.min(...casters.map(dot)) - 2);
|
||||
});
|
||||
});
|
||||
|
||||
// [186] Grundriss EG (Schnitt 1.0): Der Schatten schliesst an die Fassaden auf der Schattenseite an. Vorher lag
|
||||
// unter dem Dachvorsprung (Nord 0.6 m, West 0.35 m) kein Schatten — die Traufe galt als Abdeckung —, er
|
||||
// begann erst jenseits davon.
|
||||
describe("Schatten an der Fassade (Musterhaus komplex, EG)", () => {
|
||||
it("Punkte 1 cm vor Nord- und Westfassade liegen im Schatten", async () => {
|
||||
const { buildComplexSampleProject } = await import("../model/sampleProjectComplex");
|
||||
const p = buildComplexSampleProject();
|
||||
const { lat, lon } = projectLatLon(p);
|
||||
const sun = sunPosition(lat, lon, new Date(p.sunStudy!.when));
|
||||
const shadows = shadowPolygons(p, sun, 1.0);
|
||||
const inside = (q: Vec2, r: Vec2[]) => {
|
||||
let c = false;
|
||||
for (let i = 0, j = r.length - 1; i < r.length; j = i++) {
|
||||
if (r[i].y > q.y !== r[j].y > q.y && q.x < ((r[j].x - r[i].x) * (q.y - r[i].y)) / (r[j].y - r[i].y) + r[i].x) c = !c;
|
||||
}
|
||||
return c;
|
||||
};
|
||||
const shaded = (q: Vec2) => shadows.some((poly) => poly.reduce((c, r) => (inside(q, r) ? !c : c), false));
|
||||
// Aussenkante Nord (Atelier) y = 10.195, West x = −0.195.
|
||||
for (const x of [0.5, 2.5, 4.5]) expect(shaded({ x, y: 10.205 }), `Nord x=${x}`).toBe(true);
|
||||
for (const y of [6, 8, 9.5]) expect(shaded({ x: -0.205, y }), `West y=${y}`).toBe(true);
|
||||
// Das Innere bleibt ohne Schatten.
|
||||
expect(shaded({ x: 2.5, y: 7.5 })).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1,13 +1,13 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 65151
|
||||
bytes 66337
|
||||
circle 16
|
||||
g 1
|
||||
line 141
|
||||
path 35
|
||||
polygon 92
|
||||
path 36
|
||||
polygon 91
|
||||
polyline 102
|
||||
rect 1
|
||||
svg 1
|
||||
text 115
|
||||
tspan 24
|
||||
hash 58d95467205cbc3f
|
||||
hash 1042a774ff09039d
|
||||
@@ -1,13 +1,13 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 106864
|
||||
bytes 108050
|
||||
circle 16
|
||||
g 1
|
||||
line 369
|
||||
path 66
|
||||
polygon 213
|
||||
path 67
|
||||
polygon 212
|
||||
polyline 120
|
||||
rect 1
|
||||
svg 1
|
||||
text 115
|
||||
tspan 24
|
||||
hash 31ce4a3b10a014d6
|
||||
hash 05cb29305849a69a
|
||||
@@ -24,8 +24,14 @@ describe("Schattenstudie im Grundriss", () => {
|
||||
const first = generatePlan(p, "eg", ALL).primitives[0];
|
||||
expect(first.kind === "polygon" && first.fill === SUN_SHADOW_FILL).toBe(true);
|
||||
});
|
||||
it("nicht im OG, nicht ausgeschaltet, nicht nachts, nicht ohne Studie", () => {
|
||||
expect(shadows(withStudy("2026-12-21T11:00:00Z"), "og")).toEqual([]);
|
||||
it("im OG nur auf dem Balkon, nicht ausgeschaltet, nicht nachts, nicht ohne Studie", () => {
|
||||
// [186] OG: kein Gelände-Schatten; die EG-Decke ragt nördlich als Balkon (y 3.17…4) unter dem Dachvorsprung
|
||||
// vor — im Freien, auf der Schattenseite, also beschattet (vorher galt die Traufe als Abdeckung).
|
||||
const og = shadows(withStudy("2026-12-21T11:00:00Z"), "og");
|
||||
const ys = og.flatMap((q) => (q.kind === "polygon" ? q.pts.map((p) => p.y) : []));
|
||||
expect(og.length).toBe(1);
|
||||
expect(Math.min(...ys)).toBeGreaterThan(3.1);
|
||||
expect(Math.max(...ys)).toBeLessThan(4 + 1e-6);
|
||||
expect(shadows(withStudy("2026-12-21T11:00:00Z", false), "eg")).toEqual([]);
|
||||
expect(shadows(withStudy("2026-12-21T22:00:00Z"), "eg")).toEqual([]);
|
||||
expect(shadows(sampleProject, "eg")).toEqual([]);
|
||||
|
||||
Reference in new issue
Block a user