Skip to main content

ogeom_io/
lib.rs

1//! Data exchange.
2//!
3//! *Elsewhere:* the shape serialization, STEP, IGES, glTF and transfer-framework
4//! packages.
5//!
6//! The native format comes first, in Phase 1, because it is what the test suite
7//! round-trips through, not because anyone wants it.
8//!
9//! STEP is the one with real external value: there is no production-grade Rust STEP
10//! importer today. Parsing is the easy 20% (`ruststep`/`espr` cover it); the other
11//! 80% is semantic mapping onto our topology, unit and assembly-transform handling,
12//! and surviving spec-violating output from commercial CAD systems.
13//!
14//! # Two formats, two things
15//!
16//! [`native`] carries a whole document (topology, geometry, placements,
17//! tolerances, provenance) and reads back as the same model, handles and all.
18//! [`stl`] carries a triangle soup and loses everything else, which is the
19//! format's nature rather than a shortcoming of the writer.
20//!
21//! The crate root re-exports STL's [`read`] and [`write()`] for the common case;
22//! the native pair are reached as [`native::read`] and
23//! [`native::write()`], because "write this shape" means something different for
24//! each and a name that did not say which would be the wrong kind of convenience.
25
26pub mod brep;
27pub mod dxf;
28pub mod iges;
29pub(crate) mod inflate;
30pub(crate) mod inversion;
31pub mod json;
32pub mod mesh_formats;
33pub mod native;
34pub(crate) mod pcurves;
35pub mod step;
36pub mod stl;
37pub mod threemf;
38pub mod vrml;
39pub(crate) mod xml;
40
41pub use iges::{IgesImport, IgesReport, read_iges, write_iges};
42pub use mesh_formats::{
43    ExportMesh, ImportedMesh, read_glb, read_gltf, write_glb, write_obj, write_ply,
44};
45pub use step::{StepImport, StepReport, UntrimmedFace, WarningSummary, read_step, write_step};
46pub use stl::{Encoding, read, write};
47pub use threemf::{ObjectType, ThreeMfImport, ThreeMfObject, read_3mf, write_3mf};
48pub use vrml::read_vrml;