9.3
110 3D: Topology-safe mesh matching
3D reference map · First 3D picture
procedure
Creates the default
straight reference-translation route.
procedure
(spatial-line-route3d? value) → boolean?
value : any/c
Recognizes a straight
spatial route.
procedure
(spatial-arc-route3d #:axis axis #:angle angle) → spatial-arc-route3d? axis : vec3? angle : finite-real?
Creates a circular reference route. The
nonzero axis must be perpendicular to the source/destination
translation chord when the request is compiled, and angle must be
strictly between -pi and pi, excluding zero.
procedure
(spatial-arc-route3d? value) → boolean?
value : any/c
Recognizes a circular
spatial route.
procedure
(spatial-bezier-route3d control-1 control-2) → spatial-bezier-route3d? control-1 : vec3? control-2 : vec3?
Creates an endpoint-exact cubic route whose
controls are translations in the target parent’s local coordinates.
procedure
(spatial-bezier-route3d? value) → boolean?
value : any/c
Recognizes a cubic
spatial route.
procedure
(spatial-route3d? value) → boolean?
value : any/c
Recognizes any supported
spatial matching route.
procedure
(spatial-route3d-sample route from to progress) → vec3? route : spatial-route3d? from : vec3? to : vec3? progress : (real-in 0 1)
Samples a route directly. It returns the original from
and to values at zero and one.
procedure
(mesh3d-correspondence-compatible? source destination correspondence) → boolean? source : mesh3d? destination : mesh3d? correspondence : mesh-correspondence3d?
Reports whether
the plan supplies a complete bijection of vertices and render triangles and
every mapped source triangle uses the mapped vertices of its destination
partner. This is the safety test required before interpolating indexed mesh
geometry.
procedure
(mesh3d-matching-sample source destination correspondence route progress) → mesh3d? source : mesh3d? destination : mesh3d? correspondence : mesh-correspondence3d? route : spatial-route3d? progress : (real-in 0 1)
Samples a
same-topology matching transition. Interior samples retain the source triangle
and edge arrays, interpolate each mapped vertex, optional per-vertex normal and
colour, material envelope, opacity, wireframe colour/width, and decomposed
transform. Reference translation follows route. Progress zero and one
return the exact source and destination mesh values.
procedure
(mesh3d-cross-fade-sample source destination route progress) → spatial-visual? source : mesh3d? destination : mesh3d? route : spatial-route3d? progress : (real-in 0 1)
Samples a topology-changing transition as two independently valid temporary
mesh layers under the stable source identity. It returns the exact endpoints;
the temporary group appears only at interior progress.
procedure
(group3d-face-parts-matching-sample source destination matches route progress) → group3d? source : group3d? destination : group3d? matches : (or/c #f (listof spatial-correspondence3d?)) route : spatial-route3d? progress : (real-in 0 1)
Samples
stable direct mesh3d children as mathematical face parts. A supplied
spatial-correspondence3d names source/destination child IDs and may
override route; omitted matches pair equal child IDs. Each matched
pair independently uses a complete compatible mesh plan or a local safe
cross-fade. Unmatched source children fade out and unmatched destination
children fade in beneath generated IDs that exist only at interior samples.
The outer group endpoint values are exact.
procedure
(transform-matching-mesh3d target destination [ #:correspondence correspondence #:topology topology #:route route]) → any/c target : spatial-path? destination : mesh3d? correspondence : (or/c #f mesh-correspondence3d?) = #f topology : (or/c 'require-equal 'cross-fade) = 'require-equal route : spatial-route3d? = (spatial-line-route3d)
Creates a scene-play request for the mesh3d at
target. destination must preserve the target mesh’s spatial
identity. With 'require-equal, an omitted plan is prepared at clip
admission, then must prove a complete compatible topology; otherwise admission
raises an explanation with the unmatched-plan diagnostics. With
'cross-fade, source and destination index arrays remain separate and
fade under a temporary group. The final sample installs the exact destination
mesh and leaves no temporary identity.
The runnable example is
"examples/3d/transform-matching-polyhedra.rkt".
procedure
(transform-matching-mesh3d-request? value) → boolean?
value : any/c
Recognizes
a request created by transform-matching-mesh3d.
procedure
(transform-matching-spatial target destination [ #:matches matches #:route route]) → any/c target : spatial-path? destination : group3d? matches : (or/c #f (listof spatial-correspondence3d?)) = #f route : spatial-route3d? = (spatial-line-route3d)
Creates a scene-play direct face-part request. The group currently at
target and destination must share their outer spatial
identity; direct mesh child pairs are given by matches or equal child
IDs. Matching children interpolate only after their own compatible plan is
proved; unmatched or topology-changing children cross-fade. The final sample
installs the exact destination group, with no generated child identities.
procedure
(transform-matching-spatial-request? value) → boolean?
value : any/c
Recognizes
a request created by transform-matching-spatial.
Limitations. Face-part matching currently requires an explicitly
authored group3d with direct mesh3d face children, such as
polyhedron-net3d-group. It does not split arbitrary triangle meshes
into polygonal groups on demand, retarget arbitrary nested spatial trees, infer
a graph isomorphism, or attach labels/strokes to faces. A route changes a
part’s reference translation; it does not bend internal mesh topology. Use
'cross-fade for any whole-mesh topology change, unmatched part, or
ambiguity.
procedure
(mesh3d-normals mesh) → (or/c #f vector?)
mesh : mesh3d?
Returns optional immutable normals.
procedure
(mesh3d-colors mesh) → (or/c #f vector?)
mesh : mesh3d?
Returns optional immutable colours.
procedure
(mesh3d-material mesh) → material3d?
mesh : mesh3d?
Returns the surface material.
procedure
(mesh3d-wireframe-color mesh) → any/c
mesh : mesh3d?
Returns the current edge colour.
procedure
(mesh3d-wireframe-width mesh) → positive-real?
mesh : mesh3d?
Returns the cosmetic edge width.
procedure
(mesh3d-local-bounds mesh) → aabb3?
mesh : mesh3d?
Returns bounds enclosing local vertices.