Skip to main content

geop_ops_parts/
lib.rs

1//! Building a [`Part`](geop_core_part::Part) from a script of CAD operations.
2//!
3//! - [`operation`]: every operation a part is built with — adding a sketch,
4//!   extruding or revolving one, combining two solids, adding reference
5//!   geometry — as an
6//!   [`Operation`] with plain, serializable arguments that refer to
7//!   existing entities only by their stable names (see `geop_core_part`'s
8//!   crate docs for the naming scheme).
9//! - [`Program`]: an ordered list of such operations, each with an id of
10//!   its own, that builds a part from scratch. A program is design data: it
11//!   serializes to JSON and back without losing anything, and rebuilding
12//!   the read-back program gives the same part, name for name. It changes
13//!   only through [`Program::update`], and [`ProgramRunner`] builds it
14//!   incrementally, stopping wherever an editor asks.
15//! - [`OperationSchema`]: what every operation takes, so an editor can
16//!   offer any operation without knowing it by hand.
17//! - [`examples`]: a few programs built in Rust, used by the tests and as a
18//!   reference for writing new ones.
19
20// The derives in `geop_ops_parts_derive` name this crate by its path, which
21// has to resolve inside it too.
22extern crate self as geop_ops_parts;
23
24pub mod examples;
25pub mod operation;
26mod program;
27
28pub use operation::{
29    AddDatum, AddDatumArgs, AddSketch, AddSketchArgs, ArgKind, ArgSchema, Boolean, BooleanArgs,
30    Combine, Construction, EntityRef, Extrude, ExtrudeArgs, Operation, OperationArgs,
31    OperationSchema, PartOperation, Revolve, RevolveArgs, WorldAxis,
32};
33pub use program::{Program, ProgramEdit, ProgramRunner, Step, StepHandle, StepResult};