luft/mesh.lisp
Pair link edges at one signed lattice-edge ray.
The ordinary two transitions are one pair. A checkerboard has four transitions; occupied-side topology pairs the two transitions surrounding each occupied quadrant, producing two independent surface sheets.
Return the occupied side of one resolved link cycle as a regular star.
Resolve mask into the regular occupied-side masks supported by this spike.
The returned list has one regular mask per simple boundary-link cycle. Empty and full stars have no boundary and therefore return NIL. A cycle which needs duplicated radial vertices cannot yet be represented by the Blender regular star corpus; signal that boundary explicitly instead of silently welding it.
Whether mask's unsplit cubical boundary fails to be one manifold sheet.
--------------------------------------------------------------------------- Exact list-vector helpers retained for cold construction and tests
Reduce an exact polygon normal to the trit direction stored by the ABI.
Quantize occupancy in normal's outward local hemisphere to two AO bits.
--------------------------------------------------------------------------- Packed lattice keys
Unwrapped mesher coordinates: X and Y lie in [-1, 2^18], Z in [-1, 256]. The +1 bias keeps boundary anchors one step below zero packable. Numeric key order is (axis, x, y, z) lexicographic order.
--------------------------------------------------------------------------- Materialized occupancy
A field binds one solid's occupancy to a cell-coordinate box. Probes
inside an ordinary-size box are one dense bit-vector lookup; probes outside
it signal outside-domain with the boundary restarts, so the caller's
policy (whole-world air, a chunk store, a strict test) decides the edge.
Resident occupancy is dense unless the horizontal box would make an unreasonable allocation. The sparse fallback preserves whole-domain meshing for very large, lightly populated worlds.
Half-open cell-coordinate bounds of the resident box.
Resolutions of probes past the box but inside the world: chunk key to
:AIR, :SOLID, or a cell table, each obtained from one missing-chunk
signal and cached for every later probe into that chunk.
Index chain's cells by packed lattice key, validating them as positive.
Validate solid's cells and materialize them over the given cell box.
Signal missing-chunk once for key and cache the handler's resolution.
Occupancy of one cell: air beyond Z, a lookup inside the field's box,
one cached missing-chunk resolution per non-resident chunk inside the
world, and an outside-domain signal past the world's own edges.
Pack the eight-cell occupancy star of the lattice vertex at X Y Z.
Bit conventions match site-star-occupancy-mask on a vertex site.
--------------------------------------------------------------------------- Templates, instance streams, and the builder
Four ABI words per instance in emission order: base x, y, z, meta.
Content hash of the packed vertices to a bucket of template candidates.
When configured for bevel construction, face and band emission update this shared parity table directly from the already-oriented scratch vertices. Builders without it retain the general replay path used by mesh transformations elsewhere in this file.
Intern the vertex scratch prefix and append one columnar instance.
--------------------------------------------------------------------------- Scalar triangle assembly
Write one oriented triangle of template-local vertices; return next offset.
Emit one instance for the quad p0 p1 p2 p3 (global ticks, simple-vectors).
Emit one junction triangle whose coordinates are already site-local.
--------------------------------------------------------------------------- Cell faces
Tangent axis numbers (u v) for each normal axis number.
The central square remains face-owned. Its four collars are the planar part of the chamfer, so they must take the same one-stock policy as bevel bands and vertex closures.
A crease insets the face edge unless the coplanar tangent neighbor continues the surface flat.
Uniformly partition the exact old face rectangle. Its 6x6 heart is face-owned and its nonempty side cells are edge-owned. Leave the four corner cells open: the lattice-site fan closes their actual boundary after every face and edge instance is present.
--------------------------------------------------------------------------- Edge bands
Quadrant (u v) components around a lattice edge, in cyclic order.
Group the transition indices of one four-bit quadrant occupancy run.
An emission-order buffer of packed lattice edges discovered at faces.
Append the four lattice edges of one exposed cell face.
Sort and compact candidates into an exact simple packed edge vector.
The packed lattice keys of chain's cells, in chain order.
Resolve one occupancy transition into its face normal axis and sign, the occupied side's cross-axis offset sign, and the oriented boundary face carrying the stock.
Equal normals are one flat face continued across a cell boundary; opposite normals are two sheets touching at the lattice edge. Neither relation owns a bevel band.
The edge owns the middle after both vertex-site domains are removed. Those width-sized ends belong to the two fans.
--------------------------------------------------------------------------- Singular vertex stars
Count singular stars at the owned lattice vertices incident to cells.
Ownership is the half-open box [ox0, ox1) x [oy0, oy1) of site coordinates.
--------------------------------------------------------------------------- Open-boundary parity scan
Every face and band triangle edge is counted against a canonical key: the per-axis floor-of-eighths anchor of its two endpoints, plus both endpoints as 12-bit anchor-local coordinates. Edges observed once are the open boundary; each is then attributed to the lattice vertex whose bevel domain contains it and packed as one fixnum of biased site-local endpoints: left12<<24 | right12<<12 | stock12, where a point12 is (x+4)<<8|(y+4)<<4|(z+4).
The key itself is one fixnum, because a boundary packing states the
horizontal anchor box the scan covers -- one chunk plus its halo, or a
whole solid's own extent -- and stores anchors relative to that box's
origin: ((x * y-span + y) * 257 + (z + 1)) << 24 | undirected edge. A
solid too wide for that product to stay a fixnum has to be meshed by
chunks; mesh-chunk's boxes are always small enough.
The anchor box one parity scan covers, and thus its fixnum key layout.
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.
Parity-count the builders' face and band streams' directed triangle edges.
Returns a table from packing's fixnum edge keys to count<<36 | left12<<24 |
right12<<12 | stock12, where the 12-bit points are anchor-local.
Each triangle contributes three directed edges, and an interior edge is observed twice, so the table holds about 3/2 keys per triangle. Sizing it now spares a long chain of rehashes.
Make builders update one boundary parity table during sheet emission.
Parity-count oriented SCRATCH triangles before template interning.
Group the open boundary's directed edges by owning lattice vertex.
Returns a table from packed site keys to packed vectors of fan records whose 12-bit
points are site-local with the fan bias. An open edge not contained in any
vertex's bevel domain is an invariant violation for a whole solid; for a
chunk's witness scan it is the witness truncation boundary, provably outside
every owned site's bevel domain, and drop-nonlocal-p discards it.
Find the lattice vertex whose bevel domain contains the edge, exactly as the exact-rational original did.
Order consistently directed fan records into loops at the site.
Evaluate record's site-local affine bevel coordinates at target-width.
Whether every left endpoint of cycle is coplanar with the site origin.
The ordinary five-cell concave corner and its upside-down three-cell complement both pass through the site. The six- and seven-cell chamfer/fillet runs do not; coning those creates the ornaments.
The observed loop follows the existing surface winding. Reverse its order so the cap pairs every boundary edge with opposite winding.
Triangulate cycle without introducing its lattice-site origin as geometry.
Repeatedly remove the end whose replacement diagonal is shorter. The remaining vertices stay a contiguous interval of the boundary, giving a deterministic local triangle strip rather than a long fan of spokes.
A boundary edge incident on the center is already a radial edge of this fan. Its neighboring non-radial segment emits the triangle.
Bit zero denotes the outer RIGHT--LEFT edge. The other two
edges are triangulation diagonals inside the complete fan.
Keep each sector as its own instance because the construction
mask varies around the junction, even though stock is uniform
for this whole chamfer.
Close the sheet-builders' open loops with site-local templates in builder.
Only lattice sites inside the half-open [ox0, ox1) x [oy0, oy1) box get
fans; a chunk's neighbor owns the rest and closes them from its own
witness scan.
--------------------------------------------------------------------------- Finishing
Counting-scatter one columnar stream by template and derive its draws.
Descending source traversal preserves the historical reverse emission order within each template bucket without a permutation.
Return mesh's instances whose packed stock satisfies predicate.
The exact template vocabulary and geometry width remain borrowed from mesh;
only the three dense instance streams are partitioned. This is intended for
coarse materialization policy such as independently resident material cohorts,
not as a substitute for a variable-width junction construction.
--------------------------------------------------------------------------- Exact coplanar compression
Call function with kind, stock, ambient, mask, normal, and three points.
Return the canonical lattice site and local direction owning point.
point must come from a width-one luft surface, so every coordinate is exactly
on, one tick above, or one tick below its owning lattice plane.
Return the long edge and its interior point for a collinear triangle.
When three distinct transformed points become collinear, dropping their triangle leaves a long edge on one neighbour opposite two shorter edges on the others. The returned split is the exact T-junction contraction needed to make those three neighbours share the same two edges.
Evaluate one width-one witness at a locally selected 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 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, unmatched-edge, repaired- edge, and residual-edge counts.
contract-t-junctions-p defaults true. NIL deliberately omits collapsed
triangles without subdividing their surviving neighbours, returning the open
diagnostic surface that motivates the contraction. Production callers should
retain the default; the uncontracted surface exists only for topology study.
This deliberately simple exact prototype expands the witness triangles and interns sites in hash tables. A production emitter can compile the same site field densely without changing the affine invariant above.
First find the exact geometric edge mismatch caused only by collinear medial-limit collapses. Uniform width-four regions have no mismatch and consequently receive no needless subdivisions.
Prove that the selected contractions account for the entire mismatch before changing any triangles. A new failure mode must become explicit rather than rendering another hairline crack.
Return oriented boundary loops, or NIL when the union is not simple.
Ear-clip one positively oriented simple integer polygon.
Retain collinear boundary vertices: another coplanar attribute group or differently oriented plane may meet there. Removing such a vertex would preserve the continuous surface but introduce a topological T-junction.
Return mesh's exact triangles with every primitive edge marked visible.
The geometry, stock, ambient value, primitive class, and winding are retained. Only the three construction-mask bits change. This diagnostic realization exposes connectivity that the ordinary semantic edge mask intentionally hides; it must not be substituted for the production mesh outside topology captures.
Return only the triangles incident to the three points in split.
split is (LEFT MIDDLE RIGHT), as reported in the :CANDIDATE-SPLITS bevel
diagnostic. A triangle is retained when two or more of its vertices are
split points, so the result is the smallest actual mesh patch that contrasts
one long edge with its two short neighbours. Every retained edge is marked
visible; no vertex or triangle geometry is otherwise changed. This is the
executable closeup used by the mixed-bevel degeneracy atlas. #WSEK3C
Dissolve only interior edges between exactly coplanar equal-attribute faces.
The output has the same points, oriented planes, stocks, ambient values,
silhouette, and depth as mesh. Groups with a non-simple boundary retain their
original triangles, making the unmerged medial mesh a local rebuild oracle.
--------------------------------------------------------------------------- Entry point
Run thunk under one outside-domain policy.
:AIR answers every out-of-box probe with the TREAT-AS-AIR restart; :SIGNAL leaves the condition for the caller's own handlers (a chunk store, a test).
Classify solid into exact integer face, edge, and vertex instance streams.
Below the medial limit, every exposed cell face emits the same width-dependent
central square and crease edges own the intervening bands. At the half-cell
limit those two families become zero-area seams: a sub-medial witness retains
their boundary cycles while only the expanded site-local patches are emitted.
Each stream is sorted by template so the renderer can issue direct instanced
draws.
stock-function is called with an oriented boundary face. chamfer-stock-function
receives the face stocks incident to one edge-owned collar, bevel, or
lattice-site closure. It must return one stock for that entire chamfer.
The half-open horizontal cell box spanned by the packed keys in cells.
Emit every exposed face of the packed cell sites in cells into target.
Merge exposed cubical faces into maximal coplanar rectangles. #YGP21F
Faces merge only when their axis, orientation, plane, and stock agree. The pass therefore changes neither position, normal, material, silhouette, nor depth relative to the cubical boundary; it only dissolves interior edges.
Classify one chunk's solid chunk into the instance-stream ABI.
chunk holds exactly the cells of the chunk named by chunk-key. Probes
leaving the chunk signal missing-chunk once per neighboring chunk -- bind a
handler that answers USE-CHUNK from a store, or TREAT-AS-AIR to fill in --
and probes past the world's box signal outside-domain; mesh-chunk sets no
policy of its own. The mesh ships only what this chunk owns: faces of its
own solid cells, bands whose edge anchors lie inside it, and fans at its
own lattice vertices. Witness faces and bands are recomputed from the
one-cell halo and scanned but never shipped, so seam fans close exactly as
a whole-world mesh would close them.
When planar-merge-p is true, emit the exact unbeveled cubical boundary as
greedily merged coplanar rectangles. This far-distance representation keeps
occupancy, normals, materials, silhouette, and chunk seams while omitting
bevel ornament and all geometrically redundant interior face edges.
When coplanar-merge-p is true, first construct the requested bevel surface,
then exactly dissolve its coplanar interior edges. This retains the full
surface and falls back group-by-group whenever a boundary is not simple.
Owned sites are the half-open coordinate box of this chunk's grid cell; anchors on the far seam belong to the next chunk over. Owned sites' cell stars reach exactly one cell below the origin per axis, so only the low-side ring of neighbor cells witnesses the seams; the high seams are the low sides of the next chunks over, which witness them symmetrically.
A fully solid chunk resolution cannot feed ~ a mesh halo yet.
Owned faces ship; halo faces are witnesses for the seam scan.
High-seam anchors belong to the next chunk over and matter to none of this chunk's fans; skip them.
(mask)Default bevel width in eighth-cell integer ticks (one quarter cell).
Multiplication and scalar scaling.
Division of two represented quantities.
Addition over compatible quantities.
A simple Org table without formulas.
(sample axis-number)Sample a two-dimensional texture through a sampler at a UV coordinate.
(a b)Test whether one compatible scalar is greater than another.
(edge)Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
(edge)(mask edge)Logical negation of one test or raw truth value.
(axis-number)Test whether two compatible scalars are equal.
(axis-number sign)(mask axis-number sign)Pair link edges at one signed lattice-edge ray. The ordinary two transitions are one pair. A checkerboard has four transitions; occupied-side topology pairs the two transitions surrounding each occupied quadrant, producing two independent surface sheets.
The non-negative remainder of integer division.
(neighbors left right)(mask)Test whether one compatible scalar is less than another.
(original-mask cycle)Logical disjunction of tests and raw truth values.
(mask)Resolve MASK into the regular occupied-side masks supported by this spike. The returned list has one regular mask per simple boundary-link cycle. Empty and full stars have no boundary and therefore return NIL. A cycle which needs duplicated radial vertices cannot yet be represented by the Blender regular star…
(mask axis-number sign)(left right)Subtraction or unary negation.
(left right)(left right)(normal)Logical conjunction of tests and raw truth values.
(normal barycentric-index kind boundary-edge-mask)Test whether one compatible scalar is at most another.
(mask normal)(nx ny nz)(star-mask nx ny nz)(x y z)(key)(key)(key)Headings, paragraphs, figures and their IDs, mentions, marks.
A cell probe left its box. The signaling probe offers the boundary restarts TREAT-AS-AIR, TREAT-AS-SOLID, and USE-VALUE, so the caller's handler decides what lies past the edge: a world treats it as air, a chunk store answers from the neighboring chunk or defers, a test refuses.
A probe crossed into a chunk that is not resident in the probing field. The signaling probe offers USE-CHUNK (supply the chunk's chain), plus the TREAT-AS-AIR and TREAT-AS-SOLID boundary restarts for the whole chunk, so a streaming store answers with data, defers, or fills with a constant.
(chain)The maximum of compatible quantities.
(chain)(site)(site)(site)(site)(site)(solid x0 x1 y0 y1)(chain)(field key)(field key)(field domain x y z)Occupancy of one cell: air beyond Z, a lookup inside the field's box, one cached MISSING-CHUNK resolution per non-resident chunk inside the world, and an OUTSIDE-DOMAIN signal past the world's own edges.
(field x y z)Test whether one compatible scalar is at least another.
(domain)(domain)(domain x y z)(x y)(field domain x y z)Pack the eight-cell occupancy star of the lattice vertex at X Y Z. Bit conventions match SITE-STAR-OCCUPANCY-MASK on a vertex site.
(domain site occupancy)Pack SITE's complete incident-cell star. Absent axes are enumerated in X,Y,Z order. Zero means the cell one unit below the site on that axis (direction -1); one means the cell anchored at the site (direction +1).
(x y z attributes)(stream)(builder scratch count)(builder kind)(builder kind base-x base-y base-z stock
ambient-occlusion count)(builder base-x base-y base-z stock count)(scratch offset kind-code boundary-edge-mask
ax ay az bx by bz cx cy cz nx ny nz)(builder kind base-x base-y base-z p0 p1 p2 p3
nx ny nz stock ambient-occlusion)(builder base-x base-y base-z boundary-edge-mask
ax ay az bx by bz cx cy cz nx ny nz
stock star-mask)(builder field domain cell axis-number side stock-function
chamfer-stock-function)(domain site axis)(index)(domain site axis)(cell-count)(candidates cell-x cell-y cell-z axis-number side)(candidates)(chain)(builder field domain key stock-function chamfer-stock-function)(domain x y z &optional (extent +vertex-extent+) (polarity 1))Pack a canonical site inside DOMAIN's box. No coordinate wraps: anchors range over [0, limit] per horizontal axis, and a site extending along an axis cannot begin on that axis's far boundary.
(builder field domain cells ox0 ox1 oy0 oy1)Count singular stars at the owned lattice vertices incident to CELLS. Ownership is the half-open box [OX0, OX1) x [OY0, OY1) of site coordinates.
(chunk chunk-key
&key (stock-function (constantly 0))
(chamfer-stock-function (lambda (stocks) (first stocks)))
(bevel-width +mesh-bevel-width+)
planar-merge-p
coplanar-merge-p)Classify one chunk's solid CHUNK into the instance-stream ABI. CHUNK holds exactly the cells of the chunk named by CHUNK-KEY. Probes leaving the chunk signal MISSING-CHUNK once per neighboring chunk -- bind a handler that answers USE-CHUNK from a store, or TREAT-AS-AIR to fill in -- and probes past the world's box…
(x y z)(point)(point)(point)(record)(record)(record)(record)Anchor Z values run from -1 through 255 inclusive.
(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.
(packing anchor-x anchor-y anchor-z edge)(packing key)(packing key)(stream templates)(builders packing)Parity-count the BUILDERS' face and band streams' directed triangle edges. Returns a table from PACKING's fixnum edge keys to count<<36 | left12<<24 | right12<<12 | stock12, where the 12-bit points are anchor-local.
(stream templates packing observations)(builders packing estimated-cells)The minimum of compatible quantities.
(builders packing bevel-width drop-nonlocal-p)Group the open boundary's directed edges by owning lattice vertex. Returns a table from packed site keys to packed vectors of fan records whose 12-bit points are site-local with the fan bias. An open edge not contained in any vertex's bevel domain is an invariant violation for a whole solid; for a chunk's witness…
The componentwise absolute value of a raw value.
(site-x site-y site-z records)(record site-x site-y site-z
source-width target-width)(cycle star-mask)(builder site-x site-y site-z cycle stock star-mask)(builder site-x site-y site-z cycle stock star-mask)(builder site-x site-y site-z cycle stock star-mask)(builder field domain chamfer-stock-function sheet-builders packing
ox0 ox1 oy0 oy1 drop-nonlocal-p)Close the SHEET-BUILDERS' open loops with site-local templates in BUILDER. Only lattice sites inside the half-open [OX0, OX1) x [OY0, OY1) box get fans; a chunk's neighbor owns the rest and closes them from its own witness scan.
(builder)(stream ranges)Source index: files expand to their definitions in place; the systems table.
(builder)(mesh predicate)Return MESH's instances whose packed stock satisfies PREDICATE. The exact template vocabulary and geometry width remain borrowed from MESH; only the three dense instance streams are partitioned. This is intended for coarse materialization policy such as independently resident material cohorts, not as a substitute…
(left right)(left right)(a b c)(left right)(function mesh)(point)Return the canonical lattice site and local direction owning POINT. POINT must come from a width-one LUFT surface, so every coordinate is exactly on, one tick above, or one tick below its owning lattice plane.
(&key (code t))(left right)(a b c)Return the long edge and its interior point for a collinear triangle. When three distinct transformed points become collinear, dropping their triangle leaves a long edge on one neighbour opposite two shorter edges on the others. The returned split is the exact T-junction contraction needed to make those three…
(loop normal)(witness width-function &key (contract-t-junctions-p t))Evaluate one width-one WITNESS at a locally selected 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 list of the packed stocks on witness triangles using that site. It must return an integer width…
(builder kind stock ambient mask normal triangle)(triangles)(point a b c normal)(mesh)Return MESH's exact triangles with every primitive edge marked visible. The geometry, stock, ambient value, primitive class, and winding are retained. Only the three construction-mask bits change. This diagnostic realization exposes connectivity that the ordinary semantic edge mask intentionally hides; it must not…
(mesh split)Return only the triangles incident to the three points in SPLIT. SPLIT is (LEFT MIDDLE RIGHT), as reported in the :CANDIDATE-SPLITS bevel diagnostic. A triangle is retained when two or more of its vertices are split points, so the result is the smallest actual mesh patch that contrasts one long edge with its two…
(left right)(mesh)Dissolve only interior edges between exactly coplanar equal-attribute faces. The output has the same points, oriented planes, stocks, ambient values, silhouette, and depth as MESH. Groups with a non-simple boundary retain their original triangles, making the unmerged medial mesh a local rebuild oracle.
(policy thunk)Run THUNK under one OUTSIDE-DOMAIN policy. :AIR answers every out-of-box probe with the TREAT-AS-AIR restart; :SIGNAL leaves the condition for the caller's own handlers (a chunk store, a test).
(solid &key (stock-function (constantly 0))
(chamfer-stock-function (lambda (stocks) (first stocks)))
(bevel-width +mesh-bevel-width+)
(boundary :air))Classify SOLID into exact integer face, edge, and vertex instance streams. Below the medial limit, every exposed cell face emits the same width-dependent central square and crease edges own the intervening bands. At the half-cell limit those two families become zero-area seams: a sub-medial witness retains their…
(cells)(target field domain cells stock-function chamfer-stock-function
&optional edge-candidates)(coordinate)(coordinate)(left right)(builder field domain cells stock-function)Merge exposed cubical faces into maximal coplanar rectangles. #YGP21F Faces merge only when their axis, orientation, plane, and stock agree. The pass therefore changes neither position, normal, material, silhouette, nor depth relative to the cubical boundary; it only dissolves interior edges.
(domain bevel-width field cells stock-function)(x y z)(key)(key)(key)(key)(site)(chunk-x chunk-y)The first material-width experiment makes the site's ownership concrete. Every packed surface stock compiles once to a terrain or architecture bit; each canonical lattice vertex ORs the bits of its incident stocks and chooses one width for every primitive that uses it. Terrain-only sites take width four,…
Wherever a staircase recedes in both axes, flat \{111\} regions grow as triangles — the plane meets the three axes symmetrically, so its boundary against axis geometry runs along the 60° directions — and the construction is scale-covariant, so the same motif appears at cell scale, step scale, and terrain scale: a…
Integer site-stream surface materialization
Geometry is a sum over lattice sites. Face records select a fixed inset square, edge records select flat collars or crease bands, and vertex records select flat corner patches or Arc junction fans. Records contain only a lattice base coordinate, a stock, local ambient accessibility, and a template index. Template vertices are exact small integer offsets from that base; vertex-owned offsets stay inside the configured bevel-width domain around the lattice site.
The mesher speaks the same packed-integer language as the chain substrate. Its working representations, and the identities they preserve:
packed positive cell sites of the solid; every probe is one lookup.
axis<<59 | (x+1)<<34 | (y+1)<<9 | (z+1), so numeric order is the (axis, x, y, z) lexicographic order the streams are deterministically sorted by.
coordinates plus the ABI attribute bits. Templates intern by content.
word is already the final ABI meta word (template | stock | ambient).
(anchor key + two 12-bit anchor-local endpoints); each surviving open edge becomes a single fixnum of site-local endpoints and stock, and the whole fan phase runs on those.
star-singular-pand directional ambient occlusion are pure in at mostthirteen bits and are read from tables built once at load.