Skip to content

Commit 2f5cfc5

Browse files
committed
Update command line args
1 parent ad93f37 commit 2f5cfc5

File tree

1 file changed

+57
-55
lines changed

1 file changed

+57
-55
lines changed

splashsurf/src/reconstruction.rs

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static ARGS_BASIC: &str = "Numerical reconstruction parameters";
2121
static ARGS_ADV: &str = "Advanced parameters";
2222
static ARGS_OCTREE: &str = "Domain decomposition (octree or grid) parameters";
2323
static ARGS_DEBUG: &str = "Debug options";
24-
static ARGS_INTERP: &str = "Interpolation";
24+
static ARGS_INTERP: &str = "Interpolation & normals";
2525
static ARGS_POSTPROC: &str = "Postprocessing";
2626
static ARGS_OTHER: &str = "Remaining options";
2727

@@ -62,7 +62,7 @@ pub struct ReconstructSubcommandArgs {
6262
#[arg(help_heading = ARGS_BASIC, short = 't', long, default_value = "0.6")]
6363
pub surface_threshold: f64,
6464

65-
/// Whether to enable the use of double precision for all computations
65+
/// Enable the use of double precision for all computations
6666
#[arg(
6767
help_heading = ARGS_ADV,
6868
short = 'd',
@@ -94,7 +94,7 @@ pub struct ReconstructSubcommandArgs {
9494
)]
9595
pub particle_aabb_max: Option<Vec<f64>>,
9696

97-
/// Flag to enable multi-threading to process multiple input files in parallel
97+
/// Enable multi-threading to process multiple input files in parallel
9898
#[arg(
9999
help_heading = ARGS_ADV,
100100
long = "mt-files",
@@ -104,7 +104,7 @@ pub struct ReconstructSubcommandArgs {
104104
require_equals = true
105105
)]
106106
pub parallelize_over_files: Switch,
107-
/// Flag to enable multi-threading for a single input file by processing chunks of particles in parallel
107+
/// Enable multi-threading for a single input file by processing chunks of particles in parallel
108108
#[arg(
109109
help_heading = ARGS_ADV,
110110
long = "mt-particles",
@@ -118,7 +118,7 @@ pub struct ReconstructSubcommandArgs {
118118
#[arg(help_heading = ARGS_ADV, long, short = 'n')]
119119
pub num_threads: Option<usize>,
120120

121-
/// Whether to enable spatial decomposition using a regular grid-based approach
121+
/// Enable spatial decomposition using a regular grid-based approach
122122
#[arg(
123123
help_heading = ARGS_OCTREE,
124124
long,
@@ -132,7 +132,7 @@ pub struct ReconstructSubcommandArgs {
132132
#[arg(help_heading = ARGS_OCTREE, long, default_value="64")]
133133
pub subdomain_cubes: u32,
134134

135-
/// Whether to enable spatial decomposition using an octree (faster) instead of a global approach
135+
/// Enable spatial decomposition using an octree (faster) instead of a global approach
136136
#[arg(
137137
help_heading = ARGS_OCTREE,
138138
long,
@@ -142,7 +142,7 @@ pub struct ReconstructSubcommandArgs {
142142
require_equals = true
143143
)]
144144
pub octree_decomposition: Switch,
145-
/// 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)
145+
/// 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)
146146
#[arg(
147147
help_heading = ARGS_OCTREE,
148148
long,
@@ -158,7 +158,7 @@ pub struct ReconstructSubcommandArgs {
158158
/// 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
159159
#[arg(help_heading = ARGS_OCTREE, long)]
160160
pub octree_ghost_margin_factor: Option<f64>,
161-
/// Whether to compute particle densities in a global step before domain decomposition (slower)
161+
/// Enable computing particle densities in a global step before domain decomposition (slower)
162162
#[arg(
163163
help_heading = ARGS_OCTREE,
164164
long,
@@ -168,7 +168,7 @@ pub struct ReconstructSubcommandArgs {
168168
require_equals = true
169169
)]
170170
pub octree_global_density: Switch,
171-
/// Whether to compute particle densities per subdomain but synchronize densities for ghost-particles (faster, recommended).
171+
/// Enable computing particle densities per subdomain but synchronize densities for ghost-particles (faster, recommended).
172172
/// Note: if both this and global particle density computation is disabled the ghost particle margin has to be increased to at least 2.0
173173
/// to compute correct density values for ghost particles.
174174
#[arg(
@@ -181,17 +181,17 @@ pub struct ReconstructSubcommandArgs {
181181
)]
182182
pub octree_sync_local_density: Switch,
183183

