oxigdal_3d/lib.rs
1//! # OxiGDAL 3D
2//!
3//! 3D visualization, point cloud processing, and terrain mesh support for OxiGDAL.
4//!
5//! This crate provides comprehensive 3D geospatial data handling capabilities:
6//!
7//! ## Features
8//!
9//! - **Point Clouds**: LAS/LAZ, COPC (Cloud Optimized Point Cloud), EPT (Entwine Point Tiles)
10//! - **Mesh Formats**: OBJ, glTF 2.0/GLB export with texture support
11//! - **Terrain**: TIN (Triangulated Irregular Network), DEM to mesh conversion
12//! - **Visualization**: 3D Tiles (Cesium) for web-based 3D mapping
13//! - **Classification**: Ground, vegetation, building extraction
14//!
15//! ## Example Usage
16//!
17//! ```no_run
18//! use oxigdal_3d::*;
19//!
20//! # fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
21//! // Read LAS point cloud
22//! let mut las = pointcloud::LasReader::open("points.las")?;
23//! let point_cloud = las.read_all()?;
24//!
25//! // Classify ground points
26//! let ground = classification::classify_ground(&point_cloud.points)?;
27//!
28//! // Create TIN from ground points
29//! let tin = terrain::create_tin(&ground)?;
30//!
31//! // Export as glTF mesh
32//! let mesh = terrain::tin_to_mesh(&tin)?;
33//! mesh::export_gltf(&mesh, "terrain.glb")?;
34//! # Ok(())
35//! # }
36//! ```
37//!
38//! ## Architecture
39//!
40//! - Pure Rust implementation where possible
41//! - Streaming support for large datasets
42//! - Memory-efficient processing with spatial indexing
43//! - Web-ready formats (glTF, 3D Tiles)
44//! - Feature-gated C dependencies (PDAL, PCL) per COOLJAPAN Pure Rust Policy
45
46#![deny(clippy::unwrap_used, clippy::panic)]
47#![warn(missing_docs, unsafe_code)]
48
49// Core modules
50pub mod error;
51
52// Point cloud modules
53#[cfg(feature = "las-laz")]
54pub mod pointcloud;
55
56// Mesh modules
57#[cfg(feature = "mesh")]
58pub mod mesh;
59
60// Terrain modules
61#[cfg(feature = "terrain")]
62pub mod terrain;
63
64// Visualization modules
65#[cfg(feature = "tiles3d")]
66pub mod visualization;
67
68// Classification module
69pub mod classification;
70
71// Re-exports
72pub use error::{Error, Result};
73
74#[cfg(feature = "las-laz")]
75pub use pointcloud::{LasReader, LasWriter, Point, PointFormat};
76
77#[cfg(feature = "mesh")]
78pub use mesh::{Mesh, export_gltf, export_obj};
79
80#[cfg(feature = "terrain")]
81pub use terrain::{Tin, create_tin, tin_to_mesh};
82
83#[cfg(feature = "tiles3d")]
84pub use visualization::{Tileset, create_3d_tileset, write_3d_tiles};
85
86/// Library version
87pub const VERSION: &str = env!("CARGO_PKG_VERSION");
88
89#[cfg(test)]
90mod tests {
91 use super::*;
92
93 #[test]
94 fn test_version() {
95 assert!(!VERSION.is_empty());
96 }
97}