luft/mesh-realization.lisp
Call function with kind, stock, ambient, mask, normal, and three points.
--------------------------------------------------------------------------- Sparse semantic attachment realization
One authored face-chart point resolved against the finished surface.
ORIGIN is in renderer world units. NORMAL is the outward unit normal of the hit primitive, or the deterministic unit bisector of its normal cone when the chart point lies exactly on a crease. TANGENT is the authored face's first chart axis projected into that tangent plane. The primitive and stock lists retain the cold diagnostic provenance of every tied hit.
Test point in ABC after projection into the authored face chart.
Return the nearest chart-projected point of ABC and its squared distance.
When chart projects inside ABC, retain the original authored-normal ray
intersection exactly. Otherwise the nearest point of the closed projected
triangle lies on one of its three edges; lift that edge parameter back onto
the actual three-dimensional primitive.
A facing triangle has a nonzero chart projection, so at least two of these projected edges have positive length. Skip the possible zero-length edge defensively rather than dividing by zero.
Test point in the authored face's inclusive one-cell footprint.
Classify one admissible candidate against the current geometric optimum.
Resolve face chart coordinates U/V against finished meshes.
U and V are normalized logical-face coordinates in [-1,1]. The square chart is compacted radially onto |U|+|V|<=1: points already inside that diamond are unchanged, while logical corners map continuously onto the realized junction domain instead of casting through empty space beyond a chamfered corner.
For every facing finished triangle, the resolver finds the closest point in the authored face chart and lifts it onto that actual primitive. Candidates are ranked first by minimum tangential distance and then by outermost normal displacement. Thus any triangle under the old authored-normal ray has zero tangential distance and produces the exact old result; only a genuine ray miss moves tangentially onto the nearest finished face, band, transition triangle, or junction fan.
The finished surface of the authored support cell cannot lie outward of its cubical face or more than the mesh's maximum bevel width inward or tangentially away from the mapped chart point. It must also stay inside the exact one-cell support-face footprint. Enforcing that slab, radius, footprint, and outward facing cone is an ownership condition, not a global nearest-hit heuristic: parallel or neighboring surfaces elsewhere must never steal the attachment.
At a non-smooth point there is no unique differential normal. Rather than falling back to the cubical face, this function returns the normalized sum of the distinct tied primitive normals: a deterministic bisector of the actual surface normal cone.
(left right)Test whether one compatible scalar is less than another.
(left right)(a b c)Subtraction or unary negation.
Multiplication and scalar scaling.
(left right)Addition over compatible quantities.
The componentwise absolute value of a raw value.
Division of two represented quantities.
(function mesh)Test whether two compatible scalars are equal.
Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
(left right)(amount vector)(&rest vectors)(left right)(vector)The componentwise square root of a raw value.
The maximum of compatible quantities.
Test whether one compatible scalar is greater than another.
(point a b c u-axis v-axis)Logical disjunction of tests and raw truth values.
Logical negation of one test or raw truth value.
Logical conjunction of tests and raw truth values.
(chart a b c u-axis v-axis authored-normal primitive-normal denominator)Return the nearest chart-projected point of ABC and its squared distance. When CHART projects inside ABC, retain the original authored-normal ray intersection exactly. Otherwise the nearest point of the closed projected triangle lies on one of its three edges; lift that edge parameter back onto the actual…
The minimum of compatible quantities.
(point center u-axis v-axis epsilon)Test whether one compatible scalar is at most another.
(left right)(radius-squared displacement point
best-radius-squared best-displacement best-point
tie-epsilon radius-squared-tie-epsilon point-squared-tie-epsilon)(meshes face &key (u 0.0d0) (v 0.0d0))Resolve FACE chart coordinates U/V against finished MESHES. U and V are normalized logical-face coordinates in [-1,1]. The square chart is compacted radially onto |U|+|V|<=1: points already inside that diamond are unchanged, while logical corners map continuously onto the realized junction domain instead of casting…
(domain face)(face)(site)(site)(site)(site)
--------------------------------------------------------------------------- Exact coplanar compression