Skip to content

Commit f4f0697

Browse files
committed
Update readme
1 parent 0733743 commit f4f0697

File tree

2 files changed

+51
-55
lines changed

2 files changed

+51
-55
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Good settings for the surface reconstruction depend on the original simulation a
106106
### Benchmark example
107107
For example:
108108
```
109-
splashsurf reconstruct -i data/canyon_13353401_particles.xyz --output-dir=out --particle-radius=0.011 --smoothing-length=2.0 --cube-size=1.5 --surface-threshold=0.6
109+
splashsurf reconstruct data/canyon_13353401_particles.xyz --output-dir=out --particle-radius=0.011 --smoothing-length=2.0 --cube-size=1.5 --surface-threshold=0.6
110110
```
111111
With these parameters, a scene with 13353401 particles is reconstructed in less than 3 seconds on a Ryzen 9 5950X. The output is a mesh with 6023244 triangles.
112112
```
@@ -164,8 +164,9 @@ You can either process a single file or let the tool automatically process a seq
164164
A sequence of files is indicated by specifying a filename with a `{}` placeholder pattern in the name.
165165
The tool will treat the placeholder as a `(\d+)` regex, i.e. a group matching to at least one digit.
166166
This allows for any zero padding as well as non-zero padded incrementing indices.
167-
All files in the input path matching this pattern will then be processed in lexicographical order (i.e. silently skipping missing files in the sequence).
167+
All files in the input path matching this pattern will then be processed in natural sort order (i.e. silently skipping missing files in the sequence).
168168
Note that the tool collects all existing filenames as soon as the command is invoked and does not update the list while running.
169+
The first and last file of a sequences that should be processed can be specified with the `-s`/`--start-index` and/or `-e`/`--end-index` arguments.
169170

170171
By specifying the flag `--mt-files=on`, several files can be processed in parallel.
171172
If this is enabled, you should ideally also set `--mt-particles=off` as enabling both will probably degrade performance.
@@ -231,34 +232,31 @@ The file format is inferred from the extension of output filename.
231232

232233
### The `reconstruct` command
233234
```
234-
splashsurf-reconstruct (v0.9.2) - Reconstruct a surface from particle data
235+
splashsurf-reconstruct (v0.9.3) - Reconstruct a surface from particle data
235236
236-
Usage: splashsurf.exe reconstruct [OPTIONS] --particle-radius <PARTICLE_RADIUS> --smoothing-length <SMOOTHING_LENGTH> --cube-size <CUBE_SIZE> <--input-file <INPUT_FILE>|--input-sequence <INPUT_SEQUENCE>>
237+
Usage: splashsurf reconstruct [OPTIONS] --particle-radius <PARTICLE_RADIUS> --smoothing-length <SMOOTHING_LENGTH> --cube-size <CUBE_SIZE> <INPUT_FILE_OR_SEQUENCE>
237238
238239
Options:
239240
-h, --help Print help
240241
-V, --version Print version
241242
242243
Input/output:
243-
-i, --input-file <INPUT_FILE>
244-
Path to the input file where the particle positions are stored (supported formats: VTK 4.2, VTU, binary f32 XYZ, PLY, BGEO)
245-
-s, --input-sequence <INPUT_SEQUENCE>
246-
Path to a sequence of particle files that should be processed, use "{}" in the filename to indicate a placeholder. To specify an output format, use e.g. --output_file="filename_{}.obj"
247-
-o, --output-file <OUTPUT_FILE>
248-
Filename for writing the reconstructed surface to disk (default: "{original_filename}_surface.vtk")
249-
--output-dir <OUTPUT_DIR>
250-
Optional base directory for all output files (default: current working directory)
244+
-o, --output-file <OUTPUT_FILE> Filename for writing the reconstructed surface to disk (default: "{original_filename}_surface.vtk")
245+
--output-dir <OUTPUT_DIR> Optional base directory for all output files (default: current working directory)
246+
-s, --start-index <START_INDEX> Index of the first input file to process when processing a sequence of files (default: lowest index of the sequence)
247+
-e, --end-index <END_INDEX> Index of the last input file to process when processing a sequence of files (default: highest index of the sequence)
248+
<INPUT_FILE_OR_SEQUENCE> Path to the input file where the particle positions are stored (supported formats: VTK 4.2, VTU, binary f32 XYZ, PLY, BGEO), use "{}" in the filename to indicate a placeholder for a sequence
251249
252250
Numerical reconstruction parameters:
253-
--particle-radius <PARTICLE_RADIUS>
251+
-r, --particle-radius <PARTICLE_RADIUS>
254252
The particle radius of the input data
255253
--rest-density <REST_DENSITY>
256254
The rest density of the fluid [default: 1000.0]
257-
--smoothing-length <SMOOTHING_LENGTH>
255+
-l, --smoothing-length <SMOOTHING_LENGTH>
258256
The smoothing length radius used for the SPH kernel, the kernel compact support radius will be twice the smoothing length (in multiplies of the particle radius)
259-
--cube-size <CUBE_SIZE>
257+
-c, --cube-size <CUBE_SIZE>
260258
The cube edge length used for marching cubes in multiplies of the particle radius, corresponds to the cell size of the implicit background grid
261-
--surface-threshold <SURFACE_THRESHOLD>
259+
-t, --surface-threshold <SURFACE_THRESHOLD>
262260
The iso-surface threshold for the density, i.e. the normalized value of the reconstructed density level that indicates the fluid surface (in multiplies of the rest density) [default: 0.6]
263261
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
264262
Lower corner of the domain where surface reconstruction should be performed (requires domain-max to be specified)

