Crates.io | splashsurf_lib |
lib.rs | splashsurf_lib |
version | 0.10.0 |
source | src |
created_at | 2020-08-24 18:35:00.162829 |
updated_at | 2023-09-25 19:57:04.298543 |
description | Library for surface reconstruction of SPH particle data |
homepage | https://splashsurf.physics-simulation.org |
repository | https://github.com/InteractiveComputerGraphics/splashsurf |
max_upload_size | |
id | 280253 |
size | 826,149 |
Library for surface reconstruction of SPH particle data
The library is mainly used by the splashsurf
command-line tool which is also available on crates.io.
For more information about the CLI, check out the readme in the root of the repository.
Contents
A reconstruction from particle positions is performed using the top-level reconstruct_surface
function:
pub fn reconstruct_surface<I: Index, R: Real>(
particle_positions: &[Vector3<R>],
parameters: &Parameters<R>,
) -> Result<SurfaceReconstruction<I, R>, ReconstructionError<I, R>>
See the documentation of the crate on docs.rs for more information on the usage.
The library re-exports nalgebra
to avoid version conflicts for users of the library.
By default none of the following features are enabled to reduce the dependencies introduced by this library. The following feature flags are available for splashsurf_lib
:
vtkio
data structures (in particular UnstructuredGridPiece
) that can be used to easily write the meshes to VTK files (e.g. for viewing them with Paraview). Check out the documentation of vtkio
or the corresponding io module of the splashsurf
CLI for reference.coarse-prof
. Several functions in the library will use the profile!
macro with the function name as an argument to record their runtime. The user of the library can then obtain the profiling data using the functions provided by the coarse-prof
crate. Note that profiling using this crate might reduce performance for surface reconstructions with a very small number of particles (i.e. only a few hundred).For each of the features, splashsurf_lib
re-exports the corresponding dependencies to avoid version conflicts for users of the library.
Currently, only one method based on a "spatial hashing" strategy is implemented.
Short summary: The fluid density is evaluated or mapped onto a sparse grid using spatial hashing in the support radius of each fluid particle. This implies that memory is only allocated in areas where the fluid density is non-zero. This is in contrast to a naive approach where the marching cubes background grid is allocated for the whole domain. Finally, the marching cubes reconstruction is performed only in those grid cells where an edge crosses the surface threshold. Cells completely in the interior of the fluid are skipped in the marching cubes phase.
Individual steps: