Skip to main content

pySplashsurf

splashsurf logo

PyPI - Version PyPI - Python Version

pySplashsurf provides Python bindings for splashsurf, an open source surface reconstruction library for particle data from SPH simulations. Detailed information on the surface reconstruction and library itself and its API can be found on the project website (splashsurf.physics-simulation.org) or the main repository.

Installation

Requires Python version 3.10+

pip install pysplashsurf

To install pysplashsurf with meshio support (which adds some additional IO functionality), use

pip install pysplashsurf[meshio]

This will add support for the .bgeo file extension to meshio, so that particle data in the BGEOV format can be read using meshio. Meshio is also required for the write_to_file method from the bindings to work. The rest of the package, including the CLI, will still work even if meshio is not installed.

The pre-built wheels are compiled for a portable baseline of each platform and select SIMD code paths (AVX2+FMA or NEON) at runtime. To additionally optimize the whole package for the CPU of your machine, you can build it from source with:

RUSTFLAGS="-C target-cpu=native" pip install --no-binary pysplashsurf pysplashsurf

Packages built this way may crash with an "Illegal instruction" error on other CPUs and should not be distributed.

Usage

pySplashsurf can either be used as a library in Python scripts or as a command line tool that provides the same interface as the original Rust splashsurf CLI itself.

CLI

To use the CLI, you can use the pysplashsurf command after installing the package:

pysplashsurf --help

For example, to reconstruct a surface from particle data in a VTK file with some smoothing:

pysplashsurf reconstruct particles.vtk -r=0.025 -l=2.0 -c=0.5 -t=0.6 --mesh-smoothing-weights=on --mesh-smoothing-iters=15 --normals=on --normals-smoothing-iters=10

For more information on the CLI and its arguments, refer to the splashsurf documentation.

Library

Example to reconstruct the surface from an input file, apply some post-processing methods and write the data back to a file:

import meshio
import numpy as np
import pysplashsurf

# Load particles from mesh file
mesh = meshio.read("input.vtk")
particles = np.array(mesh.points, dtype=np.float64)

# Reconstruct the points/particles with some post-processing
mesh_with_data, reconstruction = pysplashsurf.reconstruction_pipeline(
    particles,
    particle_radius=0.025,
    rest_density=1000.0,
    smoothing_length=2.0,
    cube_size=0.5,
    iso_surface_threshold=0.6,
    mesh_smoothing_weights=True,
    mesh_smoothing_weights_normalization=13.0,
    mesh_smoothing_iters=25,
    normals_smoothing_iters=10,
    mesh_cleanup=True,
    compute_normals=True,
    subdomain_grid=True,
    subdomain_num_cubes_per_dim=64,
    output_mesh_smoothing_weights=True
)

# Write the mesh with attributes to file using meshio
mesh_with_data.write_to_file("surface.vtk")

The reconstruction_pipeline method provides (mostly) the same arguments as the splashsurf binary CLI. It may be necessary to specify the dtype of a function input (as done for particles in the example) so that the bindings know what data type to use internally. The extension supports single (np.float32) and double precision floats (np.float64).

Build instructions

You can also manually build the package from the source code:

  1. Clone the repository
  2. cd to the pysplashsurf directory
  3. Create an environment from python_environment.yaml and activate it
    • It is recommended to create it in a subfolder, e.g. conda env create --prefix ./env -f python_environment.yaml
    • Then activate it using conda activate ./env
  4. Now, to build the project, use maturin: maturin develop
    • Maturin automatically installs the resulting binary in your python environment
    • Set the release flag -r or --release to build an optimized binary, however, compilation time will be slightly longer

Documentation Build

To generate the Sphinx documentation, make sure that the package is installed through, e.g., maturin, and then run make html in the pysplashsurf/pysplashsurf/docs directory. The resulting HTML files will be in pysplashsurf/pysplashsurf/docs/build/html.

Stub File Generation

To automatically generate a stub file for the package, run cargo run --bin stub_gen --no-default-features from the root project folder (from pysplashsurf/).

Metadata

