OrientedBoxClip

An oriented-box intersection applied to a scene SDF at export.

In the namespace construct::xport. Declared in src/libs/libconstruct/construct/export/BoxClip.hpp.

Detailed description

§BVX-5 / owner report 2026-09-02. Clipping an export by truncating the SAMPLE DOMAIN produces a ragged cut — the extractor caps at grid cells and the post-process `sdfProject` then drags those cap vertices back onto the scene surface, giving polygon soup at the cut edge. Clipping by the FIELD fixes it: intersect the scene SDF with the box's own signed-distance field,

clipped(p) = max(scene(p), boxDistance(p)),

so the isosurface of `clipped` carries a genuine flat face wherever the box plane cuts through solid material. `sdfProject` then projects onto THAT surface and keeps the face flat, because the flat face IS the isosurface.

The box is evaluated in its OWN frame: the query point is mapped through `worldToLocal` and tested against an axis-aligned box of half-extent `half`. So a rotated or parented volume clips to its true oriented faces — which is exactly what §BVX-5 (BV-42) asks for, with no change to the extractor or the scheduler, only to the field the evaluator reports.

⚠ Distances are exact only for a RIGID `worldToLocal` (rotation + translation, no scale). §BVD-2c gives a volume no scale of its own, but an ancestor can; an inherited scale rescales the box distance uniformly, which shifts the cut plane sub-cell, not catastrophically. The viewport clip (`boundsInvTransform`) has the identical property, so display and export agree. A non-rigid frame is out of scope for the exact case and tracked with §BVX-5e.

In this section