#201 fix for modifiers: now exclude empty region for make_perimeter.

This commit is contained in:
supermerill 2020-04-21 15:10:04 +02:00
parent b9ab7641c5
commit 91a74c5d94
2 changed files with 12 additions and 5 deletions

View File

@ -131,6 +131,7 @@ void Layer::make_perimeters()
for (LayerRegionPtrs::const_iterator it = layerm + 1; it != m_regions.end(); ++it) {
LayerRegion* other_layerm = *it;
const PrintRegionConfig &other_config = other_layerm->region()->config();
if (other_layerm->slices().empty()) continue;
/// !!! add here the settings you want to be added in the per-object menu.
/// if you don't do that, objects will share the same region, and the same settings.
if (config.perimeter_extruder == other_config.perimeter_extruder
@ -200,8 +201,14 @@ void Layer::make_perimeters()
// Separate the fill surfaces.
ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices());
(*l)->fill_expolygons = expp;
(*l)->fill_no_overlap_expolygons = (*layerm)->fill_no_overlap_expolygons;
(*l)->fill_surfaces.set(std::move(expp), fill_surfaces.surfaces.front());
(*l)->fill_no_overlap_expolygons = (layerm_config)->fill_no_overlap_expolygons;
//(*l)->perimeters = (layerm_config)->perimeters;
//(*l)->thin_fills = (layerm_config)->thin_fills;
(*l)->fill_surfaces.clear();
for (Surface &surf: fill_surfaces.surfaces) {
ExPolygons exp = intersection_ex(to_polygons(surf.expolygon), (*l)->slices());
(*l)->fill_surfaces.append(std::move(exp), surf);
}
}
}
}

View File

@ -42,7 +42,7 @@ public:
// Collection of perimeter surfaces. This is a cached result of diff(slices, fill_surfaces).
// While not necessary, the memory consumption is meager and it speeds up calculation.
// The perimeter_surfaces keep the IDs of the slices (top/bottom/)
SurfaceCollection perimeter_surfaces;
//SurfaceCollection perimeter_surfaces;
// collection of expolygons representing the bridged areas (thus not
// needing support material)