Expand description
Analytic ray/membership evaluation of a DynamicObject tree.
A tree is flattened into supported primitive leaves (GeomLeaf, each
carrying its accumulated world transform) plus a boolean expression over
them (CsgExpr). Rays are intersected per leaf in local space and the
resulting t-intervals are combined through the booleans (classic ray-CSG
with normal flipping under Difference), so a hit identifies the final
solid’s surface: leaf, face tag, and outward normal — with no meshing.
§Conventions
- Primitive anchors follow the backend contract pinned in
rscad-csg-traits/src/dynamic.rs: cube corner-anchored spanning[0, size], cylinder/cone base ony = 0extending along+Y, sphere centered at the origin. Rotateaccumulates as Rz·Ry·Rx (OpenSCAD order), matching every renderer (DynamicObject::extract_top_transforms, the SDF compiler, Manifold). NoteSceneGraph::world_transformcurrently uses XYZ order — a pre-existing divergence; this module must match the pixels.- A zero-length
Mirroraxis yields empty geometry (Manifold behavior). - Bare 2D leaves in 3D context evaluate to empty (Manifold semantics).
- Rays keep their (unnormalized) world parameterization in local space, so
tvalues are directly comparable across leaves.
Structs§
- CsgLeaves
- Flattened analytic model of one tree: primitive leaves + boolean structure.
- Geom
Leaf - A primitive leaf with its accumulated world transform.
- HitBoundary
- One surface crossing along a ray.
- HitSpan
- A solid stretch of the ray:
enter.t < exit.t.
Enums§
- CsgExpr
- Boolean structure over leaf indices into
CsgLeaves::leaves. - Leaf
Prim - A supported primitive in its local frame.
Type Aliases§
- Aabb
Hint - Callback supplying a conservative local-space AABB for a subtree this
module cannot evaluate analytically (sketch/extrude/revolve/offset based).
Returning
Nonedrops the subtree from the model (it stops occluding).