Skip to content

Commit b99fcbb

Browse files
committed
Update readme and changelog
1 parent 016668a commit b99fcbb

File tree

3 files changed

+240
-200
lines changed

3 files changed

+240
-200
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The following changes are present in the `main` branch of the repository and are
1010
- Lib: Rename `AxisAlignedBoundingBox*d` typedefs to `Aabb3d` and `Aabb2d`
1111
- Lib: Support reading VTU (VTK XML) files
1212
- CLI: Support reconstruction of particles from VTU (VTK XML) files, including attributes
13+
- CLI: Support for specifying an output pattern (e.g. "surface_{}.obj") using `--output-file`/`-o` when processing sequences of files, this allows to specify a different output format than VTK for sequences (which was the only available output format for sequences before)
14+
- CLI: Files belonging to a sequence are now detected by treating the placeholder "{}" as a "(\d+)" regex (i.e. any number of digits) and sorting the matching files lexicographically (previously, the tool just counted up from 1)
1315

1416
## Version 0.8.0
1517

README.md

Lines changed: 108 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ In the future, flags may be added to switch the internal data structures to use
8080

8181
Note that for small numbers of fluid particles (i.e. in the low thousands or less) the multi-threaded implementation may have worse performance due to the task based parallelism and the additional overhead of domain decomposition and stitching.
8282
In this case, you can try to disable the domain decomposition. The reconstruction will then use a global approach that is parallelized using thread-local hashmaps.
83-
For larger quantities of particles the decomposition approach will be faster however.
83+
For larger quantities of particles the decomposition approach will be faster, however.
8484

8585
As shown below, the tool can handle the output of large simulations.
8686
However, it was not tested with a wide range of parameters and may not be totally robust against corner-cases or extreme parameters.
@@ -162,22 +162,34 @@ With these parameters, a scene with 13353401 particles is reconstructed in less
162162

163163
You can either process a single file or let the tool automatically process a sequence of files.
164164
A sequence of files is indicated by specifying a filename with a `{}` placeholder pattern in the name.
165-
The tool will then process files by replacing the placeholder with indices starting with `1` until a file with the given index does not exist anymore.
165+
The tool will treat the placeholder as a `(\d+)` regex, i.e. a group matching to at least one digit.
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).
166168
Note that the tool collects all existing filenames as soon as the command is invoked and does not update the list while running.
167169

168170
By specifying the flag `--mt-files=on`, several files can be processed in parallel.
169-
Note that you should ideally also set `--mt-particles=off` as enabling both will probably degrade performance.
171+
If this is enabled, you should ideally also set `--mt-particles=off` as enabling both will probably degrade performance.
172+
The combination of `--mt-files=on` and `--mt-particles=off` can be faster if many files with only few particles have to be processed.
170173

171174
## Input file formats
172175

173176
### VTK
174177