splashsurf/README.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ As input, it supports reading particle positions from `.vtk`, `.bgeo`, `.ply`, `
6161
In addition, required parameters are the kernel radius and particle radius (to compute the volume of particles) used for the original SPH simulation as well as the surface threshold.
6262

6363
By default, a domain decomposition of the particle set is performed using octree-based subdivision.
64-
The implementation first computes the density of each particle using the typical SPH approach with a cubic kernel.
64+
The implementation first computes the density of each particle using the typical SPH approach with a cubic kernel.
6565
This density is then evaluated or mapped onto a sparse grid using spatial hashing in the support radius of each particle.
66-
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.
66+
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.
6767
The marching cubes reconstruction is performed only in the narrowband of grid cells where the density values cross the surface threshold. Cells completely in the interior of the fluid are skipped. For more details, please refer to the [readme of the library]((https://github.com/w1th0utnam3/splashsurf/blob/main/splashsurf_lib/README.md)).
6868
Finally, all surface patches are stitched together by walking the octree back up, resulting in a closed surface.
6969

@@ -92,15 +92,15 @@ cargo install splashsurf
9292

9393
### Recommended settings
9494
Good settings for the surface reconstruction depend on the original simulation and can be influenced by different conventions of different simulators. The following settings appear to work well with [SPlisHSPlasH](https://github.com/InteractiveComputerGraphics/SPlisHSPlasH):
95-
- `particle-radius`: should be a bit larger than the particle radius used for the actual simulation. A radius around 1.4 to 1.6 times larger than the original SPH particle radius seems to be appropriate.
96-
- `smoothing-length`: should be set around `1.2`. Larger values smooth out the iso-surface more but also artificially increase the fluid volume.
97-
- `surface-threshold`: a good value depends on the selected `particle-radius` and `smoothing-length` and can be used to counteract a fluid volume increase e.g. due to a larger particle radius. In combination with the other recommended values a threshold of `0.6` seemed to work well.
98-
- `cube-size` usually should not be chosen larger than `1.0` to avoid artifacts (e.g. single particles decaying into rhomboids), start with a value in the range of `0.75` to `0.5` and decrease/increase it if the result is too coarse or the reconstruction takes too long.
95+
- `particle-radius`: should be a bit larger than the particle radius used for the actual simulation. A radius around 1.4 to 1.6 times larger than the original SPH particle radius seems to be appropriate.
96+
- `smoothing-length`: should be set around `1.2`. Larger values smooth out the iso-surface more but also artificially increase the fluid volume.
97+
- `surface-threshold`: a good value depends on the selected `particle-radius` and `smoothing-length` and can be used to counteract a fluid volume increase e.g. due to a larger particle radius. In combination with the other recommended values a threshold of `0.6` seemed to work well.
98+
- `cube-size` usually should not be chosen larger than `1.0` to avoid artifacts (e.g. single particles decaying into rhomboids), start with a value in the range of `0.75` to `0.5` and decrease/increase it if the result is too coarse or the reconstruction takes too long.
9999

100100
### Benchmark example
101101
For example:
102102
```
103-
splashsurf reconstruct -i data/canyon_13353401_particles.xyz --output-dir=out --particle-radius=0.011 --smoothing-length=2.0 --cube-size=1.5 --surface-threshold=0.6
103+
splashsurf reconstruct data/canyon_13353401_particles.xyz --output-dir=out --particle-radius=0.011 --smoothing-length=2.0 --cube-size=1.5 --surface-threshold=0.6
104104
```
105105
With these parameters, a scene with 13353401 particles is reconstructed in less than 3 seconds on a Ryzen 9 5950X. The output is a mesh with 6023244 triangles.
106106
```
@@ -158,8 +158,9 @@ You can either process a single file or let the tool automatically process a seq
158158
A sequence of files is indicated by specifying a filename with a `{}` placeholder pattern in the name.
159159
The tool will treat the placeholder as a `(\d+)` regex, i.e. a group matching to at least one digit.
160160
This allows for any zero padding as well as non-zero padded incrementing indices.
161-
All files in the input path matching this pattern will then be processed in lexicographical order (i.e. silently skipping missing files in the sequence).
161+
All files in the input path matching this pattern will then be processed in natural sort order (i.e. silently skipping missing files in the sequence).
162162
Note that the tool collects all existing filenames as soon as the command is invoked and does not update the list while running.
163+
The first and last file of a sequences that should be processed can be specified with the `-s`/`--start-index` and/or `-e`/`--end-index` arguments.
163164

