Skip to content

Commit

Permalink
Update command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
w1th0utnam3 committed Sep 13, 2023
1 parent ad93f37 commit 2f5cfc5
Showing 1 changed file with 57 additions and 55 deletions.
112 changes: 57 additions & 55 deletions splashsurf/src/reconstruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static ARGS_BASIC: &str = "Numerical reconstruction parameters";
static ARGS_ADV: &str = "Advanced parameters";
static ARGS_OCTREE: &str = "Domain decomposition (octree or grid) parameters";
static ARGS_DEBUG: &str = "Debug options";
static ARGS_INTERP: &str = "Interpolation";
static ARGS_INTERP: &str = "Interpolation & normals";
static ARGS_POSTPROC: &str = "Postprocessing";
static ARGS_OTHER: &str = "Remaining options";

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

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

/// Flag to enable multi-threading to process multiple input files in parallel
/// Enable multi-threading to process multiple input files in parallel
#[arg(
help_heading = ARGS_ADV,
long = "mt-files",
Expand All @@ -104,7 +104,7 @@ pub struct ReconstructSubcommandArgs {
require_equals = true
)]
pub parallelize_over_files: Switch,
/// Flag to enable multi-threading for a single input file by processing chunks of particles in parallel
/// Enable multi-threading for a single input file by processing chunks of particles in parallel
#[arg(
help_heading = ARGS_ADV,
long = "mt-particles",
Expand All @@ -118,7 +118,7 @@ pub struct ReconstructSubcommandArgs {
#[arg(help_heading = ARGS_ADV, long, short = 'n')]
pub num_threads: Option<usize>,

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

/// Whether to enable spatial decomposition using an octree (faster) instead of a global approach
/// Enable spatial decomposition using an octree (faster) instead of a global approach
#[arg(
help_heading = ARGS_OCTREE,
long,
Expand All @@ -142,7 +142,7 @@ pub struct ReconstructSubcommandArgs {
require_equals = true
)]
pub octree_decomposition: Switch,
/// 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)
/// 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)
#[arg(
help_heading = ARGS_OCTREE,
long,
Expand All @@ -158,7 +158,7 @@ pub struct ReconstructSubcommandArgs {
/// 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
#[arg(help_heading = ARGS_OCTREE, long)]
pub octree_ghost_margin_factor: Option<f64>,
/// Whether to compute particle densities in a global step before domain decomposition (slower)
/// Enable computing particle densities in a global step before domain decomposition (slower)
#[arg(
help_heading = ARGS_OCTREE,
long,
Expand All @@ -168,7 +168,7 @@ pub struct ReconstructSubcommandArgs {
require_equals = true
)]
pub octree_global_density: Switch,
/// Whether to compute particle densities per subdomain but synchronize densities for ghost-particles (faster, recommended).
/// Enable computing 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.
#[arg(
Expand All @@ -181,17 +181,17 @@ pub struct ReconstructSubcommandArgs {
)]
pub octree_sync_local_density: Switch,

/// Whether to enable MC specific mesh decimation/simplification which removes bad quality triangles typically generated by MC
/// Enable omputing surface normals at the mesh vertices and write them to the output file
#[arg(
help_heading = ARGS_INTERP,
long,
default_value = "on",
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub mesh_cleanup: Switch,
/// Whether to enable decimation of some typical bad marching cubes triangle configurations (resulting in "barnacles" after Laplacian smoothing)
pub normals: Switch,
/// Enable computing the normals using SPH interpolation instead of using the area weighted triangle normals
#[arg(
help_heading = ARGS_INTERP,
long,
Expand All @@ -200,8 +200,11 @@ pub struct ReconstructSubcommandArgs {
ignore_case = true,
require_equals = true
)]
pub decimate_barnacles: Switch,
/// Whether to keep vertices without connectivity during decimation (faster and helps with debugging)
pub sph_normals: Switch,
/// Number of smoothing iterations to run on the normal field if normal interpolation is enabled (disabled by default)
#[arg(help_heading = ARGS_INTERP, long)]
pub normals_smoothing_iters: Option<usize>,
/// Enable writing raw normals without smoothing to the output mesh if normal smoothing is enabled
#[arg(
help_heading = ARGS_INTERP,
long,
Expand All @@ -210,49 +213,47 @@ pub struct ReconstructSubcommandArgs {
ignore_case = true,
require_equals = true
)]
pub keep_verts: Switch,
/// Whether to compute surface normals at the mesh vertices and write them to the output file
pub output_raw_normals: Switch,
/// 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.
#[arg(help_heading = ARGS_INTERP, long)]
pub interpolate_attributes: Vec<String>,

