From d01f715ebf8110398ae389c353dab34029d45860 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 23 May 2019 16:22:27 +0000 Subject: [PATCH] CLI: accept --chord-tol as an option to regenerate. This is currently necessary to get repeatable results when exporting assemblies as a part of a batch process, since the mesh geometry in imported files is not regenerated for export. --- src/platform/entrycli.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/platform/entrycli.cpp b/src/platform/entrycli.cpp index cbb72318..6859712a 100644 --- a/src/platform/entrycli.cpp +++ b/src/platform/entrycli.cpp @@ -41,8 +41,10 @@ Commands: being triangulated first. export-surfaces --output Exports exact surfaces of solids in the sketch, if any. - regenerate + regenerate [--chord-tol ] Reloads all imported files, regenerates the sketch, and saves it. + Note that, although this is not an export command, it uses absolute + chord tolerance, and can be used to prepare assemblies for export. )"); auto FormatListFromFileFilters = [](const std::vector &filters) { @@ -281,7 +283,8 @@ static bool RunCommand(const std::vector args) { }; } else if(args[1] == "regenerate") { for(size_t argn = 2; argn < args.size(); argn++) { - if(!(ParseInputFile(argn))) { + if(!(ParseInputFile(argn) || + ParseChordTolerance(argn))) { fprintf(stderr, "Unrecognized option '%s'.\n", args[argn].c_str()); return false; } @@ -290,6 +293,9 @@ static bool RunCommand(const std::vector args) { outputPattern = "%.slvs"; runner = [&](const Platform::Path &output) { + SS.exportChordTol = chordTol; + SS.exportMode = true; + SS.SaveToFile(output); }; } else {