ENH: use spiral lift only when it is needed

If a travel path goes through an overhang expolygons, and their distance
is shorter than threshold, lift type will be set to SpiralLift.

Signed-off-by: yifan.wu <yifan.wu@bambulab.com>
Change-Id: I345788711755dd8611ecf385818e6052cd8abe9e
This commit is contained in:
yifan.wu 2022-11-20 22:04:25 +08:00 committed by Lane.Wei
parent 47a46010bd
commit 5d9bb61f8e
11 changed files with 199 additions and 17 deletions

View file

@ -224,6 +224,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
osteps.emplace_back(posSimplifyPath);
osteps.emplace_back(posSimplifySupportPath);
steps.emplace_back(psSkirtBrim);
}
else if (opt_key == "z_hop_type") {
osteps.emplace_back(posDetectOverhangsForLift);
} else {
// for legacy, if we can't handle this option let's invalidate all steps
//FIXME invalidate all steps of all objects as well?
@ -1631,6 +1634,17 @@ void Print::process(bool use_cache)
}
}
// BBS
for (PrintObject* obj : m_objects) {
if (need_slicing_objects.count(obj) != 0) {
obj->detect_overhangs_for_lift();
}
else {
if (obj->set_started(posDetectOverhangsForLift))
obj->set_done(posDetectOverhangsForLift);
}
}
BOOST_LOG_TRIVIAL(info) << "Slicing process finished." << log_memory_info();
}