axiolid-hidden-lines
Exact scalar hidden-line drawings of triangle meshes in orthographic and perspective views, and visible face regions in orthographic views.
| Latest release | 0.1.5 (2026-11-14) |
| crates.io | axiolid-hidden-lines |
| Facade | axiolid feature hidden-lines-provider |
| Layer | algorithms (algorithm.discrete) |
| API documentation | rustdoc · docs.rs |
| Source | crates/algorithms/discrete/hidden-lines/ |
Overview
The exact scalar provider for MeshHiddenLines (ADR 0090): the visible and hidden pieces of the boundary, silhouette and crease edges of triangle meshes (and, when selected, the edges between face groups, ADR 0106) in an orthographic or perspective view. Visibility is decided exactly in the view's affine frame, with the interval filter first and dyadic big integers when it cannot decide; no tolerance enters a decision, and the output endpoints are the exact points rounded once. It refuses what it cannot decide with a typed error that names the mesh. Candidate pairs are found in an axiolid-spatial BVH over view-space boxes (worst case still edges times triangles); the examined pairs are bounded by max_candidate_pairs. A near clipping plane that cuts a Solid mesh leaves a cap that occludes, decided by exact ray parity with a symbolic perturbation of the image point; a face of a cut solid in the plane needs no special case. A solid wholly beyond the plane is removed. It also draws perspective views (ADR 0107): a pinhole at the frame origin with near below zero, decided with exact determinants of vectors from the eye, the cap by parity along the eye ray. It does not draw exact B-rep edges or smooth silhouettes. The visible-face provider refuses perspective views by name.
ScalarVisibleFaces is the provider for MeshVisibleFaces (ADR 0094): the visible face regions of caller-grouped triangles in the same view, with the same preparation, clipping, caps and crop. The visible outlines, the clip lines, the crop and the exact intersection curves of the triangles go into the exact planar arrangement of axiolid-exact-arrangement; each side of each piece is labelled by the exact frontmost source at a symbolic side point, and the regions are traced from those labels. Region vertices are the exact points rounded once where no edge passes through the rounding cell of another vertex, and snap-rounded to the binary64 grid otherwise (ADR 0100). Sources tied in depth each receive the area. The groups are the caller's per triangle or, as FaceGroups::Planar, derived exactly: triangles join across an edge of exactly two triangles with parallel, same-facing normals, and a group is named by its smallest triangle (ADR 0106). A region whose area collapses under rounding is dropped and counted in the evidence, never refused.
Depends on
axiolid-contractsaxiolid-coreaxiolid-exactaxiolid-exact-arrangementaxiolid-guaranteesaxiolid-meshaxiolid-mesh-hidden-lines-contractaxiolid-spatial
Changes
Latest release, 0.1.5 (2026-11-14):
Added
ScalarHiddenLinesandScanHiddenLinesdraw perspective views and claim them throughsupports_projection, replacing the by-name refusal of 0.1.4: a pinhole at the frame origin, image(U / -W, V / -W),nearrequired and below zero. Every visibility predicate is an exact determinant of vectors from the eye, so triangles behind the eye need no case, endpoints are the exact rationals rounded once, and the near-plane cap is decided by ray parity along the eye ray. The perspective conformance fixtures and a binary64 eye-ray oracle (seeded scenes, eyes outside and inside) check it; the provider refuses a perspective view whosenearis missing, zero, positive or not finite withInvalidInput. The visible-face providers still refuse a perspective view by name (ADR 0107, #387).- The broad phase scales the depth coordinate of its hierarchy to the size of the image in a perspective view, where the image is in units of one over the depth and the longest-extent split would otherwise cut by depth alone. On the 50x50 perspective grid of
scenario/hidden-linesthe tree then returns 4.2M boxes instead of 44.3M before the exact test (540,676 pairs either way; the isometric grid returns 3.5M). The drawing is unchanged and orthographic views are untouched. A vertex at or behind the eye plane (W >= 0) has an unbounded image enclosure, so a triangle beside or behind the eye sends the whole scene to the linear scan (same pairs, slower candidate search); this is documented in the crate docs (#387). - An edge-on perspective triangle whose plane contains the eye may contain the eye itself, strictly inside, on a side or at a vertex. The eye in the closed triangle is decided exactly (no two of the three signs of
v_i × v_jalong the normal strictly opposite) and every ray from the eye then starts in the triangle, so its fibre reaches from the eye to the side the ray leaves by: the span of each non-skipped side counts as in front without the nearer-than test, while the near plane still has to be reached and the point still has to be strictly beyond it (ADR 0107, #387).
Full history: crates/algorithms/discrete/hidden-lines/CHANGELOG.md