aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/src/main.cpp
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2021-02-17 18:58:11 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2021-02-17 18:58:11 +0100
commitda9d7280d5d099c65f3e8d134a60b4778a5bcfb2 (patch)
tree935676348176d3a06032ff4ac4440081a59a17bd /svg-flatten/src/main.cpp
parentf9c5c00f513e6c6be70b033782976fd109eb4ac9 (diff)
downloadgerbolyze-da9d7280d5d099c65f3e8d134a60b4778a5bcfb2.tar.gz
gerbolyze-da9d7280d5d099c65f3e8d134a60b4778a5bcfb2.tar.bz2
gerbolyze-da9d7280d5d099c65f3e8d134a60b4778a5bcfb2.zip
svg-flatten: add curve flattening tolerance command line param
Diffstat (limited to 'svg-flatten/src/main.cpp')
-rw-r--r--svg-flatten/src/main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/svg-flatten/src/main.cpp b/svg-flatten/src/main.cpp
index 3427373..0abe3d1 100644
--- a/svg-flatten/src/main.cpp
+++ b/svg-flatten/src/main.cpp
@@ -42,6 +42,9 @@ int main(int argc, char **argv) {
{"min_feature_size", {"-d", "--trace-space"},
"Minimum feature size of elements in vectorized graphics (trace/space) in mm. Default: 0.1mm.",
1},
+ {"curve_tolerance", {"-c", "--curve-tolerance"},
+ "Tolerance for curve flattening in mm. Default: 0.1mm.",
+ 1},
{"no_header", {"--no-header"},
"Do not export output format header/footer, only export the primitives themselves",
0},
@@ -243,10 +246,8 @@ int main(int argc, char **argv) {
}
delete vec;
- double min_feature_size = 0.1; /* mm */
- if (args["min_feature_size"]) {
- min_feature_size = args["min_feature_size"].as<double>();
- }
+ double min_feature_size = args["min_feature_size"].as<double>(0.1); /* mm */
+ double curve_tolerance = args["curve_tolerance"].as<double>(0.1); /* mm */
string ending = "";
auto idx = in_f_name.rfind(".");
@@ -411,6 +412,7 @@ int main(int argc, char **argv) {
VectorizerSelectorizer vec_sel(vectorizer, args["vectorizer_map"] ? args["vectorizer_map"].as<string>() : "");
RenderSettings rset {
min_feature_size,
+ curve_tolerance,
vec_sel,
};