luft/mesh-variation.lisp
Compile one site policy and realize an owner-preserving mesh cohort.
Evaluate one closed width-one witness at a local width per vertex site.
width-function is called once for each canonical lattice vertex as
(width-function X Y Z INCIDENT-STOCKS)
where INCIDENT-STOCKS is a sorted, duplicate-free list of the packed stocks on
witness triangles using that site. It must return an integer width from one
through four.
Every witness vertex has the exact affine form 8*S + Q with Q in {-1,0,1}^3.
The result replaces it by 8*S + width(S)*Q. Since every incident primitive
uses the same canonical S, shared vertices remain equal without stitching.
At the medial limit a witness triangle can collapse to three collinear points.
The result contracts that triangle by splitting its surviving neighbour's long
edge at the middle point, eliminating the otherwise visible T-junction without
inventing a surface. witness remains the rebuild oracle for topology and
uniform-width geometry. Transition triangles may leave the uniform mesher's
26 exact normal directions. The packed trit normal remains an orientation
witness; fragment shading derives the actual primitive normal from world-space
position derivatives, so the new directions are not lighting-quantized.
The second value is a five-entry site census indexed by width. The third is a diagnostic plist containing the collapsed-triangle, locally unmatched-edge, repaired-edge, and residual-edge counts. For the required closed width-one witness, only a collapse can change edge parity, so the queried local counts are the complete transition defect. This production entry point always contracts medial T-junctions; the deliberately open study surface has a separate diagnostic name.
Return the deliberately open pre-repair variable-width study surface.
Evaluate a closed width-one witness from an incident-stock mask policy.
stock-masks is indexed by packed triangle stock. The masks of every stock
incident on a canonical vertex site are combined with LOGIOR, then that mask
indexes site-widths. This is the dense production form of the generic callback
contract: it preserves the same shared site field and the same realization and
repair algorithm without constructing stock lists in the triangle loop.
Every referenced stock mask must be a positive fixnum bit mask, and each
combined mask must be a valid site-widths index. Index zero is unused; every
selected entry must be an integer width from one through four. This canonical
entry point always repairs medial T-junctions.
Return the dense-policy variable-width study surface before repair.
Evaluate an owner-keyed width-one cohort from one shared stock-mask policy.
owner-witnesses is a nonempty alist of stable owner keys to width-one surface
meshes in one world domain. The incident stock masks of every witness are
compiled into one canonical site field; collapse discovery and T-junction
repair likewise see the entire cohort. Each surviving source triangle and
every repair child is emitted to the source triangle's original owner.
When output-owners is omitted, every witness owner is returned. When supplied,
it is a nonempty subset of the witness keys. Every witness contributes to the
shared site policy and repair plan. realize-context-owners may additionally
select nonpublished owners whose transformed surface is needed by a cold query,
such as an attachment frame whose canonical primitive belongs to a neighboring
chunk. Context realization never expands the output publication set.
The first value is a fresh alist, in owner-witnesses order, containing only the
selected owners. The second value is the shared five-entry site-width census.
The third is the transition diagnostic plist; its residual count covers only
collapse/repair neighborhoods relevant to the selected output interior. The
fourth value is a fresh alist of realized context owners, also in witness order
and excluding every selected output owner.
(owner-witnesses output-owners realize-context-owners
width-function stock-masks site-widths contract-t-junctions-p)Logical conjunction of tests and raw truth values.
(a b)Test whether two compatible scalars are equal.
(domain stock-masks site-widths)(owner-witnesses stock-masks site-widths width-census)Fold a positive byte stock lane through sparse 8-cubed pages. Return the sparse or dense realized width field, its exact site count and maximum width, and its inclusive coordinate bounds. Pages are only the one-pass accumulation language; the returned field has the same tight layout used by the generic compiler and…
The maximum of compatible quantities.
(site)(site)(site)The minimum of compatible quantities.
(x y z)Multiplication and scalar scaling.
((mesh kind stock ambient mask
ax ay az bx by bz cx cy cz)
&body body)Iterate MESH's packed triangles with scalar coordinates and no callback. This is the dense-loop counterpart to %MAP-SURFACE-MESH-TRIANGLE-RECORDS. The latter deliberately materializes convenient point and normal lists for cold transformations and inspection; performance-sensitive compilers should keep the packed…
Test whether one compatible scalar is less than another.
Logical disjunction of tests and raw truth values.
Test whether one compatible scalar is at most another.
Division of two represented quantities.
(key)(key)(key)Subtraction or unary negation.
(x0 x1 y0 y1)Pack anchors of the cell box [X0, X1) x [Y0, Y1). Instance bases lie inside the box and template offsets reach at most one eighth-cell anchor beyond it, so the packed anchor box is widened by two.
Headings, paragraphs, figures and their IDs, mentions, marks.
(x y z x0 y0 z0 y-span z-span)(field owner-witnesses output-witnesses output-set realize-set
live-triangle-counts-by-owner packing contract-t-junctions-p)(field realized-witnesses output-set builder-by-owner
live-triangle-counts-by-owner packing plan)(packing key)(witness width-function contract-t-junctions-p)(witness width-function)Evaluate one closed width-one WITNESS at a local width per vertex site. WIDTH-FUNCTION is called once for each canonical lattice vertex as (WIDTH-FUNCTION X Y Z INCIDENT-STOCKS) where INCIDENT-STOCKS is a sorted, duplicate-free list of the packed stocks on witness triangles using that site. It must return an…
(witness width-function)(witness stock-masks site-widths contract-t-junctions-p)(witness stock-masks site-widths)Evaluate a closed width-one WITNESS from an incident-stock mask policy. STOCK-MASKS is indexed by packed triangle stock. The masks of every stock incident on a canonical vertex site are combined with LOGIOR, then that mask indexes SITE-WIDTHS. This is the dense production form of the generic callback contract: it…
(witness stock-masks site-widths)(owner-witnesses stock-masks site-widths
&key (output-owners nil output-owners-p)
realize-context-owners)Evaluate an owner-keyed width-one cohort from one shared stock-mask policy. OWNER-WITNESSES is a nonempty alist of stable owner keys to width-one surface meshes in one world domain. The incident stock masks of every witness are compiled into one canonical site field; collapse discovery and T-junction repair likewise…
Site policy remains semantic. The renderer's positive byte-mask lane folds through bounded sparse pages; arbitrary masks and the generic callback retain the EQL table oracle. Triangle realization stays in the witness's packed scalar language, and both compilers produce the same tight dense-or-sparse width field below.