Skip to content

feat(examples): add ray-cast-space and lattice-deform - #304

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/ray-cast-lattice-examples
Oct 2, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
feat/ray-cast-lattice-examples

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Adds two rendered gallery examples taken from the ROADMAP candidate pool.

ray-cast-space

Contract: Object.ray_cast takes object-local coordinates and Scene.ray_cast takes world coordinates. The script casts five closed-form rays at a block that is translated, rotated 32° about Z and scaled 1.55 × 0.62 × 0.62.

Exit Check
3 Scene.ray_cast hits every world point and normal exactly
4 Object.ray_cast, fed matrix_world.inverted() origins and directions mapped through the 3×3 only, hits the same polygon. Mapped back, it lands within 5e-7 m
5 World coordinates handed straight to Object.ray_cast must land at least 0.25 m off (measured: 0.287 m). Without this, the trap check could pass by coincidence

Falsifier: --world-to-object exits 4. Ray 0 mapped back lands 1.1253 m off and hits polygon 2 instead of 3.

lattice-deform

Contract: a 2×2×2 lattice with interpolation_type_u/v/w = 'KEY_LINEAR', two top corners moved through LatticePoint.co_deform, read back through the depsgraph (evaluated_get / to_mesh / to_mesh_clear). All 602 evaluated vertices land on the trilinear closed form, max error 5.62e-07. The lattice object is translated and scaled unevenly.

Exit Check
3 An unmoved lattice leaves the mesh unchanged
4 Every vertex matches the trilinear closed form
5 The mesh actually moved (0.531 max), so the check cannot pass vacuously

Falsifier: --bspline (the default interpolation) exits 4. The max error is 0.2145.

Evidence: live local runs

All binaries are under .scratch/; each run went through a single-Blender lock.

Binary (reported version) ray-cast-space default --world-to-object lattice-deform default --bspline
Blender 5.2.1 LTS exit 0 exit 4 exit 0 exit 4
Blender 4.5.11 LTS (4db51e9d1e1e) exit 0 exit 4 exit 0 exit 4
Blender 5.1.2 (ec6e62d40fa9) exit 0 not run exit 0 exit 4
  • ray-cast-space also ran two throwaway probes, since deleted. Local coordinates fed to Scene.ray_cast exit 3 (1.46 m off). An identity transform exits 5.
  • tests/smoke/run_example.py reports [PASS] for lattice-deform on 5.2.1 and 4.5.11.
  • Each check-only run takes about 1 s.

Contact sheets (docs/gallery/contact-sheets/)

Tile Luma Stage Warmth Saturation
ray-cast-space 0.224 0.192 −0.094 0.204
lattice-deform 0.284 0.218 +0.050 0.170
armature-bend 0.243 0.192 −0.144 0.237
damped-track-aim 0.237 0.218 +0.105 0.178
bmesh-gear 0.237 0.252 +0.092 0.153
  • Every criterion passes for both stills.
  • lattice-deform is the brightest tile. It is still below shipped outliers such as attribute-domain-shear (0.285), png-exr-alpha (0.299) and compositor-glare (0.417).
  • Framing gate fill: ray-cast-space x 0.481 / y 0.789; lattice-deform x 0.812 / y 0.867.
  • ray-cast-space contact sheet · lattice-deform contact sheet

Wiring

  • examples/gallery.json, tests/smoke/catalog.json and .cursor-plugin/plugin.json have entries for both examples.
  • README has two rows in "Mesh, curves & text" (13 → 15). The counts move from 60 to 62 examples and from 52 to 54 rendered.
  • The AGENTS.md and CLAUDE.md counts are updated, and their stale showcase count is corrected from 67 to 72.
  • In ROADMAP, both candidates are marked SHIPPED and one new candidate is added: lattice use_outside.
  • docs/gallery/ is regenerated. The alt text and witnesses callout on both new pages match gallery.json character for character.

Local checks (all pass): check_site_links (129 pages, 0 failures), check_exit_code_readme, check_engine_id, check_gallery_images, check_falsifier_targets.

Established by inspection only: the heroes were produced by a scratch stand-in that calls render_hero.py's functions with the same settings, because render_hero.py rejects names that are not yet in gallery.json. With the entries now wired, render_hero.py --only <name> reproduces them.

🤖 Generated with Claude Code

ray-cast-space: Object.ray_cast takes object-local coordinates;
Scene.ray_cast takes world coordinates. The script casts five closed-form
rays at a block that is translated, rotated about Z and scaled unevenly.
- Scene.ray_cast hits every world point and normal exactly (exit 3).
- Object.ray_cast, given matrix_world.inverted() origins and directions
  mapped through the 3x3 only, hits the same polygons and maps back
  within 5e-7 m (exit 4).
- World coordinates passed straight to Object.ray_cast land at least
  0.287 m from the true hits (exit 5).
- --world-to-object exits 4 with a 1.125 m error.

lattice-deform: a 2x2x2 KEY_LINEAR lattice with two corners moved
through co_deform puts all 602 evaluated vertices on the trilinear
closed form, max error 5.6e-7, through a translated and unevenly scaled
lattice.
- An unmoved lattice is the identity (exit 3).
- The mesh really does move (exit 5).
- --bspline, the default interpolation, misses by 0.2145 and exits 4.

Both pass the default check on Blender 4.5.11, 5.1.2 and 5.2.1, and each
falsifier is proven on 4.5.11 and 5.2.1. Contact sheets are committed
under docs/gallery/contact-sheets/. Counts are updated in README, AGENTS,
CLAUDE and new-example-prompt; the AGENTS and CLAUDE showcase counts are
corrected from 67 to 72 as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
@github-actions github-actions Bot added examples Runnable smoke-gated examples under examples/ documentation Improvements or additions to documentation labels Oct 2, 2026
@TMHSDigital
TMHSDigital merged commit f7511b1 into main Oct 2, 2026
12 checks passed
@TMHSDigital
TMHSDigital deleted the feat/ray-cast-lattice-examples branch October 2, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples Runnable smoke-gated examples under examples/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant