diff --git a/src/libslic3r/Layer.hpp b/src/libslic3r/Layer.hpp index a277aca29e..747e943179 100644 --- a/src/libslic3r/Layer.hpp +++ b/src/libslic3r/Layer.hpp @@ -311,6 +311,7 @@ protected: { ExPolygon *area; int type; + int interface_id = 0; coordf_t dist_to_top; // mm dist to top bool need_infill = false; bool need_extra_wall = false; diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index 2975c2c3fb..16156965fb 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -1523,8 +1523,9 @@ static inline ExPolygons detect_overhangs( // spanning just the projection between the two slices. // Subtracting them as they are may leave unwanted narrow // residues of diff_polygons that would then be supported. - diff_polygons = diff(diff_polygons, - expand(union_(annotations.blockers_layers[layer_id]), float(1000. * SCALED_EPSILON))); + auto blocker = expand(union_(annotations.blockers_layers[layer_id]), float(1000. * SCALED_EPSILON)); + diff_polygons = diff(diff_polygons, blocker); + layer.sharp_tails = diff_ex(layer.sharp_tails, blocker); } if (bridge_no_support) { @@ -1729,9 +1730,11 @@ Layer* sync_gap_with_object_layer(const Layer& layer, const coordf_t gap_support gap_synced -= last_valid_gap_layer->height; last_valid_gap_layer = last_valid_gap_layer->lower_layer; } - upper_layer = last_valid_gap_layer; // layer just above the last valid gap layer - if (last_valid_gap_layer->upper_layer) - upper_layer = last_valid_gap_layer->upper_layer; + if (gap_support_object > 0) { + upper_layer = last_valid_gap_layer; // layer just above the last valid gap layer + if (last_valid_gap_layer->upper_layer) + upper_layer = last_valid_gap_layer->upper_layer; + } return upper_layer; } } @@ -2433,21 +2436,21 @@ static inline SupportGeneratorLayer* detect_bottom_contacts( // Grow top surfaces so that interface and support generation are generated // with some spacing from object - it looks we don't need the actual // top shapes so this can be done here + Layer* upper_layer = layer.upper_layer; if (object.print()->config().independent_support_layer_height) { // If the layer is extruded with no bridging flow, support just the normal extrusions. - layer_new.height = slicing_params.soluble_interface? + layer_new.height = slicing_params.soluble_interface ? // Align the interface layer with the object's layer height. - layer.upper_layer->height : + upper_layer->height : // Place a bridge flow interface layer or the normal flow interface layer over the top surface. support_params.support_material_bottom_interface_flow.height(); - layer_new.print_z = slicing_params.soluble_interface ? layer.upper_layer->print_z : + layer_new.print_z = slicing_params.soluble_interface ? upper_layer->print_z : layer.print_z + layer_new.height + slicing_params.gap_object_support; } else { - Layer* synced_layer = sync_gap_with_object_layer(layer, slicing_params.gap_object_support, false); - // If the layer is extruded with no bridging flow, support just the normal extrusions. - layer_new.height = synced_layer->height; - layer_new.print_z = synced_layer->print_z; + upper_layer = sync_gap_with_object_layer(layer, slicing_params.gap_object_support, false); + layer_new.height = upper_layer->height; + layer_new.print_z = upper_layer->print_z; } layer_new.bottom_z = layer.print_z; layer_new.idx_object_layer_below = layer_id; diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 51df15c0e7..ab5366dfa5 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1290,7 +1290,7 @@ static void make_perimeter_and_infill(ExtrusionEntitiesPtr& dst, const Print& pr FillParams fill_params; fill_params.density = support_density; fill_params.dont_adjust = true; - ExPolygons to_infill = support_area_new; + ExPolygons to_infill = offset_ex(support_area, -float(wall_count) * float(flow.scaled_spacing()), jtSquare); std::vector fill_boxes = fill_expolygons_generate_paths(dst, to_infill, filler_support, fill_params, role, flow); // allow wall_count to be zero, which means only draw infill @@ -1524,7 +1524,8 @@ void TreeSupport::generate_toolpaths() fill_params.dont_sort = true; } if (m_object_config->support_interface_pattern == smipRectilinearInterlaced) - filler_interface->layer_id = round(area_group.dist_to_top / ts_layer->height); + filler_interface->layer_id = area_group.interface_id; + fill_expolygons_generate_paths(ts_layer->support_fills.entities, polys, filler_interface.get(), fill_params, erSupportMaterialInterface, m_support_material_interface_flow); } @@ -1969,6 +1970,7 @@ void TreeSupport::draw_circles(const std::vector>& con coordf_t max_layers_above_base = 0; coordf_t max_layers_above_roof = 0; coordf_t max_layers_above_roof1 = 0; + int interface_id = 0; bool has_polygon_node = false; bool has_circle_node = false; @@ -2051,6 +2053,7 @@ void TreeSupport::draw_circles(const std::vector>& con { append(roof_areas, area); max_layers_above_roof = std::max(max_layers_above_roof, node.dist_mm_to_top); + interface_id = node.obj_layer_nr % top_interface_layers; } else { @@ -2140,7 +2143,10 @@ void TreeSupport::draw_circles(const std::vector>& con area_groups.emplace_back(&area, SupportLayer::BaseType, max_layers_above_base); area_groups.back().need_infill = has_polygon_node; } - for (auto &area : ts_layer->roof_areas) area_groups.emplace_back(&area, SupportLayer::RoofType, max_layers_above_roof); + for (auto& area : ts_layer->roof_areas) { + area_groups.emplace_back(&area, SupportLayer::RoofType, max_layers_above_roof); + area_groups.back().interface_id = interface_id; + } for (auto &area : ts_layer->floor_areas) area_groups.emplace_back(&area, SupportLayer::FloorType, 10000); for (auto &area : ts_layer->roof_1st_layer) area_groups.emplace_back(&area, SupportLayer::Roof1stLayer, max_layers_above_roof1);