You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pysplashsurf is a Python binding for splashsurf, an open source surface reconstruction library for particle data from SPH simulations. Detailed information on how the library works can be found on the [project website (splashsurf.physics-simulation.org)](https://splashsurf.physics-simulation.org/) or the [main repository](https://github.com/InteractiveComputerGraphics/splashsurf).
5
+
PySplashsurf provides Python bindings for `splashsurf`, an open source surface reconstruction library for particle data from SPH simulations.
6
+
Detailed information on the surface reconstruction and library itself and its API can be found on the [project website (splashsurf.physics-simulation.org)](https://splashsurf.physics-simulation.org/) or the [main repository](https://github.com/InteractiveComputerGraphics/splashsurf).
6
7
7
8
## Installation
8
9
```
9
10
pip install pysplashsurf
10
11
```
11
12
Requires Python version 3.7+
12
13
13
-
To install pysplashsurf directly with meshio (which allows some additional functionality), do
14
+
To install pysplashsurf with meshio support (which adds some additional IO functionality), use
14
15
```
15
16
pip install pysplashsurf[meshio]
16
17
```
17
-
When meshio is installed, support for the `.bgeo` extension will be added to it, so that particle data from the `BGEOV` format can be read using meshio. Meshio is also required for the `write_to_file` method to work. The rest of the package will still work even if meshio is not installed.
18
+
This will add support for the `.bgeo` file extension to meshio, so that particle data in the `BGEOV` format can be read using meshio.
19
+
Meshio is also required for the `write_to_file` method from the bindings to work.
20
+
The rest of the package will still work even if meshio is not installed.
18
21
19
22
## Usage
20
-
Example to reconstruct the surface from an input file, apply some postprocessing methods and write the data back to a file:
23
+
Example to reconstruct the surface from an input file, apply some post-processing methods and write the data back to a file:
It may be necessary to specify the dtype of a function input (as done for `particles` in the example) so that Rust knows what data type to use internally. The extension supports single (`np.float32`) and double precision floats (`np.float64`).
52
+
The `reconstruction_pipeline` method provides (mostly) the same arguments as the splashsurf binary CLI.
53
+
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.
54
+
The extension supports single (`np.float32`) and double precision floats (`np.float64`).
34
55
35
56
## Build instructions
36
57
You can also manually build the package from the source code:
37
58
1. Clone the repository
38
-
2. cd to the pysplashsurf directory
39
-
3. Create an environment from python_environment.yaml and activate it
59
+
2. cd to the `pysplashsurf` directory
60
+
3. Create an environment from `python_environment.yaml` and activate it
4. Now, to build the project, use maturin: `maturin develop`
44
65
- Maturin automatically installs the resulting binary in your python environment
45
-
- Set the release flag `-r` or `--release` to build a more performant binary, however compilation time will be slightly longer
66
+
- Set the release flag `-r` or `--release` to build a more performant binary, however, compilation time will be slightly longer
46
67
47
68
### Documentation Build
48
-
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`.
69
+
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.
70
+
The resulting HTML files will be in `pysplashsurf/pysplashsurf/docs/build/html`.
49
71
50
72
### Stub File Generation
51
-
To automatically generate a stub file for the package, run `cargo run --bin stub_gen` from the root project folder (from `pysplashsurf/`).
73
+
To automatically generate a stub file for the package, run `cargo run --bin stub_gen` from the root project folder (from `pysplashsurf/`).
0 commit comments