Skip to main content

ogeom_io/
lib.rs

1//! Data exchange.
2//!
3//! The native format is what the test suite round-trips through. STEP is the
4//! exchange format with external value, and reading it is mostly not parsing:
5//! the Part 21 syntax is the small part, and the rest is the semantic mapping
6//! onto this kernel's topology, unit and assembly-transform handling, and
7//! surviving the spec-violating output real exporters write.
8//!
9//! # Two formats, two things
10//!
11//! [`native`] carries a whole document (topology, geometry, placements,
12//! tolerances, provenance) and reads back as the same model, handles and all.
13//! [`stl`] carries a triangle soup and loses everything else, which is the
14//! format's nature rather than a shortcoming of the writer.
15//!
16//! The crate root re-exports STL's [`read`] and [`write()`] for the common case;
17//! the native pair are reached as [`native::read`] and
18//! [`native::write()`], because "write this shape" means something different for
19//! each and a name that did not say which would be the wrong kind of convenience.
20
21pub(crate) mod bodies;
22pub mod brep;
23pub mod cloud;
24pub mod dxf;
25pub mod iges;
26pub(crate) mod image;
27pub(crate) mod inflate;
28pub(crate) mod inversion;
29pub mod json;
30pub mod mesh_formats;
31pub mod native;
32mod obj;
33pub(crate) mod pcurves;
34mod ply;
35pub mod step;
36pub mod stl;
37pub mod threemf;
38pub mod vrml;
39pub(crate) mod xml;
40
41pub use cloud::{PointCloud, Scalar, XyzColumn, read_pts, read_xyz, write_xyz};
42pub use iges::{
43    IgesExport, IgesImport, IgesReport, read_iges, read_iges_file, write_iges, write_iges_reported,
44};
45pub use mesh_formats::{
46    ExportMesh, ImportedMesh, MeshColours, ObjImport, PlyImport, read_glb, read_gltf, read_obj,
47    read_obj_file, read_obj_with_materials, read_ply, read_ply_bytes, write_glb, write_obj,
48    write_ply, write_ply_binary,
49};
50pub use step::{StepImport, StepReport, UntrimmedFace, WarningSummary, read_step, write_step};
51pub use stl::{Encoding, StlMesh, read, read_with_quantum, write};
52pub use threemf::{
53    ObjectRole, ObjectType, ThreeMfImport, ThreeMfObject, ThreeMfVolume, read_3mf, write_3mf,
54};
55pub use vrml::read_vrml;