Port of Cura's multi-material interlocking (#5775)

* Init port of Cura's MM interlocking

* Refactor a bit

* Fix crash when bottom surface is multi-color

* Fix crash when boundary avoidance is 0

* Add config

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Noisyfox 2024-06-30 23:25:15 +08:00 committed by GitHub
parent 8ccf0edbc2
commit 4145f45e42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1029 additions and 5 deletions

View file

@ -2292,7 +2292,9 @@ std::vector<std::vector<ExPolygons>> multi_material_segmentation_by_painting(con
BOOST_LOG_TRIVIAL(debug) << "MM segmentation - layers segmentation in parallel - end";
throw_on_cancel_callback();
if (auto max_width = print_object.config().mmu_segmented_region_max_width, interlocking_depth = print_object.config().mmu_segmented_region_interlocking_depth; max_width > 0.f || interlocking_depth > 0.f) {
auto interlocking_beam = print_object.config().interlocking_beam;
if (auto max_width = print_object.config().mmu_segmented_region_max_width, interlocking_depth = print_object.config().mmu_segmented_region_interlocking_depth;
!interlocking_beam && (max_width > 0.f || interlocking_depth > 0.f)) {
cut_segmented_layers(input_expolygons, segmented_regions, float(scale_(max_width)), float(scale_(interlocking_depth)), throw_on_cancel_callback);
throw_on_cancel_callback();
}