From 480489b29bbba298b1e2d619b035457117544e57 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Fri, 8 Mar 2024 17:22:16 +0800 Subject: [PATCH] FIX: infill speed not work on region level Jira: none Signed-off-by: qing.zhang Change-Id: Ie3d17c5e3cbf91a8854e3b4cd80babeb2b1bd121 --- src/libslic3r/Fill/Fill.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index da876374e..d60b2d505 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -60,7 +60,10 @@ struct SurfaceFillParams // Index of this entry in a linear vector. size_t idx = 0; - + // infill speed settings + float sparse_infill_speed = 0; + float top_surface_speed = 0; + float solid_infill_speed = 0; bool operator<(const SurfaceFillParams &rhs) const { #define RETURN_COMPARE_NON_EQUAL(KEY) if (this->KEY < rhs.KEY) return true; if (this->KEY > rhs.KEY) return false; @@ -85,6 +88,10 @@ struct SurfaceFillParams RETURN_COMPARE_NON_EQUAL(flow.nozzle_diameter()); RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, bridge); RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, extrusion_role); + RETURN_COMPARE_NON_EQUAL(sparse_infill_speed); + RETURN_COMPARE_NON_EQUAL(top_surface_speed); + RETURN_COMPARE_NON_EQUAL(solid_infill_speed); + return false; } @@ -102,7 +109,10 @@ struct SurfaceFillParams this->anchor_length_max == rhs.anchor_length_max && this->with_loop == rhs.with_loop && this->flow == rhs.flow && - this->extrusion_role == rhs.extrusion_role; + this->extrusion_role == rhs.extrusion_role && + this->sparse_infill_speed == rhs.sparse_infill_speed && + this->top_surface_speed == rhs.top_surface_speed && + this->solid_infill_speed == rhs.solid_infill_speed; } }; @@ -182,7 +192,15 @@ std::vector group_fills(const Layer &layer) //BBS: always enable thick bridge for internal bridge layerm.bridging_flow(extrusion_role, (surface.is_bridge() && !surface.is_external()) || object_config.thick_bridges) : layerm.flow(extrusion_role, (surface.thickness == -1) ? layer.height : surface.thickness); - + //BBS: record speed params + if (!params.with_loop && !params.bridge) { + if (params.extrusion_role == erInternalInfill) + params.sparse_infill_speed = region_config.sparse_infill_speed; + else if (params.extrusion_role == erTopSolidInfill) + params.top_surface_speed = region_config.top_surface_speed; + else if (params.extrusion_role == erSolidInfill) + params.solid_infill_speed = region_config.internal_solid_infill_speed; + } // Calculate flow spacing for infill pattern generation. if (surface.is_solid() || is_bridge) { params.spacing = params.flow.spacing();