feat(rig): add CameraRig.grid planar camera-wall preset#57
Merged
Conversation
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
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
CameraRighadring,stereo,arc,line,custom, andstationspresets 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 atcorner + c*right + r*down, returned row-major with idr*cols + c, all facinglook_at. Built throughCamera.look_at(like the other presets), so the RDF / Z-up /t = -R @ Cconvention is never re-derived. Modeled onCameraRig.lineand shares its_intrinsics/_resolve_overridesplumbing.Acceptance criteria
rows*colscameras spanning the plane defined bycorner+right/downspacing vectors_intrinsics(...)(exactly one offocal/fov_deg) and the existingoverridesshape (sequence or index-keyed mapping)rows >= 1,cols >= 1look_at(project(look_at)lands on the principal point), andt = -R@Cholds (centre()round-trips to the grid position)mypy,ruff check,ruff format --check,pytestgreenTests
tests/test_rig_grid.py(standalone — imports onlyCameraRig, no triangulation-reader dependency): the 2×3 facing/convention test above, an fov +overridescase, non-positiverows/colsrejection, and the exactly-one-of focal/fov guard. 4 passed.Fixes #51