From 2e3edc45181ab83ecb0ec57378bc489c99deae38 Mon Sep 17 00:00:00 2001 From: "jiaxi.chen" Date: Fri, 14 Feb 2025 12:21:43 +0800 Subject: [PATCH] FIX: wall count fixed && overlapping of interface filling path jira: STUDIO-10419, STUDIO-10420 Change-Id: Ib7274420ceb8149a02e82d896757ce5ace908fb9 --- .../BBL/process/fdm_process_common.json | 2 +- src/libslic3r/ExtrusionEntityCollection.cpp | 2 ++ src/libslic3r/GCode.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 2 +- src/libslic3r/Support/TreeSupport.cpp | 18 +++++++++--------- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/resources/profiles/BBL/process/fdm_process_common.json b/resources/profiles/BBL/process/fdm_process_common.json index c5daf95fe..79d980852 100644 --- a/resources/profiles/BBL/process/fdm_process_common.json +++ b/resources/profiles/BBL/process/fdm_process_common.json @@ -125,7 +125,7 @@ ], "tree_support_branch_angle": "45", "tree_support_branch_diameter": "2", - "tree_support_wall_count": "1", + "tree_support_wall_count": "0", "wall_generator": "classic", "wall_infill_order": "inner wall/outer wall/infill", "wall_loops": "2", diff --git a/src/libslic3r/ExtrusionEntityCollection.cpp b/src/libslic3r/ExtrusionEntityCollection.cpp index ed6af12b7..1224d07c2 100644 --- a/src/libslic3r/ExtrusionEntityCollection.cpp +++ b/src/libslic3r/ExtrusionEntityCollection.cpp @@ -13,6 +13,8 @@ void filter_by_extrusion_role_in_place(ExtrusionEntitiesPtr &extrusion_entities, auto last = extrusion_entities.end(); extrusion_entities.erase( std::remove_if(first, last, [&role](const ExtrusionEntity* ee) { + if((ee->role() == erSupportTransition && role ==erSupportMaterial)) + return false; return ee->role() != role; }), last); } diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 4088b44e4..6383449ac 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3849,7 +3849,7 @@ GCode::LayerResult GCode::process_layer( // Assign an extruder to the base. ObjectByExtruder &obj = object_by_extruder(by_extruder, has_support ? support_extruder : interface_extruder, &layer_to_print - layers.data(), layers.size()); obj.support = &support_layer.support_fills; - obj.support_extrusion_role = single_extruder ? erMixed : role; + obj.support_extrusion_role = single_extruder ? erMixed : erSupportMaterial; if (! single_extruder && has_interface) { ObjectByExtruder &obj_interface = object_by_extruder(by_extruder, interface_extruder, &layer_to_print - layers.data(), layers.size()); obj_interface.support = &support_layer.support_fills; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 967fea671..46fa9e87c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4061,7 +4061,7 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->max = 2; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionInt(1)); + def->set_default_value(new ConfigOptionInt(0)); def = this->add("chamber_temperatures", coInts); def->label = L("Chamber temperature"); diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 366f0e34a..59e5cf44a 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1607,15 +1607,15 @@ void TreeSupport::generate_toolpaths() if (bridge_layer) { for (size_t region_id = 0; region_id < bridge_layer->regions().size(); ++region_id) { LayerRegion *layerm = bridge_layer->regions()[region_id]; - bool find_bridge = false; + bool bridge_found = false; for (const auto surface : layerm->fill_surfaces.surfaces) { if (surface.surface_type == stBottomBridge && overlaps(polys, surface.expolygon)) { filler_Roof1stLayer->angle = surface.bridge_angle + (m_support_params.num_top_interface_layers - 1) * M_PI_2; - find_bridge - true; + bridge_found = true; break; } } - if (find_bridge) break; + if (bridge_found) break; } } } @@ -1644,7 +1644,7 @@ void TreeSupport::generate_toolpaths() fill_params.dont_sort = true; } if (m_support_params.contact_fill_pattern = ipRectilinear) { - bool find_bridge = false; + bool bridge_found = false; for (size_t i = 0; i < m_support_params.num_top_interface_layers; i++) { auto cur_ts_layer = m_object->get_support_layer(layer_id + i); if (cur_ts_layer == nullptr) break; @@ -1656,16 +1656,16 @@ void TreeSupport::generate_toolpaths() for (const auto surface : layerm->fill_surfaces.surfaces) { if (surface.surface_type == stBottomBridge && overlaps(polys, surface.expolygon)) { filler_interface->angle = surface.bridge_angle + (i + 1) * M_PI_2; - find_bridge = true; + bridge_found = true; break; } } - if (find_bridge) break; + if (bridge_found) break; } } - if (find_bridge) break; + if (bridge_found) break; } - if (!find_bridge) + if (!bridge_found) filler_interface->layer_id = area_group.interface_id; else filler_interface->layer_id = 0; @@ -1697,7 +1697,7 @@ void TreeSupport::generate_toolpaths() // allow infill-only mode if support is thick enough (so min_wall_count is 0); // otherwise must draw 1 wall // Don't need extra walls if we have infill. Extra walls may overlap with the infills. - size_t min_wall_count = offset(poly, -scale_(support_spacing * 1.5)).empty() ? 1 : 0; + size_t min_wall_count = 1; make_perimeter_and_infill(ts_layer->support_fills.entities, poly, std::max(min_wall_count, wall_count), flow, erSupportMaterial, filler_support.get(), support_density); }