axiolid_linear_intersection/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Certified intersections for linear geometry.
4//!
5//! This package exists so a line-query application can compile intersection
6//! logic with a four-package internal closure — `axiolid-core`,
7//! `axiolid-guarantees`, `axiolid-linear`, `axiolid-predicates` — and no
8//! curves, surfaces, NURBS, meshes, B-rep, topology, providers, or execution
9//! machinery (ADR 0036). The `linear-intersection-minimal` profile in
10//! `docs/architecture/closure-profiles.toml` pins that closure, so any new
11//! internal dependency fails `cargo xtask architecture closure check`.
12//!
13//! # Classification, not `Option<Point2>`
14//!
15//! Collapsing the answer to an optional point destroys facts a topology or
16//! rule checker needs: crossing, endpoint contact, parallel-disjoint,
17//! coincident, collinear-disjoint, and overlap are distinct outcomes and are
18//! returned as distinct variants.
19//!
20//! # Certified topology
21//!
22//! Parallel-versus-coincident and on-segment decisions come from
23//! `axiolid-predicates`, which escalates to exact arithmetic. The caller's
24//! [`axiolid_core::Tolerance`] governs residual acceptance of the computed
25//! coordinate, never the topological branch.
26
27mod error;
28mod line_line;
29mod segment_segment;
30mod validate;
31
32/// Re-exported so a caller can name the required tolerance policy without a
33/// separate dependency on `axiolid-core`.
34pub use axiolid_core::Tolerance;
35pub use error::{InputSide, LinearIntersectionError};
36pub use line_line::{line_line2, LineLineIntersection2};
37pub use segment_segment::{segment_segment2, SegmentSegmentIntersection2};