Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_splitted_vbuffer

This commit is contained in:
enricoturri1966 2021-01-20 13:48:09 +01:00
commit 5161643fc6
22 changed files with 257 additions and 184 deletions

View file

@ -2591,10 +2591,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
throw Slic3r::InvalidArgument("Invalid speed");
}
}
if (this->on_first_layer())
speed = m_config.get_abs_value("first_layer_speed", speed);
if (m_volumetric_speed != 0. && speed == 0)
speed = m_volumetric_speed / path.mm3_per_mm;
if (this->on_first_layer())
speed = m_config.get_abs_value("first_layer_speed", speed);
if (m_config.max_volumetric_speed.value > 0) {
// cap speed with max_volumetric_speed anyway (even if user is not using autospeed)
speed = std::min(

View file

@ -928,7 +928,11 @@ void PresetBundle::load_config_file_config_bundle(const std::string &path, const
if (opt_compatible->type() == coStrings)
static_cast<ConfigOptionStrings*>(opt_compatible)->values.clear();
}
collection_dst.load_preset(path, preset_name_dst, std::move(preset_src->config), activate).is_external = true;
(collection_dst.type() == Preset::TYPE_FILAMENT ?
collection_dst.load_preset(path, preset_name_dst, preset_src->config, activate) :
// Only move the source config for non filament profiles, as single filament profile may be referenced multiple times.
collection_dst.load_preset(path, preset_name_dst, std::move(preset_src->config), activate))
.is_external = true;
return preset_name_dst;
};
load_one(this->prints, tmp_bundle.prints, tmp_bundle.prints .get_selected_preset_name(), true);

View file

@ -1400,8 +1400,12 @@ std::string Print::validate() const
#endif
auto validate_extrusion_width = [min_nozzle_diameter, max_nozzle_diameter](const ConfigBase &config, const char *opt_key, double layer_height, std::string &err_msg) -> bool {
double extrusion_width_min = config.get_abs_value(opt_key, min_nozzle_diameter);
double extrusion_width_max = config.get_abs_value(opt_key, max_nozzle_diameter);
// This may change in the future, if we switch to "extrusion width wrt. nozzle diameter"
// instead of currently used logic "extrusion width wrt. layer height", see GH issues #1923 #2829.
// double extrusion_width_min = config.get_abs_value(opt_key, min_nozzle_diameter);
// double extrusion_width_max = config.get_abs_value(opt_key, max_nozzle_diameter);
double extrusion_width_min = config.get_abs_value(opt_key, layer_height);
double extrusion_width_max = config.get_abs_value(opt_key, layer_height);
if (extrusion_width_min == 0) {
// Default "auto-generated" extrusion width is always valid.
} else if (extrusion_width_min <= layer_height) {

View file

@ -3299,15 +3299,20 @@ DynamicPrintConfig* DynamicPrintConfig::new_from_defaults_keys(const std::vector
double min_object_distance(const ConfigBase &cfg)
{
const ConfigOptionEnum<PrinterTechnology> *opt_printer_technology = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
auto printer_technology = opt_printer_technology ? opt_printer_technology->value : ptUnknown;
double ret = 0.;
if (printer_technology(cfg) == ptSLA) ret = 6.;
if (printer_technology == ptSLA)
ret = 6.;
else {
auto ecr_opt = cfg.option<ConfigOptionFloat>("extruder_clearance_radius");
auto dd_opt = cfg.option<ConfigOptionFloat>("duplicate_distance");
auto co_opt = cfg.option<ConfigOptionBool>("complete_objects");
if (!ecr_opt || !dd_opt || !co_opt) ret = 0.;
if (!ecr_opt || !dd_opt || !co_opt)
ret = 0.;
else {
// min object distance is max(duplicate_distance, clearance_radius)
ret = (co_opt->value && ecr_opt->value > dd_opt->value) ?
@ -3318,21 +3323,6 @@ double min_object_distance(const ConfigBase &cfg)
return ret;
}
PrinterTechnology printer_technology(const ConfigBase &cfg)
{
const ConfigOptionEnum<PrinterTechnology> *opt = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
if (opt) return opt->value;
const ConfigOptionBool *export_opt = cfg.option<ConfigOptionBool>("export_sla");
if (export_opt && export_opt->getBool()) return ptSLA;
export_opt = cfg.option<ConfigOptionBool>("export_gcode");
if (export_opt && export_opt->getBool()) return ptFFF;
return ptUnknown;
}
void DynamicPrintConfig::normalize_fdm()
{
if (this->has("extruder")) {

View file

@ -246,7 +246,7 @@ extern const PrintConfigDef print_config_def;
class StaticPrintConfig;
PrinterTechnology printer_technology(const ConfigBase &cfg);
// Minimum object distance for arrangement, based on printer technology.
double min_object_distance(const ConfigBase &cfg);
// Slic3r dynamic configuration, used to override the configuration