settings with width% is from nozzle instead of layer height.

This commit is contained in:
supermerill 2019-02-08 16:19:37 +01:00
parent 75775bc909
commit aab7dd32f3
7 changed files with 41 additions and 29 deletions

View File

@ -275,6 +275,14 @@ wipe_tower_width = 60
wipe_tower_x = 180 wipe_tower_x = 180
wipe_tower_y = 140 wipe_tower_y = 140
xy_size_compensation = 0 xy_size_compensation = 0
extrusion_width = 105%
external_perimeter_extrusion_width = 105%
first_layer_extrusion_width = 140%
infill_extrusion_width = 110%
perimeter_extrusion_width = 110%
solid_infill_extrusion_width = 110%
top_infill_extrusion_width = 110%
support_material_extrusion_width = 110%
[print:*0.15nozzle*] [print:*0.15nozzle*]
perimeters = 6 perimeters = 6

View File

@ -37,12 +37,12 @@ Flow Flow::new_from_config_width(FlowRole role, const ConfigOptionFloatOrPercent
// optimization to avoid sqrt() // optimization to avoid sqrt()
nozzle_diameter : nozzle_diameter :
sqrt(bridge_flow_ratio) * nozzle_diameter; sqrt(bridge_flow_ratio) * nozzle_diameter;
} else if (! width.percent && width.value == 0.) { } else if (! width.percent && width.value <= 0.) {
// If user left option to 0, calculate a sane default width. // If user left option to 0, calculate a sane default width.
w = auto_extrusion_width(role, nozzle_diameter, height); w = auto_extrusion_width(role, nozzle_diameter, height);
} else { } else {
// If user set a manual value, use it. // If user set a manual value, use it.
w = float(width.get_abs_value(height)); w = float(width.get_abs_value(nozzle_diameter));
} }
return Flow(w, height, nozzle_diameter, bridge_flow_ratio > 0); return Flow(w, height, nozzle_diameter, bridge_flow_ratio > 0);

View File

@ -109,6 +109,7 @@ void Layer::make_perimeters()
&& config.gap_fill_speed == other_config.gap_fill_speed && config.gap_fill_speed == other_config.gap_fill_speed
&& config.overhangs == other_config.overhangs && config.overhangs == other_config.overhangs
&& config.serialize("perimeter_extrusion_width").compare(other_config.serialize("perimeter_extrusion_width")) == 0 && config.serialize("perimeter_extrusion_width").compare(other_config.serialize("perimeter_extrusion_width")) == 0
&& config.serialize("external_perimeter_extrusion_width").compare(other_config.serialize("external_perimeter_extrusion_width")) == 0
&& config.thin_walls == other_config.thin_walls && config.thin_walls == other_config.thin_walls
&& config.thin_walls_min_width == other_config.thin_walls_min_width && config.thin_walls_min_width == other_config.thin_walls_min_width
&& config.thin_walls_overlap == other_config.thin_walls_overlap && config.thin_walls_overlap == other_config.thin_walls_overlap

View File

@ -96,14 +96,14 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
const bool has_infill = this->region()->config().fill_density.value > 0.; const bool has_infill = this->region()->config().fill_density.value > 0.;
coord_t margin = scale_(this->region()->config().external_infill_margin.getFloat()); coord_t margin = scale_(this->region()->config().external_infill_margin.getFloat());
coord_t margin_bridged = scale_(this->region()->config().bridged_infill_margin.getFloat()); coord_t margin_bridged = scale_(this->region()->config().bridged_infill_margin.getFloat());
//if no infill, reduce the margin for averythign to only the perimeter //if no infill, reduce the margin for everything to only the perimeter
if (!has_infill) { if (!has_infill) {
coord_t max_margin = 0;
if ((this->region()->config().perimeters > 0)) { if ((this->region()->config().perimeters > 0)) {
const coord_t perimeter_width = scale_(this->region()->config().perimeter_extrusion_width.get_abs_value(this->layer()->object()->config().layer_height.value)); max_margin = this->flow(frExternalPerimeter).width + this->flow(frPerimeter).width * (this->region()->config().perimeters.value - 1);
const coord_t first_perimeter_width = scale_(this->region()->config().external_perimeter_extrusion_width.get_abs_value(this->layer()->object()->config().layer_height.value)); }
margin = first_perimeter_width + perimeter_width * (this->region()->config().perimeters.value - 1); margin = std::min(margin, max_margin);
} else margin = 0; margin_bridged = std::min(margin_bridged, max_margin);
margin_bridged = margin;
} }
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING #ifdef SLIC3R_DEBUG_SLICE_PROCESSING
export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial"); export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial");

View File

