Skip to main content

Crate geop_ops_parts

Crate geop_ops_parts 

Source
Expand description

Building a Part from a script of CAD operations.

  • operation: every operation a part is built with — adding a sketch, extruding or revolving one, combining two solids, adding reference geometry — as an Operation with plain, serializable arguments that refer to existing entities only by their stable names (see geop_core_part’s crate docs for the naming scheme).
  • Program: an ordered list of such operations, each with an id of its own, that builds a part from scratch. A program is design data: it serializes to JSON and back without losing anything, and rebuilding the read-back program gives the same part, name for name. It changes only through Program::update, and ProgramRunner builds it incrementally, stopping wherever an editor asks.
  • OperationSchema: what every operation takes, so an editor can offer any operation without knowing it by hand.
  • examples: a few programs built in Rust, used by the tests and as a reference for writing new ones.

Re-exports§

pub use operation::AddDatum;
pub use operation::AddDatumArgs;
pub use operation::AddSketch;
pub use operation::AddSketchArgs;
pub use operation::ArgKind;
pub use operation::ArgSchema;
pub use operation::Boolean;
pub use operation::BooleanArgs;
pub use operation::Combine;
pub use operation::Construction;
pub use operation::EntityRef;
pub use operation::Extrude;
pub use operation::ExtrudeArgs;
pub use operation::Operation;
pub use operation::OperationArgs;
pub use operation::OperationSchema;
pub use operation::PartOperation;
pub use operation::Revolve;
pub use operation::RevolveArgs;
pub use operation::WorldAxis;

Modules§

examples
Example programs, written in Rust against the operation types.
operation
The operations a crate::Program is made of.

Structs§

Program
A recipe for building a Part: an ordered list of steps, each referring to what earlier ones built only by name. Those names come from step ids and sketch element ids, never from the internal ids a build happens to assign (see geop_core_part), so a program means the same thing every time it is run — including after a round trip through JSON.
ProgramRunner
Builds a program the way an editor needs it built: incrementally, and only as far as asked.
Step
One step of a Program: an operation with its arguments, and the id everything it creates is named after. Serializes as {"id": "box", "operation": "extrude", "args": {...}}.
StepHandle
A handle (see Handle) of the step step.
StepResult
How one step of a run went.

Enums§

ProgramEdit
A change to a Program. Every edit of a program — whoever makes it — is one of these, applied by Program::update.