InteractiveComputerGraphics / splashsurf

Surface reconstruction library and CLI for particle data from SPH simulations, written in Rust.
https://splashsurf.physics-simulation.org/
MIT License
135 stars 20 forks source link

panic during meshing reconstruction in neighorhood_search #41

Open whiterabbit42k opened 3 years ago

whiterabbit42k commented 3 years ago

I've got a new panic i'm seeing during mesh reconstruction in the neighborhood_search file:

thread 'fluid_mesher' panicked at 'called `Option::unwrap()` on a `None` value', /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/neighborhood_search.rs:363:44
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:50:5
   3: core::option::Option<T>::unwrap
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/option.rs:388:21
   4: splashsurf_lib::neighborhood_search::sequential_generate_cell_to_particle_map
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/neighborhood_search.rs:363:20
   5: splashsurf_lib::neighborhood_search::sequential_search
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/neighborhood_search.rs:131:9
   6: splashsurf_lib::neighborhood_search::search_inplace
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/neighborhood_search.rs:62:9
   7: splashsurf_lib::reconstruction::compute_particle_densities_and_neighbors
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/reconstruction.rs:552:5
   8: splashsurf_lib::reconstruction::reconstruct_single_surface_append
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/reconstruction.rs:590:9
   9: splashsurf_lib::reconstruction::reconstruct_surface_global
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/reconstruction.rs:34:5
  10: splashsurf_lib::reconstruct_surface_inplace
             at /home/whiterabbit/.cargo/registry/src/github.com-1ecc6299db9ec823/splashsurf_lib-0.6.1/src/lib.rs:354:9

if you need some more info, let me know; it seems to be sort of random; this was in context of me experimenting with rendering a faucet. (so particles deleted after some time).

w1th0utnam3 commented 3 years ago

Thanks for reporting this. Are you able to update to 0.7.0? Because in this release I added some tests for the neighborhood search (e.g. verifying the spatial hashing results with a brute force O(n^2) search) and I might have fixed this bug.

whiterabbit42k commented 3 years ago

let me try with update, thanks for asking