Skip to main content

geop_ops_step/
lib.rs

1//! STEP (ISO 10303) exchange: reading the B-rep solids and sheets of a STEP
2//! file into a part, and writing a part's bodies as one — so parts travel
3//! between geop and other CAD systems; and meshes read from STL.
4//!
5//! - [`part21`]: the clear-text encoding every STEP file is written in.
6//! - [`import`]: a file's bodies as descriptions the kernel builds.
7//! - [`export`]: a part's bodies, and the parts placed in it, as a file
8//!   ([`write_part`]).
9//! - [`ImportStep`]: the operation adding a file's bodies to a part.
10//! - [`ImportStl`]: a mesh of triangles added to a part as a B-rep.
11
12pub mod export;
13pub mod import;
14pub mod operation;
15pub mod part21;
16pub mod stl;
17
18pub use export::{Step, write_part, write_step};
19pub use import::{Healing, ImportedBody, read_step};
20pub use operation::{ImportStep, ImportStepArgs, Imported, add_bodies, imported, is_step_file};
21pub use stl::{ImportStl, ImportStlArgs, add_mesh, is_stl_file, read_stl};
22
23#[cfg(test)]
24mod regression_tests;
25#[cfg(test)]
26mod tests;
27
28#[cfg(test)]
29mod corpus;
30mod icons;
31
32use geop_core_editor::registry::Registry;
33use geop_core_math::geop_error::GeopResult;
34
35/// Adds what this crate offers an editor to `r`: importing STEP files, and
36/// writing a part as one.
37pub fn register(r: Registry) -> GeopResult<Registry> {
38    r.operation(ImportStep)?
39        .operation(ImportStl)?
40        .exporter(Step)
41}