mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-19 04:37:52 -06:00
CLI: Ensure that objects are on bed by default, new CLI config option:
'dont-ensure-on-bed' (which allows to override). This was the original behaviour in Slic3r and Sli3rPE, probably broken long ago when CLI was ported from Perl. Also, --scale-to-fit should now work again (#5772)
This commit is contained in:
parent
d0d3c5ad16
commit
bc81c22ea9
3 changed files with 21 additions and 8 deletions
|
@ -258,6 +258,7 @@ int CLI::run(int argc, char **argv)
|
|||
Points bed = get_bed_shape(m_print_config);
|
||||
ArrangeParams arrange_cfg;
|
||||
arrange_cfg.min_obj_distance = scaled(min_object_distance(m_print_config));
|
||||
bool user_ensure_on_bed = true;
|
||||
|
||||
for (auto const &opt_key : m_transforms) {
|
||||
if (opt_key == "merge") {
|
||||
|
@ -330,6 +331,10 @@ int CLI::run(int argc, char **argv)
|
|||
}
|
||||
} else if (opt_key == "dont_arrange") {
|
||||
// do nothing - this option alters other transform options
|
||||
} else if (opt_key == "dont_ensure_on_bed") {
|
||||
// Remember that we saw this so we don't lift objects from the bed
|
||||
// after the other transformations are processed.
|
||||
user_ensure_on_bed = false;
|
||||
} else if (opt_key == "rotate") {
|
||||
for (auto &model : m_models)
|
||||
for (auto &o : model.objects)
|
||||
|
@ -432,6 +437,13 @@ int CLI::run(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
// All transforms have been dealt with. Now ensure that the objects are on bed.
|
||||
// (Unless the user said otherwise.)
|
||||
if (user_ensure_on_bed)
|
||||
for (auto &model : m_models)
|
||||
for (auto &o : model.objects)
|
||||
o->ensure_on_bed();
|
||||
|
||||
// loop through action options
|
||||
for (auto const &opt_key : m_actions) {
|
||||
if (opt_key == "help") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue