diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2022-02-01 16:15:18 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2022-02-01 16:15:18 +0300 |
commit | ebb9041041008cd759704c1507612d6172718ede (patch) | |
tree | e8f56f126fddba8a383038d8a28f6ab335a3a1e2 /src/libslic3r/PrintConfig.cpp | |
parent | 8f0916e37135a47a6d23fe3ed9815b96f175df05 (diff) | |
parent | 9dae482e1222ee55e21584f2c2c8d0a1f692a20b (diff) |
Merge branch 'master' into stable - no conflicts fixed
Diffstat (limited to 'src/libslic3r/PrintConfig.cpp')
-rw-r--r-- | src/libslic3r/PrintConfig.cpp | 960 |
1 files changed, 807 insertions, 153 deletions
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index bffb33082..c22f35de6 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1,4 +1,5 @@ #include "PrintConfig.hpp" +#include "Config.hpp" #include "I18N.hpp" #include <set> @@ -6,6 +7,7 @@ #include <boost/algorithm/string/case_conv.hpp> #include <boost/format.hpp> #include <boost/lexical_cast.hpp> +#include <boost/log/trivial.hpp> #include <boost/thread.hpp> #include <float.h> @@ -17,6 +19,184 @@ namespace Slic3r { #define L(s) (s) #define _(s) Slic3r::I18N::translate(s) +static t_config_enum_names enum_names_from_keys_map(const t_config_enum_values &enum_keys_map) +{ + t_config_enum_names names; + int cnt = 0; + for (const auto& kvp : enum_keys_map) + cnt = std::max(cnt, kvp.second); + cnt += 1; + names.assign(cnt, ""); + for (const auto& kvp : enum_keys_map) + names[kvp.second] = kvp.first; + return names; +} + +#define CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(NAME) \ + static t_config_enum_names s_keys_names_##NAME = enum_names_from_keys_map(s_keys_map_##NAME); \ + template<> const t_config_enum_values& ConfigOptionEnum<NAME>::get_enum_values() { return s_keys_map_##NAME; } \ + template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names() { return s_keys_names_##NAME; } + +static t_config_enum_values s_keys_map_PrinterTechnology { + { "FFF", ptFFF }, + { "SLA", ptSLA } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrinterTechnology) + +static t_config_enum_values s_keys_map_GCodeFlavor { + { "reprap", gcfRepRapSprinter }, + { "reprapfirmware", gcfRepRapFirmware }, + { "repetier", gcfRepetier }, + { "teacup", gcfTeacup }, + { "makerware", gcfMakerWare }, + { "marlin", gcfMarlinLegacy }, + { "marlin2", gcfMarlinFirmware }, + { "sailfish", gcfSailfish }, + { "smoothie", gcfSmoothie }, + { "mach3", gcfMach3 }, + { "machinekit", gcfMachinekit }, + { "no-extrusion", gcfNoExtrusion } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(GCodeFlavor) + +static t_config_enum_values s_keys_map_MachineLimitsUsage { + { "emit_to_gcode", int(MachineLimitsUsage::EmitToGCode) }, + { "time_estimate_only", int(MachineLimitsUsage::TimeEstimateOnly) }, + { "ignore", int(MachineLimitsUsage::Ignore) } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(MachineLimitsUsage) + +static t_config_enum_values s_keys_map_PrintHostType { + { "prusalink", htPrusaLink }, + { "octoprint", htOctoPrint }, + { "duet", htDuet }, + { "flashair", htFlashAir }, + { "astrobox", htAstroBox }, + { "repetier", htRepetier }, + { "mks", htMKS } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrintHostType) + +static t_config_enum_values s_keys_map_AuthorizationType { + { "key", atKeyPassword }, + { "user", atUserPassword } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(AuthorizationType) + +static t_config_enum_values s_keys_map_FuzzySkinType { + { "none", int(FuzzySkinType::None) }, + { "external", int(FuzzySkinType::External) }, + { "all", int(FuzzySkinType::All) } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FuzzySkinType) + +static t_config_enum_values s_keys_map_InfillPattern { + { "rectilinear", ipRectilinear }, + { "monotonic", ipMonotonic }, + { "alignedrectilinear", ipAlignedRectilinear }, + { "grid", ipGrid }, + { "triangles", ipTriangles }, + { "stars", ipStars }, + { "cubic", ipCubic }, + { "line", ipLine }, + { "concentric", ipConcentric }, + { "honeycomb", ipHoneycomb }, + { "3dhoneycomb", ip3DHoneycomb }, + { "gyroid", ipGyroid }, + { "hilbertcurve", ipHilbertCurve }, + { "archimedeanchords", ipArchimedeanChords }, + { "octagramspiral", ipOctagramSpiral }, + { "adaptivecubic", ipAdaptiveCubic }, + { "supportcubic", ipSupportCubic }, +#if HAS_LIGHTNING_INFILL + { "lightning", ipLightning } +#endif // HAS_LIGHTNING_INFILL +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InfillPattern) + +static t_config_enum_values s_keys_map_IroningType { + { "top", int(IroningType::TopSurfaces) }, + { "topmost", int(IroningType::TopmostOnly) }, + { "solid", int(IroningType::AllSolid) } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(IroningType) + +static t_config_enum_values s_keys_map_SlicingMode { + { "regular", int(SlicingMode::Regular) }, + { "even_odd", int(SlicingMode::EvenOdd) }, + { "close_holes", int(SlicingMode::CloseHoles) } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SlicingMode) + +static t_config_enum_values s_keys_map_SupportMaterialPattern { + { "rectilinear", smpRectilinear }, + { "rectilinear-grid", smpRectilinearGrid }, + { "honeycomb", smpHoneycomb } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialPattern) + +static t_config_enum_values s_keys_map_SupportMaterialStyle { + { "grid", smsGrid }, + { "snug", smsSnug } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialStyle) + +static t_config_enum_values s_keys_map_SupportMaterialInterfacePattern { + { "auto", smipAuto }, + { "rectilinear", smipRectilinear }, + { "concentric", smipConcentric } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialInterfacePattern) + +static t_config_enum_values s_keys_map_SeamPosition { + { "random", spRandom }, + { "nearest", spNearest }, + { "aligned", spAligned }, + { "rear", spRear } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SeamPosition) + +static const t_config_enum_values s_keys_map_SLADisplayOrientation = { + { "landscape", sladoLandscape}, + { "portrait", sladoPortrait} +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLADisplayOrientation) + +static const t_config_enum_values s_keys_map_SLAPillarConnectionMode = { + {"zigzag", slapcmZigZag}, + {"cross", slapcmCross}, + {"dynamic", slapcmDynamic} +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAPillarConnectionMode) + +static const t_config_enum_values s_keys_map_SLAMaterialSpeed = { + {"slow", slamsSlow}, + {"fast", slamsFast} +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAMaterialSpeed); + +static const t_config_enum_values s_keys_map_BrimType = { + {"no_brim", btNoBrim}, + {"outer_only", btOuterOnly}, + {"inner_only", btInnerOnly}, + {"outer_and_inner", btOuterAndInner} +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BrimType) + +static const t_config_enum_values s_keys_map_DraftShield = { + { "disabled", dsDisabled }, + { "limited", dsLimited }, + { "enabled", dsEnabled } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(DraftShield) + +static const t_config_enum_values s_keys_map_ForwardCompatibilitySubstitutionRule = { + { "disable", ForwardCompatibilitySubstitutionRule::Disable }, + { "enable", ForwardCompatibilitySubstitutionRule::Enable }, + { "enable_silent", ForwardCompatibilitySubstitutionRule::EnableSilent } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(ForwardCompatibilitySubstitutionRule) + static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology) { for (std::pair<const t_config_option_key, ConfigOptionDef> &kvp : options) @@ -62,11 +242,21 @@ void PrintConfigDef::init_common_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionString("")); + def = this->add("elefant_foot_compensation", coFloat); + def->label = L("Elephant foot compensation"); + def->category = L("Advanced"); + def->tooltip = L("The first layer will be shrunk in the XY plane by the configured value " + "to compensate for the 1st layer squish aka an Elephant Foot effect."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("thumbnails", coPoints); def->label = L("G-code thumbnails"); def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \"XxY, XxY, ...\""); def->mode = comExpert; - def->gui_type = "one_string"; + def->gui_type = ConfigOptionDef::GUIType::one_string; def->set_default_value(new ConfigOptionPoints()); def = this->add("layer_height", coFloat); @@ -87,16 +277,6 @@ void PrintConfigDef::init_common_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(200.0)); - def = this->add("slice_closing_radius", coFloat); - def->label = L("Slice gap closing radius"); - def->category = L("Advanced"); - def->tooltip = L("Cracks smaller than 2x gap closing radius are being filled during the triangle mesh slicing. " - "The gap closing operation may reduce the final print resolution, therefore it is advisable to keep the value reasonably low."); - def->sidetext = L("mm"); - def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(0.049)); - def = this->add("print_host", coString); def->label = L("Hostname, IP or URL"); def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " @@ -104,6 +284,7 @@ void PrintConfigDef::init_common_params() "Print host behind HAProxy with basic auth enabled can be accessed by putting the user name and password into the URL " "in the following format: https://username:password@your-octopi-address/"); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); def = this->add("printhost_apikey", coString); @@ -111,13 +292,15 @@ void PrintConfigDef::init_common_params() def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " "the API Key or the password required for authentication."); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); def = this->add("printhost_port", coString); def->label = L("Printer"); def->tooltip = L("Name of the printer"); - def->gui_type = "select_open"; + def->gui_type = ConfigOptionDef::GUIType::select_open; def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); def = this->add("printhost_cafile", coString); @@ -125,37 +308,39 @@ void PrintConfigDef::init_common_params() def->tooltip = L("Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. " "If left blank, the default OS CA certificate repository is used."); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); - def = this->add("elefant_foot_compensation", coFloat); - def->label = L("Elephant foot compensation"); - def->category = L("Advanced"); - def->tooltip = L("The first layer will be shrunk in the XY plane by the configured value " - "to compensate for the 1st layer squish aka an Elephant Foot effect."); - def->sidetext = L("mm"); - def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(0.2)); - // Options used by physical printers def = this->add("printhost_user", coString); def->label = L("User"); // def->tooltip = L(""); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); def = this->add("printhost_password", coString); def->label = L("Password"); // def->tooltip = L(""); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); + + // Only available on Windows. + def = this->add("printhost_ssl_ignore_revoke", coBool); + def->label = L("Ignore HTTPS certificate revocation checks"); + def->tooltip = L("Ignore HTTPS certificate revocation checks in case of missing or offline distribution points. " + "One may want to enable this option for self signed certificates if connection fails."); + def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; + def->set_default_value(new ConfigOptionBool(false)); - def = this->add("preset_name", coString); - def->label = L("Printer preset name"); - def->tooltip = L("Related printer preset name"); + def = this->add("preset_names", coStrings); + def->label = L("Printer preset names"); + def->tooltip = L("Names of presets related to the physical printer"); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionString("")); + def->set_default_value(new ConfigOptionStrings()); def = this->add("printhost_authorization_type", coEnum); def->label = L("Authorization Type"); @@ -166,7 +351,14 @@ void PrintConfigDef::init_common_params() def->enum_labels.push_back(L("API key")); def->enum_labels.push_back(L("HTTP digest")); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionEnum<AuthorizationType>(atKeyPassword)); + + // temporary workaround for compatibility with older Slicer + { + def = this->add("preset_name", coString); + def->set_default_value(new ConfigOptionString()); + } } void PrintConfigDef::init_fff_params() @@ -192,6 +384,7 @@ void PrintConfigDef::init_fff_params() "Detour length could be specified either as an absolute value or as percentage (for example 50%) of a direct travel path."); def->sidetext = L("mm or % (zero to disable)"); def->min = 0; + def->max_literal = 1000; def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(0., false)); @@ -298,12 +491,40 @@ void PrintConfigDef::init_fff_params() def = this->add("brim_width", coFloat); def->label = L("Brim width"); - def->tooltip = L("Horizontal width of the brim that will be printed around each object on the first layer."); + def->category = L("Skirt and brim"); + def->tooltip = L("The horizontal width of the brim that will be printed around each object on the first layer. " + "When raft is used, no brim is generated (use raft_first_layer_expansion)."); def->sidetext = L("mm"); def->min = 0; + def->max = 200; def->mode = comSimple; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("brim_type", coEnum); + def->label = L("Brim type"); + def->category = L("Skirt and brim"); + def->tooltip = L("The places where the brim will be printed around each object on the first layer."); + def->enum_keys_map = &ConfigOptionEnum<BrimType>::get_enum_values(); + def->enum_values.emplace_back("no_brim"); + def->enum_values.emplace_back("outer_only"); + def->enum_values.emplace_back("inner_only"); + def->enum_values.emplace_back("outer_and_inner"); + def->enum_labels.emplace_back(L("No brim")); + def->enum_labels.emplace_back(L("Outer brim only")); + def->enum_labels.emplace_back(L("Inner brim only")); + def->enum_labels.emplace_back(L("Outer and inner brim")); + def->mode = comSimple; + def->set_default_value(new ConfigOptionEnum<BrimType>(btOuterOnly)); + + def = this->add("brim_separation", coFloat); + def->label = L("Brim separation gap"); + def->category = L("Skirt and brim"); + def->tooltip = L("Offset of brim from the printed object. The offset is applied after the elephant foot compensation."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.f)); + def = this->add("clip_multipart_objects", coBool); def->label = L("Clip multi-part objects"); def->tooltip = L("When printing multi-material objects, this settings will make Slic3r " @@ -510,6 +731,7 @@ void PrintConfigDef::init_fff_params() "If expressed as percentage (for example 200%), it will be computed over layer height."); def->sidetext = L("mm or %"); def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -543,7 +765,7 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionBool(true)); def = this->add("extruder", coInt); - def->gui_type = "i_enum_open"; + def->gui_type = ConfigOptionDef::GUIType::i_enum_open; def->label = L("Extruder"); def->category = L("Extruders"); def->tooltip = L("The extruder to use (unless more specific extruder settings are specified). " @@ -581,7 +803,7 @@ void PrintConfigDef::init_fff_params() def = this->add("extruder_colour", coStrings); def->label = L("Extruder Color"); def->tooltip = L("This is only used in the Slic3r interface as a visual help."); - def->gui_type = "color"; + def->gui_type = ConfigOptionDef::GUIType::color; // Empty string means no color assigned yet. def->set_default_value(new ConfigOptionStrings { "" }); @@ -621,6 +843,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm or %"); def->min = 0; def->max = 1000; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -643,7 +866,7 @@ void PrintConfigDef::init_fff_params() def = this->add("filament_colour", coStrings); def->label = L("Color"); def->tooltip = L("This is only used in the Slic3r interface as a visual help."); - def->gui_type = "color"; + def->gui_type = ConfigOptionDef::GUIType::color; def->set_default_value(new ConfigOptionStrings { "#29B2B2" }); def = this->add("filament_notes", coStrings); @@ -787,7 +1010,7 @@ void PrintConfigDef::init_fff_params() def = this->add("filament_type", coStrings); def->label = L("Filament type"); def->tooltip = L("The filament material type for use in custom G-codes."); - def->gui_type = "f_enum_open"; + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; def->gui_flags = "show_value"; def->enum_values.push_back("PLA"); def->enum_values.push_back("PET"); @@ -856,7 +1079,7 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionFloat(45)); def = this->add("fill_density", coPercent); - def->gui_type = "f_enum_open"; + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; def->gui_flags = "show_value"; def->label = L("Fill density"); def->category = L("Infill"); @@ -915,6 +1138,9 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("octagramspiral"); def->enum_values.push_back("adaptivecubic"); def->enum_values.push_back("supportcubic"); +#if HAS_LIGHTNING_INFILL + def->enum_values.push_back("lightning"); +#endif // HAS_LIGHTNING_INFILL def->enum_labels.push_back(L("Rectilinear")); def->enum_labels.push_back(L("Aligned Rectilinear")); def->enum_labels.push_back(L("Grid")); @@ -931,6 +1157,9 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Octagram Spiral")); def->enum_labels.push_back(L("Adaptive Cubic")); def->enum_labels.push_back(L("Support Cubic")); +#if HAS_LIGHTNING_INFILL + def->enum_labels.push_back(L("Lightning")); +#endif // HAS_LIGHTNING_INFILL def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipStars)); def = this->add("first_layer_acceleration", coFloat); @@ -942,6 +1171,15 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("first_layer_acceleration_over_raft", coFloat); + def->label = L("First object layer over raft interface"); + def->tooltip = L("This is the acceleration your printer will use for first layer of object above raft interface. Set zero " + "to disable acceleration control for first layer of object above raft interface."); + def->sidetext = L("mm/s²"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("first_layer_bed_temperature", coInts); def->label = L("First layer"); def->full_label = L("First layer bed temperature"); @@ -962,6 +1200,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm or %"); def->ratio_over = "first_layer_height"; def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(200, true)); @@ -969,10 +1208,9 @@ void PrintConfigDef::init_fff_params() def->label = L("First layer height"); def->category = L("Layers and Perimeters"); def->tooltip = L("When printing with very low layer heights, you might still want to print a thicker " - "bottom layer to improve adhesion and tolerance for non perfect build plates. " - "This can be expressed as an absolute value or as a percentage (for example: 150%) " - "over the default layer height."); - def->sidetext = L("mm or %"); + "bottom layer to improve adhesion and tolerance for non perfect build plates."); + def->sidetext = L("mm"); + def->min = 0; def->ratio_over = "layer_height"; def->set_default_value(new ConfigOptionFloatOrPercent(0.35, false)); @@ -983,6 +1221,17 @@ void PrintConfigDef::init_fff_params() "(for example: 40%) it will scale the default speeds."); def->sidetext = L("mm/s or %"); def->min = 0; + def->max_literal = 20; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatOrPercent(30, false)); + + def = this->add("first_layer_speed_over_raft", coFloatOrPercent); + def->label = L("Speed of object first layer over raft interface"); + def->tooltip = L("If expressed as absolute value in mm/s, this speed will be applied to all the print moves " + "of the first object layer above raft interface, regardless of their type. If expressed as a percentage " + "(for example: 40%) it will scale the default speeds."); + def->sidetext = L("mm/s or %"); + def->min = 0; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(30, false)); @@ -1007,6 +1256,48 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionInts { 0 }); + def = this->add("fuzzy_skin", coEnum); + def->label = L("Fuzzy Skin"); + def->category = L("Fuzzy Skin"); + def->tooltip = L("Fuzzy skin type."); + + def->enum_keys_map = &ConfigOptionEnum<FuzzySkinType>::get_enum_values(); + def->enum_values.push_back("none"); + def->enum_values.push_back("external"); + def->enum_values.push_back("all"); + def->enum_labels.push_back(L("None")); + def->enum_labels.push_back(L("Outside walls")); + def->enum_labels.push_back(L("All walls")); + def->mode = comSimple; + def->set_default_value(new ConfigOptionEnum<FuzzySkinType>(FuzzySkinType::None)); + + def = this->add("fuzzy_skin_thickness", coFloat); + def->label = L("Fuzzy skin thickness"); + def->category = L("Fuzzy Skin"); + def->tooltip = L("The maximum distance that each skin point can be offset (both ways), " + "measured perpendicular to the perimeter wall."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.3)); + + def = this->add("fuzzy_skin_point_dist", coFloat); + def->label = L("Fuzzy skin point distance"); + def->category = L("Fuzzy Skin"); + def->tooltip = L("Perimeters will be split into multiple segments by inserting Fuzzy skin points. " + "Lowering the Fuzzy skin point distance will increase the number of randomly offset points on the perimeter wall."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.8)); + + def = this->add("gap_fill_enabled", coBool); + def->label = L("Fill gaps"); + def->category = L("Layers and Perimeters"); + def->tooltip = L("Enables filling of gaps between perimeters and between the inner most perimeters and infill."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("gap_fill_speed", coFloat); def->label = L("Gap fill"); def->category = L("Speed"); @@ -1037,6 +1328,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("teacup"); def->enum_values.push_back("makerware"); def->enum_values.push_back("marlin"); + def->enum_values.push_back("marlin2"); def->enum_values.push_back("sailfish"); def->enum_values.push_back("mach3"); def->enum_values.push_back("machinekit"); @@ -1047,7 +1339,8 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back("Repetier"); def->enum_labels.push_back("Teacup"); def->enum_labels.push_back("MakerWare (MakerBot)"); - def->enum_labels.push_back("Marlin"); + def->enum_labels.push_back("Marlin (legacy)"); + def->enum_labels.push_back("Marlin 2"); def->enum_labels.push_back("Sailfish (MakerBot)"); def->enum_labels.push_back("Mach3/LinuxCNC"); def->enum_labels.push_back("Machinekit"); @@ -1064,6 +1357,12 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(0)); + def = this->add("gcode_substitutions", coStrings); + def->label = L("G-code substitutions"); + def->tooltip = L("Find / replace patterns in G-code lines and substitute them."); + def->mode = comExpert; + def->set_default_value(new ConfigOptionStrings()); + def = this->add("high_current_on_filament_swap", coBool); def->label = L("High extruder current on filament swap"); def->tooltip = L("It may be beneficial to increase the extruder motor current during the filament exchange" @@ -1103,7 +1402,8 @@ void PrintConfigDef::init_fff_params() "Set this parameter to zero to disable anchoring perimeters connected to a single infill line."); def->sidetext = L("mm or %"); def->ratio_over = "infill_extrusion_width"; - def->gui_type = "f_enum_open"; + def->max_literal = 1000; + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; def->enum_values.push_back("0"); def->enum_values.push_back("1"); def->enum_values.push_back("2"); @@ -1111,10 +1411,10 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("10"); def->enum_values.push_back("1000"); def->enum_labels.push_back(L("0 (no open anchors)")); - def->enum_labels.push_back("1 mm"); - def->enum_labels.push_back("2 mm"); - def->enum_labels.push_back("5 mm"); - def->enum_labels.push_back("10 mm"); + def->enum_labels.push_back(L("1 mm")); + def->enum_labels.push_back(L("2 mm")); + def->enum_labels.push_back(L("5 mm")); + def->enum_labels.push_back(L("10 mm")); def->enum_labels.push_back(L("1000 (unlimited)")); def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(600, true)); @@ -1130,13 +1430,14 @@ void PrintConfigDef::init_fff_params() "Set this parameter to zero to disable anchoring."); def->sidetext = def_infill_anchor_min->sidetext; def->ratio_over = def_infill_anchor_min->ratio_over; + def->max_literal = def_infill_anchor_min->max_literal; def->gui_type = def_infill_anchor_min->gui_type; def->enum_values = def_infill_anchor_min->enum_values; def->enum_labels.push_back(L("0 (not anchored)")); - def->enum_labels.push_back("1 mm"); - def->enum_labels.push_back("2 mm"); - def->enum_labels.push_back("5 mm"); - def->enum_labels.push_back("10 mm"); + def->enum_labels.push_back(L("1 mm")); + def->enum_labels.push_back(L("2 mm")); + def->enum_labels.push_back(L("5 mm")); + def->enum_labels.push_back(L("10 mm")); def->enum_labels.push_back(L("1000 (unlimited)")); def->mode = def_infill_anchor_min->mode; def->set_default_value(new ConfigOptionFloatOrPercent(50, false)); @@ -1158,6 +1459,7 @@ void PrintConfigDef::init_fff_params() "If expressed as percentage (for example 90%) it will be computed over layer height."); def->sidetext = L("mm or %"); def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -1220,6 +1522,15 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); + def = this->add("mmu_segmented_region_max_width", coFloat); + def->label = L("Maximum width of a segmented region"); + def->tooltip = L("Maximum width of a segmented region. Zero disables this feature."); + def->sidetext = L("mm (zero to disable)"); + def->min = 0; + def->category = L("Advanced"); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0.f)); + def = this->add("ironing", coBool); def->label = L("Enable ironing"); def->tooltip = L("Enable ironing of the top layers with the hot print head for smooth surface"); @@ -1309,7 +1620,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Use for time estimate")); def->enum_labels.push_back(L("Ignore")); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum<MachineLimitsUsage>(MachineLimitsUsage::EmitToGCode)); + def->set_default_value(new ConfigOptionEnum<MachineLimitsUsage>(MachineLimitsUsage::TimeEstimateOnly)); { struct AxisDefault { @@ -1401,21 +1712,34 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats{ 0., 0. }); - // M204 S... [mm/sec^2] + // M204 P... [mm/sec^2] def = this->add("machine_max_acceleration_extruding", coFloats); def->full_label = L("Maximum acceleration when extruding"); def->category = L("Machine limits"); - def->tooltip = L("Maximum acceleration when extruding (M204 S)"); + def->tooltip = L("Maximum acceleration when extruding (M204 P)\n\n" + "Marlin (legacy) firmware flavor will use this also " + "as travel acceleration (M204 T)."); def->sidetext = L("mm/s²"); def->min = 0; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats{ 1500., 1250. }); - // M204 T... [mm/sec^2] + + // M204 R... [mm/sec^2] def = this->add("machine_max_acceleration_retracting", coFloats); def->full_label = L("Maximum acceleration when retracting"); def->category = L("Machine limits"); - def->tooltip = L("Maximum acceleration when retracting (M204 T)"); + def->tooltip = L("Maximum acceleration when retracting (M204 R)"); + def->sidetext = L("mm/s²"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloats{ 1500., 1250. }); + + // M204 T... [mm/sec^2] + def = this->add("machine_max_acceleration_travel", coFloats); + def->full_label = L("Maximum acceleration for travel moves"); + def->category = L("Machine limits"); + def->tooltip = L("Maximum acceleration for travel moves (M204 T)"); def->sidetext = L("mm/s²"); def->min = 0; def->mode = comAdvanced; @@ -1547,13 +1871,19 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("flashair"); def->enum_values.push_back("astrobox"); def->enum_values.push_back("repetier"); +<<<<<<< HEAD +======= + def->enum_values.push_back("mks"); +>>>>>>> master def->enum_labels.push_back("PrusaLink"); def->enum_labels.push_back("OctoPrint"); def->enum_labels.push_back("Duet"); def->enum_labels.push_back("FlashAir"); def->enum_labels.push_back("AstroBox"); def->enum_labels.push_back("Repetier"); + def->enum_labels.push_back("MKS"); def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionEnum<PrintHostType>(htOctoPrint)); def = this->add("only_retract_when_crossing_perimeters", coBool); @@ -1561,7 +1891,7 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("Disables retraction when the travel path does not exceed the upper layer's perimeters " "(and thus any ooze will be probably invisible)."); def->mode = comExpert; - def->set_default_value(new ConfigOptionBool(true)); + def->set_default_value(new ConfigOptionBool(false)); def = this->add("ooze_prevention", coBool); def->label = L("Enable"); @@ -1634,6 +1964,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm or %"); def->aliases = { "perimeters_extrusion_width" }; def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -1712,6 +2043,43 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionString("")); def->cli = ConfigOptionDef::nocli; + def = this->add("raft_contact_distance", coFloat); + def->label = L("Raft contact Z distance"); + def->category = L("Support material"); + def->tooltip = L("The vertical distance between object and raft. Ignored for soluble interface."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.1)); + + def = this->add("raft_expansion", coFloat); + def->label = L("Raft expansion"); + def->category = L("Support material"); + def->tooltip = L("Expansion of the raft in XY plane for better stability."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.5)); + + def = this->add("raft_first_layer_density", coPercent); + def->label = L("First layer density"); + def->category = L("Support material"); + def->tooltip = L("Density of the first raft or support layer."); + def->sidetext = L("%"); + def->min = 10; + def->max = 100; + def->mode = comExpert; + def->set_default_value(new ConfigOptionPercent(90)); + + def = this->add("raft_first_layer_expansion", coFloat); + def->label = L("First layer expansion"); + def->category = L("Support material"); + def->tooltip = L("Expansion of the first raft or support layer to improve adhesion to print bed."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(3.)); + def = this->add("raft_layers", coInt); def->label = L("Raft layers"); def->category = L("Support material"); @@ -1723,7 +2091,7 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionInt(0)); def = this->add("resolution", coFloat); - def->label = L("Resolution"); + def->label = L("Slice resolution"); def->tooltip = L("Minimum detail resolution, used to simplify the input file for speeding up " "the slicing job and reducing memory usage. High-resolution models often carry " "more detail than printers can render. Set to zero to disable any simplification " @@ -1733,6 +2101,18 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("gcode_resolution", coFloat); + def->label = L("G-code resolution"); + def->tooltip = L("Maximum deviation of exported G-code paths from their full resolution counterparts. " + "Very high resolution G-code requires huge amount of RAM to slice and preview, " + "also a 3D printer may stutter not being able to process a high resolution G-code in a timely manner. " + "On the other hand, a low resolution G-code will produce a low poly effect and because " + "the G-code reduction is performed at each layer independently, visible artifacts may be produced."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0.0125)); + def = this->add("retract_before_travel", coFloats); def->label = L("Minimum travel after retraction"); def->tooltip = L("Retraction is not triggered when travel moves are shorter than this length."); @@ -1850,7 +2230,7 @@ void PrintConfigDef::init_fff_params() #if 0 def = this->add("seam_preferred_direction", coFloat); -// def->gui_type = "slider"; +// def->gui_type = ConfigOptionDef::GUIType::slider; def->label = L("Direction"); def->sidetext = L("°"); def->full_label = L("Preferred direction of the seam"); @@ -1860,7 +2240,7 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionFloat(0)); def = this->add("seam_preferred_direction_jitter", coFloat); -// def->gui_type = "slider"; +// def->gui_type = ConfigOptionDef::GUIType::slider; def->label = L("Jitter"); def->sidetext = L("°"); def->full_label = L("Seam preferred direction jitter"); @@ -1871,27 +2251,34 @@ void PrintConfigDef::init_fff_params() #endif def = this->add("skirt_distance", coFloat); - def->label = L("Distance from object"); - def->tooltip = L("Distance between skirt and object(s). Set this to zero to attach the skirt " - "to the object(s) and get a brim for better adhesion."); + def->label = L("Distance from brim/object"); + def->tooltip = L("Distance between skirt and brim (when draft shield is not used) or objects."); def->sidetext = L("mm"); def->min = 0; def->set_default_value(new ConfigOptionFloat(6)); def = this->add("skirt_height", coInt); def->label = L("Skirt height"); - def->tooltip = L("Height of skirt expressed in layers. Set this to a tall value to use skirt " - "as a shield against drafts."); + def->tooltip = L("Height of skirt expressed in layers."); def->sidetext = L("layers"); def->mode = comAdvanced; def->set_default_value(new ConfigOptionInt(1)); - def = this->add("draft_shield", coBool); + def = this->add("draft_shield", coEnum); def->label = L("Draft shield"); - def->tooltip = L("If enabled, the skirt will be as tall as a highest printed object. " + def->tooltip = L("With draft shield active, the skirt will be printed skirt_distance from the object, possibly intersecting brim.\n" + "Enabled = skirt is as tall as the highest printed object.\n" + "Limited = skirt is as tall as specified by skirt_height.\n" "This is useful to protect an ABS or ASA print from warping and detaching from print bed due to wind draft."); + def->enum_keys_map = &ConfigOptionEnum<DraftShield>::get_enum_values(); + def->enum_values.push_back("disabled"); + def->enum_values.push_back("limited"); + def->enum_values.push_back("enabled"); + def->enum_labels.push_back(L("Disabled")); + def->enum_labels.push_back(L("Limited")); + def->enum_labels.push_back(L("Enabled")); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionBool(false)); + def->set_default_value(new ConfigOptionEnum<DraftShield>(dsDisabled)); def = this->add("skirts", coInt); def->label = L("Loops (minimum)"); @@ -1962,6 +2349,7 @@ void PrintConfigDef::init_fff_params() "If expressed as percentage (for example 90%) it will be computed over layer height."); def->sidetext = L("mm or %"); def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -2090,6 +2478,30 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); + def = this->add("slice_closing_radius", coFloat); + def->label = L("Slice gap closing radius"); + def->category = L("Advanced"); + def->tooltip = L("Cracks smaller than 2x gap closing radius are being filled during the triangle mesh slicing. " + "The gap closing operation may reduce the final print resolution, therefore it is advisable to keep the value reasonably low."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.049)); + + def = this->add("slicing_mode", coEnum); + def->label = L("Slicing Mode"); + def->category = L("Advanced"); + def->tooltip = L("Use \"Even-odd\" for 3DLabPrint airplane models. Use \"Close holes\" to close all holes in the model."); + def->enum_keys_map = &ConfigOptionEnum<SlicingMode>::get_enum_values(); + def->enum_values.push_back("regular"); + def->enum_values.push_back("even_odd"); + def->enum_values.push_back("close_holes"); + def->enum_labels.push_back(L("Regular")); + def->enum_labels.push_back(L("Even-odd")); + def->enum_labels.push_back(L("Close holes")); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum<SlicingMode>(SlicingMode::Regular)); + def = this->add("support_material", coBool); def->label = L("Generate support material"); def->category = L("Support material"); @@ -2112,6 +2524,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm or %"); def->ratio_over = "external_perimeter_extrusion_width"; def->min = 0; + def->max_literal = 10; def->mode = comAdvanced; // Default is half the external perimeter width. def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); @@ -2134,8 +2547,8 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionBool(false)); def = this->add("support_material_contact_distance", coFloat); - def->gui_type = "f_enum_open"; - def->label = L("Contact Z distance"); + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; + def->label = L("Top contact Z distance"); def->category = L("Support material"); def->tooltip = L("The vertical distance between object and support material interface. " "Setting this to 0 will also prevent Slic3r from using bridge flow and speed " @@ -2143,12 +2556,32 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm"); // def->min = 0; def->enum_values.push_back("0"); + def->enum_values.push_back("0.1"); def->enum_values.push_back("0.2"); def->enum_labels.push_back(L("0 (soluble)")); + def->enum_labels.push_back(L("0.1 (detachable)")); def->enum_labels.push_back(L("0.2 (detachable)")); def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.2)); + def = this->add("support_material_bottom_contact_distance", coFloat); + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; + def->label = L("Bottom contact Z distance"); + def->category = L("Support material"); + def->tooltip = L("The vertical distance between the object top surface and the support material interface. " + "If set to zero, support_material_contact_distance will be used for both top and bottom contact Z distances."); + def->sidetext = L("mm"); +// def->min = 0; + def->enum_values.push_back("0"); + def->enum_values.push_back("0.1"); + def->enum_values.push_back("0.2"); + //TRN To be shown in Print Settings "Bottom contact Z distance". Have to be as short as possible + def->enum_labels.push_back(L("Same as top")); + def->enum_labels.push_back("0.1"); + def->enum_labels.push_back("0.2"); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("support_material_enforce_layers", coInt); def->label = L("Enforce support for the first"); def->category = L("Support material"); @@ -2179,6 +2612,7 @@ void PrintConfigDef::init_fff_params() "If expressed as percentage (for example 90%) it will be computed over layer height."); def->sidetext = L("mm or %"); def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -2198,15 +2632,50 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionInt(1)); - def = this->add("support_material_interface_layers", coInt); - def->label = L("Interface layers"); + auto support_material_interface_layers = def = this->add("support_material_interface_layers", coInt); + def->gui_type = ConfigOptionDef::GUIType::i_enum_open; + def->label = L("Top interface layers"); def->category = L("Support material"); def->tooltip = L("Number of interface layers to insert between the object(s) and support material."); def->sidetext = L("layers"); def->min = 0; + def->enum_values.push_back("0"); + def->enum_values.push_back("1"); + def->enum_values.push_back("2"); + def->enum_values.push_back("3"); + def->enum_labels.push_back(L("0 (off)")); + def->enum_labels.push_back(L("1 (light)")); + def->enum_labels.push_back(L("2 (default)")); + def->enum_labels.push_back(L("3 (heavy)")); def->mode = comAdvanced; def->set_default_value(new ConfigOptionInt(3)); + def = this->add("support_material_bottom_interface_layers", coInt); + def->gui_type = ConfigOptionDef::GUIType::i_enum_open; + def->label = L("Bottom interface layers"); + def->category = L("Support material"); + def->tooltip = L("Number of interface layers to insert between the object(s) and support material. " + "Set to -1 to use support_material_interface_layers"); + def->sidetext = L("layers"); + def->min = -1; + def->enum_values.push_back("-1"); + append(def->enum_values, support_material_interface_layers->enum_values); + //TRN To be shown in Print Settings "Bottom interface layers". Have to be as short as possible + def->enum_labels.push_back(L("Same as top")); + append(def->enum_labels, support_material_interface_layers->enum_labels); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionInt(-1)); + + def = this->add("support_material_closing_radius", coFloat); + def->label = L("Closing radius"); + def->category = L("Support material"); + def->tooltip = L("For snug supports, the support regions will be merged using morphological closing operation." + " Gaps smaller than the closing radius will be filled in."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(2)); + def = this->add("support_material_interface_spacing", coFloat); def->label = L("Interface pattern spacing"); def->category = L("Support material"); @@ -2241,6 +2710,22 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionEnum<SupportMaterialPattern>(smpRectilinear)); + def = this->add("support_material_interface_pattern", coEnum); + def->label = L("Interface pattern"); + def->category = L("Support material"); + def->tooltip = L("Pattern used to generate support material interface. " + "Default pattern for non-soluble support interface is Rectilinear, " + "while default pattern for soluble support interface is Concentric."); + def->enum_keys_map = &ConfigOptionEnum<SupportMaterialInterfacePattern>::get_enum_values(); + def->enum_values.push_back("auto"); + def->enum_values.push_back("rectilinear"); + def->enum_values.push_back("concentric"); + def->enum_labels.push_back(L("Default")); + def->enum_labels.push_back(L("Rectilinear")); + def->enum_labels.push_back(L("Concentric")); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum<SupportMaterialInterfacePattern>(smipRectilinear)); + def = this->add("support_material_spacing", coFloat); def->label = L("Pattern spacing"); def->category = L("Support material"); @@ -2259,6 +2744,20 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(60)); + def = this->add("support_material_style", coEnum); + def->label = L("Style"); + def->category = L("Support material"); + def->tooltip = L("Style and shape of the support towers. Projecting the supports into a regular grid " + "will create more stable supports, while snug support towers will save material and reduce " + "object scarring."); + def->enum_keys_map = &ConfigOptionEnum<SupportMaterialStyle>::get_enum_values(); + def->enum_values.push_back("grid"); + def->enum_values.push_back("snug"); + def->enum_labels.push_back(L("Grid")); + def->enum_labels.push_back(L("Snug")); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum<SupportMaterialStyle>(smsGrid)); + def = this->add("support_material_synchronize_layers", coBool); def->label = L("Synchronize with object layers"); def->category = L("Support material"); @@ -2299,6 +2798,14 @@ void PrintConfigDef::init_fff_params() def->max = max_temp; def->set_default_value(new ConfigOptionInts { 200 }); + def = this->add("thick_bridges", coBool); + def->label = L("Thick bridges"); + def->category = L("Layers and Perimeters"); + def->tooltip = L("If enabled, bridges are more reliable, can bridge longer distances, but may look worse. " + "If disabled, bridges look better but are reliable just for shorter bridged distances."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("thin_walls", coBool); def->label = L("Detect thin walls"); def->category = L("Layers and Perimeters"); @@ -2322,7 +2829,7 @@ void PrintConfigDef::init_fff_params() def = this->add("toolchange_gcode", coString); def->label = L("Tool change G-code"); def->tooltip = L("This custom code is inserted before every toolchange. Placeholder variables for all PrusaSlicer settings " - "as well as {previous_extruder} and {next_extruder} can be used. When a tool-changing command " + "as well as {toolchange_z}, {previous_extruder} and {next_extruder} can be used. When a tool-changing command " "which changes to the correct extruder is included (such as T{next_extruder}), PrusaSlicer will emit no other such command. " "It is therefore possible to script custom behaviour both before and after the toolchange."); def->multiline = true; @@ -2340,6 +2847,7 @@ void PrintConfigDef::init_fff_params() "If expressed as percentage (for example 90%) it will be computed over layer height."); def->sidetext = L("mm or %"); def->min = 0; + def->max_literal = 50; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); @@ -2387,6 +2895,15 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(130)); + def = this->add("travel_speed_z", coFloat); + def->label = L("Z travel"); + def->tooltip = L("Speed for movements along the Z axis.\nWhen set to zero, the value " + "is ignored and regular travel speed is used instead."); + def->sidetext = L("mm/s"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("use_firmware_retraction", coBool); def->label = L("Use firmware retraction"); def->tooltip = L("This experimental setting uses G10 and G11 commands to have the firmware " @@ -2478,10 +2995,18 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("wipe_tower_brim_width", coFloat); + def->label = L("Wipe tower brim width"); + def->tooltip = L("Wipe tower brim width"); + def->sidetext = L("mm"); + def->mode = comAdvanced; + def->min = 0.f; + def->set_default_value(new ConfigOptionFloat(2.)); + def = this->add("wipe_into_infill", coBool); def->category = L("Wipe options"); def->label = L("Wipe into this object's infill"); - def->tooltip = L("Purging after toolchange will done inside this object's infills. " + def->tooltip = L("Purging after toolchange will be done inside this object's infills. " "This lowers the amount of waste but may result in longer print time " " due to additional travel moves."); def->set_default_value(new ConfigOptionBool(false)); @@ -2663,7 +3188,31 @@ void PrintConfigDef::init_sla_params() def->tooltip = L("Printer scaling correction"); def->min = 0; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats( { 1., 1. } )); + def->set_default_value(new ConfigOptionFloats( { 1., 1.} )); + + def = this->add("relative_correction_x", coFloat); + def->label = L("Printer scaling correction in X axis"); + def->full_label = L("Printer scaling X axis correction"); + def->tooltip = L("Printer scaling correction in X axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); + + def = this->add("relative_correction_y", coFloat); + def->label = L("Printer scaling correction in Y axis"); + def->full_label = L("Printer scaling Y axis correction"); + def->tooltip = L("Printer scaling correction in Y axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); + + def = this->add("relative_correction_z", coFloat); + def->label = L("Printer scaling correction in Z axis"); + def->full_label = L("Printer scaling Z axis correction"); + def->tooltip = L("Printer scaling correction in Z axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); def = this->add("absolute_correction", coFloat); def->label = L("Printer absolute correction"); @@ -2696,10 +3245,17 @@ void PrintConfigDef::init_sla_params() // SLA Material settings. + + def = this->add("material_colour", coString); + def->label = L("Color"); + def->tooltip = L("This is only used in the Slic3r interface as a visual help."); + def->gui_type = ConfigOptionDef::GUIType::color; + def->set_default_value(new ConfigOptionString("#29B2B2")); + def = this->add("material_type", coString); def->label = L("SLA material type"); def->tooltip = L("SLA material type"); - def->gui_type = "f_enum_open"; // TODO: ??? + def->gui_type = ConfigOptionDef::GUIType::f_enum_open; // TODO: ??? def->gui_flags = "show_value"; def->enum_values.push_back("Tough"); def->enum_values.push_back("Flexible"); @@ -2802,7 +3358,28 @@ void PrintConfigDef::init_sla_params() def->tooltip = L("Correction for expansion"); def->min = 0; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats( { 1. , 1. } )); + def->set_default_value(new ConfigOptionFloats( { 1., 1., 1. } )); + + def = this->add("material_correction_x", coFloat); + def->full_label = L("Correction for expansion in X axis"); + def->tooltip = L("Correction for expansion in X axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); + + def = this->add("material_correction_y", coFloat); + def->full_label = L("Correction for expansion in Y axis"); + def->tooltip = L("Correction for expansion in Y axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); + + def = this->add("material_correction_z", coFloat); + def->full_label = L("Correction for expansion in Z axis"); + def->tooltip = L("Correction for expansion in Z axis"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(1.)); def = this->add("material_notes", coString); def->label = L("SLA print material notes"); @@ -3195,6 +3772,19 @@ void PrintConfigDef::init_sla_params() def->max = 10; def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(2.0)); + + def = this->add("material_print_speed", coEnum); + def->label = L("Print speed"); + def->tooltip = L( + "A slower printing profile might be necessary when using materials with higher viscosity " + "or with some hollowed parts. It slows down the tilt movement and adds a delay before exposure."); + def->enum_keys_map = &ConfigOptionEnum<SLAMaterialSpeed>::get_enum_values(); + def->enum_values.push_back("slow"); + def->enum_values.push_back("fast"); + def->enum_labels.push_back(L("Slow")); + def->enum_labels.push_back(L("Fast")); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum<SLAMaterialSpeed>(slamsFast)); } void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &value) @@ -3211,8 +3801,12 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } catch (boost::bad_lexical_cast &) { value = "0"; } - } else if (opt_key == "gcode_flavor" && value == "makerbot") { - value = "makerware"; + } else if (opt_key == "gcode_flavor") { + if (value == "makerbot") + value = "makerware"; + else if (value == "marlinfirmware") + // the "new" marlin firmware flavor used to be called "marlinfirmware" for some time during PrusaSlicer 2.4.0-alpha development. + value = "marlin2"; } else if (opt_key == "fill_density" && value.find("%") == std::string::npos) { try { // fill_density was turned into a percent value @@ -3241,16 +3835,30 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va value = "rectilinear"; } else if (opt_key == "skirt_height" && value == "-1") { // PrusaSlicer no more accepts skirt_height == -1 to print a draft shield to the top of the highest object. - // A new "draft_shield" boolean config value is used instead. + // A new "draft_shield" enum config value is used instead. opt_key = "draft_shield"; - value = "1"; + value = "enabled"; + } else if (opt_key == "draft_shield" && (value == "1" || value == "0")) { + // draft_shield used to be a bool, it was turned into an enum in PrusaSlicer 2.4.0. + value = value == "1" ? "enabled" : "disabled"; } else if (opt_key == "octoprint_host") { opt_key = "print_host"; } else if (opt_key == "octoprint_cafile") { opt_key = "printhost_cafile"; } else if (opt_key == "octoprint_apikey") { opt_key = "printhost_apikey"; - } + } else if (opt_key == "preset_name") { + opt_key = "preset_names"; + } /*else if (opt_key == "material_correction" || opt_key == "relative_correction") { + ConfigOptionFloats p; + p.deserialize(value); + + if (p.values.size() < 3) { + double firstval = p.values.front(); + p.values.emplace(p.values.begin(), firstval); + value = p.serialize(); + } + }*/ // Ignore the following obsolete configuration keys: static std::set<std::string> ignore = { @@ -3263,7 +3871,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va #ifndef HAS_PRESSURE_EQUALIZER , "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", #endif /* HAS_PRESSURE_EQUALIZER */ - "serial_port", "serial_speed" + "serial_port", "serial_speed", + // Introduced in some PrusaSlicer 2.3.1 alpha, later renamed or removed. + "fuzzy_skin_perimeter_mode", "fuzzy_skin_shape", }; // In PrusaSlicer 2.3.0-alpha0 the "monotonous" infill was introduced, which was later renamed to "monotonic". @@ -3301,15 +3911,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) ? @@ -3320,21 +3935,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")) { @@ -3373,6 +3973,32 @@ void DynamicPrintConfig::normalize_fdm() this->opt<ConfigOptionPercent>("fill_density", true)->value = 0; } } + + if (auto *opt_gcode_resolution = this->opt<ConfigOptionFloat>("gcode_resolution", false); opt_gcode_resolution) + // Resolution will be above 1um. + opt_gcode_resolution->value = std::max(opt_gcode_resolution->value, 0.001); +} + +void handle_legacy_sla(DynamicPrintConfig &config) +{ + for (std::string corr : {"relative_correction", "material_correction"}) { + if (config.has(corr)) { + if (std::string corr_x = corr + "_x"; !config.has(corr_x)) { + auto* opt = config.opt<ConfigOptionFloat>(corr_x, true); + opt->value = config.opt<ConfigOptionFloats>(corr)->values[0]; + } + + if (std::string corr_y = corr + "_y"; !config.has(corr_y)) { + auto* opt = config.opt<ConfigOptionFloat>(corr_y, true); + opt->value = config.opt<ConfigOptionFloats>(corr)->values[0]; + } + + if (std::string corr_z = corr + "_z"; !config.has(corr_z)) { + auto* opt = config.opt<ConfigOptionFloat>(corr_z, true); + opt->value = config.opt<ConfigOptionFloats>(corr)->values[1]; + } + } + } } void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders) @@ -3402,7 +4028,7 @@ std::string DynamicPrintConfig::validate() FullPrintConfig fpc; fpc.apply(*this, true); // Verify this print options through the FullPrintConfig. - return fpc.validate(); + return Slic3r::validate(fpc); } default: //FIXME no validation on SLA data? @@ -3411,134 +4037,141 @@ std::string DynamicPrintConfig::validate() } //FIXME localize this function. -std::string FullPrintConfig::validate() +std::string validate(const FullPrintConfig &cfg) { // --layer-height - if (this->get_abs_value("layer_height") <= 0) + if (cfg.get_abs_value("layer_height") <= 0) return "Invalid value for --layer-height"; - if (fabs(fmod(this->get_abs_value("layer_height"), SCALING_FACTOR)) > 1e-4) + if (fabs(fmod(cfg.get_abs_value("layer_height"), SCALING_FACTOR)) > 1e-4) return "--layer-height must be a multiple of print resolution"; // --first-layer-height - if (this->get_abs_value("first_layer_height") <= 0) + if (cfg.first_layer_height.value <= 0) return "Invalid value for --first-layer-height"; // --filament-diameter - for (double fd : this->filament_diameter.values) + for (double fd : cfg.filament_diameter.values) if (fd < 1) return "Invalid value for --filament-diameter"; // --nozzle-diameter - for (double nd : this->nozzle_diameter.values) + for (double nd : cfg.nozzle_diameter.values) if (nd < 0.005) return "Invalid value for --nozzle-diameter"; // --perimeters - if (this->perimeters.value < 0) + if (cfg.perimeters.value < 0) return "Invalid value for --perimeters"; // --solid-layers - if (this->top_solid_layers < 0) + if (cfg.top_solid_layers < 0) return "Invalid value for --top-solid-layers"; - if (this->bottom_solid_layers < 0) + if (cfg.bottom_solid_layers < 0) return "Invalid value for --bottom-solid-layers"; - if (this->use_firmware_retraction.value && - this->gcode_flavor.value != gcfSmoothie && - this->gcode_flavor.value != gcfRepRapSprinter && - this->gcode_flavor.value != gcfRepRapFirmware && - this->gcode_flavor.value != gcfMarlin && - this->gcode_flavor.value != gcfMachinekit && - this->gcode_flavor.value != gcfRepetier) + if (cfg.use_firmware_retraction.value && + cfg.gcode_flavor.value != gcfSmoothie && + cfg.gcode_flavor.value != gcfRepRapSprinter && + cfg.gcode_flavor.value != gcfRepRapFirmware && + cfg.gcode_flavor.value != gcfMarlinLegacy && + cfg.gcode_flavor.value != gcfMarlinFirmware && + cfg.gcode_flavor.value != gcfMachinekit && + cfg.gcode_flavor.value != gcfRepetier) return "--use-firmware-retraction is only supported by Marlin, Smoothie, RepRapFirmware, Repetier and Machinekit firmware"; - if (this->use_firmware_retraction.value) - for (unsigned char wipe : this->wipe.values) + if (cfg.use_firmware_retraction.value) + for (unsigned char wipe : cfg.wipe.values) if (wipe) return "--use-firmware-retraction is not compatible with --wipe"; // --gcode-flavor - if (! print_config_def.get("gcode_flavor")->has_enum_value(this->gcode_flavor.serialize())) + if (! print_config_def.get("gcode_flavor")->has_enum_value(cfg.gcode_flavor.serialize())) return "Invalid value for --gcode-flavor"; // --fill-pattern - if (! print_config_def.get("fill_pattern")->has_enum_value(this->fill_pattern.serialize())) + if (! print_config_def.get("fill_pattern")->has_enum_value(cfg.fill_pattern.serialize())) return "Invalid value for --fill-pattern"; // --top-fill-pattern - if (! print_config_def.get("top_fill_pattern")->has_enum_value(this->top_fill_pattern.serialize())) + if (! print_config_def.get("top_fill_pattern")->has_enum_value(cfg.top_fill_pattern.serialize())) return "Invalid value for --top-fill-pattern"; // --bottom-fill-pattern - if (! print_config_def.get("bottom_fill_pattern")->has_enum_value(this->bottom_fill_pattern.serialize())) + if (! print_config_def.get("bottom_fill_pattern")->has_enum_value(cfg.bottom_fill_pattern.serialize())) return "Invalid value for --bottom-fill-pattern"; // --fill-density - if (fabs(this->fill_density.value - 100.) < EPSILON && - ! print_config_def.get("top_fill_pattern")->has_enum_value(this->fill_pattern.serialize())) + if (fabs(cfg.fill_density.value - 100.) < EPSILON && + ! print_config_def.get("top_fill_pattern")->has_enum_value(cfg.fill_pattern.serialize())) return "The selected fill pattern is not supposed to work at 100% density"; // --infill-every-layers - if (this->infill_every_layers < 1) + if (cfg.infill_every_layers < 1) return "Invalid value for --infill-every-layers"; // --skirt-height - if (this->skirt_height < 0) + if (cfg.skirt_height < 0) return "Invalid value for --skirt-height"; // --bridge-flow-ratio - if (this->bridge_flow_ratio <= 0) + if (cfg.bridge_flow_ratio <= 0) return "Invalid value for --bridge-flow-ratio"; // extruder clearance - if (this->extruder_clearance_radius <= 0) + if (cfg.extruder_clearance_radius <= 0) return "Invalid value for --extruder-clearance-radius"; - if (this->extruder_clearance_height <= 0) + if (cfg.extruder_clearance_height <= 0) return "Invalid value for --extruder-clearance-height"; // --extrusion-multiplier - for (double em : this->extrusion_multiplier.values) + for (double em : cfg.extrusion_multiplier.values) if (em <= 0) return "Invalid value for --extrusion-multiplier"; + // The following test was commented out after 482841b, see also https://github.com/prusa3d/PrusaSlicer/pull/6743. + // The backend should now handle this case correctly. I.e., zero default_acceleration behaves as if all others + // were zero too. This is now consistent with what the UI said would happen. + // The UI already grays the fields out, there is no more reason to reject it here. This function validates the + // config before exporting, leaving this check in would mean that config would be rejected before export + // (although both the UI and the backend handle it). // --default-acceleration - if ((this->perimeter_acceleration != 0. || this->infill_acceleration != 0. || this->bridge_acceleration != 0. || this->first_layer_acceleration != 0.) && - this->default_acceleration == 0.) - return "Invalid zero value for --default-acceleration when using other acceleration settings"; + //if ((cfg.perimeter_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.first_layer_acceleration != 0.) && + // cfg.default_acceleration == 0.) + // return "Invalid zero value for --default-acceleration when using other acceleration settings"; // --spiral-vase - if (this->spiral_vase) { + if (cfg.spiral_vase) { // Note that we might want to have more than one perimeter on the bottom // solid layers. - if (this->perimeters > 1) + if (cfg.perimeters > 1) return "Can't make more than one perimeter when spiral vase mode is enabled"; - else if (this->perimeters < 1) + else if (cfg.perimeters < 1) return "Can't make less than one perimeter when spiral vase mode is enabled"; - if (this->fill_density > 0) + if (cfg.fill_density > 0) return "Spiral vase mode can only print hollow objects, so you need to set Fill density to 0"; - if (this->top_solid_layers > 0) + if (cfg.top_solid_layers > 0) return "Spiral vase mode is not compatible with top solid layers"; - if (this->support_material || this->support_material_enforce_layers > 0) + if (cfg.support_material || cfg.support_material_enforce_layers > 0) return "Spiral vase mode is not compatible with support material"; } // extrusion widths { double max_nozzle_diameter = 0.; - for (double dmr : this->nozzle_diameter.values) + for (double dmr : cfg.nozzle_diameter.values) max_nozzle_diameter = std::max(max_nozzle_diameter, dmr); const char *widths[] = { "external_perimeter", "perimeter", "infill", "solid_infill", "top_infill", "support_material", "first_layer" }; for (size_t i = 0; i < sizeof(widths) / sizeof(widths[i]); ++ i) { std::string key(widths[i]); key += "_extrusion_width"; - if (this->get_abs_value(key, max_nozzle_diameter) > 10. * max_nozzle_diameter) + if (cfg.get_abs_value(key, max_nozzle_diameter) > 10. * max_nozzle_diameter) return std::string("Invalid extrusion width (too large): ") + key; } } // Out of range validation of numeric values. - for (const std::string &opt_key : this->keys()) { - const ConfigOption *opt = this->optptr(opt_key); + for (const std::string &opt_key : cfg.keys()) { + const ConfigOption *opt = cfg.optptr(opt_key); assert(opt != nullptr); const ConfigOptionDef *optdef = print_config_def.get(opt_key); assert(optdef != nullptr); @@ -3583,19 +4216,21 @@ std::string FullPrintConfig::validate() return ""; } -// Declare the static caches for each StaticPrintConfig derived class. -StaticPrintConfig::StaticCache<class Slic3r::PrintObjectConfig> PrintObjectConfig::s_cache_PrintObjectConfig; -StaticPrintConfig::StaticCache<class Slic3r::PrintRegionConfig> PrintRegionConfig::s_cache_PrintRegionConfig; -StaticPrintConfig::StaticCache<class Slic3r::MachineEnvelopeConfig> MachineEnvelopeConfig::s_cache_MachineEnvelopeConfig; -StaticPrintConfig::StaticCache<class Slic3r::GCodeConfig> GCodeConfig::s_cache_GCodeConfig; -StaticPrintConfig::StaticCache<class Slic3r::PrintConfig> PrintConfig::s_cache_PrintConfig; -StaticPrintConfig::StaticCache<class Slic3r::FullPrintConfig> FullPrintConfig::s_cache_FullPrintConfig; - -StaticPrintConfig::StaticCache<class Slic3r::SLAMaterialConfig> SLAMaterialConfig::s_cache_SLAMaterialConfig; -StaticPrintConfig::StaticCache<class Slic3r::SLAPrintConfig> SLAPrintConfig::s_cache_SLAPrintConfig; -StaticPrintConfig::StaticCache<class Slic3r::SLAPrintObjectConfig> SLAPrintObjectConfig::s_cache_SLAPrintObjectConfig; -StaticPrintConfig::StaticCache<class Slic3r::SLAPrinterConfig> SLAPrinterConfig::s_cache_SLAPrinterConfig; -StaticPrintConfig::StaticCache<class Slic3r::SLAFullPrintConfig> SLAFullPrintConfig::s_cache_SLAFullPrintConfig; +// Declare and initialize static caches of StaticPrintConfig derived classes. +#define PRINT_CONFIG_CACHE_ELEMENT_DEFINITION(r, data, CLASS_NAME) StaticPrintConfig::StaticCache<class Slic3r::CLASS_NAME> BOOST_PP_CAT(CLASS_NAME::s_cache_, CLASS_NAME); +#define PRINT_CONFIG_CACHE_ELEMENT_INITIALIZATION(r, data, CLASS_NAME) Slic3r::CLASS_NAME::initialize_cache(); +#define PRINT_CONFIG_CACHE_INITIALIZE(CLASSES_SEQ) \ + BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CACHE_ELEMENT_DEFINITION, _, BOOST_PP_TUPLE_TO_SEQ(CLASSES_SEQ)) \ + int print_config_static_initializer() { \ + /* Putting a trace here to avoid the compiler to optimize out this function. */ \ + BOOST_LOG_TRIVIAL(trace) << "Initializing StaticPrintConfigs"; \ + BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CACHE_ELEMENT_INITIALIZATION, _, BOOST_PP_TUPLE_TO_SEQ(CLASSES_SEQ)) \ + return 1; \ + } +PRINT_CONFIG_CACHE_INITIALIZE(( + PrintObjectConfig, PrintRegionConfig, MachineEnvelopeConfig, GCodeConfig, PrintConfig, FullPrintConfig, + SLAMaterialConfig, SLAPrintConfig, SLAPrintObjectConfig, SLAPrinterConfig, SLAFullPrintConfig)) +static int print_config_static_initialized = print_config_static_initializer(); CLIActionsConfigDef::CLIActionsConfigDef() { @@ -3721,6 +4356,11 @@ CLITransformConfigDef::CLITransformConfigDef() def->label = L("Don't arrange"); def->tooltip = L("Do not rearrange the given models before merging and keep their original XY coordinates."); + def = this->add("ensure_on_bed", coBool); + def->label = L("Ensure on bed"); + def->tooltip = L("Lift the object above the bed when it is partially below. Enabled by default, use --no-ensure-on-bed to disable."); + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("duplicate", coInt); def->label = L("Duplicate"); def->tooltip =L("Multiply copies by this factor."); @@ -3791,6 +4431,20 @@ CLIMiscConfigDef::CLIMiscConfigDef() def->enum_labels.push_back("Enable reading unknown configuration values by silently substituting them with defaults."); def->set_default_value(new ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>(ForwardCompatibilitySubstitutionRule::Enable)); + def = this->add("config_compatibility", coEnum); + def->label = L("Forward-compatibility rule when loading configurations from config files and project files (3MF, AMF)."); + def->tooltip = L("This version of PrusaSlicer may not understand configurations produced by the newest PrusaSlicer versions. " + "For example, newer PrusaSlicer may extend the list of supported firmware flavors. One may decide to " + "bail out or to substitute an unknown value with a default silently or verbosely."); + def->enum_keys_map = &ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>::get_enum_values(); + def->enum_values.push_back("disable"); + def->enum_values.push_back("enable"); + def->enum_values.push_back("enable_silent"); + def->enum_labels.push_back(L("Bail out on unknown configuration values")); + def->enum_labels.push_back(L("Enable reading unknown configuration values by verbosely substituting them with defaults.")); + def->enum_labels.push_back(L("Enable reading unknown configuration values by silently substituting them with defaults.")); + def->set_default_value(new ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>(ForwardCompatibilitySubstitutionRule::Enable)); + def = this->add("load", coStrings); def->label = "Load config file"; def->tooltip = "Load configuration from the specified file. It can be used more than once to load options from multiple files."; |