164165
By specifying the flag `--mt-files=on`, several files can be processed in parallel.
165166
If this is enabled, you should ideally also set `--mt-particles=off` as enabling both will probably degrade performance.
@@ -169,9 +170,9 @@ The combination of `--mt-files=on` and `--mt-particles=off` can be faster if man
169170

170171
### VTK
171172

172-
Legacy VTK files with the "`.vtk`" extension are loaded using [`vtkio`](https://crates.io/crates/vtkio).
173-
The VTK file is loaded as a big endian binary file and has to contain an "Unstructured Grid" with either `f32` or `f64` vertex coordinates.
174-
Any other data or attributes are ignored except for those attributes that were specified with the ` --interpolate-attributes` command line argument.
173+
Legacy VTK files with the "`.vtk`" extension are loaded using [`vtkio`](https://crates.io/crates/vtkio).
174+
The VTK file is loaded as a big endian binary file and has to contain an "Unstructured Grid" with either `f32` or `f64` vertex coordinates.
175+
Any other data or attributes are ignored except for those attributes that were specified with the ` --interpolate-attributes` command line argument.
175176
Currently supported attribute data types are scalar integers, floats and three-component float vectors.
176177
Only the first "Unstructured Grid" is loaded, other entities are ignored.
177178

@@ -186,27 +187,27 @@ Files using "raw" binary sections (i.e. a `<AppendedData encoding="raw">...</App
186187

187188
### BGEO
188189

189-
Files with the "`.bgeo`" extension are loaded using a custom parser.
190-
Note, that only the "old" `BGEOV` format is supported (which is the format supported by "Partio").
191-
Both uncompressed and (gzip) compressed files are supported.
192-
Only points and their implicit position vector attributes are loaded from the file.
193-
All other entities (e.g. vertices) and other attributes are ignored/discarded.
194-
Notably, the parser supports BGEO files written by [SPlisHSPlasH](https://github.com/InteractiveComputerGraphics/SPlisHSPlasH) ("Partio export").
190+
Files with the "`.bgeo`" extension are loaded using a custom parser.
191+
Note, that only the "old" `BGEOV` format is supported (which is the format supported by "Partio").
192+
Both uncompressed and (gzip) compressed files are supported.
193+
Only points and their implicit position vector attributes are loaded from the file.
194+
All other entities (e.g. vertices) and other attributes are ignored/discarded.
195+
Notably, the parser supports BGEO files written by [SPlisHSPlasH](https://github.com/InteractiveComputerGraphics/SPlisHSPlasH) ("Partio export").
195196

196197
### PLY
197198

198-
Files with the "`.ply`" extension are loaded using [`ply-rs`](https://crates.io/crates/ply-rs).
199-
The PLY file has to contain an element called "`vertex`" with the properties `x`, `y` and `z` of type `f32`/["`Property::Float`"](https://docs.rs/ply-rs/0.1.3/ply_rs/ply/enum.Property.html#variant.Float).
199+
Files with the "`.ply`" extension are loaded using [`ply-rs`](https://crates.io/crates/ply-rs).
200+
The PLY file has to contain an element called "`vertex`" with the properties `x`, `y` and `z` of type `f32`/["`Property::Float`"](https://docs.rs/ply-rs/0.1.3/ply_rs/ply/enum.Property.html#variant.Float).
200201
Any other properties or elements are ignored.
201202

202203
### XYZ
203204

204-
Files with the "`.xyz`" extension are interpreted as raw bytes of `f32` values in native endianness of the system.
205+
Files with the "`.xyz`" extension are interpreted as raw bytes of `f32` values in native endianness of the system.
205206
Three consecutive `f32`s represent a (x,y,z) coordinate triplet of a fluid particle.
206207

207208
### JSON
208209

209-
Files with the "`.json`" extension are interpreted as serializations of a `Vec<[f32; 3]>` where each three component array represents a particle position.
210+
Files with the "`.json`" extension are interpreted as serializations of a `Vec<[f32; 3]>` where each three component array represents a particle position.
210211
This corresponds to a JSON file with a structure like this for example:
211212
```json
212213
[
@@ -217,42 +218,39 @@ This corresponds to a JSON file with a structure like this for example:
217218

218219
## Output file formats
219220

220-
Currently, only VTK and OBJ formats are supported to store the reconstructed surface meshes.
221-
Both formats support output of normals but only VTK supports additional fields such as interpolated scalar or vector fields.
221+
Currently, only VTK and OBJ formats are supported to store the reconstructed surface meshes.
222+
Both formats support output of normals but only VTK supports additional fields such as interpolated scalar or vector fields.
222223
The file format is inferred from the extension of output filename.
223224

224225
## All command line options
225226

226227
### The `reconstruct` command
227228
```
228-
splashsurf-reconstruct (v0.9.2) - Reconstruct a surface from particle data
229+
splashsurf-reconstruct (v0.9.3) - Reconstruct a surface from particle data
229230
230-
Usage: splashsurf.exe reconstruct [OPTIONS] --particle-radius <PARTICLE_RADIUS> --smoothing-length <SMOOTHING_LENGTH> --cube-size <CUBE_SIZE> <--input-file <INPUT_FILE>|--input-sequence <INPUT_SEQUENCE>>
231+
Usage: splashsurf reconstruct [OPTIONS] --particle-radius <PARTICLE_RADIUS> --smoothing-length <SMOOTHING_LENGTH> --cube-size <CUBE_SIZE> <INPUT_FILE_OR_SEQUENCE>
231232
232233
Options:
233234
-h, --help Print help
234235
-V, --version Print version
235236
236237
Input/output:
237-
-i, --input-file <INPUT_FILE>
238-
Path to the input file where the particle positions are stored (supported formats: VTK 4.2, VTU, binary f32 XYZ, PLY, BGEO)
239-
-s, --input-sequence <INPUT_SEQUENCE>
240-
Path to a sequence of particle files that should be processed, use "{}" in the filename to indicate a placeholder. To specify an output format, use e.g. --output_file="filename_{}.obj"
241-
-o, --output-file <OUTPUT_FILE>
242-
Filename for writing the reconstructed surface to disk (default: "{original_filename}_surface.vtk")
243-
--output-dir <OUTPUT_DIR>
244-
Optional base directory for all output files (default: current working directory)
238+
-o, --output-file <OUTPUT_FILE> Filename for writing the reconstructed surface to disk (default: "{original_filename}_surface.vtk")
239+
--output-dir <OUTPUT_DIR> Optional base directory for all output files (default: current working directory)
240+
-s, --start-index <START_INDEX> Index of the first input file to process when processing a sequence of files (default: lowest index of the sequence)
241+
-e, --end-index <END_INDEX> Index of the last input file to process when processing a sequence of files (default: highest index of the sequence)
242+
<INPUT_FILE_OR_SEQUENCE> Path to the input file where the particle positions are stored (supported formats: VTK 4.2, VTU, binary f32 XYZ, PLY, BGEO), use "{}" in the filename to indicate a placeholder for a sequence
245243
246244
Numerical reconstruction parameters:
247-
--particle-radius <PARTICLE_RADIUS>
245+
-r, --particle-radius <PARTICLE_RADIUS>
248246
The particle radius of the input data
249247
--rest-density <REST_DENSITY>
250248
The rest density of the fluid [default: 1000.0]
251-
--smoothing-length <SMOOTHING_LENGTH>
249+
-l, --smoothing-length <SMOOTHING_LENGTH>
252250
The smoothing length radius used for the SPH kernel, the kernel compact support radius will be twice the smoothing length (in multiplies of the particle radius)
253-
--cube-size <CUBE_SIZE>
251+
-c, --cube-size <CUBE_SIZE>
254252
The cube edge length used for marching cubes in multiplies of the particle radius, corresponds to the cell size of the implicit background grid
255-
--surface-threshold <SURFACE_THRESHOLD>
253+
-t, --surface-threshold <SURFACE_THRESHOLD>
256254
The iso-surface threshold for the density, i.e. the normalized value of the reconstructed density level that indicates the fluid surface (in multiplies of the rest density) [default: 0.6]
257255
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
258256
Lower corner of the domain where surface reconstruction should be performed (requires domain-max to be specified)
@@ -300,7 +298,7 @@ Debug options:
300298

301299
### The `convert` subcommand
302300

303-
Allows conversion between particle file formats and between mesh file formats. For particles `VTK, BGEO, PLY, XYZ, JSON -> VTK`
301+
Allows conversion between particle file formats and between mesh file formats. For particles `VTK, BGEO, PLY, XYZ, JSON -> VTK`
304302
is supported. For meshes only `VTK, PLY -> VTK, OBJ` is supported.
305303

306304
```
@@ -330,5 +328,5 @@ Options:
330328
# License
331329

332330
For license information of this project, see the LICENSE file.
333-
The splashsurf logo is based on two graphics ([1](https://www.svgrepo.com/svg/295647/wave), [2](https://www.svgrepo.com/svg/295652/surfboard-surfboard)) published on SVG Repo under a CC0 ("No Rights Reserved") license.
331+
The splashsurf logo is based on two graphics ([1](https://www.svgrepo.com/svg/295647/wave), [2](https://www.svgrepo.com/svg/295652/surfboard-surfboard)) published on SVG Repo under a CC0 ("No Rights Reserved") license.
334332
The dragon model shown in the images on this page are part of the ["Stanford 3D Scanning Repository"](https://graphics.stanford.edu/data/3Dscanrep/).

0 commit comments

Comments
 (0)