Skip to main content

geop_ops_reference_geometry/
lib.rs

1//! Reference geometry as an operation of a program: [`AddDatum`] builds a
2//! point, an axis, a plane or a coordinate system from elements picked in
3//! the part ([`Selected`]), in one of the ways CAD systems commonly offer
4//! (see [`Construction`]), and adds it to the part's datums (see
5//! [`geop_ops_model::datums`]). What it is built from is picked as any
6//! element of the part ([`geop_ops_model::selection::Selected`]).
7
8mod add_datum;
9mod editor;
10#[cfg(test)]
11mod editor_tests;
12#[cfg(any(test, feature = "examples"))]
13pub mod examples;
14mod icons;
15#[cfg(test)]
16mod program_tests;
17
18pub use add_datum::{
19    AddDatum, AddDatumArgs, CONSTRUCTIONS, Construction, ConstructionSchema, Param, ParamKind,
20    fitting_constructions,
21};
22
23use geop_core_editor::registry::Registry;
24use geop_core_math::geop_error::GeopResult;
25
26/// Adds what this crate offers an editor to `r`: the step adding a datum.
27pub fn register(r: Registry) -> GeopResult<Registry> {
28    let r = r.operation(AddDatum)?;
29    #[cfg(any(test, feature = "examples"))]
30    let r = r.examples(examples::set())?;
31    Ok(r)
32}