ENH: optimize the efficiency of auto lift

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I9c1679cc80ae23ff066df6e2fe98b5530a9d2288
This commit is contained in:
qing.zhang 2023-05-12 17:23:27 +08:00 committed by Lane.Wei
parent 1b0b14c0f2
commit 1d0476fa44
7 changed files with 70 additions and 28 deletions

View file

@ -441,9 +441,9 @@ void PrintObject::detect_overhangs_for_lift()
ExPolygons overhangs = diff_ex(layer.lslices, offset_ex(lower_layer.lslices, scale_(min_overlap)));
layer.loverhangs = std::move(offset2_ex(overhangs, -0.1f * scale_(m_config.line_width), 0.1f * scale_(m_config.line_width)));
layer.loverhangs_bbox = get_extents(layer.loverhangs);
}
});
this->set_done(posDetectOverhangsForLift);
}
}
@ -2006,7 +2006,21 @@ bool PrintObject::update_layer_height_profile(const ModelObject &model_object, c
return updated;
}
//BBS:
void PrintObject::get_certain_layers(float start, float end, std::vector<LayerPtrs> &out, std::vector<BoundingBox> &boundingbox_objects)
{
BoundingBox temp;
LayerPtrs out_temp;
for (const auto &layer : layers()) {
if (layer->print_z < start) continue;
if (layer->print_z > end + EPSILON) break;
temp.merge(layer->loverhangs_bbox);
out_temp.emplace_back(layer);
}
boundingbox_objects.emplace_back(std::move(temp));
out.emplace_back(std::move(out_temp));
};
// Only active if config->infill_only_where_needed. This step trims the sparse infill,
// so it acts as an internal support. It maintains all other infill types intact.
// Here the internal surfaces and perimeters have to be supported by the sparse infill.