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
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.
112
112
```
@@ -164,8 +164,9 @@ You can either process a single file or let the tool automatically process a seq
164
164
A sequence of files is indicated by specifying a filename with a `{}` placeholder pattern in the name.
165
165
The tool will treat the placeholder as a `(\d+)` regex, i.e. a group matching to at least one digit.
166
166
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).
168
168
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.
169
170
170
171
By specifying the flag `--mt-files=on`, several files can be processed in parallel.
171
172
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.
231
232
232
233
### The `reconstruct` command
233
234
```
234
-
splashsurf-reconstruct (v0.9.2) - Reconstruct a surface from particle data
235
+
splashsurf-reconstruct (v0.9.3) - Reconstruct a surface from particle data
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
251
249
252
250
Numerical reconstruction parameters:
253
-
--particle-radius <PARTICLE_RADIUS>
251
+
-r, --particle-radius <PARTICLE_RADIUS>
254
252
The particle radius of the input data
255
253
--rest-density <REST_DENSITY>
256
254
The rest density of the fluid [default: 1000.0]
257
-
--smoothing-length <SMOOTHING_LENGTH>
255
+
-l, --smoothing-length <SMOOTHING_LENGTH>
258
256
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>
260
258
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>
262
260
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]
263
261
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
264
262
Lower corner of the domain where surface reconstruction should be performed (requires domain-max to be specified)
Copy file name to clipboardExpand all lines: splashsurf/README.md
+37-39Lines changed: 37 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,9 @@ As input, it supports reading particle positions from `.vtk`, `.bgeo`, `.ply`, `
61
61
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.
62
62
63
63
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.
65
65
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.
67
67
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)).
68
68
Finally, all surface patches are stitched together by walking the octree back up, resulting in a closed surface.
69
69
@@ -92,15 +92,15 @@ cargo install splashsurf
92
92
93
93
### Recommended settings
94
94
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.
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.
106
106
```
@@ -158,8 +158,9 @@ You can either process a single file or let the tool automatically process a seq
158
158
A sequence of files is indicated by specifying a filename with a `{}` placeholder pattern in the name.
159
159
The tool will treat the placeholder as a `(\d+)` regex, i.e. a group matching to at least one digit.
160
160
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).
162
162
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.
163
164
164
165
By specifying the flag `--mt-files=on`, several files can be processed in parallel.
165
166
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
169
170
170
171
### VTK
171
172
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.
175
176
Currently supported attribute data types are scalar integers, floats and three-component float vectors.
176
177
Only the first "Unstructured Grid" is loaded, other entities are ignored.
177
178
@@ -186,27 +187,27 @@ Files using "raw" binary sections (i.e. a `<AppendedData encoding="raw">...</App
186
187
187
188
### BGEO
188
189
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").
195
196
196
197
### PLY
197
198
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).
200
201
Any other properties or elements are ignored.
201
202
202
203
### XYZ
203
204
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.
205
206
Three consecutive `f32`s represent a (x,y,z) coordinate triplet of a fluid particle.
206
207
207
208
### JSON
208
209
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.
210
211
This corresponds to a JSON file with a structure like this for example:
211
212
```json
212
213
[
@@ -217,42 +218,39 @@ This corresponds to a JSON file with a structure like this for example:
217
218
218
219
## Output file formats
219
220
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.
222
223
The file format is inferred from the extension of output filename.
223
224
224
225
## All command line options
225
226
226
227
### The `reconstruct` command
227
228
```
228
-
splashsurf-reconstruct (v0.9.2) - Reconstruct a surface from particle data
229
+
splashsurf-reconstruct (v0.9.3) - Reconstruct a surface from particle data
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
245
243
246
244
Numerical reconstruction parameters:
247
-
--particle-radius <PARTICLE_RADIUS>
245
+
-r, --particle-radius <PARTICLE_RADIUS>
248
246
The particle radius of the input data
249
247
--rest-density <REST_DENSITY>
250
248
The rest density of the fluid [default: 1000.0]
251
-
--smoothing-length <SMOOTHING_LENGTH>
249
+
-l, --smoothing-length <SMOOTHING_LENGTH>
252
250
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>
254
252
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>
256
254
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]
257
255
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
258
256
Lower corner of the domain where surface reconstruction should be performed (requires domain-max to be specified)
@@ -300,7 +298,7 @@ Debug options:
300
298
301
299
### The `convert` subcommand
302
300
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`
304
302
is supported. For meshes only `VTK, PLY -> VTK, OBJ` is supported.
305
303
306
304
```
@@ -330,5 +328,5 @@ Options:
330
328
# License
331
329
332
330
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.
334
332
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