Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ Options:
-o,--output TEXT Output tetmesh OUTPUT in .msh format. (string, optional, default: input_file+postfix+'.msh')
--tag TEXT:FILE Tag input faces for Boolean operation.
--op INT Boolean operation: 0: union, 1: intersection, 2: difference.
-l,--lr FLOAT ideal_edge_length = diag_of_bbox * L. (double, optional, default: 0.05)
-a,--la FLOAT Ideal edge length not scaled by diag_of_bbox. Excludes: --lr. (double, optional)
-l,--lr FLOAT ideal_edge_length = diag_of_bbox * L. Excludes: --la. (double, optional, default: 0.05)
-e,--epsr FLOAT epsilon = diag_of_bbox * EPS. (double, optional, default: 1e-3)
--stop-energy FLOAT Stop optimization when max energy is lower than this.
--log TEXT Log info to given file.
Expand Down
11 changes: 10 additions & 1 deletion src/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ namespace floatTetWild {
Scalar ideal_edge_length_rel = 1 / 20.0;
Scalar min_edge_len_rel = -1;

// initial absolute target edge length not scaled to the box diagonal
Scalar ideal_edge_length_abs = 0.0;

int max_its = 80;
Scalar stop_energy = 10;

Expand Down Expand Up @@ -104,7 +107,13 @@ namespace floatTetWild {

bbox_diag_length = bbox_diag_l;

ideal_edge_length = bbox_diag_length * ideal_edge_length_rel;
if (ideal_edge_length_abs > 0.0) {
ideal_edge_length = ideal_edge_length_abs;
ideal_edge_length_rel = ideal_edge_length / bbox_diag_length;
}
else {
ideal_edge_length = bbox_diag_length * ideal_edge_length_rel;
}
ideal_edge_length_2 = ideal_edge_length * ideal_edge_length;

eps_input = bbox_diag_length * eps_rel;
Expand Down
8 changes: 7 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,16 @@ int main(int argc, char** argv)
command_line.add_option(
"--op", boolean_op, "Boolean operation: 0: union, 1: intersection, 2: difference.");

command_line.add_option(
auto absolute_op = command_line.add_option(
"-a,--la",
params.ideal_edge_length_abs,
"Ideal edge length not scaled by diag_of_bbox. (double, optional)");
auto relative_op = command_line.add_option(
"-l,--lr",
params.ideal_edge_length_rel,
"ideal_edge_length = diag_of_bbox * L. (double, optional, default: 0.05)");
relative_op->excludes(absolute_op);

command_line.add_option("-e,--epsr",
params.eps_rel,
"epsilon = diag_of_bbox * EPS. (double, optional, default: 1e-3)");
Expand Down
Loading