Added cache for sequential printing clearance contours into class Print to avoid calculate them twice when needed.

This commit is contained in:
enricoturri1966 2023-02-16 10:18:40 +01:00
parent 088fb22182
commit 056d703573
3 changed files with 12 additions and 8 deletions

View file

@ -471,11 +471,13 @@ std::string Print::validate(std::string* warning) const
return L("The supplied settings will cause an empty print.");
if (m_config.complete_objects) {
if (! sequential_print_horizontal_clearance_valid(*this))
if (!sequential_print_horizontal_clearance_valid(*this, const_cast<Polygons*>(&m_sequential_print_clearance_polygons)))
return L("Some objects are too close; your extruder will collide with them.");
if (! sequential_print_vertical_clearance_valid(*this))
return L("Some objects are too tall and cannot be printed without extruder collisions.");
if (!sequential_print_vertical_clearance_valid(*this))
return L("Some objects are too tall and cannot be printed without extruder collisions.");
}
else
const_cast<Polygons*>(&m_sequential_print_clearance_polygons)->clear();
if (m_config.avoid_crossing_perimeters && m_config.avoid_crossing_curled_overhangs) {
return L("Avoid crossing perimeters option and avoid crossing curled overhangs option cannot be both enabled together.");