brep_surface_offset/lib.rs
1//! Surface offsets of the BREP kernel: offset carriers, trims, regularity and fold loci.
2//!
3//! It is one of the implementation crates the kernel is built from. Applications
4//! should depend on [`BREP_kernel`](https://crates.io/crates/BREP_kernel), which
5//! re-exports the public API of every kernel crate at its root (`brep_kernel::…`)
6//! and adds the feature pipeline and the STEP, IGES, Parasolid (import), 3MF,
7//! GLB, STL and OBJ exchange.
8//! Many items here are public only so the other kernel crates can reach them;
9//! those are hidden from the documentation and carry no stability promise beyond
10//! the kernel's own. The kernel crates are released together, at one version.
11//!
12//! It contains:
13//!
14//! - offset carriers of analytic and NURBS faces;
15//! - re-trimming and re-intersecting offset faces;
16//! - regularity checks, fold loci and carving of the parts an offset folds over.
17//!
18//! Kernel crates it requires: [`BREP_RANSAC`](https://crates.io/crates/BREP_RANSAC), [`BREP_geometry`](https://crates.io/crates/BREP_geometry), [`BREP_topology`](https://crates.io/crates/BREP_topology). It is required by [`BREP_blend`](https://crates.io/crates/BREP_blend), [`BREP_offset`](https://crates.io/crates/BREP_offset), [`BREP_direct_edit`](https://crates.io/crates/BREP_direct_edit), [`BREP_kernel`](https://crates.io/crates/BREP_kernel).
19//!
20//! ## Building
21//!
22//! The crate builds natively and for `wasm32-unknown-unknown`. The `parallel`
23//! feature runs some per-face loops on rayon; `profile-wall` turns on a diagnostic
24//! wall-time partition. Both are off by default, and `BREP_kernel` forwards them.
25//!
26//! The packaged crate ships the library sources, the README, the licence and the
27//! manifest; it carries no test suite.
28//!
29//! ## License
30//!
31//! The Autodrop3d licence in `LICENSE.md`, shipped in the crate (`license-file` in
32//! the manifest). Source: <https://github.com/mmiscool/next.BREP.io_RUST_BREP_KERNEL>
33// Implementation crate of the kernel: its formerly crate-private items are public for the crates above
34// (documented hidden), and their docs may name private helpers.
35#![allow(rustdoc::private_intra_doc_links)]
36use serde::{Deserialize, Serialize};
37#[allow(unused_imports)]
38use wasm_bindgen::prelude::*;
39#[macro_use]
40extern crate brep_geometry;
41#[allow(unused_imports)]
42#[doc(no_inline)]
43pub use brep_geometry::*;
44#[macro_use]
45extern crate brep_topology;
46#[allow(unused_imports)]
47#[doc(no_inline)]
48pub use brep_topology::*;
49
50// The shared re-trim helpers — ONE definition of "rebuild a face's carrier and
51// pcurves around a boundary that has already moved", shared by push-face,
52// face-move and the direct-edit heals. This is the RE-INTERSECTION sense of
53// trimming; offset-shell's parametric-image trimming is a different operation
54// and deliberately not here (see the module doc). Crate-internal: no consumer
55// outside the kernel names these.
56#[path = "offset/retrim.rs"]
57#[doc(hidden)]
58pub mod offset_retrim;
59// The RE-INTERSECTION seam — ONE definition of "intersect two carriers to
60// remake a trim boundary", with the exact analytic lane first and the general
61// marched lane behind it. `offset_retrim` above re-trims a face around a
62// boundary that has ALREADY moved; this is the step that moves it, and it is
63// what makes a neighbour re-intersection surface-type-blind the way
64// offset-shell's imprint driver already is. Crate-internal: no consumer outside
65// the kernel names these.
66#[path = "offset/reintersect.rs"]
67#[doc(hidden)]
68pub mod offset_reintersect;
69#[path = "offset/offset.rs"]
70#[doc(hidden)]
71pub mod offset;
72pub use offset::{
73 offset_face_carrier, offset_face_carrier_measured, offset_face_carrier_sided, offset_surface,
74 offset_surface_measured, offset_surface_measured_sided, CarrierDeviation, CarrierExtension,
75 MeasuredOffsetSurface, OffsetFaceCarrier, OffsetSurfaceLane,
76};
77// Region-scoped offset REGULARITY — ONE definition of "does the equidistant
78// surface fold over THIS trimmed region", shared by the sheet thickener's gate
79// and offset-shell's carrier-collapse lane. Both used to sweep a fixed grid
80// over the whole surface DOMAIN, which answers about the carrier instead of the
81// face. Crate-internal: no consumer outside the kernel names these.
82#[path = "offset/regularity.rs"]
83#[doc(hidden)]
84pub mod offset_regularity;
85// The fold LOCUS — the curve `1 − d·k = 0` itself, marched out of the brackets
86// the regularity scan above already finds on its own grid. `regularity` answers
87// "does this region fold"; this answers "WHERE does it stop folding", which is
88// the boundary a partially-folded trim has to be split along. Crate-internal:
89// no consumer outside the kernel names these.
90#[path = "offset/fold_locus.rs"]
91#[doc(hidden)]
92pub mod offset_fold_locus;
93// The CARVE — split a trim along the fold locus, keep the regular side, hand
94// back the folded one. The two modules above decide THAT a region folds and
95// WHERE it stops; this is what both are for, and it is shared by the sheet
96// thickener and offset shell for the same reason the scan is. Crate-internal:
97// no consumer outside the kernel names these.
98#[path = "offset/carve.rs"]
99#[doc(hidden)]
100pub mod offset_carve;
101
102/// Hash of this crate's source (`build.rs`), one part of the kernel's source stamp.
103#[doc(hidden)]
104pub const SOURCE_HASH: Option<&str> = option_env!("BREP_KERNEL_SOURCE_HASH");