/// Enable MC specific mesh decimation/simplification which removes bad quality triangles typically generated by MC
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
default_value = "on",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub normals: Switch,
/// 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
pub mesh_cleanup: Switch,
/// Enable decimation of some typical bad marching cubes triangle configurations (resulting in "barnacles" after Laplacian smoothing)
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub sph_normals: Switch,
/// Number of smoothing iterations to run on the normal field if normal interpolation is enabled (disabled by default)
#[arg(help_heading = ARGS_INTERP, long)]
pub normals_smoothing_iters: Option<usize>,
/// Whether to write raw normals without smoothing to the output mesh if normal smoothing is enabled
pub decimate_barnacles: Switch,
/// Enable keeping vertices without connectivity during decimation instead of filtering them out (faster and helps with debugging)
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub output_raw_normals: Switch,
/// 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.
#[arg(help_heading = ARGS_INTERP, long)]
pub interpolate_attributes: Vec<String>,
pub keep_verts: Switch,
/// Number of smoothing iterations to run on the reconstructed mesh
#[arg(help_heading = ARGS_INTERP, long)]
#[arg(help_heading = ARGS_POSTPROC, long)]
pub mesh_smoothing_iters: Option<usize>,
/// Whether to enable feature weights for mesh smoothing if mesh smoothing enabled. Preserves isolated particles even under strong smoothing.
/// Enable feature weights for mesh smoothing if mesh smoothing enabled. Preserves isolated particles even under strong smoothing.
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
Expand All @@ -261,32 +262,22 @@ pub struct ReconstructSubcommandArgs {
)]
pub mesh_smoothing_weights: Switch,
/// Normalization value from weighted number of neighbors to mesh smoothing weights
#[arg(help_heading = ARGS_INTERP, long, default_value = "13.0")]
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "13.0")]
pub mesh_smoothing_weights_normalization: f64,
/// Whether to write the smoothing weights to the output mesh file
/// Enable writing the smoothing weights as a vertex attribute to the output mesh file
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub output_smoothing_weights: Switch,
/// Whether to write out the raw reconstructed mesh before applying any post-processing steps
#[arg(
help_heading = ARGS_INTERP,
long,
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub output_raw_mesh: Switch,

/// Whether to try to convert triangles to quads if they meet quality criteria
/// Enable trying to convert triangles to quads if they meet quality criteria
#[arg(
help_heading = ARGS_INTERP,
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
Expand All @@ -295,13 +286,13 @@ pub struct ReconstructSubcommandArgs {
)]
pub generate_quads: Switch,
/// Maximum allowed ratio of quad edge lengths to its diagonals to merge two triangles to a quad (inverse is used for minimum)
#[arg(help_heading = ARGS_INTERP, long, default_value = "1.75")]
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "1.75")]
pub quad_max_edge_diag_ratio: f64,
/// Maximum allowed angle (in degrees) between triangle normals to merge them to a quad
#[arg(help_heading = ARGS_INTERP, long, default_value = "10")]
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "10")]
pub quad_max_normal_angle: f64,
/// Maximum allowed vertex interior angle (in degrees) inside of a quad to merge two triangles to a quad
#[arg(help_heading = ARGS_INTERP, long, default_value = "135")]
#[arg(help_heading = ARGS_POSTPROC, long, default_value = "135")]
pub quad_max_interior_angle: f64,

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

/// Enable writing the raw reconstructed mesh before applying any post-processing steps
#[arg(
help_heading = ARGS_POSTPROC,
long,
default_value = "off",
value_name = "off|on",
ignore_case = true,
require_equals = true
)]
pub output_raw_mesh: Switch,

/// Optional filename for writing the point cloud representation of the intermediate density map to disk
#[arg(help_heading = ARGS_DEBUG, long, value_parser = value_parser!(PathBuf))]
pub output_dm_points: Option<PathBuf>,
Expand All @@ -344,7 +346,7 @@ pub struct ReconstructSubcommandArgs {
/// Optional filename for writing the octree used to partition the particles to disk
#[arg(help_heading = ARGS_DEBUG, long, value_parser = value_parser!(PathBuf))]
pub output_octree: Option<PathBuf>,
/// 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)
/// 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)
#[arg(
help_heading = ARGS_DEBUG,
long,
Expand Down

0 comments on commit 2f5cfc5

Please sign in to comment.