{"id":24404,"library":"pysplashsurf","title":"PySplashSurf","description":"Python bindings for splashsurf, a high-performance surface reconstruction library for SPH (Smoothed Particle Hydrodynamics) simulations. Current version 0.14.1.0, release cadence irregular; follows the underlying C++ library.","status":"active","version":"0.14.1.0","language":"python","source_language":"en","source_url":"https://github.com/InteractiveComputerGraphics/splashsurf.git","tags":["sph","surface-reconstruction","fluid-simulation","mesh-generation"],"install":[{"cmd":"pip install pysplashsurf","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Input/output particle positions and mesh arrays","package":"numpy","optional":false}],"imports":[{"note":"Function is a module-level export; direct attribute access may fail depending on version.","wrong":"import splashsurf; splashsurf.reconstruct_surface","symbol":"reconstruct_surface","correct":"from splashsurf import reconstruct_surface"},{"note":null,"wrong":null,"symbol":"compute_normals","correct":"from splashsurf import compute_normals"},{"note":null,"wrong":null,"symbol":"mesh_to_obj","correct":"from splashsurf import mesh_to_obj"}],"quickstart":{"code":"import numpy as np\nfrom splashsurf import reconstruct_surface\n\n# Example: random particle positions\npositions = np.random.rand(1000, 3).astype(np.float64)\n\n# Reconstruct surface (returns vertices, faces as numpy arrays)\nvertices, faces = reconstruct_surface(positions)\nprint(f\"Surface: {len(vertices)} vertices, {len(faces)} faces\")","lang":"python","description":"Basic surface reconstruction from particle positions."},"warnings":[{"fix":"Update code to unpack the tuple: `vertices, faces = reconstruct_surface(positions)`.","message":"The Python API changed between version 0.11.x and 0.12.x: the function `reconstruct_surface` now returns a tuple `(vertices, faces)` instead of a namedtuple-like object. Old code using attribute access will break.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Ensure positions are `np.ascontiguousarray(positions, dtype=np.float64)`.","message":"Input particle positions must be a contiguous numpy array of dtype float64 (double precision). Using float32 or non-contiguous arrays (e.g., slices) may cause segmentation faults or incorrect results.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `conda install -c conda-forge pysplashsurf` or build from source following the GitHub instructions.","message":"On macOS with Apple Silicon, the pip-installed wheel may fall back to a slow pure-Python fallback if the native binary is not available. Install from conda-forge or build from source for optimal performance.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest version: `pip install --upgrade pysplashsurf`. If still fails, check installed version with `pip show pysplashsurf`.","cause":"Old version of the library (pre-0.12) where function was named differently or not exported at top level.","error":"ImportError: cannot import name 'reconstruct_surface' from 'splashsurf'"},{"fix":"Convert positions to float64 before calling: `positions = positions.astype(np.float64)`.","cause":"Particle positions array has dtype float32 instead of float64.","error":"ValueError: Buffer dtype mismatch, expected 'float64' but got 'float32'"},{"fix":"Make array contiguous: `positions = np.ascontiguousarray(positions)`.","cause":"Non-contiguous array (e.g., transpose or slice) passed to the C++ backend.","error":"Segmentation fault (core dumped)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}