184-
/// Whether to enable MC specific mesh decimation/simplification which removes bad quality triangles typically generated by MC
184+
/// Enable omputing surface normals at the mesh vertices and write them to the output file
185185
#[arg(
186186
help_heading = ARGS_INTERP,
187187
long,
188-
default_value = "on",
188+
default_value = "off",
189189
value_name = "off|on",
190190
ignore_case = true,
191191
require_equals = true
192192
)]
193-
pub mesh_cleanup: Switch,
194-
/// Whether to enable decimation of some typical bad marching cubes triangle configurations (resulting in "barnacles" after Laplacian smoothing)
193+
pub normals: Switch,
194+
/// Enable computing the normals using SPH interpolation instead of using the area weighted triangle normals
195195
#[arg(
196196
help_heading = ARGS_INTERP,
197197
long,
@@ -200,8 +200,11 @@ pub struct ReconstructSubcommandArgs {
200200
ignore_case = true,
201201
require_equals = true
202202
)]
203-
pub decimate_barnacles: Switch,
204-
/// Whether to keep vertices without connectivity during decimation (faster and helps with debugging)
203+
pub sph_normals: Switch,
204+
/// Number of smoothing iterations to run on the normal field if normal interpolation is enabled (disabled by default)
205+
#[arg(help_heading = ARGS_INTERP, long)]
206+
pub normals_smoothing_iters: Option<usize>,
207+
/// Enable writing raw normals without smoothing to the output mesh if normal smoothing is enabled
205208
#[arg(
206209
help_heading = ARGS_INTERP,
207210
long,
@@ -210,49 +213,47 @@ pub struct ReconstructSubcommandArgs {
210213
ignore_case = true,
211214
require_equals = true
212215
)]
213-
pub keep_verts: Switch,
214-
/// Whether to compute surface normals at the mesh vertices and write them to the output file
216+
pub output_raw_normals: Switch,
217+
/// 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.
218+
#[arg(help_heading = ARGS_INTERP, long)]
219+
pub interpolate_attributes: Vec<String>,
220+
221+
/// Enable MC specific mesh decimation/simplification which removes bad quality triangles typically generated by MC
215222
#[arg(
216-
help_heading = ARGS_INTERP,
223+
help_heading = ARGS_POSTPROC,
217224
long,
218-
default_value = "off",
225+
default_value = "on",
219226
value_name = "off|on",
220227
ignore_case = true,
221228
require_equals = true
222229
)]
223-
pub normals: Switch,
224-
/// 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
230+
pub mesh_cleanup: Switch,
231+
/// Enable decimation of some typical bad marching cubes triangle configurations (resulting in "barnacles" after Laplacian smoothing)
225232
#[arg(
226-
help_heading = ARGS_INTERP,
233+
help_heading = ARGS_POSTPROC,
227234
long,
228235
default_value = "off",
229236
value_name = "off|on",
230237
ignore_case = true,
231238
require_equals = true
232239
)]
233-
pub sph_normals: Switch,
234-
/// Number of smoothing iterations to run on the normal field if normal interpolation is enabled (disabled by default)
235-
#[arg(help_heading = ARGS_INTERP, long)]
236-
pub normals_smoothing_iters: Option<usize>,
237-
/// Whether to write raw normals without smoothing to the output mesh if normal smoothing is enabled
240+
pub decimate_barnacles: Switch,
241+
/// Enable keeping vertices without connectivity during decimation instead of filtering them out (faster and helps with debugging)
238242
#[arg(
239-
help_heading = ARGS_INTERP,
243+
help_heading = ARGS_POSTPROC,
240244
long,
241245
default_value = "off",
242246
value_name = "off|on",
243247
ignore_case = true,
244248
require_equals = true
245249
)]
246-
pub output_raw_normals: Switch,
247-
/// 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.
248-
#[arg(help_heading = ARGS_INTERP, long)]
249-
pub interpolate_attributes: Vec<String>,
250+
pub keep_verts: Switch,
250251
/// Number of smoothing iterations to run on the reconstructed mesh
251-
#[arg(help_heading = ARGS_INTERP, long)]
252+
#[arg(help_heading = ARGS_POSTPROC, long)]
252253
pub mesh_smoothing_iters: Option<usize>,
253-
/// Whether to enable feature weights for mesh smoothing if mesh smoothing enabled. Preserves isolated particles even under strong smoothing.
254+
/// Enable feature weights for mesh smoothing if mesh smoothing enabled. Preserves isolated particles even under strong smoothing.
254255
#[arg(
255-
help_heading = ARGS_INTERP,
256+
help_heading = ARGS_POSTPROC,
256257
long,
257258
default_value = "off",
258259
value_name = "off|on",
@@ -261,32 +262,22 @@ pub struct ReconstructSubcommandArgs {
261262
)]
262263
pub mesh_smoothing_weights: Switch,
263264
/// Normalization value from weighted number of neighbors to mesh smoothing weights
264-
#[arg(help_heading = ARGS_INTERP, long, default_value = "13.0")]
265+
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "13.0")]
265266
pub mesh_smoothing_weights_normalization: f64,
266-
/// Whether to write the smoothing weights to the output mesh file
267+
/// Enable writing the smoothing weights as a vertex attribute to the output mesh file
267268
#[arg(
268-
help_heading = ARGS_INTERP,
269+
help_heading = ARGS_POSTPROC,
269270
long,
270271
default_value = "off",
271272
value_name = "off|on",
272273
ignore_case = true,
273274
require_equals = true
274275
)]
275276
pub output_smoothing_weights: Switch,
276-
/// Whether to write out the raw reconstructed mesh before applying any post-processing steps
277-
#[arg(
278-
help_heading = ARGS_INTERP,
279-
long,
280-
default_value = "off",
281-
value_name = "off|on",
282-
ignore_case = true,
283-
require_equals = true
284-
)]
285-
pub output_raw_mesh: Switch,
286277

