Eye-zone model with reflected-glare constraints - #3
Merged
Conversation
protect_depth protects a strip of floor; the real target is eyes. New optional window config models them directly: - eye_zone: a height range and depth range to keep sun out of, replacing protect_depth (which remains as the degenerate floor-level case and is unchanged for existing configs). - reflectors: horizontal reflective surfaces (floor, counters) as height + distance span. Each adds one linear constraint by unfolding the mirror: a bounce into the eye zone is a straight ray into the zone's reflection below the surface. Constraints are clipped to the strip that can actually bounce into the zone and the patch the sun actually lights, so the escape case (bounces landing beyond the hazard) falls out for free. - sill_height: absolute heights now matter, so the bottom of the glass is a real input (default 0 keeps old behavior). The published position is the highest satisfying every constraint — non-monotonic over a day by design: high sun can close (floor bounce climbs into eyes), mid-descent opens, low sun closes again. The glare sensor gains a 'constraint' attribute (direct/reflected/none) for shadow-mode tuning. Worst-case assumptions (specular bounce, full window width) over-shade rather than under-shade; narrow a reflector's span if it binds at hours nobody experiences glare. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the floor-strip
protect_depthmodel with an optional eye zone — a height range × depth range to keep sun out of — plus reflectors (floor, countertops) that catch sun bouncing up into it.protect_depthis unchanged and remains the default; nothing changes for existing configs until a zone opts in.How it works
All geometry stays in the profile-angle plane, so each reflector is just
{height, from, to}— no 3D. Reflections are handled by unfolding the mirror: a bounce off a plane at height r into the eye zone is a straight ray into the zone's mirror image below that plane, so every reflector is one more linear constraint in the samemin(). Constraints are clipped to the strip of surface that can actually bounce into the zone and to the patch the sun actually lights, which yields the escape case (bounce lands beyond the hazard, rises past the eyes) for free.The result is deliberately non-monotonic over a day — glare when high (floor bounce), open mid-descent, closing again as the sun reaches eye level — matching the observed kitchen behavior.
Changes
calculator.py:EyeZone,Reflector,sill_height;glare()takes the min over direct + per-reflector constraints and reports which one bound via a newconstraintfield__init__.py: YAML schema (eye_zone,reflectors,sill_height), cross-field validation,protect_depthnow optional-but-one-requiredsensor.py:constraintattribute on the glare sensor (direct/reflected/none) for shadow-mode tuningVerification
pytest tests/ -q→ 28 passedSuggested rollout: add an
eye_zone+ floor/counter reflectors to the kitchen zone only, shadow theconstraintattribute for a few sunny days, and narrow reflector spans ifreflectedbinds at glare-free hours.🤖 Generated with Claude Code