$ show InteractiveComputerGraphics/splashsurf
This repository provides a high-performance surface reconstruction system for SPH (Smoothed Particle Hydrodynamics) fluid simulation data. The core library, splashsurf_lib, implements a marching cubes pipeline that converts particle positions and densities into triangle meshes, with subdomain-based parallel decomposition, SIMD-accelerated kernel evaluation (AVX2, NEON), and optional post-processing (weighted Laplacian smoothing, barnacle decimation, quad conversion, attribute interpolation). The system is exposed as a CLI tool (splashsurf), a Python package (pysplashsurf via PyO3), and a Blender add-on (splashsurf_studio) for interactive viewport and render-time reconstruction. The architecture is modular: a generic library with traits for numeric types, a dense subdomain grid for parallelism, a half-edge mesh for decimation, and a custom nom-based BGEO parser. The codebase is well-structured with strong emphasis on performance and reproducibility, and it implements the research from LΓΆschner et al. (2023) on weighted Laplacian smoothing. It targets researchers and artists working with SPH simulations (e.g., SPlisHSPlasH) and supports multiple input/output formats (VTK, PLY, OBJ, BGEO, XYZ, JSON).
The LLM identified 5 files worth highlighting for reuse:
Provides a cubic spline kernel for SPH interpolation with scalar and SIMD (AVX2, NEON) implementations. Demonstrates runtime SIMD detection, fallback, and correctness tests. Reusable in any SPH project.
Implements a uniform Cartesian cube grid with flattening, cell/edge/point indexing, and neighbor enumeration. Generic over integer and float types. Core building block for grid-based algorithms like marching cubes.
Multi-threaded spatial hashing for building neighbor lists from particle positions. Includes sequential and parallel variants, flat neighbor list storage, and unsafe slice parallel writes. Can be extracted for particle simulation or point cloud processing.
Half-edge triangle mesh data structure with edge collapse operations, legality checks, and manifold preservation. Used for mesh decimation and cleanup. Self-contained and reusable for mesh processing tasks.
Custom parser and writer for Houdini's BGEO binary geometry format using nom. Handles compressed and uncompressed data, attribute types. Demonstrates binary format parsing with feel for error handling. Reusable for Houdini interop.