-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test of full surface reconstruction (not finished)
- Loading branch information
1 parent
804435b
commit 8cadc7c
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod io; | ||
|
||
pub mod test_full; | ||
pub mod test_octree; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use nalgebra::Vector3; | ||
use splashsurf_lib::{Parameters, reconstruct_surface}; | ||
|
||
use super::io::vtk::{write_vtk, particles_from_vtk}; | ||
|
||
#[test] | ||
pub fn surface_reconstruction_bunny() { | ||
let particle_positions: &Vec<Vector3<f32>> = | ||
&particles_from_vtk("../data/bunny_frame_14_7705_particles.vtk").unwrap(); | ||
|
||
let particle_radius = 0.025; | ||
let kernel_radius = 4.0 * particle_radius; | ||
let cube_size = 0.75 * particle_radius; | ||
|
||
let parameters = Parameters { | ||
particle_radius, | ||
rest_density: 1000.0, | ||
kernel_radius, | ||
splash_detection_radius: None, | ||
cube_size, | ||
iso_surface_threshold: 0.6, | ||
domain_aabb: None, | ||
enable_multi_threading: true, | ||
spatial_decomposition: None, | ||
}; | ||
|
||
let reconstruction = reconstruct_surface::<i64, _>(particle_positions.as_slice(), ¶meters).unwrap(); | ||
|
||
// TODO: Compare with a solution file | ||
// TODO: Test with a fixed grid? | ||
|
||
write_vtk( | ||
reconstruction.mesh(), | ||
"../out/reconstruct_surface_bunny.vtk", | ||
"mesh", | ||
) | ||
.unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters