Skip to main content

geop_ops_fillet/
lib.rs

1//! Blending a solid's edges: rounding them ([`Fillet`]) and bevelling them
2//! ([`Chamfer`]).
3//!
4//! `blend` builds, for every edge, the tool that holds the material between
5//! the edge and its blend face — a ball rolled along it (`rolling`), exact
6//! where its section is carried along the edge unchanged — and cuts it away
7//! with the boolean difference of `geop_lib_booleans`, or fills it in with
8//! their union. Where every edge of a corner is filleted, the corner is
9//! rounded by a ball's piece (`corner`); tools joined there are built whole
10//! as one solid (`tool`). `operation` makes
11//! that the [`Fillet`] and [`Chamfer`] operations of a program.
12
13mod blend;
14mod corner;
15#[cfg(test)]
16mod editor_tests;
17#[cfg(test)]
18mod example_tests;
19#[cfg(any(test, feature = "examples"))]
20pub mod examples;
21pub mod operation;
22mod rolling;
23mod tool;
24
25pub use operation::{Chamfer, ChamferArgs, Fillet, FilletArgs, VertexRadius};
26
27#[cfg(test)]
28mod program_tests;
29#[cfg(test)]
30mod regression_tests;
31#[cfg(test)]
32mod rolling_tests;
33#[cfg(test)]
34mod stress_tests;
35#[cfg(test)]
36mod subd_regression_tests;
37#[cfg(test)]
38mod tests;
39#[cfg(test)]
40mod tutorial_regression_tests;
41
42use geop_core_editor::registry::Registry;
43use geop_core_math::geop_error::GeopResult;
44
45/// Adds what this crate offers an editor to `r`: fillets and chamfers, and
46/// the examples of them.
47pub fn register(r: Registry) -> GeopResult<Registry> {
48    let r = r.operation(Fillet)?.operation(Chamfer)?;
49    #[cfg(any(test, feature = "examples"))]
50    let r = r.examples(examples::set())?;
51    Ok(r)
52}