1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! # lib3mf-converters
//!
//! Format converters for converting between 3MF and other 3D file formats.
//!
//! ## Overview
//!
//! This crate provides importers and exporters for converting STL and OBJ files to and from the 3MF format.
//! It builds on [`lib3mf_core`] to provide bi-directional conversion between these common 3D formats and the
//! full 3MF [`Model`] representation.
//!
//! **Supported formats:**
//! - **STL**: Binary and ASCII STL formats with auto-detection
//! - **OBJ**: Basic geometry only (vertices and faces, no materials/textures)
//!
//! ## Quick Start
//!
//! ```no_run
//! use lib3mf_converters::stl::StlImporter;
//! use lib3mf_core::validation::ValidationLevel;
//! use std::fs::File;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Import an STL file
//! let file = File::open("model.stl")?;
//! let model = StlImporter::read(file)?;
//!
//! // Validate the imported geometry
//! let report = model.validate(ValidationLevel::Standard);
//! if report.has_errors() {
//! eprintln!("Imported model has validation errors");
//! }
//!
//! // Access the mesh data
//! println!("Imported {} objects", model.resources.iter_objects().count());
//! # Ok(())
//! # }
//! ```
//!
//! ## Modules
//!
//! - [`stl`]: Binary and ASCII STL import and export
//! - [`obj`]: Wavefront OBJ import and export
//!
//! ## Limitations
//!
//! - **STL**: No color or material attribute support in STL format
//! - **OBJ**: Materials (mtllib/usemtl), texture coordinates (vt), and normals (vn) are ignored during import
//! - **OBJ**: Export does not include materials or textures, only geometry
//! - Vertex deduplication in STL import uses bitwise float comparison (exact match required)
//!
//! ## Cross-References
//!
//! This crate works with types from [`lib3mf_core`], particularly:
//! - [`lib3mf_core::model::Model`]: The primary 3MF model structure
//! - [`lib3mf_core::model::Mesh`]: Triangle mesh geometry
//! - [`lib3mf_core::error::Lib3mfError`]: Error type for conversion operations
//!
//! [`lib3mf_core`]: https://docs.rs/lib3mf-core
//! [`Model`]: https://docs.rs/lib3mf-core/latest/lib3mf_core/model/struct.Model.html
//! [`lib3mf_core::model::Model`]: https://docs.rs/lib3mf-core/latest/lib3mf_core/model/struct.Model.html
//! [`lib3mf_core::model::Mesh`]: https://docs.rs/lib3mf-core/latest/lib3mf_core/model/struct.Mesh.html
//! [`lib3mf_core::error::Lib3mfError`]: https://docs.rs/lib3mf-core/latest/lib3mf_core/error/enum.Lib3mfError.html