1#![warn(missing_docs)]
20#![warn(missing_debug_implementations)]
21
22pub mod bounds;
23pub mod dag;
24pub mod dgc;
25pub mod error;
26pub mod local_triangle;
27pub mod meshlet_builder;
28pub mod obj;
29pub mod simplify;
30pub mod types;
31pub mod validation;
32
33pub use dag::{build_meshlet_dag, DagLevel, DagOptions, MeshletDag};
34pub use dgc::{crc32c, read_dgc, write_dgc, DgcWriteOptions, FLAG_ZLIB, NO_PARENT};
35pub use error::{DagError, DagResult};
36pub use local_triangle::{pack_local_triangle, unpack_local_triangle};
37pub use meshlet_builder::{build_meshlets, MeshletBuildResult};
38pub use obj::{parse_obj, write_obj};
39pub use simplify::{cluster_simplify, ClusterSimplifyResult};
40pub use types::{
41 IndexedGeometry, MESHLET_BOUNDS_STRIDE, MESHLET_DESCRIPTOR_STRIDE, MESHLET_SCHEMA_VERSION,
42};
43pub use validation::validate_input;
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn public_pipeline_smoke() {
51 let geometry = IndexedGeometry {
52 positions: vec![0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0],
53 indices: vec![0, 1, 2],
54 };
55 let dag = build_meshlet_dag(&geometry, &DagOptions::default()).expect("dag");
56 assert_eq!(dag.levels[0].meshlet_count, 1);
57 let bytes = write_dgc(&dag, &DgcWriteOptions::default()).expect("dgc");
58 let back = read_dgc(&bytes).expect("parse dgc");
59 assert_eq!(back.levels[0].indices, geometry.indices);
60 }
61}