Skip to content

feat(rig): add CameraRig.grid planar camera-wall preset#57

Merged
bamdadd merged 1 commit into
bamdadd:mainfrom
dchaudhari7177:feat/camera-rig-grid
Jul 22, 2026
Merged

feat(rig): add CameraRig.grid planar camera-wall preset#57
bamdadd merged 1 commit into
bamdadd:mainfrom
dchaudhari7177:feat/camera-rig-grid

Conversation

@dchaudhari7177

Copy link
Copy Markdown
Contributor

What

CameraRig had ring, stereo, arc, line, custom, and stations presets but no planar grid — a common capture setup (camera wall / light-stage front).

Adds CameraRig.grid(rows, cols, corner, right, down, look_at, *, width, height_px, focal|fov_deg, overrides=None): camera (r, c) sits at corner + c*right + r*down, returned row-major with id r*cols + c, all facing look_at. Built through Camera.look_at (like the other presets), so the RDF / Z-up / t = -R @ C convention is never re-derived. Modeled on CameraRig.line and shares its _intrinsics / _resolve_overrides plumbing.

Acceptance criteria

  • ✅ returns rows*cols cameras spanning the plane defined by corner + right/down spacing vectors
  • ✅ reuses _intrinsics(...) (exactly one of focal/fov_deg) and the existing overrides shape (sequence or index-keyed mapping)
  • ✅ validates rows >= 1, cols >= 1
  • ✅ a test asserts count, that every camera faces look_at (project(look_at) lands on the principal point), and t = -R@C holds (centre() round-trips to the grid position)
  • mypy, ruff check, ruff format --check, pytest green

Tests

tests/test_rig_grid.py (standalone — imports only CameraRig, no triangulation-reader dependency): the 2×3 facing/convention test above, an fov + overrides case, non-positive rows/cols rejection, and the exactly-one-of focal/fov guard. 4 passed.

Fixes #51

CameraRig had ring/stereo/arc/line/custom/stations but no planar grid —
a common capture setup (camera wall / light-stage front). Add
grid(rows, cols, corner, right, down, look_at, ...): rows*cols cameras
at corner + c*right + r*down, all facing look_at, built through
Camera.look_at so the RDF / Z-up / t=-R@C convention is never
re-derived. Reuses _intrinsics (exactly one of focal/fov_deg) and the
existing overrides plumbing; validates rows>=1, cols>=1.

Fixes bamdadd#51
@bamdadd
bamdadd merged commit a6676a2 into bamdadd:main Jul 22, 2026
1 check passed
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.

Add a CameraRig.grid preset (planar M×N camera wall facing a target)

3 participants