Release files for pysplashsurf 0.14.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysplashsurf 0.14.2.0
File Size Uploaded Provenance Actions
pysplashsurf-0.14.2.0.tar.gz 486.1 kB Without provenance Details for pysplashsurf-0.14.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pysplashsurf 0.14.2.0
File Actions
pysplashsurf-0.14.2.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for pysplashsurf-0.14.2.0-cp310-abi3-win_arm64.whl
pysplashsurf-0.14.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for pysplashsurf-0.14.2.0-cp310-abi3-win_amd64.whl
pysplashsurf-0.14.2.0-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details for pysplashsurf-0.14.2.0-cp310-abi3-win32.whl
pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-32 Details for pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl
pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details for pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pysplashsurf-0.14.2.0-cp310-abi3-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-32, Linux glibc 2.12+ x86-32 Details for pysplashsurf-0.14.2.0-cp310-abi3-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl
pysplashsurf-0.14.2.0-cp310-abi3-macosx_15_0_arm64.whl CPython 3.10 abi3 macOS 15.0+ ARM64 Details for pysplashsurf-0.14.2.0-cp310-abi3-macosx_15_0_arm64.whl

Total release size: 24.8 MB

Release files / pysplashsurf-0.14.2.0.tar.gz

Download URL pysplashsurf-0.14.2.0.tar.gz
Size 486.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d51dcec070df6ee69212683c9e1f457492ad1d9e88c6afb6bd35a70a7606c00f
BLAKE2b-256 checksum
How to use checksums
5b81593dc9e96cde1932316f1b3dc1c1fc7300f4ff6de3f38b94562a855be800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-win_arm64.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-win_arm64.whl
Size 2.6 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
6dfe3e5f8812959e36c41fcf749f881a060c8bef7b9606cf1122abb865be93b7
BLAKE2b-256 checksum
How to use checksums
33099b8e35b437080a7af599c1a8d3442daadc0cf2eb412adfd5140ef9597aac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-win_amd64.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-win_amd64.whl
Size 2.8 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
6f54cb4d9865e288e2674e05ed1a333a78990e97569eef3d29385dada42f3961
BLAKE2b-256 checksum
How to use checksums
531ff99e41eea02f426f9c37bb0e61c596b801b983dcd61aee4b8ff72fb704df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-win32.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-win32.whl
Size 2.5 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
b410cce0fc1b9df1c2eb8aa72a03ecf6f92d5a9d29658494d6681de3d3d0eed8
BLAKE2b-256 checksum
How to use checksums
63f27070e39caebde96e37fea3a929bd8dbb2665fbfa6a11e28ac38482e419b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
af415116c58199eca010d0b4639dc17f82746dcbe1b50df000fecee3806e9226
BLAKE2b-256 checksum
How to use checksums
138df846fed57e2658ecb90ccc9b9a8daf7c70fd60df915b0c89632a66103408
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl
Size 2.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
e989b83a27b89e6a4a2749f0e0d97e9727a30b09e1b0ff9d910191498c25ab18
BLAKE2b-256 checksum
How to use checksums
2d5aacff91079d88a3cd7cc682417ed82aa45d22b52e8f44dc86b75cbdd2ccfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
27206cc7cbf266e287eb4f47c2a2bf6b031061f56485f332e87c2384936a4c62
BLAKE2b-256 checksum
How to use checksums
570e1b6229e62c955d32fedde0bd632c24690164d5dc3fe3f81e404b20067e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
084a6e863238b4b19e88e06fe058bdb1fc7d8d16d2465e69a73fcdbbb0679279
BLAKE2b-256 checksum
How to use checksums
5486ee71d4f3e362e884707fa1810d99ffd1dc68a005f2e222d1e8d6d37449be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.12+ x86-32 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
30645104fb421dfba15887063f1c6cf096f01b7c3b89e48fdacae504b6d7a827
BLAKE2b-256 checksum
How to use checksums
cfaec58626d1b19f36ce1e864f24b2007a5b9d8c188d0fe2ad59401261ce6736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pysplashsurf-0.14.2.0-cp310-abi3-macosx_15_0_arm64.whl

Download URL pysplashsurf-0.14.2.0-cp310-abi3-macosx_15_0_arm64.whl
Size 2.5 MB
Tags CPython 3.10 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
fd0e8eaf6d14dcbfb4df71163784986d5345cec10218663abf47cd9d263a41c1
BLAKE2b-256 checksum
How to use checksums
08dd9abe3fa86be337148c48071b343ff7381826c0abcf05c3fccbfa513df778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for pysplashsurf 0.14.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page