Skip to main content

axiolid_reference/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Portable scalar reference implementation: the correctness oracle (ADR 0012).
4//!
5//! No intrinsics, no threading, no feature gates. Every optimized backend is
6//! validated by differential test against this crate, so it must stay readable
7//! and obviously correct in preference to being fast.
8//!
9//! This package is a **convenience umbrella** (ADR 0036). Certified predicates
10//! now live in the focused `axiolid-predicates` package and are re-exported
11//! here unchanged, so an existing `axiolid_reference::orient2d` caller is
12//! unaffected while a narrow consumer can depend on the substrate directly
13//! instead of acquiring this package's whole dependency graph. Analytic and
14//! spline evaluation moved to `axiolid-evaluate` the same way. Do not
15//! re-inline either: adding a dependency here is cheap, adding one to an
16//! extracted package is an architectural decision.
17//!
18//! Error bounds scale with operand magnitude; a constant epsilon is a bug.
19//! Tests here include a differential gate against an oracle that shares no
20//! code with the implementation, and assert that the exact path was actually
21//! reached: a suite that never escalates proves nothing about exactness.
22
23pub mod assemble;
24pub mod boolean;
25pub mod clash;
26pub mod convex_hull;
27pub mod coplanar;
28pub mod intersection;
29pub mod polygon;
30pub mod primitive;
31pub mod retriangulate;
32pub mod section;
33pub mod segment_triangle;
34pub mod tessellate;
35pub mod triangle_triangle;
36
37/// Certified derivative and chord bounds (#232), re-exported on the same
38/// footing as `curve` and `surface`.
39pub use axiolid_evaluate::bound;
40/// Derivatives, certified bounds and corners of elevated and banked
41/// curves in plan distance (#252), re-exported on the same footing as
42/// `curve` and `surface`.
43pub use axiolid_evaluate::elevated;
44/// Stations: a section frame at a distance along a curve (#241),
45/// re-exported on the same footing as `curve` and `surface`.
46pub use axiolid_evaluate::station;
47/// Arc length along any evaluable curve and its inverse, and arc-length
48/// chains (#239), re-exported on the same footing as `curve` and `surface`.
49pub use axiolid_evaluate::{arc_parameter, chain};
50/// Analytic and spline evaluation moved to the focused `axiolid-evaluate`
51/// package (ADR 0036). Re-exported unchanged so existing
52/// `axiolid_reference::curve::*` and `::surface::*` callers are unaffected.
53pub use axiolid_evaluate::{curve, surface};
54
55pub use axiolid_predicates::{
56    arithmetic, expansion, orient3, orientation, scene, sphere, static_filter,
57};
58
59pub use assemble::exact_boolean;
60pub use axiolid_evaluate::{
61    derivative2, derivative3, evaluate2, evaluate3, flatten2, partials, Patch, ScalarCurve,
62    ScalarSurface,
63};
64// Arc-length evaluation of natural-equation curves (ADR 0061, ADR 0062).
65// Re-exported on the same footing as the rest of `axiolid-evaluate`, so a
66// consumer of the umbrella reaches a torsion curve without taking the
67// parametric package as a direct dependency.
68pub use axiolid_evaluate::{
69    elevated_point, elevated_tangent, frenet_frame, frenet_point, frenet_tangent, intrinsic_point,
70    intrinsic_tangent, join_intrinsic3, offset_intrinsic3, trim_intrinsic3,
71};
72pub use axiolid_predicates::{
73    incircle, incircle_filter, insphere, insphere_filter, orient2d, orient2d_filter, orient3d,
74    orient3d_filter, two_diff, two_product, two_sum, StaticFilter,
75};
76pub use boolean::ScalarBoolean;
77pub use convex_hull::{
78    minimum_area_rectangle, side_lengths, strict_convex_hull, OrientedRectangle2,
79};
80pub use intersection::{
81    assemble_polylines, intersection_segments, EdgeKey, IntersectionCurve, IntersectionSegment,
82    NodeKey, Operand, Polyline,
83};
84pub use polygon::{ring_orientation, signed_area2, triangulate_simple};
85pub use retriangulate::{retriangulate_face, FacePatch};
86pub use section::ScalarSection;
87pub use segment_triangle::{segment_triangle_relation, SegmentTriangleRelation};
88pub use triangle_triangle::{triangle_triangle_relation, TriangleTriangleRelation};