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
67
68
69
70
71
72
73
74
75
76
//! # Schematic Mesher
//!
//! A Rust library for generating 3D meshes from Minecraft schematics.
//!
//! ## Overview
//!
//! This library takes a Minecraft schematic and resource pack as input,
//! and produces a 3D mesh (GLB/glTF) with a texture atlas as output.
//!
//! ## Quick Start
//!
//! ```ignore
//! use schematic_mesher::{load_resource_pack, Mesher, export_glb};
//!
//! // Load a resource pack
//! let pack = load_resource_pack("path/to/pack.zip")?;
//!
//! // Create a mesher
//! let mesher = Mesher::new(pack);
//!
//! // Generate mesh from blocks (using BlockSource trait)
//! let output = mesher.mesh(&my_block_source)?;
//!
//! // Export to GLB
//! let glb_bytes = export_glb(&output)?;
//! ```
//!
//! ## Library Integration
//!
//! For integrating with existing block storage (like Nucleation), implement the
//! `BlockSource` trait or use `mesh_blocks()` with an iterator of blocks:
//!
//! ```ignore
//! use schematic_mesher::{Mesher, InputBlock, BlockPosition, BoundingBox};
//!
//! // Create blocks from your schematic
//! let blocks: Vec<(BlockPosition, InputBlock)> = /* ... */;
//! let bounds = BoundingBox::new([0, 0, 0], [16, 16, 16]);
//!
//! // Mesh with references
//! let output = mesher.mesh_blocks(
//! blocks.iter().map(|(pos, block)| (*pos, block)),
//! bounds
//! )?;
//! ```
// Re-export main types for convenience
pub use ;
pub use ;
pub use ;
pub use ;
pub use TextureAtlas;
pub use export_glb;
pub use ;
pub use ;
/// Load a resource pack from a file path (ZIP or directory).
/// Load a resource pack from bytes (for WASM compatibility).