Skip to content

M2: calculation engine (grids, tilt, vertical illuminance, statistics) - #2

Merged
Erry91 merged 1 commit into
mainfrom
feat/m2-engine
Oct 21, 2026
Merged

Erry91 merged 1 commit into
mainfrom
feat/m2-engine

Conversation

@Erry91

@Erry91 Erry91 commented Oct 21, 2026

Copy link
Copy Markdown
Owner

What this changes

M2: the calculation engine.

  • Luminaires have a heading and a tilt. Tilt 90° is wall-mounted: the luminaire's nadir swings towards C0. IES tilt factors are applied, and a tilt outside the file's table is an error rather than a guess.

  • Direct illuminance on any surface: horizontal, vertical (e.g. at fire-fighting equipment) or inclined.

  • Grids:

    • over an area: a polygon, less a border;
    • along a route: the centre line, over its full width, with each corner counted once;
    • or points given one by one.

    Every grid is summed over all luminaires and capped at a million points.

  • Statistics: min, mean, max, max/min and min/mean. One undefined point (e.g. at a luminaire's centre) makes them None, which a check will report as "cannot verify".

  • Photometry plausibility warnings (gap 13), shown by luxpath photometry:

    • a relative file whose table emits more than its lamps;
    • an EULUMDAT file whose declared light output ratio disagrees with its table.
  • Faster intensity lookup (binary search).

How you verified it

  • cargo xtask ci, natively (macOS) and in the local Linux container, including the release-mode timing budget. Merged on the local checks (hosted CI unavailable).
  • Exit criteria:
    • isotropic and Lambertian cases match their closed forms within 1e-6, point by point over a grid;
    • 100 luminaires × 10,000 points take 53 ms (budget 100 ms).
  • Watched the tests fail: flipping the tilt direction and counting route corners twice each turn a test red.
  • Hand-checkable numbers: every test states its arithmetic in a comment.

Life safety (AGENTS.md §2)

  • No path reports "pass" when data is missing or ambiguous. Undefined points and tilts outside the file's table give no number.
  • The engine still ignores walls between luminaire and point; this is recorded as an alpha blocker (gap 16) to be fixed before M4's checks.

Never panic (AGENTS.md §3)

  • No new unwrap/indexing on input outside tests; non-finite inputs give None or errors; grid sizes are capped

Provenance (AGENTS.md §1)

  • No text or values from a standard. Grid spacings and borders stay parameters for M4 to set from the text.
  • Nothing from closed tools; no GPL/AGPL code

Records

  • parity/features.toml: calc.direct-point, grids, tilt and vertical illuminance shipped
  • docs/status.md, docs/gaps.md (rows 3, 8, 9 and 13 closed; 16 added), docs/roadmap.md, ROADMAP.md log

Luminaires with heading and tilt (IES tilt factors applied), direct
illuminance on any surface, area and full-width route grids summed over
luminaires, min/mean/max and uniformity statistics that are unverifiable
when any point is; photometry plausibility warnings. Isotropic and
Lambertian cases within 1e-6; 100 luminaires x 10,000 points in ~55 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Erry91
Erry91 merged commit dde3bfb into main Oct 21, 2026
@Erry91
Erry91 deleted the feat/m2-engine branch October 21, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant