axiolid_construct/lib.rs
1#![forbid(unsafe_code)]
2
3//! Geometry generation from exact inputs into explicit mesh or focused analytic results.
4//!
5//! # Why this is its own crate
6//!
7//! Everything here answers one question: given an exact profile and a path,
8//! what solid does that denote? Extrusion, revolution, the sweep families,
9//! lofting and half-space clipping are all the same problem with different
10//! path kinds, and they share one stitching implementation so that winding,
11//! hole orientation and cap pairing are decided once.
12//!
13//! None of that needs an operation graph. These functions take geometry and
14//! return geometry; they do not walk a DAG, cache results, resolve node
15//! references, or dispatch to a backend. That is why they live here and not
16//! in `axiolid-mesh-compile`, which does all four.
17//!
18//! The split matters beyond tidiness. A caller that wants a swept solid --
19//! a CAD front end, a test, a future exact B-rep generator -- should not have
20//! to construct a `SolidOperation` graph and run a compiler to get one. Under
21//! the old layout that was the only way to reach this code.
22//!
23//! # Exact generation coverage
24//!
25//! Broad sweep families still produce meshes by default, but exact generation
26//! is no longer a narrow slice. Every `Profile` variant extrudes exactly:
27//! rectangle (including through-holes), circle, ellipse, contour (with holes
28//! and arcs), section, centre-line, derived and composite. Revolution covers
29//! any profile that lowers to a contour, sweeping cylinders, cones, planar
30//! annuli and tori.
31//!
32//! What still refuses is stated per call site and is about geometry the
33//! kernel cannot represent exactly rather than work not yet done -- a partial
34//! turn, a section straddling the revolution axis, an offset with no
35//! same-kind result, a non-conformal transform. None of this implies general
36//! exact booleans.
37//!
38//! Certified affine surface-pair arrangement remains the other focused
39//! analytic constructor.
40
41use axiolid_contracts::BackendId;
42
43/// Identity these generators report in diagnostics.
44///
45/// Distinct from the compiler's: a failure raised while building a swept
46/// solid comes from this crate, and attributing it to `axiolid-mesh-compile`
47/// would send a reader to the wrong place. Sweeps already reported a
48/// separate identity before the split; this makes every generator
49/// consistent with that.
50pub const BACKEND_ID: BackendId = BackendId::new("scalar-generate");
51
52mod assemble;
53mod boolean_column;
54pub mod boolean_exact;
55mod boolean_provenance;
56pub mod boolean_stepped;
57pub mod center_line;
58pub mod center_line_exact;
59mod column;
60pub mod contour_lower;
61pub mod extrude;
62mod extrude_arc;
63mod extrude_exact;
64pub mod feature;
65pub mod fillet_variable;
66pub mod half_space;
67pub mod hull;
68pub mod loft;
69pub mod offset;
70pub mod polyhedron;
71pub mod profile;
72pub mod profile_lower;
73pub mod result;
74pub mod revolve;
75pub mod revolve_contour;
76pub mod revolve_exact;
77pub mod section_lower;
78pub mod sweep;
79pub mod trimmed_intersection;
80mod trimmed_intersection_assembly;
81mod trimmed_intersection_builder;
82mod trimmed_intersection_classify;
83mod trimmed_intersection_clone_surface;
84mod trimmed_intersection_rectangle;
85mod trimmed_intersection_types;
86
87pub use axiolid_brep::{
88 Curve2Id, Curve3Id, ExactBRep, ExactBRepBuilder, ExactBRepError, ExactTopology, SurfaceId,
89};
90pub use result::{GeneratedGeometry, GenerationOutput, GenerationRequest, TessellationRequest};
91pub use trimmed_intersection::{
92 split_surface_pair_certified, CertifiedDualTrimmedSurfacePair3, CertifiedSurfacePairSplit3,
93 CertifiedSurfacePairSplitOptions, CertifiedTrimmedSurfacePair3, EmbeddedFaceCurve,
94 SurfacePairMember, SurfacePairSplitUnresolvedReason,
95};