@ -1397,9 +1397,9 @@ double Print::skirt_first_layer_height() const
Flow Print::brim_flow() const Flow Print::brim_flow() const
{ {
ConfigOptionFloatOrPercent width = m_config.first_layer_extrusion_width; ConfigOptionFloatOrPercent width = m_config.first_layer_extrusion_width;
if (width.value == 0) if (width.value <= 0)
width = m_regions.front()->config().perimeter_extrusion_width; width = m_regions.front()->config().perimeter_extrusion_width;
if (width.value == 0) if (width.value <= 0)
width = m_objects.front()->config().extrusion_width; width = m_objects.front()->config().extrusion_width;
/* We currently use a random region's perimeter extruder. /* We currently use a random region's perimeter extruder.
@ -1419,9 +1419,9 @@ Flow Print::brim_flow() const
Flow Print::skirt_flow() const Flow Print::skirt_flow() const
{ {
ConfigOptionFloatOrPercent width = m_config.first_layer_extrusion_width; ConfigOptionFloatOrPercent width = m_config.first_layer_extrusion_width;
if (width.value == 0) if (width.value <= 0)
width = m_regions.front()->config().perimeter_extrusion_width; width = m_regions.front()->config().perimeter_extrusion_width;
if (width.value == 0) if (width.value <= 0)
width = m_objects.front()->config().extrusion_width; width = m_objects.front()->config().extrusion_width;
/* We currently use a random object's support material extruder. /* We currently use a random object's support material extruder.
@ -1913,7 +1913,8 @@ void Print::_make_wipe_tower()
float(m_config.cooling_tube_length.value), float(m_config.parking_pos_retraction.value), float(m_config.cooling_tube_length.value), float(m_config.parking_pos_retraction.value),
float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging), float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging),
m_config.high_current_on_filament_swap.value, wipe_volumes, m_config.high_current_on_filament_swap.value, wipe_volumes,
m_wipe_tower_data.tool_ordering.first_extruder(), float(m_config.first_layer_extrusion_width)); m_wipe_tower_data.tool_ordering.first_extruder(), this->brim_flow().width);
//wipe_tower.set_retract(); //wipe_tower.set_retract();
//wipe_tower.set_zhop(); //wipe_tower.set_zhop();

View File

@ -488,7 +488,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Extrusion Width"); def->category = L("Extrusion Width");
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for external perimeters. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for external perimeters. "
"If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. "
"If expressed as percentage (for example 200%), it will be computed over layer height."); "If expressed as percentage (for example 112.5%), it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "external-perimeter-extrusion-width=s"; def->cli = "external-perimeter-extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;
@ -637,7 +637,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Set this to a non-zero value to allow a manual extrusion width. " def->tooltip = L("Set this to a non-zero value to allow a manual extrusion width. "
"If left to zero, Slic3r derives extrusion widths from the nozzle diameter " "If left to zero, Slic3r derives extrusion widths from the nozzle diameter "
"(see the tooltips for perimeter extrusion width, infill extrusion width etc). " "(see the tooltips for perimeter extrusion width, infill extrusion width etc). "
"If expressed as percentage (for example: 230%), it will be computed over layer height."); "If expressed as percentage (for example: 105%), it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for auto)"); def->sidetext = L("mm or % (leave 0 for auto)");
def->cli = "extrusion-width=s"; def->cli = "extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;
@ -1000,13 +1000,14 @@ void PrintConfigDef::init_fff_params()
def->category = L("Extrusion Width"); def->category = L("Extrusion Width");
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for first layer. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for first layer. "
"You can use this to force fatter extrudates for better adhesion. If expressed " "You can use this to force fatter extrudates for better adhesion. If expressed "
"as percentage (for example 120%) it will be computed over first layer height. " "as percentage (for example 140%) it will be computed over the nozzle diameter "
"of the nozzle used for the type of extrusion. "
"If set to zero, it will use the default extrusion width."); "If set to zero, it will use the default extrusion width.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "first-layer-extrusion-width=s"; def->cli = "first-layer-extrusion-width=s";
def->ratio_over = "first_layer_height"; def->ratio_over = "first_layer_height";
def->mode = comAdvanced; def->mode = comAdvanced;
def->default_value = new ConfigOptionFloatOrPercent(200, true); def->default_value = new ConfigOptionFloatOrPercent(140, true);
def = this->add("first_layer_height", coFloatOrPercent); def = this->add("first_layer_height", coFloatOrPercent);
def->label = L("First layer height"); def->label = L("First layer height");
@ -1201,7 +1202,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill. "
"If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. "
"You may want to use fatter extrudates to speed up the infill and make your parts stronger. " "You may want to use fatter extrudates to speed up the infill and make your parts stronger. "
"If expressed as percentage (for example 90%) it will be computed over layer height."); "If expressed as percentage (for example 110%) it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "infill-extrusion-width=s"; def->cli = "infill-extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;
@ -1671,7 +1672,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for perimeters. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for perimeters. "
"You may want to use thinner extrudates to get more accurate surfaces. " "You may want to use thinner extrudates to get more accurate surfaces. "
"If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. "
"If expressed as percentage (for example 200%) it will be computed over layer height."); "If expressed as percentage (for example 105%) it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "perimeter-extrusion-width=s"; def->cli = "perimeter-extrusion-width=s";
def->aliases = { "perimeters_extrusion_width" }; def->aliases = { "perimeters_extrusion_width" };
@ -2061,7 +2062,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Extrusion Width"); def->category = L("Extrusion Width");
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill for solid surfaces. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill for solid surfaces. "
"If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise 1.125 x nozzle diameter will be used. "
"If expressed as percentage (for example 90%) it will be computed over layer height."); "If expressed as percentage (for example 110%) it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "solid-infill-extrusion-width=s"; def->cli = "solid-infill-extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;
@ -2275,7 +2276,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Extrusion Width"); def->category = L("Extrusion Width");
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for support material. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for support material. "
"If left zero, default extrusion width will be used if set, otherwise nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise nozzle diameter will be used. "
"If expressed as percentage (for example 90%) it will be computed over layer height."); "If expressed as percentage (for example 110%) it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "support-material-extrusion-width=s"; def->cli = "support-material-extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;
@ -2413,7 +2414,8 @@ void PrintConfigDef::init_fff_params()
def->label = L(""); def->label = L("");
def->category = L("Layers and Perimeters"); def->category = L("Layers and Perimeters");
def->tooltip = L("Detect single-width walls (parts where two extrusions don't fit and we need " def->tooltip = L("Detect single-width walls (parts where two extrusions don't fit and we need "
"to collapse them into a single trace)."); "to collapse them into a single trace). If unchecked, slic3r may try to fit perimeters "
"where it's not possible, creating some overlap leading to over-extrusion.");
def->cli = "thin-walls!"; def->cli = "thin-walls!";
def->mode = comAdvanced; def->mode = comAdvanced;
def->default_value = new ConfigOptionBool(true); def->default_value = new ConfigOptionBool(true);
@ -2422,7 +2424,8 @@ void PrintConfigDef::init_fff_params()
def->label = L("min width"); def->label = L("min width");
def->category = L("Layers and Perimeters"); def->category = L("Layers and Perimeters");
def->tooltip = L("Minimum width for the extrusion to be extruded (widths lower than the nozzle diameter will be over-extruded at the nozzle diameter)." def->tooltip = L("Minimum width for the extrusion to be extruded (widths lower than the nozzle diameter will be over-extruded at the nozzle diameter)."
"Can be percent of the nozzle size. The default behavior of slic3r and slic3rPE is with a 33% value. Put 100% to avoid any sort of over-extrusion."); " If expressed as percentage (for example 110%) it will be computed over nozzle diameter."
" The default behavior of slic3r and slic3rPE is with a 33% value. Put 100% to avoid any sort of over-extrusion.");
def->cli = "thin-walls-min-width=s"; def->cli = "thin-walls-min-width=s";
def->mode = comExpert; def->mode = comExpert;
def->min = 0; def->min = 0;
@ -2467,7 +2470,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill for top surfaces. " def->tooltip = L("Set this to a non-zero value to set a manual extrusion width for infill for top surfaces. "
"You may want to use thinner extrudates to fill all narrow regions and get a smoother finish. " "You may want to use thinner extrudates to fill all narrow regions and get a smoother finish. "
"If left zero, default extrusion width will be used if set, otherwise nozzle diameter will be used. " "If left zero, default extrusion width will be used if set, otherwise nozzle diameter will be used. "
"If expressed as percentage (for example 90%) it will be computed over layer height."); "If expressed as percentage (for example 110%) it will be computed over nozzle diameter.");
def->sidetext = L("mm or % (leave 0 for default)"); def->sidetext = L("mm or % (leave 0 for default)");
def->cli = "top-infill-extrusion-width=s"; def->cli = "top-infill-extrusion-width=s";
def->mode = comAdvanced; def->mode = comAdvanced;

View File

@ -7,6 +7,7 @@
#include "Fill/FillBase.hpp" #include "Fill/FillBase.hpp"
#include "EdgeGrid.hpp" #include "EdgeGrid.hpp"
#include "Geometry.hpp" #include "Geometry.hpp"
#include "Flow.hpp"
#include <cmath> #include <cmath>
#include <memory> #include <memory>
@ -164,11 +165,9 @@ PrintObjectSupportMaterial::PrintObjectSupportMaterial(const PrintObject *object
coordf_t external_perimeter_width = 0.; coordf_t external_perimeter_width = 0.;
for (size_t region_id = 0; region_id < object->region_volumes.size(); ++ region_id) { for (size_t region_id = 0; region_id < object->region_volumes.size(); ++ region_id) {
if (! object->region_volumes[region_id].empty()) { if (! object->region_volumes[region_id].empty()) {
const PrintRegionConfig &config = object->print()->get_region(region_id)->config(); const Flow ext_peri_flow = object->print()->get_region(region_id)->flow(frExternalPerimeter,
coordf_t width = config.external_perimeter_extrusion_width.get_abs_value(slicing_params.layer_height); slicing_params.layer_height, false, false, -1, *object);
if (width <= 0.) external_perimeter_width = std::max(external_perimeter_width, (coordf_t)ext_peri_flow.width);
width = m_print_config->nozzle_diameter.get_at(config.perimeter_extruder-1);
external_perimeter_width = std::max(external_perimeter_width, width);
} }
} }
m_gap_xy = m_object_config->support_material_xy_spacing.get_abs_value(external_perimeter_width); m_gap_xy = m_object_config->support_material_xy_spacing.get_abs_value(external_perimeter_width);