#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) { for (LayerRegionPtrs::const_iterator it = layerm + 1; it != m_regions.end(); ++it) {
LayerRegion* other_layerm = *it; LayerRegion* other_layerm = *it;
const PrintRegionConfig &other_config = other_layerm->region()->config(); 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. /// !!! 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 you don't do that, objects will share the same region, and the same settings.
if (config.perimeter_extruder == other_config.perimeter_extruder if (config.perimeter_extruder == other_config.perimeter_extruder
@ -138,8 +139,8 @@ void Layer::make_perimeters()
&& config.perimeter_speed == other_config.perimeter_speed // it os mandatory? can't this be set at gcode.cpp? && config.perimeter_speed == other_config.perimeter_speed // it os mandatory? can't this be set at gcode.cpp?
&& config.external_perimeter_extrusion_width == other_config.external_perimeter_extrusion_width && config.external_perimeter_extrusion_width == other_config.external_perimeter_extrusion_width
&& config.external_perimeters_first == other_config.external_perimeters_first && config.external_perimeters_first == other_config.external_perimeters_first
&& config.external_perimeters_vase == other_config.external_perimeters_vase && config.external_perimeters_vase == other_config.external_perimeters_vase
&& config.external_perimeters_hole == other_config.external_perimeters_hole && config.external_perimeters_hole == other_config.external_perimeters_hole
&& config.external_perimeters_nothole == other_config.external_perimeters_nothole && config.external_perimeters_nothole == other_config.external_perimeters_nothole
&& config.external_perimeter_speed == other_config.external_perimeter_speed && config.external_perimeter_speed == other_config.external_perimeter_speed
&& config.extra_perimeters_odd_layers == other_config.extra_perimeters_odd_layers && config.extra_perimeters_odd_layers == other_config.extra_perimeters_odd_layers
@ -200,8 +201,14 @@ void Layer::make_perimeters()
// Separate the fill surfaces. // Separate the fill surfaces.
ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices()); ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices());
(*l)->fill_expolygons = expp; (*l)->fill_expolygons = expp;
(*l)->fill_no_overlap_expolygons = (*layerm)->fill_no_overlap_expolygons; (*l)->fill_no_overlap_expolygons = (layerm_config)->fill_no_overlap_expolygons;
(*l)->fill_surfaces.set(std::move(expp), fill_surfaces.surfaces.front()); //(*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). // 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. // While not necessary, the memory consumption is meager and it speeds up calculation.
// The perimeter_surfaces keep the IDs of the slices (top/bottom/) // 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 // collection of expolygons representing the bridged areas (thus not
// needing support material) // needing support material)