fj_core/operations/
mod.rs

1//! # Create and modify shapes
2//!
3//! ## Purpose and Design
4//!
5//! This module provides functionality to create and modify shapes, generally in
6//! the form of extension traits. These extension traits are implemented for the
7//! object types that the functionality applies to, making them easily available
8//! to the caller, without creating a huge, monolithic API that would clutter up
9//! the modules that those object types are defined in.
10//!
11//! Objects are immutable, so to update one, one must create a new version of
12//! the object that incorporates the update. For this reason, the extension
13//! traits generally take `&self` and return the newly created object. Trait
14//! methods are annotated with `#[must_use]`, to prevent mistakes due to
15//! misunderstanding this principle.
16//!
17//!
18//! ### Bare Objects vs Stored Objects
19//!
20//! Extension traits are mostly implemented for bare object types (i.e. for
21//! `Vertex` instead of `Handle<Vertex>`). This makes those operations more
22//! flexible, as a `Handle` might not be available, but a reference to the bare
23//! object can always be produced from a `Handle`.
24//!
25//! They also mostly return bare objects, which also provides more flexibility
26//! to the user. An inserted object must always be valid, but in a series of
27//! operations, any intermediate ones might leave the object in an invalid
28//! state. By returning the bare object, the decision when to insert the object
29//! is left to the caller.
30//!
31//! Some operations might deviate from this rule, where it makes sense.
32//!
33//!
34//! ## Implementation Note
35//!
36//! Not all operation methods take `&self`, and not all are implemented for bare
37//! objects first. Where this is done without a clear justification, you can
38//! assume that the code in question is outdated. Feel free to open an issue or
39//! send a pull request!
40
41pub mod build;
42pub mod derive;
43pub mod geometry;
44pub mod holes;
45pub mod insert;
46pub mod join;
47pub mod merge;
48pub mod presentation;
49pub mod replace;
50pub mod reverse;
51pub mod split;
52pub mod sweep;
53pub mod transform;
54pub mod update;