Skip to main content

geop_ops_subd/
lib.rs

1//! Subdivision-surface modelling: a freeform body shaped by a control cage
2//! and built as the cage's Catmull–Clark limit surface, a B-rep of
3//! B-spline faces every other operation works with.
4//!
5//! - [`cage`]: the cage a step holds — vertices, faces, creased edges — and
6//!   the same indexed, mirrored and checked.
7//! - [`edit`]: the cages to start from, and the edits that shape them;
8//!   [`select`]: the edge loops, rings and boundaries they and a
9//!   selection follow.
10//! - [`subdivide`]: one Catmull–Clark step with creases, after which every
11//!   face is a quad.
12//! - [`limit`]: the limit surface of that as bicubic Bézier patches sharing
13//!   their boundary curves.
14//! - [`brep`]: those patches as a closed solid, or an open sheet, with the
15//!   cage's own topology and names.
16//! - [`operation`]: the [`Subd`] operation of a program, and how it is
17//!   edited.
18
19pub mod brep;
20pub mod cage;
21pub mod edit;
22pub mod limit;
23pub mod operation;
24pub mod select;
25pub mod subdivide;
26
27#[cfg(test)]
28mod editor_tests;
29pub mod examples;
30mod icons;
31#[cfg(test)]
32mod program_tests;
33#[cfg(test)]
34mod regression_tests;
35#[cfg(test)]
36mod tests;
37
38pub use cage::{Cage, CageFace, CageVertex, Crease, Mirror};
39pub use operation::{Subd, SubdArgs, SubdEditing, SubdSession, build_subd};
40
41use geop_core_editor::registry::Registry;
42use geop_core_math::geop_error::GeopResult;
43
44/// Adds what this crate offers an editor to `r`: subdivision surfaces, and the examples of them.
45pub fn register(r: Registry) -> GeopResult<Registry> {
46    r.operation(Subd)?.examples(examples::set())
47}