▼V Reference
52 Find a task or a name
53 Modules to require
54 Scenes and sampling
55 Scene states
56 Animation requests
57 Native model details
58 Visuals
59 Geometry
60 Number Lines and Coordinate Decorations
61 Point Markers, Scatter Plots, and Filled Areas
62 Probability and Statistical Diagrams
63 Calculus lessons
64 Colors
65 Slides
66 Slide command-line tools
67 Source Programs and Authored Timelines
68 Interactive Preview and Inspection
69 Preview controls and diagnostics
70 Projects and Final Rendering
71 Project execution and cache details
72 Pict Renderer Protocol
73 3D reference map
74 3D:   Objects, groups, and paths
75 3D:   Cameras and projection
76 3D:   Views inside a Scene
77 3D:   Animating 3D objects
78 3D:   Animating the 3D camera
79 3D:   Cuts, caps, and section measurements
80 3D:   Supplementary surface, section, and annotation bindings
81 3D:   Cuts, sections, and numerical volume
82 3D:   Vectors
83 3D:   Linear maps and rotations
84 3D:   Affine transforms
85 3D:   Bounds, rays, and planes
86 3D:   Spatial maps and homotopies
87 3D:   Materials and lights
88 3D:   Lighting inspection
89 3D:   Shadow descriptors and stable bounds
90 3D:   Finite-light animation
91 3D:   Software finite-light evaluation
92 3D:   Colour space and final output
93 3D:   Relations and geometric annotations
94 3D:   Projected labels
95 3D:   Textured billboards
96 3D:   Spatial curves and vector diagrams
97 3D:   Spatial anchors and label layout
98 3D:   Anchors and projected labels
99 3D:   Parametric surfaces and calculus
100 3D:   Adaptive, trimmed, and implicit surfaces
101 3D:   Constructive solids
102 3D:   Surface constructors and queries
103 3D:   Meshes
104 3D:   Triangle topology
105 3D:   Polygonal faces
106 3D:   Deterministic convex hulls
107 3D:   Polyhedral duals
108 3D:   Schlegel diagrams and polyhedral nets
109 3D:   Conservative mesh correspondence
110 3D:   Topology-safe mesh matching
111 3D:   Checking and repairing mesh orientation
112 3D:   Clipping, sections, and transparency
113 3D:   Prepared spatial ODE trajectories and vector fields
114 3D:   Seeds and streamline sets
115 3D:   Poincare sections and return maps
116 3D:   Equilibria and local linearization
117 3D:   Flow maps and volume change
118 3D:   Drawing and inspecting trajectories
119 3D:   Reading prepared trajectories
120 3D:   Drawing vector fields and particles
121 3D:   Trajectory display
122 3D:   Spatial inspection and exact picking
123 3D:   Retained renderer backends
124 3D:   Compiled geometry and instances
125 3D:   Frame requests and results
126 3D:   Software rendering and statistics
127 3D:   Optional Racket/  Open  GL backend
128 Experimental Derived Visuals
129 Source Package Hygiene
On this page:
surface-pick-anchor3d
prepare-scene-label-layout3d
9.3

97 3D: Spatial anchors and label layout🔗ℹ

3D reference map · First 3D picture

Spatial annotations use immutable anchor3d? descriptors. vertex-anchor3d, edge-anchor3d, face-anchor3d, curve-anchor3d, surface-anchor3d, and bounds/origin anchors resolve after every spatial transformation into a resolved-anchor3d world point, normal/tangent when available, source path, and stable provenance identity. Parametric surface anchors—including generated adaptive and trimmed surfaces—expose evaluated normals and u-tangents after their complete world transform. A surface-pick-anchor3d carries an immutable exact pick provenance; this makes an implicit surface’s interpolated normal available without pretending it owns a UV tangent frame.

procedure

(surface-pick-anchor3d pick) → anchor3d?

  pick : surface-pick3d?
Creates an immutable anchor from one exact surface-picking result. Parametric picks retain their UV coordinate. Implicit picks retain the lowered triangle index and barycentric point, so later spatial transforms affect the resolved world point and normal without mutating the original pick.

label3d uses such an anchor while retaining its content as a crisp ordinary 2D Visual. label-placement3d and layout-labels3d provide a deterministic, pure direct-mode candidate layout in output pixels. The outer scene compositor resolves and measures all projected labels for a sampled frame before it positions any one label, then consumes that one batched direct layout without re-rendering the viewport. prepare-label-layout3d optionally computes an immutable dynamic-programming candidate table for a declared finite frame grid, applying explicit movement and switching penalties without relying on the previously displayed frame. Equal-priority labels retain declaration order, and equal-cost candidates retain the declared preferred-direction order.

procedure

(prepare-scene-label-layout3d 
  scene 
  #:frames frames 
  [#:view view-id 
  #:fps fps 
  #:camera camera 
  #:supersample supersample 
  #:switch-penalty switch-penalty 
  #:movement-penalty movement-penalty]) 
 → prepared-label-layout3d?
  scene : scene?
  frames : (listof exact-nonnegative-integer?)
  view-id : (or/c #f symbol?) = #f
  fps : exact-positive-integer? = 30
  camera : (or/c #f camera?) = #f
  supersample : exact-positive-integer? = 1
  switch-penalty : nonnegative-real? = 0
  movement-penalty : nonnegative-real? = 0
Samples the declared source-frame grid, resolves and measures the same stable projected-label slots used by final composition, and returns an immutable table. A #:view selection prepares one view3d while labels in other viewports keep their direct layout. The function has no previous-frame dependency and does not create a 3D renderer artifact while it measures labels. Supply its result through the #:prepared-label-layout option of scene-frame->bitmap, render-frame-indices!, or the project render operations.

Current limitations: prepared tables are explicit render inputs rather than a default project-render policy, and a table applies only to the source-frame grid and viewport raster for which it was measured. Core world-space dimensions, angle markers, normal markers, and coordinate tripods are fixed-structure spatial relations, but they do not yet supply automatic formula labels or camera-facing screen sizing. Leaders are fixed one-pixel grey 2D paths and are attached for top-level projected labels; they intentionally do not claim 3D occlusion or textured styling. The executable anchor probe is "examples/3d/anchor-aware-labels.rkt".

An example is "examples/3d/sphere-plane-section.rkt".