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 bounding;
58pub mod center_line;
59pub mod center_line_exact;
60mod column;
61pub mod contour_lower;
62pub mod extrude;
63mod extrude_arc;
64mod extrude_exact;
65pub mod feature;
66pub mod fillet_variable;
67pub mod half_space;
68pub mod hull;
69pub mod loft;
70pub mod offset;
71pub mod polyhedron;
72pub mod profile;
73pub mod profile_lower;
74pub mod result;
75pub mod revolve;
76pub mod revolve_contour;
77pub mod revolve_exact;
78pub mod section_lower;
79pub mod sweep;
80pub mod trimmed_intersection;
81mod trimmed_intersection_assembly;
82mod trimmed_intersection_builder;
83mod trimmed_intersection_classify;
84mod trimmed_intersection_clone_surface;
85mod trimmed_intersection_rectangle;
86mod trimmed_intersection_types;
87
88pub use axiolid_brep::{
89    Curve2Id, Curve3Id, ExactBRep, ExactBRepBuilder, ExactBRepError, ExactTopology, SurfaceId,
90};
91pub use result::{GeneratedGeometry, GenerationOutput, GenerationRequest, TessellationRequest};
92pub use trimmed_intersection::{
93    split_surface_pair_certified, CertifiedDualTrimmedSurfacePair3, CertifiedSurfacePairSplit3,
94    CertifiedSurfacePairSplitOptions, CertifiedTrimmedSurfacePair3, EmbeddedFaceCurve,
95    SurfacePairMember, SurfacePairSplitUnresolvedReason,
96};