From 8b9ea5fe1cf85aa7eb9568c88282eedabf00e5e4 Mon Sep 17 00:00:00 2001 From: supermerill Date: Thu, 29 Nov 2018 15:45:44 +0100 Subject: [PATCH] forgot a .pl more () for protection for the operator | --- t/combineinfill.t | 2 +- xs/src/libslic3r/Layer.cpp | 4 ++-- xs/src/libslic3r/LayerRegion.cpp | 4 ++-- xs/src/libslic3r/LayerRegionFill.cpp | 4 ++-- xs/src/libslic3r/PrintObject.cpp | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/t/combineinfill.t b/t/combineinfill.t index 66e461d45..510f7aa93 100644 --- a/t/combineinfill.t +++ b/t/combineinfill.t @@ -82,7 +82,7 @@ plan tests => 8; my $print = Slic3r::Test::init_print('20mm_cube', config => $config); $print->process; - ok defined(first { @{$_->get_region(0)->fill_surfaces->filter_by_type(S_TYPE_INTERNALVOID)} > 0 } + ok defined(first { @{$_->get_region(0)->fill_surfaces->filter_by_type(S_TYPE_INTERNAL + S_TYPE_VOID)} > 0 } @{$print->print->get_object(0)->layers}), 'infill combination produces internal void surfaces'; diff --git a/xs/src/libslic3r/Layer.cpp b/xs/src/libslic3r/Layer.cpp index 044f14f58..3e627b164 100644 --- a/xs/src/libslic3r/Layer.cpp +++ b/xs/src/libslic3r/Layer.cpp @@ -331,7 +331,7 @@ Layer::detect_surfaces_type() const SurfaceType surface_type_bottom = (object.config.support_material.value && object.config.support_material_contact_distance.value == 0) ? stBottom - : stBottom | stBridge; + : (stBottom | stBridge); // Any surface lying on the void is a true bottom bridge (an overhang) bottom.append( @@ -370,7 +370,7 @@ Layer::detect_surfaces_type() // just like any other bottom surface lying on the void const SurfaceType surface_type_bottom = (object.config.raft_layers.value > 0 && object.config.support_material_contact_distance.value > 0) - ? stBottom | stBridge + ? (stBottom | stBridge) : stBottom; for (Surface &s : bottom.surfaces) s.surface_type = surface_type_bottom; } diff --git a/xs/src/libslic3r/LayerRegion.cpp b/xs/src/libslic3r/LayerRegion.cpp index 750d86143..773801c98 100644 --- a/xs/src/libslic3r/LayerRegion.cpp +++ b/xs/src/libslic3r/LayerRegion.cpp @@ -241,7 +241,7 @@ LayerRegion::prepare_fill_surfaces() for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface) { if (surface->surface_type == stTop) { if (this->layer()->object()->config.infill_only_where_needed) { - surface->surface_type = stInternal | stVoid; + surface->surface_type = (stInternal | stVoid); } else { surface->surface_type = stInternal; } @@ -264,7 +264,7 @@ LayerRegion::prepare_fill_surfaces() const double min_area = this->region()->config.solid_infill_below_area.value / SCALING_FACTOR / SCALING_FACTOR; for (Surface &surface : this->fill_surfaces.surfaces) { if (!surface.is_internal() && surface.area() <= min_area) - surface.surface_type = stInternal | stSolid; + surface.surface_type = (stInternal | stSolid); } } } diff --git a/xs/src/libslic3r/LayerRegionFill.cpp b/xs/src/libslic3r/LayerRegionFill.cpp index 55ca3e4d5..45223fd83 100644 --- a/xs/src/libslic3r/LayerRegionFill.cpp +++ b/xs/src/libslic3r/LayerRegionFill.cpp @@ -137,7 +137,7 @@ LayerRegion::make_fill() ); Polygons to_subtract; - surfaces.filter_by_type(stInternal | stVoid, &to_subtract); + surfaces.filter_by_type((stInternal | stVoid), &to_subtract); append_to(to_subtract, collapsed); surfaces.append( @@ -146,7 +146,7 @@ LayerRegion::make_fill() to_subtract, true ), - stInternal | stSolid + (stInternal | stSolid) ); } diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 05330814e..e4604782e 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -395,7 +395,7 @@ PrintObject::bridge_over_infill() // extract the stInternalSolid surfaces that might be transformed into bridges Polygons internal_solid; - layerm->fill_surfaces.filter_by_type(stInternal | stSolid, &internal_solid); + layerm->fill_surfaces.filter_by_type((stInternal | stSolid), &internal_solid); if (internal_solid.empty()) continue; // check whether we should bridge or not according to density @@ -497,10 +497,10 @@ PrintObject::bridge_over_infill() } for (ExPolygons::const_iterator ex = to_bridge.begin(); ex != to_bridge.end(); ++ex) - new_surfaces.push_back(Surface(stInternal | stBridge, *ex)); + new_surfaces.push_back(Surface( (stInternal | stBridge), *ex)); for (ExPolygons::const_iterator ex = not_to_bridge.begin(); ex != not_to_bridge.end(); ++ex) - new_surfaces.push_back(Surface(stInternal | stSolid, *ex)); + new_surfaces.push_back(Surface( (stInternal | stSolid), *ex)); layerm->fill_surfaces.surfaces = new_surfaces; } @@ -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()) { @@ -1636,7 +1636,7 @@ PrintObject::_discover_neighbor_horizontal_shells(LayerRegion* layerm, const siz neighbor_layerm->fill_surfaces.append(internal, stInternal); // assign new internal-solid surfaces to layer - neighbor_layerm->fill_surfaces.append(internal_solid, stInternal | stSolid); + neighbor_layerm->fill_surfaces.append(internal_solid, (stInternal | stSolid)); // assign top and bottom surfaces to layer SurfaceCollection tmp_coll; @@ -1729,10 +1729,10 @@ PrintObject::clip_fill_surfaces() if (layerm->region()->config.fill_density.value == 0) continue; - Polygons internal{ to_polygons(layerm->fill_surfaces.filter_by_type({ stInternal, stInternal | stVoid })) }; - layerm->fill_surfaces.remove_types({ stInternal, stInternal | stVoid }); + Polygons internal{ to_polygons(layerm->fill_surfaces.filter_by_type({ stInternal, (stInternal | stVoid) })) }; + layerm->fill_surfaces.remove_types({ stInternal, (stInternal | stVoid) }); layerm->fill_surfaces.append(intersection_ex(internal, upper_internal, true), stInternal); - layerm->fill_surfaces.append(diff_ex (internal, upper_internal, true), stInternal | stVoid); + layerm->fill_surfaces.append(diff_ex (internal, upper_internal, true), (stInternal | stVoid)); // If there are voids it means that our internal infill is not adjacent to // perimeters. In this case it would be nice to add a loop around infill to