175-
Files with the "`.vtk`" extension are loaded using [`vtkio`](https://crates.io/crates/vtkio).
178+
Legacy VTK files with the "`.vtk`" extension are loaded using [`vtkio`](https://crates.io/crates/vtkio).
176179
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.
177180
Any other data or attributes are ignored except for those attributes that were specified with the ` --interpolate-attributes` command line argument.
178181
Currently supported attribute data types are scalar integers, floats and three-component float vectors.
179182
Only the first "Unstructured Grid" is loaded, other entities are ignored.
180183

184+
Not that currently only the "pure" v4.2 legacy format is supported as documented on [here](https://kitware.github.io/vtk-examples/site/VTKFileFormats/#simple-legacy-formats).
185+
This corresponds to the `--output-format vtk42` flag of the [`meshio convert`](https://github.com/nschloe/meshio) tool.
186+
187+
### VTU
188+
189+
VTK XML files with the "`.vtu`" extension are loaded using [`vtkio`](https://crates.io/crates/vtkio).
190+
Currently only VTU files using ASCII or encoded binary are supported.
191+
Files using "raw" binary sections (i.e. a `<AppendedData encoding="raw">...</AppendedData>` block) are not supported by `vtkio` at the moment.
192+
181193
### BGEO
182194

183195
Files with the "`.bgeo`" extension are loaded using a custom parser.
@@ -219,65 +231,77 @@ The file format is inferred from the extension of output filename.
219231

220232
### The `reconstruct` command
221233
```
222-
splashsurf-reconstruct 0.9.0
223-
Reconstruct a surface from particle data
224-
225-
USAGE:
226-
splashsurf reconstruct [OPTIONS] --cube-size <cube-size> --particle-radius <particle-radius> --smoothing-length <smoothing-length>
227-
228-
FLAGS:
229-
-h, --help Prints help information
230-
-V, --version Prints version information
231-
232-
OPTIONS:
233-
-i, --input-file <input-file>
234-
Path to the input file where the particle positions are stored (supported formats: VTK, binary f32 XYZ, PLY,
235-
BGEO)
236-
-s, --input-sequence <input-sequence>
237-
Path to a sequence of particle files that should be processed, use `{}` in the filename to indicate a
238-
placeholder
239-
--output-dir <output-dir>
240-
Optional base directory for all output files (default: current working directory)
241-
242-
-o, --output-file <output-file>
243-
Filename for writing the reconstructed surface to disk (default: "{original_filename}_surface.vtk")
244-
245-
--cube-size <cube-size>
246-
The cube edge length used for marching cubes in multiplies of the particle radius, corresponds to the cell
247-
size of the implicit background grid
248-
--particle-radius <particle-radius> The particle radius of the input data
249-
--rest-density <rest-density> The rest density of the fluid [default: 1000.0]
250-
--smoothing-length <smoothing-length>
251-
The smoothing length radius used for the SPH kernel, the kernel compact support radius will be twice the
252-
smoothing length (in multiplies of the particle radius)
253-
--surface-threshold <surface-threshold>
254-
The iso-surface threshold for the density, i.e. the normalized value of the reconstructed density level that
255-
indicates the fluid surface (in multiplies of the rest density) [default: 0.6]
256-
--domain-max <domain-max> <domain-max> <domain-max>
257-
Upper corner of the domain where surface reconstruction should be performed, format:domain-
258-
max=x_max;y_max;z_max (requires domain-min to be specified)
259-
--domain-min <domain-min> <domain-min> <domain-min>
260-
Lower corner of the domain where surface reconstruction should be performed, format: domain-
261-
min=x_min;y_min;z_min (requires domain-max to be specified)
262-
-d, --double-precision=<double-precision>
263-
Whether to enable the use of double precision for all computations [default: off] [possible values: on,
264-
Optional filename for writing the point cloud representation of the intermediate density map to disk
265-
266-
--output-octree <output-octree>
267-
Optional filename for writing the octree used to partition the particles to disk
268-
269-
--interpolate-attributes <interpolate-attributes>...
270-
List of point attribute field names from the input file that should be interpolated to the reconstructed
271-
surface. Currently this is only supported for VTK input files
272-
--normals=<normals>
273-
Whether to compute surface normals at the mesh vertices and write them to the output file [default: off]
274-
[possible values: on, off]
275-
--sph-normals=<sph-normals>
276-
Whether to compute the normals using SPH interpolation (smoother and more true to actual fluid surface, but
277-
slower) instead of just using area weighted triangle normals [default: on] [possible values: on, off]
278-
--check-mesh=<check-mesh>
279-
Whether to check the final mesh for topological problems such as holes (note that when stitching is disabled
280-
this will lead to a lot of reported problems) [default: off] [possible values: on, off]
234+
splashsurf-reconstruct (v0.9.0) - Reconstruct a surface from particle data
235+
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+
238+
Options:
239+
-h, --help Print help
240+
-V, --version Print version
241+
242+
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)
251+
252+
Numerical reconstruction parameters:
253+
--particle-radius <PARTICLE_RADIUS>
254+
The particle radius of the input data
255+
--rest-density <REST_DENSITY>
256+
The rest density of the fluid [default: 1000.0]
257+
--smoothing-length <SMOOTHING_LENGTH>
258+
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>
260+
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>
262+
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+
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
264+
Lower corner of the domain where surface reconstruction should be performed (requires domain-max to be specified)
265+
--domain-max <X_MIN> <Y_MIN> <Z_MIN>
266+
Upper corner of the domain where surface reconstruction should be performed (requires domain-min to be specified)
267+
268+
Advanced parameters:
269+
-d, --double-precision=<off|on> Whether to enable the use of double precision for all computations [default: off] [possible values: off, on]
270+
--mt-files=<off|on> Flag to enable multi-threading to process multiple input files in parallel [default: off] [possible values: off, on]
271+
--mt-particles=<off|on> Flag to enable multi-threading for a single input file by processing chunks of particles in parallel [default: on] [possible values: off, on]
272+
-n, --num-threads <NUM_THREADS> Set the number of threads for the worker thread pool
273+
274+
Octree (domain decomposition) parameters:
275+
--octree-decomposition=<off|on>
276+
Whether to enable spatial decomposition using an octree (faster) instead of a global approach [default: on] [possible values: off, on]
277+
--octree-stitch-subdomains=<off|on>
278+
Whether to enable stitching of the disconnected local meshes resulting from the reconstruction when spatial decomposition is enabled (slower, but without stitching meshes will not be closed) [default: on] [possible values: off, on]
279+
--octree-max-particles <OCTREE_MAX_PARTICLES>
280+
The maximum number of particles for leaf nodes of the octree, default is to compute it based on the number of threads and particles
281+
--octree-ghost-margin-factor <OCTREE_GHOST_MARGIN_FACTOR>
282+
Safety factor applied to the kernel compact support radius when it's used as a margin to collect ghost particles in the leaf nodes when performing the spatial decomposition
283+
--octree-global-density=<off|on>
284+
Whether to compute particle densities in a global step before domain decomposition (slower) [default: off] [possible values: off, on]
285+
--octree-sync-local-density=<off|on>
286+
Whether to compute particle densities per subdomain but synchronize densities for ghost-particles (faster, recommended). Note: if both this and global particle density computation is disabled the ghost particle margin has to be increased to at least 2.0 to compute correct density values for ghost particles [default: on] [possible values: off, on]
287+
288+
Interpolation:
289+
--normals=<off|on>
290+
Whether to compute surface normals at the mesh vertices and write them to the output file [default: off] [possible values: off, on]
291+
--sph-normals=<off|on>
292+
Whether to compute the normals using SPH interpolation (smoother and more true to actual fluid surface, but slower) instead of just using area weighted triangle normals [default: on] [possible values: off, on]
293+
--interpolate-attributes <INTERPOLATE_ATTRIBUTES>
294+
List of point attribute field names from the input file that should be interpolated to the reconstructed surface. Currently this is only supported for VTK and VTU input files
295+
296+
Debug options:
297+
--output-dm-points <OUTPUT_DM_POINTS>
298+
Optional filename for writing the point cloud representation of the intermediate density map to disk
299+
--output-dm-grid <OUTPUT_DM_GRID>
300+
Optional filename for writing the grid representation of the intermediate density map to disk
301+
--output-octree <OUTPUT_OCTREE>
302+
Optional filename for writing the octree used to partition the particles to disk
303+
--check-mesh=<off|on>
304+
Whether to check the final mesh for topological problems such as holes (note that when stitching is disabled this will lead to a lot of reported problems) [default: off] [possible values: off, on]
281305
```
282306

283307
### The `convert` subcommand
@@ -286,32 +310,27 @@ Allows conversion between particle file formats and between mesh file formats. F
286310
is supported. For meshes only `VTK, PLY -> VTK, OBJ` is supported.
287311

288312
```
289-
splashsurf-convert 0.9.0
290-
Convert particle or mesh files between different file formats
291-
292-
USAGE:
293-
splashsurf convert [FLAGS] [OPTIONS] -o <output-file>
294-
295-
FLAGS:
296-
-h, --help Prints help information
297-
--overwrite Whether to overwrite existing files without asking
298-
-V, --version Prints version information
299-
300-
OPTIONS:
301-
--domain-max <domain-max> <domain-max> <domain-max>
302-
Lower corner of the domain of particles to keep, format:domain-max="x_max;y_max;z_max" (requires domain-min
303-
to be specified)
304-
--domain-min <domain-min> <domain-min> <domain-min>
305-
Lower corner of the domain of particles to keep, format: domain-min="x_min;y_min;z_min" (requires domain-max
306-
to be specified)
307-
--mesh <input-mesh>
308-
Path to the input file with a surface to read (supported formats: .vtk, .ply)
309-
310-
--particles <input-particles>
311-
Path to the input file with particles to read (supported formats: .vtk, .bgeo, .ply, .xyz, .json)
312-
313-
-o <output-file>
314-
Path to the output file (supported formats for particles: .vtk, for meshes: .obj, .vtk)
313+
splashsurf-convert (v0.9.0) - Convert particle or mesh files between different file formats
314+
315+
Usage: splashsurf.exe convert [OPTIONS] -o <OUTPUT_FILE>
316+
317+
Options:
318+
--particles <INPUT_PARTICLES>
319+
Path to the input file with particles to read (supported formats: .vtk, .vtu, .bgeo, .ply, .xyz, .json)
320+
--mesh <INPUT_MESH>
321+
Path to the input file with a surface to read (supported formats: .vtk, .ply)
322+
-o <OUTPUT_FILE>
323+
Path to the output file (supported formats for particles: .vtk, .bgeo, .json, for meshes: .obj, .vtk)
324+
--overwrite
325+
Whether to overwrite existing files without asking
326+
--domain-min <X_MIN> <Y_MIN> <Z_MIN>
327+
Lower corner of the domain of particles to keep (requires domain-max to be specified)
328+
--domain-max <X_MIN> <Y_MIN> <Z_MIN>
329+
Lower corner of the domain of particles to keep (requires domain-min to be specified)
330+
-h, --help
331+
Print help
332+
-V, --version
333+
Print version
315334
```
316335

317336
# License

0 commit comments

Comments
 (0)