geop_ops_edit/lib.rs
1//! Edits of the bodies a part already has, as operations of a program (see
2//! [`geop_core_editor::part_operation`]):
3//!
4//! - [`DeleteBody`]: delete solids and faces standing on their own.
5//! - [`ExtractFace`]: copy a face out of its body into a face standing on
6//! its own — what a solid can be split with.
7//! - [`MoveFace`], [`OffsetFace`], [`ReplaceFace`], [`DeleteFace`]: direct
8//! edits of a solid's faces — shifted, pushed or pulled along their
9//! normals, put on another face's surface, taken out and healed over or
10//! left open — the solid rebuilt around them.
11
12pub mod delete;
13pub mod direct;
14#[cfg(test)]
15mod editor_tests;
16pub mod extract;
17mod icons;
18#[cfg(test)]
19mod program_tests;
20#[cfg(test)]
21mod stress_tests;
22
23pub use delete::{DeleteBody, DeleteBodyArgs};
24pub use direct::{
25 DeleteFace, DeleteFaceArgs, HealGap, MergeFaces, MergeFacesArgs, MoveFace, MoveFaceArgs,
26 OffsetFace, OffsetFaceArgs, ReplaceFace, ReplaceFaceArgs,
27};
28pub use extract::{ExtractFace, ExtractFaceArgs};
29
30use geop_core_editor::registry::Registry;
31use geop_core_math::geop_error::GeopResult;
32
33/// Adds what this crate offers an editor to `r`: deleting bodies,
34/// extracting faces, and moving, offsetting and replacing faces.
35pub fn register(r: Registry) -> GeopResult<Registry> {
36 r.operation(DeleteBody)?
37 .operation(ExtractFace)?
38 .operation(MoveFace)?
39 .operation(OffsetFace)?
40 .operation(ReplaceFace)?
41 .operation(DeleteFace)?
42 .operation(MergeFaces)
43}