106 3D: Deterministic convex hulls
3D reference map · First 3D picture
struct
(struct convex-hull3d-coplanar-group3d ( face-id triangle-indices boundary-vertex-indices source-point-indices) #:transparent) face-id : any/c triangle-indices : vector? boundary-vertex-indices : (or/c #f vector?) source-point-indices : vector?
struct
(struct convex-hull3d-result ( dimension mesh source-point-indices coplanar-groups interior-indices diagnostics) #:transparent) dimension : (integer-in 0 3) mesh : mesh3d? source-point-indices : vector? coplanar-groups : vector? interior-indices : vector? diagnostics : hash?
procedure
(convex-hull3d points [ #:id id #:tolerance tolerance #:merge-tolerance merge-tolerance #:orientation-tolerance orientation-tolerance #:coplanar-tolerance coplanar-tolerance #:coplanar coplanar #:on-degenerate on-degenerate]) → convex-hull3d-result? points : (or/c vector? list?) id : symbol? = 'hull tolerance : (or/c 'automatic nonnegative-real?) = 'automatic merge-tolerance : (or/c #f nonnegative-real?) = #f orientation-tolerance : (or/c #f nonnegative-real?) = #f coplanar-tolerance : (or/c #f nonnegative-real?) = #f coplanar : (or/c 'merge 'triangulate) = 'merge on-degenerate : (or/c 'report 'error) = 'report
The next outside point is chosen by greatest positive face distance, then stable coordinate/source order. 'merge returns polygonal supporting-face records; 'triangulate leaves that vector empty. If a point set is lower-dimensional, 'report returns its actual dimension and 'error raises instead. Diagnostics state the effective tolerances, the exact/inexact orientation policy, duplicate count, and near-zero decision count.
Limitations. The convex-hull implementation is deterministic but is not a general computational-geometry repair system: it does not resolve self-intersecting input, and inexact near-degenerate cases use the recorded scale-aware policy instead of a bigfloat/exact-predicate fallback. Near-duplicate clustering with an explicit tolerance is deterministic and transitive: a chain of close points forms one cluster even when its endpoints are not directly close. Concave hulls, Delaunay triangulation, and arbitrary polygon-with-hole operations are not supported.