From 77e4d70420cdbc8f3371ee81d599e75b5b94f300 Mon Sep 17 00:00:00 2001 From: supermerill Date: Thu, 29 Nov 2018 18:44:45 +0100 Subject: [PATCH] a bugfix and other protections --- xs/src/libslic3r/LayerRegionFill.cpp | 2 +- xs/src/libslic3r/PrintObject.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xs/src/libslic3r/LayerRegionFill.cpp b/xs/src/libslic3r/LayerRegionFill.cpp index 45223fd83..4788fbc2a 100644 --- a/xs/src/libslic3r/LayerRegionFill.cpp +++ b/xs/src/libslic3r/LayerRegionFill.cpp @@ -175,7 +175,7 @@ LayerRegion::make_fill() if (surface.is_solid()) { density = 100.; fill_pattern = (surface.is_top()) ? this->region()->config.top_infill_pattern.value - : (surface.is_bottom() && !is_bridge) ? this->region()->config.bottom_infill_pattern.value + : (surface.is_bottom() && !is_bridge) ? this->region()->config.bottom_infill_pattern.value : ipRectilinear; } else if (density <= 0) continue; diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index bcce57559..3ae97f900 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -1376,7 +1376,7 @@ PrintObject::combine_infill() // Save void surfaces. layerm->fill_surfaces.append( intersection_ex(internal, intersection_with_clearance), - stInternal | stVoid); + (stInternal | stVoid)); } } } @@ -1534,7 +1534,7 @@ PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const siz { const auto& region_config = layerm->region()->config; - for (int n = (type == stTop ? i-1 : i+1); std::abs(n-int(i)) < solid_layers; (type == stTop ? n-- : n++)) { + for (int n = ((type & stTop) != 0 ? i-1 : i+1); std::abs(n-int(i)) < solid_layers; ((type & stTop) != 0 ? n-- : n++)) { if (n < 0 || static_cast(n) >= this->layer_count()) continue; LayerRegion* neighbor_layerm { this->get_layer(n)->get_region(region_id) }; @@ -1545,7 +1545,7 @@ PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const siz // intersections have contours and holes Polygons new_internal_solid = intersection( solid, - to_polygons(neighbor_fill_surfaces.filter_by_type({ (stInternal, stInternal) | stSolid})), + to_polygons(neighbor_fill_surfaces.filter_by_type({stInternal, (stInternal | stSolid)})), true ); if (new_internal_solid.empty()) { @@ -1625,11 +1625,11 @@ PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const siz // and new ones Polygons tmp { to_polygons(neighbor_fill_surfaces.filter_by_type(stInternal | stSolid)) }; polygons_append(tmp, new_internal_solid); - const auto internal_solid = union_ex(tmp); + const ExPolygons internal_solid = union_ex(tmp); // subtract intersections from layer surfaces to get resulting internal surfaces tmp = to_polygons(neighbor_fill_surfaces.filter_by_type(stInternal)); - const auto internal = diff_ex(tmp, to_polygons(internal_solid), 1); + const ExPolygons internal = diff_ex(tmp, to_polygons(internal_solid), 1); // assign resulting internal surfaces to layer neighbor_layerm->fill_surfaces.clear(); @@ -1640,7 +1640,7 @@ PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const siz // assign top and bottom surfaces to layer SurfaceCollection tmp_coll; - for (const auto& s : neighbor_fill_surfaces.surfaces) + for (const Surface& s : neighbor_fill_surfaces.surfaces) if (s.is_top() || s.is_bottom()) tmp_coll.append(s); @@ -1719,7 +1719,7 @@ PrintObject::clip_fill_surfaces() Polygons lower_layer_internal_surfaces; for (const auto* layerm : lower_layer->regions) polygons_append(lower_layer_internal_surfaces, to_polygons( - layerm->fill_surfaces.filter_by_type({ stInternal, stInternal | stVoid }) + layerm->fill_surfaces.filter_by_type({ stInternal, (stInternal | stVoid) }) )); upper_internal = intersection(overhangs, lower_layer_internal_surfaces); }