Fixed a crash in Lightning infill.

This commit is contained in:
Lukáš Hejl 2022-04-29 08:07:30 +02:00
parent 356bec6e5f
commit 17e74141ce

View File

@ -116,8 +116,12 @@ void Generator::generateTrees(const PrintObject &print_object)
if (layer_id == 0) if (layer_id == 0)
return; return;
const Polygons& below_outlines = infill_outlines[layer_id - 1]; const Polygons &below_outlines = infill_outlines[layer_id - 1];
outlines_locator.set_bbox(get_extents(below_outlines).inflated(SCALED_EPSILON)); BoundingBox below_outlines_bbox = get_extents(below_outlines).inflated(SCALED_EPSILON);
if (const BoundingBox &outlines_locator_bbox = outlines_locator.bbox(); outlines_locator_bbox.defined)
below_outlines_bbox.merge(outlines_locator_bbox);
outlines_locator.set_bbox(below_outlines_bbox);
outlines_locator.create(below_outlines, locator_cell_size); outlines_locator.create(below_outlines, locator_cell_size);
std::vector<NodeSPtr>& lower_trees = m_lightning_layers[layer_id - 1].tree_roots; std::vector<NodeSPtr>& lower_trees = m_lightning_layers[layer_id - 1].tree_roots;