Skip to content

Commit

Permalink
Add test of full surface reconstruction (not finished)
Browse files Browse the repository at this point in the history
  • Loading branch information
w1th0utnam3 committed Jan 25, 2021
1 parent 804435b commit 8cadc7c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
3 changes: 3 additions & 0 deletions data/bunny_frame_14_7705_particles.vtk
Git LFS file not shown
1 change: 1 addition & 0 deletions splashsurf_lib/tests/integration_tests/mod.rs
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;
38 changes: 38 additions & 0 deletions splashsurf_lib/tests/integration_tests/test_full.rs
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(), &parameters).unwrap();

// TODO: Compare with a solution file
// TODO: Test with a fixed grid?

write_vtk(
reconstruction.mesh(),
"../out/reconstruct_surface_bunny.vtk",
"mesh",
)
.unwrap();
}
2 changes: 0 additions & 2 deletions splashsurf_lib/tests/integration_tests/test_octree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ fn build_octree_par_consistency() {
grid_for_reconstruction::<i64, _>(particles.as_slice(), 0.025, 0.2, None, true).unwrap();

let mut octree_seq = Octree::new(&grid, particles.as_slice().len());
//octree_seq.subdivide_recursively(&grid, particles.as_slice(), 20);
octree_seq.subdivide_recursively_margin(
&grid,
particles.as_slice(),
Expand All @@ -157,7 +156,6 @@ fn build_octree_par_consistency() {
);

let mut octree_par = Octree::new(&grid, particles.as_slice().len());
//octree_par.subdivide_recursively(&grid, particles.as_slice(), 20);
octree_par.subdivide_recursively_margin_par(
&grid,
particles.as_slice(),
Expand Down

0 comments on commit 8cadc7c

Please sign in to comment.