▼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:
schlegel-diagram3d-data
prepare-schlegel-diagram3d
schlegel-diagram3d
net-overlap3d
net-hinge3d
net-face-transform3d
polyhedron-net3d
prepare-polyhedron-net3d
polyhedron-net3d-face-child-ids
polyhedron-net3d-group
polyhedron-net3d-sample-transforms
unfold-polyhedron3d
fold-polyhedron3d
9.3

108 3D: Schlegel diagrams and polyhedral nets🔗ℹ

3D reference map · First 3D picture

struct

(struct schlegel-diagram3d-data (outer-face
    viewpoint
    plane
    vertex-positions
    edges
    face-polygons
    mappings
    diagnostics)
    #:transparent)
  outer-face : any/c
  viewpoint : vec3?
  plane : plane3?
  vertex-positions : vector?
  edges : vector?
  face-polygons : vector?
  mappings : hash?
  diagnostics : hash?
Prepared Schlegel-projection data. The diagnostics retain the deterministic outer face, canonical target-plane basis, margin, and viewpoint distance.

procedure

(prepare-schlegel-diagram3d complex 
  [#:outer-face selector 
  #:viewpoint-distance distance 
  #:margin margin 
  #:tolerance tolerance]) 
 → schlegel-diagram3d-data?
  complex : polyhedral-complex3d?
  selector : any/c = #f
  distance : positive-real? = 3
  margin : nonnegative-real? = 1/20
  tolerance : nonnegative-real? = 1e-8
Projects a selected simple outer face into a canonical plane. It rejects projections whose inner vertices do not lie in the outer polygon instead of returning a misleading diagram.

procedure

(schlegel-diagram3d data    
  [#:id id    
  #:color color    
  #:width width]) → spatial-visual?
  data : schlegel-diagram3d-data?
  id : symbol? = 'schlegel
  color : any/c = "slateblue"
  width : positive-real? = 2
Builds the flat 3D edge visual from prepared data.

struct

(struct net-overlap3d (first-face
    second-face
    area
    boundary-crossings)
    #:transparent)
  first-face : exact-nonnegative-integer?
  second-face : exact-nonnegative-integer?
  area : nonnegative-real?
  boundary-crossings : exact-nonnegative-integer?
A positive-area pairwise overlap in root-plane coordinates. Sharing only a hinge boundary has zero area and therefore does not produce this record.

struct

(struct net-hinge3d (parent child primal-edge)
    #:transparent)
  parent : exact-nonnegative-integer?
  child : exact-nonnegative-integer?
  primal-edge : exact-nonnegative-integer?
One oriented parent-to-child hinge in a face-adjacency spanning tree.

struct

(struct net-face-transform3d (face
    source-origin
    source-e
    source-f
    source-n
    target-origin
    target-e
    target-f
    target-n)
    #:transparent)
  face : exact-nonnegative-integer?
  source-origin : vec3?
  source-e : vec3?
  source-f : vec3?
  source-n : vec3?
  target-origin : vec3?
  target-e : vec3?
  target-f : vec3?
  target-n : vec3?
An orientation-preserving rigid frame from a source face to the net’s root plane.

struct

(struct polyhedron-net3d (root-face
    hinge-tree
    cut-edges
    face-transforms
    flat-polygons
    overlaps
    diagnostics)
    #:transparent)
  root-face : exact-nonnegative-integer?
  hinge-tree : vector?
  cut-edges : vector?
  face-transforms : vector?
  flat-polygons : vector?
  overlaps : vector?
  diagnostics : hash?
Prepared net data. diagnostics records strategy, search completion, selected tree edges, overlap total, boundary crossings, and flat-net diameter.

procedure

(prepare-polyhedron-net3d complex 
  [#:root-face root 
  #:hinges hinges 
  #:strategy strategy 
  #:search-limit limit]) 
 → polyhedron-net3d?
  complex : polyhedral-complex3d?
  root : exact-nonnegative-integer? = 0
  hinges : (or/c #f (listof exact-nonnegative-integer?)) = #f
  strategy : (or/c 'breadth-first 'depth-first 'minimum-overlap)
   = 'breadth-first
  limit : exact-positive-integer? = 1000
Prepares a rigid flat net. Explicit hinges must form a connected spanning tree. The automatic breadth/depth policies use source edge order. 'minimum-overlap enumerates candidate trees in that order and minimizes total positive overlap area, then boundary crossings and flat-net diameter. When its bounded search is truncated, (hash-ref (polyhedron-net3d-diagnostics result) 'search-complete?) is false and no optimality claim is made.

Returns one stable direct-child symbol per polygonal face, in face-index order. An explicit polygonal face identity is retained, so face 'front is a child at '(net front); generated faces use deterministic 'face-N identities.

procedure

(polyhedron-net3d-group complex    
  net    
  #:id id    
  [#:face-materials materials]) → group3d?
  complex : polyhedral-complex3d?
  net : polyhedron-net3d?
  id : symbol?
  materials : (or/c #f vector?) = #f
Creates the canonical group of independent mesh children for a prepared net. materials, when present, has one material3d per face and is useful for making a net’s face boundaries visually legible.

procedure

(polyhedron-net3d-sample-transforms net    
  progress) → vector?
  net : polyhedron-net3d?
  progress : (real-in 0 1)
Returns the source-to-sampled local transform for every canonical face child. Interior samples recursively rotate each child around its source hinge and inherit its parent’s current rigid map; the root stays fixed. The endpoints use exact identity and prepared-flat transforms.

procedure

(unfold-polyhedron3d target net) → any/c

  target : spatial-path?
  net : polyhedron-net3d?
Returns a scene-play request that unfolds the direct face children below target.

procedure

(fold-polyhedron3d target net) → any/c

  target : spatial-path?
  net : polyhedron-net3d?
Returns the inverse request. It requires the exact flattened endpoint produced by unfold-polyhedron3d, and returns the exact source transforms.

The canonical runnable demonstration is "examples/3d/fold-unfold-polyhedron.rkt".

Limitations. Net faces must be simple polygonal faces. The overlap kernel handles simple concave polygons by deterministic ear triangulation, but does not repair self-intersection or hole boundaries. Fold/unfold presently requires the independent, identity-local-transform face meshes made by polyhedron-net3d-group; it does not yet retarget arbitrary authored mesh trees, animate labels/strokes with their faces, sequence hinges to avoid intermediate collisions, or solve a global collision-free folding path.