9.3
107 3D: Polyhedral duals
3D reference map · First 3D picture
struct
(struct dual-polyhedron-face3d ( index primal-vertex triangle-indices boundary-vertex-indices) #:transparent) index : exact-nonnegative-integer? primal-vertex : exact-nonnegative-integer? triangle-indices : vector? boundary-vertex-indices : vector?
A mathematical dual polygon generated by one primal
vertex. Its render-triangle indexes refer to the mesh in the enclosing result.
struct
(struct dual-polyhedron3d-result ( mesh primal-face->dual-vertex primal-edge->dual-edge primal-vertex->dual-face diagnostics) #:transparent) mesh : mesh3d? primal-face->dual-vertex : vector? primal-edge->dual-edge : vector? primal-vertex->dual-face : vector? diagnostics : hash?
An immutable dual mesh and explicit primal-to-dual
correspondence. A #f edge mapping denotes a render diagonal inside one
grouped primal polygonal face, which has no mathematical dual edge. Diagnostics
contain 'rejected-render-faces for polygonal cycles that are preserved
as topology but cannot be safely triangulated for rendering.
procedure
(combinatorial-dual3d complex [#:id id])
→ dual-polyhedron3d-result? complex : polyhedral-complex3d? id : symbol? = 'combinatorial-dual
Creates one dual vertex at each primal
polygonal-face centroid and one dual polygon at each primal vertex. It is a
combinatorial/diagram embedding; no convexity or regularity claim is made.
procedure
(polar-dual3d complex [ #:center center #:scale scale #:tolerance tolerance #:id id]) → dual-polyhedron3d-result? complex : polyhedral-complex3d? center : vec3? = origin3 scale : positive-real? = 1 tolerance : nonnegative-real? = 1e-9 id : symbol? = 'polar-dual
Creates the polar dual. For every outward
primal face plane n \cdot (x-c)=d, its dual vertex is
c + (s/d)n. The operation rejects nonmanifold, open, nonorientable,
nonplanar, nonconvex, or centre-touching input rather than returning a false
polar dual.
Limitations. Duals currently require simple planar polygonal faces and a closed orientable manifold. The combinatorial centroid embedding may overlap or self-intersect for a nonconvex polyhedron; its exact polygonal cycle is still returned, but unsafe projected cycles are omitted from the render mesh and reported in diagnostics. The polar operation has no automatic centre-finding or nonconvex repair policy.