FIX: several support bugs

1. interlaced rectilinear interface pattern not working with tree supports
2. infill overlaps with walls when wall count>1
3. support blockers can't block sharp tail detection in normal support
   jira: STUDIO-5663
4. bottom z distance=0 not working for normal support.
   jira: STUDIO-5676
   github: #3203

Change-Id: I025eff2aaad90ad565661aa656c59c82ff969bbf
(cherry picked from commit 5aaf7ead0fd697043f673161e0ede0145ec49f4d)
(cherry picked from commit f3bd5ff87021b5c26794751a1f1da4349b603102)
This commit is contained in:
Arthur 2023-12-20 12:09:27 +08:00 committed by Noisyfox
parent 8c51f3e693
commit 1c498664a5
3 changed files with 25 additions and 15 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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<BoundingBox> 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<std::vector<SupportNode*>>& 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<std::vector<SupportNode*>>& 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<std::vector<SupportNode*>>& 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);