axiolid_pointcloud_reconstruction_contract/lib.rs
1#![forbid(unsafe_code)]
2//! Portable pointcloud-to-surface reconstruction contract, evidence, and
3//! conformance suite.
4//!
5//! # Why a contract before an implementation
6//!
7//! Reconstruction has no single right answer: Poisson, ball pivoting, and
8//! alpha shapes all produce different surfaces from identical input, and
9//! each is correct for different data. Fixing the *seam* — request, result,
10//! evidence, typed refusal — before any provider lands is what lets those
11//! methods be swapped without every consumer rewriting itself.
12//!
13//! # The honesty requirement
14//!
15//! A reconstruction is an estimate. The contract therefore refuses to let a
16//! provider present a guess as a measurement:
17//!
18//! - An absent surface is a typed [`ReconstructionRefusal`], never an empty
19//! mesh a caller might read as "the object is not there".
20//! - Surface invented across gaps in the capture is counted in
21//! [`ReconstructionEvidence::interpolated_triangles`].
22//! - The sample spacing the data actually resolves is reported, so a caller
23//! can tell measured detail from interpolated detail.
24//! - `require_closed` is honoured or refused, never satisfied by
25//! fabricating unmeasured surface.
26
27pub mod conformance;
28mod contract;
29mod evidence;
30
31pub use axiolid_contracts::{
32 Backend, BackendDescriptor, BackendId, CancellationGranularity, Determinism, ExecutionOptions,
33 ExecutionTarget, GeomError, GeomResult, Operation, ScratchRequirement,
34};
35pub use contract::{PointcloudReconstruction, Reconstruction, ReconstructionRefusal};
36pub use evidence::{
37 ReconstructionEvidence, ReconstructionOutcome, ReconstructionRequest, Resolution,
38};
39
40/// Capability this contract describes.
41pub const CAPABILITY_ID: axiolid_contracts::CapabilityId =
42 axiolid_contracts::capability_ids::POINTCLOUD_RECONSTRUCTION;