86 3D: Spatial maps and homotopies
3D reference map · First 3D picture
Spatial map requests use the ordinary immutable scene timeline. Every target is a rooted spatial path, and every map procedure is authored in world coordinates. This makes a map applied to a nested child mean the same thing as applying it to an equivalent top-level child. A surrounding parent map must therefore be invertible when the result is rebased into that parent’s local coordinate system.
apply-linear3 and apply-affine3 retain the original spatial subtree and attach a full affine map to it. They consequently preserve the indexed topology exactly, even for a shear, reflection, or singular map. A named child of a transformed group3d remains addressable. The canonical linear-transformation-diagram3d groups coordinate planes, a unit cube, basis arrows, and an arbitrary vector so one map applies to all of them coherently.
(scene-play (scene-add (make-scene) world) (apply-linear3 '(world diagram) (linear3 1 0 1 0 1 0 0 0 1)) (apply-homotopy3 '(world sheet) (lambda (point phase) (vec3 (vec3-x point) (* (cos phase) (vec3-y point)) (* (sin phase) (vec3-y point))))) #:duration 2)
procedure
(linear-transformation-diagram3d #:id id [ #:vector vector #:cube-side cube-side #:plane-size plane-size]) → group3d? id : symbol? vector : vec3? = (vec3 3/2 1 1/2) cube-side : positive-real? = 1 plane-size : positive-real? = 3
procedure
(apply-linear3 path map) → any/c
path : spatial-path? map : linear3?
procedure
(apply-affine3 path map) → any/c
path : spatial-path? map : affine3?
procedure
(apply-pointwise3 path map-point [ #:on-failure on-failure #:recompute-normals? recompute-normals?]) → any/c path : spatial-path? map-point : procedure? on-failure : (or/c 'error 'drop-triangle) = 'error recompute-normals? : boolean? = #t
procedure
(apply-homotopy3 path homotopy [ #:on-failure on-failure #:recompute-normals? recompute-normals?]) → any/c path : spatial-path? homotopy : procedure? on-failure : (or/c 'error 'drop-triangle) = 'error recompute-normals? : boolean? = #t
An example is "examples/3d/spatial-maps-and-homotopies.rkt".