axiolid_mesh_hidden_lines_contract/lib.rs
1#![forbid(unsafe_code)]
2//! Portable hidden-line drawing operation contract and evidence.
3//!
4//! The request names triangle meshes, a view (orthographic, or
5//! perspective, ADR 0107) and the edge kinds
6//! to draw. The outcome lists, per source edge, maximal pieces that are
7//! visible or hidden in the view. Visibility is a geometric decision made
8//! by the provider; the contract fixes what the decision means (ADR 0090):
9//!
10//! - a point is hidden exactly when a kept triangle point lies strictly in
11//! front of it at the same image point;
12//! - triangles are closed sets, so touching an image boundary covers;
13//! - equal depth never occludes;
14//! - a face seen edge-on occludes through the depth range it spans.
15//!
16//! Visible face regions are a separate operation, [`MeshVisibleFaces`]
17//! (ADR 0094), over the same view and meshes.
18//!
19//! No tolerance enters a visibility decision; a provider refuses what it
20//! cannot decide.
21//!
22//! A refusal names the first refused mesh only ([`HiddenLineError`]). A
23//! registry's audit lists every refused mesh ([`RefusedMesh`]) in one call, so
24//! a caller can leave them out and ask again; no substitute drawing is made.
25
26pub mod conformance;
27mod contract;
28mod error;
29mod face_fixtures;
30mod faces;
31mod fixtures;
32
33#[allow(deprecated)]
34pub use contract::OrthographicView;
35pub use contract::{
36 EdgeKind, EdgeSelection, HiddenLineEvidence, HiddenLineLimits, HiddenLineMesh,
37 HiddenLineOutcome, HiddenLineRequest, HiddenLineSegment, HiddenLineSource, MeshHiddenLines,
38 MeshId, MeshRole, SourceEdge, View, ViewProjection, Visibility,
39};
40pub use error::{HiddenLineError, RefusedMesh};
41pub use faces::{
42 FaceGroup, FaceGroups, FaceSource, MeshVisibleFaces, VisibleFaceEvidence, VisibleFaceLimits,
43 VisibleFaceOutcome, VisibleFaceRequest, VisibleRegion,
44};
45
46pub const CAPABILITY_ID: axiolid_contracts::CapabilityId =
47 axiolid_contracts::capability_ids::MESH_HIDDEN_LINES;
48
49/// Capability proven by implementing [`MeshVisibleFaces`] (ADR 0094).
50pub const FACES_CAPABILITY_ID: axiolid_contracts::CapabilityId =
51 axiolid_contracts::capability_ids::MESH_VISIBLE_FACES;