English | 日本語
A crate for voxelizing point clouds and generating 3D tiles.
- Voxelization based on pixel coordinates
- Each voxel generated by this crate corresponds to one pixel in the pixel coordinate system.
- This ensures positional consistency between multiple models.
- Tile-based partitioning
- The generated voxel data can be divided into tile spaces at the specified zoom level.
- This feature allows large point cloud data to be split into multiple files for output.
File Format | Input | Output |
---|---|---|
ply | ○ | ○ |
glb | x | ○ |
las | ○ | x |
laz | ○ | x |
fn example() {
// Load data
let file = BufReader::new(File::open("examples/data-source/colored_stanford_bunny.ply").unwrap());
// Collect vertex information from data
let point_cloud = PointCloud::from_ply(file);
// Define resolution
let resolution = Resolution::Mater(0.03);
// Voxelize
let voxel_collection = BuildSimpleVoxelizerDefault::voxelize_one(point_cloud, resolution);
// Generate mesh
let mesh = Mesher::meshing(voxel_collection, ValidSide::all());
// Simplify mesh (optional)
let simplified_mesh = mesh.simplify();
// Generate glb file
let glb = Glb::from_voxel_mesh(mesh.clone()).unwrap();
// Write file
let writer = File::create("examples/exports/colored_stanford_bunny.glb").expect("I/O error");
glb.to_writer(writer).expect("glTF binary output error");
println!("Generated colored_stanford_bunny.glb");
}
Refer to examples/generate_voxel_bunny.rs
.
cargo run --example bunny --features="ply"
Refer to examples/generate_voxel_tile.rs
.
When dealing with models with many vertex colors generated from point cloud data, converting them to glb
files (which
are smaller in size than ASCII ply files) seems to make rendering very costly. The cause is under investigation.
This takes a very long time. It is recommended to run it in release build.
cargo run --example tile --features="las ply"
Refer to generate_terrain_glb
.
cargo run --example terrain --features="image"
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
(The English in README.md
and documentation comments was translated from Japanese using ChatGPT and DeepL)