▼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:
trim-expression3d?
trim-field3d
surface-trim
trim-and3d
trim-or3d
trim-not3d
reveal-surface-u
reveal-surface-v
transform-surface3d
9.3

100 3D: Adaptive, trimmed, and implicit surfaces🔗ℹ

3D reference map · First 3D picture

Adaptive, trimmed, and implicit surface constructors all lower to the same immutable indexed surface record returned by surface3d-local-mesh. The record preserves vertex and triangle provenance as well as a topology key, while renderer caches remain outside authored values.

Surfaces implement gen:surface3d. The protocol deliberately separates local geometry from the authored spatial envelope: surface3d-local-mesh always has identity placement and full opacity, while surface3d->mesh3d restores the surface’s transform and opacity for standalone use. A surface-domain3d owns any executable retained-domain predicate; the serializable surface-diagnostics3d value never embeds that procedure.

adaptive-parametric-surface3d accepts the same parameterization shape as parametric-surface3d, but samples it on a deterministic dyadic quadtree. Its position, normal-angle, and maximum-edge-length tolerances are camera independent. Neighbouring cells are conformed before lowering, so their shared edge vertices are identical rather than merely close.

trimmed-parametric-surface3d accepts signed surface-trim fields in parameter space, or an explicit Boolean field made with trim-field3d, trim-and3d, trim-or3d, and trim-not3d. A list remains conjunction for the simple case. Its trim classifier samples each adaptive cell’s corners, side midpoints, and centre before requesting a split, rather than imposing a fixed global lattice on every planar trimmed surface. It clips the retained adaptive triangles and shares edge/trim intersections by canonical keys. Consequently surface3d-domain-contains? and surface3d-position-at? can distinguish a point in the original parameter box from one outside its trim. Root refinement uses deterministic bisection for true sign crossings.

implicit-surface3d currently uses deterministic fixed-grid marching tetrahedra. It canonicalizes exact iso vertices, uses an author gradient when supplied (otherwise bounded one-sided finite differences), and reports extraction-boundary crossings. Its #:on-invalid policy may raise, skip invalid cells, or use bounded local subdivision before recording unresolved cells in diagnostics. This API does not provide adaptive octree implicit extraction.

procedure

(trim-expression3d? value) → boolean?

  value : any/c
Recognizes an immutable signed trim field or Boolean trim expression.

procedure

(trim-field3d field    
  [#:keep keep]    
  #:id id    
  #:tolerance tolerance) → trim-expression3d?
  field : procedure?
  keep : (or/c 'positive 'negative) = 'positive
  id : symbol?
  tolerance : positive?
Creates one retained signed trim field. Its non-negative side is retained; 'negative reverses the source field.

procedure

(surface-trim field    
  [#:keep keep]    
  #:id id    
  #:tolerance tolerance) → trim-expression3d?
  field : procedure?
  keep : (or/c 'positive 'negative) = 'positive
  id : symbol?
  tolerance : positive?
The established spelling for trim-field3d.

procedure

(trim-and3d first rest ...) → trim-expression3d?

  first : trim-expression3d?
  rest : trim-expression3d?
Intersects nonempty signed trim expressions.

procedure

(trim-or3d first rest ...) → trim-expression3d?

  first : trim-expression3d?
  rest : trim-expression3d?
Unites nonempty signed trim expressions.

procedure

(trim-not3d expression) → trim-expression3d?

  expression : trim-expression3d?
Complements one signed trim expression.

Current trim limitations: Nine samples are a conservative local discovery rule, not a proof that an arbitrarily tiny component between all sample positions will be found. Compound trim provenance identifies its source field deterministically, but reconstructed named boundary loops are not yet exposed as a separate surface value.

implicit-surface3d samples a finite scalar field within a declared axis-aligned box and extracts one level set with deterministic marching tetrahedra. It shares lattice-edge intersections, estimates normals from central field differences, and records whether the surface touches the box boundary. The extractor uses a fixed resolution; it does not adapt its 3D cells. view3d-surface-pick uses the ordinary CPU BVH hit and attaches the retained triangle provenance: barycentrically interpolated (vector u v) parameters for parametric surfaces and the source cube/ tetrahedron record for implicit ones. It does not claim a separate analytic implicit intersection solver.

Adaptive and trimmed parametric surfaces retain their evaluator and parameter domain as well as their lowered mesh. Therefore surface-anchor3d can provide a deterministic local finite-difference tangent/normal frame for those surfaces. An implicit surface has no invented UV coordinate. Instead, surface-pick-anchor3d converts one immutable surface-pick3d into an anchor: it resolves the current barycentric mesh point and interpolated normal, while truthfully leaving the tangent unavailable.

The focused executable probe is "examples/3d/adaptive-trimmed-implicit-surfaces.rkt".

procedure

(reveal-surface-u target) → any/c

  target : spatial-path?
Reveals an existing surface directly from its minimum-u boundary without changing its grid size.

procedure

(reveal-surface-v target) → any/c

  target : spatial-path?
The analogous minimum-v reveal.

procedure

(transform-surface3d target destination) → any/c

  target : spatial-path?
  destination : surface3d?
Interpolates matching topology and material structure directly from immutable source/destination grids.

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