287-
/// Whether to try to convert triangles to quads if they meet quality criteria
278+
/// Enable trying to convert triangles to quads if they meet quality criteria
288279
#[arg(
289-
help_heading = ARGS_INTERP,
280+
help_heading = ARGS_POSTPROC,
290281
long,
291282
default_value = "off",
292283
value_name = "off|on",
@@ -295,13 +286,13 @@ pub struct ReconstructSubcommandArgs {
295286
)]
296287
pub generate_quads: Switch,
297288
/// Maximum allowed ratio of quad edge lengths to its diagonals to merge two triangles to a quad (inverse is used for minimum)
298-
#[arg(help_heading = ARGS_INTERP, long, default_value = "1.75")]
289+
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "1.75")]
299290
pub quad_max_edge_diag_ratio: f64,
300291
/// Maximum allowed angle (in degrees) between triangle normals to merge them to a quad
301-
#[arg(help_heading = ARGS_INTERP, long, default_value = "10")]
292+
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "10")]
302293
pub quad_max_normal_angle: f64,
303294
/// Maximum allowed vertex interior angle (in degrees) inside of a quad to merge two triangles to a quad
304-
#[arg(help_heading = ARGS_INTERP, long, default_value = "135")]
295+
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "135")]
305296
pub quad_max_interior_angle: f64,
306297

307298
/// Lower corner of the bounding-box for the surface mesh, triangles completely outside are removed (requires mesh-aabb-max to be specified)
@@ -324,7 +315,7 @@ pub struct ReconstructSubcommandArgs {
324315
requires = "mesh_aabb_min",
325316
)]
326317
pub mesh_aabb_max: Option<Vec<f64>>,
327-
/// Whether to clamp vertices outside of the specified mesh AABB to the AABB (only has an effect if mesh-aabb-min/max are specified)
318+
/// Enable clamping of vertices outside of the specified mesh AABB to the AABB (only has an effect if mesh-aabb-min/max are specified)
328319
#[arg(
329320
help_heading = ARGS_POSTPROC,
330321
long,
@@ -335,6 +326,17 @@ pub struct ReconstructSubcommandArgs {
335326
)]
336327
pub mesh_aabb_clamp_verts: Switch,
337328

329+
/// Enable writing the raw reconstructed mesh before applying any post-processing steps
330+
#[arg(
331+
help_heading = ARGS_POSTPROC,
332+
long,
333+
default_value = "off",
334+
value_name = "off|on",
335+
ignore_case = true,
336+
require_equals = true
337+
)]
338+
pub output_raw_mesh: Switch,
339+
338340
/// Optional filename for writing the point cloud representation of the intermediate density map to disk
339341
#[arg(help_heading = ARGS_DEBUG, long, value_parser = value_parser!(PathBuf))]
340342
pub output_dm_points: Option<PathBuf>,
@@ -344,7 +346,7 @@ pub struct ReconstructSubcommandArgs {
344346
/// Optional filename for writing the octree used to partition the particles to disk
345347
#[arg(help_heading = ARGS_DEBUG, long, value_parser = value_parser!(PathBuf))]
346348
pub output_octree: Option<PathBuf>,
347-
/// 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)
349+
/// Enable checking the final mesh for topological problems such as holes (note that when stitching is disabled this will lead to a lot of reported problems)
348350
#[arg(
349351
help_heading = ARGS_DEBUG,
350352
long,

0 commit comments

Comments
 (0)