From a585fa9cdc8e772adf1a4b4dfe8595ec97f7f568 Mon Sep 17 00:00:00 2001 From: supermerill Date: Mon, 3 Feb 2020 19:31:41 +0100 Subject: [PATCH] fix ironing for support interface pattern #153 --- src/libslic3r/Fill/FillSmooth.cpp | 9 ++++++--- src/libslic3r/SupportMaterial.cpp | 4 +++- src/slic3r/GUI/Field.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/Fill/FillSmooth.cpp b/src/libslic3r/Fill/FillSmooth.cpp index 39e0886c7..93f57fe4c 100644 --- a/src/libslic3r/Fill/FillSmooth.cpp +++ b/src/libslic3r/Fill/FillSmooth.cpp @@ -38,7 +38,7 @@ namespace Slic3r { else params_modifided.flow_mult *= (float)percentFlow[idx]; //choose if we are going to extrude with or without overlap - if ((params.flow->bridge && idx == 0) || has_overlap[idx]){ + if ((params.flow->bridge && idx == 0) || has_overlap[idx] || this->no_overlap_expolygons.empty()){ this->fill_expolygon(idx, *eec, srf_source, params_modifided, volume); } else{ @@ -90,12 +90,12 @@ namespace Slic3r { good_role = params.flow->bridge && idx == 0 ? erBridgeInfill : rolePass[idx]; } // print - float mult_flow = (params.fill_exactly /*&& idx == 0*/ ? std::min(2., volume / extrudedVolume) : 1); + float mult_flow = float(params.fill_exactly /*&& idx == 0*/ ? std::min(2., volume / extrudedVolume) : 1); extrusion_entities_append_paths( eec.entities, std::move(polylines_layer), good_role, params.flow->mm3_per_mm() * params.flow_mult * mult_flow, - //min-reduced flow width for a better view (it's only a gui thing) + //min-reduced flow width for a better view (it's mostly a gui thing, but some support code can want to mess with it) (float)(params.flow->width * (params.flow_mult* mult_flow < 0.1 ? 0.1 : params.flow_mult * mult_flow)), (float)params.flow->height); } } @@ -121,6 +121,9 @@ namespace Slic3r { //extruded volume: see http://manual.slic3r.org/advanced/flow-math, and we need to remove a circle at an end (as the flow continue) volumeToOccupy += poylineVolume; } + if (this->no_overlap_expolygons.empty()) { + volumeToOccupy = unscaled(unscaled(surface->area())) * params.flow->height; + } //create root node ExtrusionEntityCollection *eecroot = new ExtrusionEntityCollection(); diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index d7042ffa4..c7ec450be 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -2811,8 +2811,10 @@ void modulate_extrusion_by_overlapping_layers( path_fragments.back().polylines = diff_pl(path_fragments.back().polylines, polygons_trimming, false); // Adjust the extrusion parameters for a reduced layer height and a non-bridging flow (nozzle_dmr = -1, does not matter). assert(this_layer.print_z > overlapping_layer.print_z); + float old_height = frag.height; frag.height = float(this_layer.print_z - overlapping_layer.print_z); - frag.mm3_per_mm = Flow(frag.width, frag.height, -1.f, false).mm3_per_mm(); + // don't recompute the flow, just use a simple % reduction/increase + frag.mm3_per_mm = frag.mm3_per_mm * frag.height / old_height; #ifdef SLIC3R_DEBUG svg.draw(frag.polylines, dbg_index_to_color(i_overlapping_layer), scale_(0.1)); #endif /* SLIC3R_DEBUG */ diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 64d2eaf6d..a15636014 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -935,7 +935,7 @@ void Choice::set_value(const boost::any& value, bool change_event) case coEnum: { int val = boost::any_cast(value); if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern" - || m_opt_id == "fill_pattern" || m_opt_id == "support_fill_pattern") + || m_opt_id == "fill_pattern" || m_opt_id == "support_material_interface_pattern") { val = idx_from_enum_value(val); } else if (m_opt_id.compare("perimeter_loop_seam") == 0) {