79 3D: Cuts, caps, and section measurements
3D reference map · First 3D picture
A plane section includes an explicit local numerical policy, plane basis, and component records. cut-mesh3d returns both clipped halves plus their shared section3d, optional separate cap meshes, and when capped, exact-coordinate welded solid halves through mesh-cut3d-result-positive-solid and mesh-cut3d-result-negative-solid. It does not mutate the source mesh. section3d-area, section3d-centroid, and section3d-perimeter operate on the same preserved section topology. Measurements reject an open/branch component, repeated vertex, zero-area loop, self-intersection, and a touching or intersecting pair of loops rather than silently treating it as an even/odd region. clip-planes3d and clip-box3d build ordered render-only half-space sequences.
section-fill3d exposes a separate cap-style mesh for a section; section-hatch3d creates deterministic even/odd stroke intervals in the plane-local basis, including empty intervals for nested holes. slice-stack3d retains stable section-group paths as planes advance along a normal. prepare-cross-section-function3d makes an immutable table of sections, areas, centroids, and diagnostics, which volume-by-slices3d evaluates with a declared midpoint, trapezoid, or Simpson rule. The sampling convention is part of the table and is checked by the chosen numerical rule. riemann-volume3d provides a separate midpoint-column construction for graph-volume explanations; each row and cell is an ordinary stable spatial child. washer-sum3d creates stable midpoint annular slabs about the x axis, and shell-sum3d creates stable midpoint cylindrical shells about the z axis. These are explanatory geometry groups; numerical volume estimation remains explicit.
The cap triangulator handles simple concave loops and a deterministic containment forest of nested holes. It bridges each immediate hole into its outer loop with a visible, source-order tie-broken bridge, then verifies that the cap triangle area equals outer area minus holes. mesh3d-weld performs exact-coordinate (never tolerance-based) boundary reuse for derived cut solids; it intentionally omits per-vertex normals because the current mesh representation has no per-corner normal channel.
Current limitations: cuts presently preserve positions, normals, and RGBA colours, but do not yet offer general UV/scalar/semantic attribute descriptors; cap construction for self-intersecting or touching contours does not yet have robust recovery (measurements reject those contours); and repeated semantic multi-plane cutting currently produces uncapped geometry.
procedure
(cut-mesh-by-box3d mesh bounds #:id id #:settings settings) → mesh3d? mesh : mesh3d? bounds : aabb3? id : symbol? settings : section3d-settings?
procedure
(mesh3d-weld meshes #:id id #:material material) → mesh3d? meshes : (listof mesh3d?) id : symbol? material : material3d?
procedure
(riemann-volume3d function [ #:x-range x-range #:y-range y-range #:resolution resolution #:base base] #:id id) → group3d? function : procedure? x-range : list? = (list -1 1) y-range : list? = (list -1 1) resolution : list? = (list 8 8) base : finite-real? = 0 id : symbol?
procedure
(washer-sum3d outer inner [ #:x-range x-range #:count count] #:id id) → group3d? outer : procedure? inner : procedure? x-range : list? = (list -1 1) count : exact-positive-integer? = 8 id : symbol?
procedure
(shell-sum3d height [ #:radius-range radius-range #:count count #:base base] #:id id) → group3d? height : procedure? radius-range : list? = (list 0 1) count : exact-positive-integer? = 8 base : finite-real? = 0 id : symbol?