Crates.io | voxel-tiler-core |
lib.rs | voxel-tiler-core |
version | 0.3.2 |
source | src |
created_at | 2024-05-18 16:23:28.434027 |
updated_at | 2024-07-18 22:53:57.769455 |
description | Convert point clouds to voxel data. |
homepage | https://crates.io/crates/voxel-tiler-core |
repository | https://github.com/azishio/voxel-tiler-core-rs |
max_upload_size | |
id | 1244371 |
size | 171,331 |
English | 日本語
A crate for voxelizing point clouds and generating 3D tiles.
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
at your option.
(The English in README.md
and documentation comments was translated from Japanese using ChatGPT and DeepL)