fix ironing for support interface pattern

#153
This commit is contained in:
supermerill 2020-02-03 19:31:41 +01:00
parent 705edaa7fb
commit a585fa9cdc
3 changed files with 10 additions and 5 deletions

View File

@ -38,7 +38,7 @@ namespace Slic3r {
else params_modifided.flow_mult *= (float)percentFlow[idx]; else params_modifided.flow_mult *= (float)percentFlow[idx];
//choose if we are going to extrude with or without overlap //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); this->fill_expolygon(idx, *eec, srf_source, params_modifided, volume);
} }
else{ else{
@ -90,12 +90,12 @@ namespace Slic3r {
good_role = params.flow->bridge && idx == 0 ? erBridgeInfill : rolePass[idx]; good_role = params.flow->bridge && idx == 0 ? erBridgeInfill : rolePass[idx];
} }
// print // 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( extrusion_entities_append_paths(
eec.entities, std::move(polylines_layer), eec.entities, std::move(polylines_layer),
good_role, good_role,
params.flow->mm3_per_mm() * params.flow_mult * mult_flow, 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); (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) //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; volumeToOccupy += poylineVolume;
} }
if (this->no_overlap_expolygons.empty()) {
volumeToOccupy = unscaled(unscaled(surface->area())) * params.flow->height;
}
//create root node //create root node
ExtrusionEntityCollection *eecroot = new ExtrusionEntityCollection(); ExtrusionEntityCollection *eecroot = new ExtrusionEntityCollection();

View File

@ -2811,8 +2811,10 @@ void modulate_extrusion_by_overlapping_layers(
path_fragments.back().polylines = diff_pl(path_fragments.back().polylines, polygons_trimming, false); 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). // 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); 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.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 #ifdef SLIC3R_DEBUG
svg.draw(frag.polylines, dbg_index_to_color(i_overlapping_layer), scale_(0.1)); svg.draw(frag.polylines, dbg_index_to_color(i_overlapping_layer), scale_(0.1));
#endif /* SLIC3R_DEBUG */ #endif /* SLIC3R_DEBUG */

View File

@ -935,7 +935,7 @@ void Choice::set_value(const boost::any& value, bool change_event)
case coEnum: { case coEnum: {
int val = boost::any_cast<int>(value); int val = boost::any_cast<int>(value);
if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "solid_fill_pattern" 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<InfillPattern>(val); val = idx_from_enum_value<InfillPattern>(val);
} else if (m_opt_id.compare("perimeter_loop_seam") == 0) { } else if (m_opt_id.compare("perimeter_loop_seam") == 0) {