9.3
101 3D: Constructive solids
3D reference map · First 3D picture
Solid constructors create deterministic indexed meshes. The standard constructors and regular-polyhedron constructors return ordinary mesh3d values. Their tessellation parameters are part of the authored immutable value, not a renderer decision.
procedure
side : finite-real? id : symbol?
Creates a cube.
procedure
width : finite-real? height : finite-real? depth : finite-real? id : symbol?
Creates an axis-aligned box.
procedure
sides : exact-positive-integer? id : symbol?
Creates a regular prism.
procedure
radius : finite-real? id : symbol?
Creates a latitude-longitude sphere.
procedure
(cylinder3d radius height #:id id) → mesh3d?
radius : finite-real? height : finite-real? id : symbol?
Creates a cylinder.
procedure
radius : finite-real? height : finite-real? id : symbol?
Creates a cone.
procedure
major-radius : finite-real? minor-radius : finite-real? id : symbol?
Creates a torus.
procedure
(extrude3d contour #:id id #:vector direction) → mesh3d? contour : (listof vec2?) id : symbol? direction : vec3?
Extrudes one simple
closed xy-plane contour through a noncoplanar vector. Caps use deterministic
ear clipping.
Revolves a
nonnegative-radius profile around an axis.
Sweeps a simple profile along a
sampled curve using a direct parallel-transport frame.
procedure
(mesh3d-smooth-normals mesh) → mesh3d?
mesh : mesh3d?
Computes stable
area-weighted shared-vertex normals while retaining every semantic part ID.
procedure
(mesh3d-flat-normals mesh) → mesh3d?
mesh : mesh3d?
Duplicates face vertices
so every triangle receives one normal. Triangle face IDs remain one-to-one;
vertex and edge ID vectors are deliberately absent because their parts have
been split into new representation corners.
procedure
(mesh3d-boundary-edges mesh) → vector?
mesh : mesh3d?
Reports its
deterministically ordered manifold boundary edges.
An example is "examples/3d/solid-of-revolution.rkt".