mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -06:00
Fixed a crash in the multi-material segmentation when projected lines are outside of the BoundingBox used for EdgeGrid.
This commit is contained in:
parent
f577350f1f
commit
da3a0c6332
3 changed files with 55 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "Fill/Fill.hpp"
|
||||
#include "ShortestPath.hpp"
|
||||
#include "SVG.hpp"
|
||||
#include "BoundingBox.hpp"
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
|
|
@ -258,4 +259,26 @@ void Layer::export_region_fill_surfaces_to_svg_debug(const char *name) const
|
|||
this->export_region_fill_surfaces_to_svg(debug_out_path("Layer-fill_surfaces-%s-%d.svg", name, idx ++).c_str());
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const LayerRegion &layer_region)
|
||||
{
|
||||
BoundingBox bbox;
|
||||
if (!layer_region.slices.surfaces.empty()) {
|
||||
bbox = get_extents(layer_region.slices.surfaces.front());
|
||||
for (auto it = layer_region.slices.surfaces.cbegin() + 1; it != layer_region.slices.surfaces.cend(); ++it)
|
||||
bbox.merge(get_extents(*it));
|
||||
}
|
||||
return bbox;
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const LayerRegionPtrs &layer_regions)
|
||||
{
|
||||
BoundingBox bbox;
|
||||
if (!layer_regions.empty()) {
|
||||
bbox = get_extents(*layer_regions.front());
|
||||
for (auto it = layer_regions.begin() + 1; it != layer_regions.end(); ++it)
|
||||
bbox.merge(get_extents(**it));
|
||||
}
|
||||
return bbox;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue