Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
YuSanka 2021-12-23 18:31:32 +01:00
commit 2458c4339b
45 changed files with 105161 additions and 126304 deletions

View File

@ -13,6 +13,8 @@ This guide describes building PrusaSlicer statically against dependencies pulled
#### 0. Prerequisities
You need at least 8GB of RAM on your system. Linking on a 4GB RAM system will likely fail and you may need to limit the number of compiler processes with the '-j xxx' make or ninja parameter, where 'xxx' is the number of compiler processes launched if running on low RAM multi core system, for example on Raspberry PI.
GNU build tools, CMake, git and other libraries have to be installed on the build machine.
Unless that's already the case, install them as usual from your distribution packages.
E.g. on Ubuntu 20.10, run
@ -87,6 +89,7 @@ And that's it. It is now possible to run the freshly built PrusaSlicer binary:
- `-DSLIC3R_STATIC=ON` for static build (defaults to `OFF`)
- `-DSLIC3R_WX_STABLE=ON` to look for wxWidgets 3.0 (defaults to `OFF`)
- `-DCMAKE_BUILD_TYPE=Debug` to build in debug mode (defaults to `Release`)
- `-DSLIC3R_GUI=no` to build the console variant of PrusaSlicer
See the CMake files to get the complete list.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -450,7 +450,6 @@ msgid "First layer height"
msgstr "Laagdikte eerste laag"
#: src/slic3r/GUI/ConfigManipulation.cpp:82
#, fuzzy, c-format, boost-format
msgid ""
"The Spiral Vase mode requires:\n"
"- one perimeter\n"
@ -11363,7 +11362,6 @@ msgid "Extra perimeters if needed"
msgstr "Extra perimeters indien nodig"
#: src/libslic3r/PrintConfig.cpp:761
#, fuzzy, c-format, boost-format
msgid ""
"Add more perimeters when needed for avoiding gaps in sloping walls. Slic3r "
"keeps adding perimeters, until more than 70% of the loop immediately above "
@ -12546,7 +12544,6 @@ msgid "This setting represents the maximum speed of your fan."
msgstr "Deze instelling gaat over de maximale snelheid van uw ventilator."
#: src/libslic3r/PrintConfig.cpp:1753
#, fuzzy, c-format, boost-format
msgid ""
"This is the highest printable layer height for this extruder, used to cap "
"the variable layer height and support layer height. Maximum recommended "

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -10736,7 +10736,6 @@ msgid "Extra perimeters if needed"
msgstr "Gerekirse fazladan duvar ekle"
#: src/libslic3r/PrintConfig.cpp:761
#, fuzzy, c-format, boost-format
msgid ""
"Add more perimeters when needed for avoiding gaps in sloping walls. Slic3r "
"keeps adding perimeters, until more than 70% of the loop immediately above "
@ -11853,7 +11852,6 @@ msgid "This setting represents the maximum speed of your fan."
msgstr "Bu ayar, fanınızın en fazla hızını gösterir."
#: src/libslic3r/PrintConfig.cpp:1753
#, fuzzy, c-format, boost-format
msgid ""
"This is the highest printable layer height for this extruder, used to cap "
"the variable layer height and support layer height. Maximum recommended "

View File

@ -440,7 +440,6 @@ msgid "First layer height"
msgstr "Висота першого шару"
#: src/slic3r/GUI/ConfigManipulation.cpp:82
#, fuzzy, c-format, boost-format
msgid ""
"The Spiral Vase mode requires:\n"
"- one perimeter\n"
@ -11111,7 +11110,6 @@ msgid "Extra perimeters if needed"
msgstr "Додаткові периметри, якщо необхідно"
#: src/libslic3r/PrintConfig.cpp:761
#, fuzzy, c-format, boost-format
msgid ""
"Add more perimeters when needed for avoiding gaps in sloping walls. Slic3r "
"keeps adding perimeters, until more than 70% of the loop immediately above "
@ -12272,7 +12270,6 @@ msgid "This setting represents the maximum speed of your fan."
msgstr "Цей параметр відображає максимальну швидкість вашого вентилятора."
#: src/libslic3r/PrintConfig.cpp:1753
#, fuzzy, c-format, boost-format
msgid ""
"This is the highest printable layer height for this extruder, used to cap "
"the variable layer height and support layer height. Maximum recommended "

View File

@ -10592,7 +10592,6 @@ msgid "Extra perimeters if needed"
msgstr "如果需要,打印额外轮廓"
#: src/libslic3r/PrintConfig.cpp:761
#, fuzzy, c-format, boost-format
msgid ""
"Add more perimeters when needed for avoiding gaps in sloping walls. Slic3r "
"keeps adding perimeters, until more than 70% of the loop immediately above "
@ -11653,7 +11652,6 @@ msgid "This setting represents the maximum speed of your fan."
msgstr "此设置表示风扇的最大速度。"
#: src/libslic3r/PrintConfig.cpp:1753
#, fuzzy, c-format, boost-format
msgid ""
"This is the highest printable layer height for this extruder, used to cap "
"the variable layer height and support layer height. Maximum recommended "

View File

@ -10533,7 +10533,6 @@ msgid "Extra perimeters if needed"
msgstr "如果需要的話,擴展外圍輪廓"
#: src/libslic3r/PrintConfig.cpp:761
#, fuzzy, c-format, boost-format
msgid ""
"Add more perimeters when needed for avoiding gaps in sloping walls. Slic3r "
"keeps adding perimeters, until more than 70% of the loop immediately above "
@ -11587,7 +11586,6 @@ msgid "This setting represents the maximum speed of your fan."
msgstr "該值表示風扇的最大速度。"
#: src/libslic3r/PrintConfig.cpp:1753
#, fuzzy, c-format, boost-format
msgid ""
"This is the highest printable layer height for this extruder, used to cap "
"the variable layer height and support layer height. Maximum recommended "

View File

@ -1,4 +1,5 @@
min_slic3r_version = 2.4.0-rc
0.1.3 Ender-3 S1 improvements.
0.1.2 Added alpha Ender 3 S1 profiles.
min_slic3r_version = 2.4.0-beta4
0.1.1 Added Ender 2 Pro

View File

@ -5,7 +5,7 @@
name = Creality
# Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the PrusaSlicer configuration to be downgraded.
config_version = 0.1.2
config_version = 0.1.3
# Where to get the updates from?
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Creality/
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
@ -914,6 +914,13 @@ pause_print_gcode = M25 ; pause print
[printer:*descendingz*]
end_gcode = {if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F600{endif} ; Move print bed down\nG1 X50 Y50 F{travel_speed*60} ; move print head out of the way\n{if max_layer_z < max_print_height-10}G1 Z{z_offset+max_print_height-10} F600{endif} ; Move print bed close to the bottom\nM140 S0 ; turn off heatbed\nM104 S0 ; turn off temperature\nM107 ; turn off fan\nM84 X Y E ; disable motors
[printer:*spriteextruder*]
retract_length = 0.8
retract_speed = 30
deretract_speed = 30
retract_before_travel = 1
retract_before_wipe = 0%
# Intended for printers with dual extruders and a single hotend/nozzle, like the CR-X series
[printer:*dualextruder*]
single_extruder_multi_material = 1
@ -962,8 +969,7 @@ printer_model = ENDER3V2
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3V2\nPRINTER_HAS_BOWDEN
[printer:Creality Ender-3 S1]
inherits = *common*; *fastabl*
retract_length = 1
inherits = *common*; *spriteextruder*
bed_shape = 5x0,215x0,215x220,5x220
max_print_height = 270
printer_model = ENDER3S1

File diff suppressed because it is too large Load Diff

View File

@ -1212,6 +1212,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
if ((initial_extruder_id = tool_ordering.first_extruder()) != static_cast<unsigned int>(-1))
break;
}
if (initial_extruder_id == static_cast<unsigned int>(-1))
// No object to print was found, cancel the G-code export.
throw Slic3r::SlicingError(_(L("No extrusions were generated for objects.")));
// We don't allow switching of extruders per layer by Model::custom_gcode_per_print_z in sequential mode.
// Use the extruder IDs collected from Regions.
this->set_extruders(print.extruders());
@ -1220,6 +1223,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// If the tool ordering has been pre-calculated by Print class for wipe tower already, reuse it.
tool_ordering = print.tool_ordering();
tool_ordering.assign_custom_gcodes(print);
if (tool_ordering.all_extruders().empty())
// No object to print was found, cancel the G-code export.
throw Slic3r::SlicingError(_(L("No extrusions were generated for objects.")));
has_wipe_tower = print.has_wipe_tower() && tool_ordering.has_wipe_tower();
initial_extruder_id = (has_wipe_tower && ! print.config().single_extruder_multi_material_priming) ?
// The priming towers will be skipped.

View File

@ -101,7 +101,7 @@ std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, in
}
gcode << temperature;
bool multiple_tools = this->multiple_extruders && ! m_single_extruder_multi_material;
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) ) {
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish) || FLAVOR_IS(gcfRepRapFirmware)) ) {
if (FLAVOR_IS(gcfRepRapFirmware)) {
gcode << " P" << tool;
} else {

View File

@ -336,6 +336,8 @@ PrintObjectSupportMaterial::PrintObjectSupportMaterial(const PrintObject *object
m_support_params.support_layer_height_min = 1000000.;
for (auto lh : m_print_config->min_layer_height.values)
m_support_params.support_layer_height_min = std::min(m_support_params.support_layer_height_min, std::max(0.01, lh));
for (auto layer : m_object->layers())
m_support_params.support_layer_height_min = std::min(m_support_params.support_layer_height_min, std::max(0.01, layer->height));
if (m_object_config->support_material_interface_layers.value == 0) {
// No interface layers allowed, print everything with the base support pattern.

View File

@ -336,7 +336,8 @@ protected:
int m_orig_size_indices = 0;
std::unique_ptr<Cursor> m_cursor;
float m_old_cursor_radius_sqr;
// Zero indicates an uninitialized state.
float m_old_cursor_radius_sqr = 0;
// Private functions:
private:

View File

@ -2910,8 +2910,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
}
p->any_sla_selected = p->check_sla_selected();
if (p->only_sla_mode)
p->any_fff_selected = p->check_fff_selected();
p->any_fff_selected = ! p->only_sla_mode && p->check_fff_selected();
p->update_materials(T_ANY);
if (!p->only_sla_mode)

View File

@ -73,9 +73,19 @@ static std::vector<std::array<float, 4>> decode_colors(const std::vector<std::st
return output;
}
static float round_to_nearest_percent(float value)
// Round to a bin with minimum two digits resolution.
// Equivalent to conversion to string with sprintf(buf, "%.2g", value) and conversion back to float, but faster.
static float round_to_bin(const float value)
{
return std::round(value * 100.f) * 0.01f;
// assert(value > 0);
constexpr float const scale [5] = { 100.f, 1000.f, 10000.f, 100000.f, 1000000.f };
constexpr float const invscale [5] = { 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f };
constexpr float const threshold[5] = { 0.095f, 0.0095f, 0.00095f, 0.000095f, 0.0000095f };
// Scaling factor, pointer to the tables above.
int i = 0;
// While the scaling factor is not yet large enough to get two integer digits after scaling and rounding:
for (; value < threshold[i] && i < 4; ++ i) ;
return std::round(value * scale[i]) * invscale[i];
}
void GCodeViewer::VBuffer::reset()
@ -138,7 +148,7 @@ bool GCodeViewer::Path::matches(const GCodeProcessorResult::MoveVertex& move) co
// use rounding to reduce the number of generated paths
return type == move.type && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id && role == move.extrusion_role &&
move.position.z() <= sub_paths.front().first.position.z() && feedrate == move.feedrate && fan_speed == move.fan_speed &&
height == round_to_nearest_percent(move.height) && width == round_to_nearest_percent(move.width) &&
height == round_to_bin(move.height) && width == round_to_bin(move.width) &&
matches_percent(volumetric_rate, move.volumetric_rate(), 0.05f);
}
case EMoveType::Travel: {
@ -171,7 +181,7 @@ void GCodeViewer::TBuffer::add_path(const GCodeProcessorResult::MoveVertex& move
Path::Endpoint endpoint = { b_id, i_id, s_id, move.position };
// use rounding to reduce the number of generated paths
paths.push_back({ move.type, move.extrusion_role, move.delta_extruder,
round_to_nearest_percent(move.height), round_to_nearest_percent(move.width),
round_to_bin(move.height), round_to_bin(move.width),
move.feedrate, move.fan_speed, move.temperature,
move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } });
}
@ -746,12 +756,12 @@ void GCodeViewer::refresh(const GCodeProcessorResult& gcode_result, const std::v
{
case EMoveType::Extrude:
{
m_extrusions.ranges.height.update_from(round_to_nearest_percent(curr.height));
m_extrusions.ranges.width.update_from(round_to_nearest_percent(curr.width));
m_extrusions.ranges.height.update_from(round_to_bin(curr.height));
m_extrusions.ranges.width.update_from(round_to_bin(curr.width));
m_extrusions.ranges.fan_speed.update_from(curr.fan_speed);
m_extrusions.ranges.temperature.update_from(curr.temperature);
if (curr.extrusion_role != erCustom || is_visible(erCustom))
m_extrusions.ranges.volumetric_rate.update_from(round_to_nearest_percent(curr.volumetric_rate()));
m_extrusions.ranges.volumetric_rate.update_from(round_to_bin(curr.volumetric_rate()));
[[fallthrough]];
}
case EMoveType::Travel:

View File

@ -1398,6 +1398,18 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (m_objects_model->GetItemType(item)&itInstance)
item = m_objects_model->GetItemById(obj_idx);
wxArrayString input_files;
if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() != wxID_CLOSE)
dlg.get_input_files(input_files);
}
else
wxGetApp().import_model(wxGetApp().tab_panel()->GetPage(0), input_files);
if (input_files.IsEmpty())
return;
take_snapshot((type == ModelVolumeType::MODEL_PART) ? _L("Load Part") : _L("Load Modifier"));
std::vector<ModelVolume*> volumes;
@ -1406,7 +1418,7 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (type == ModelVolumeType::MODEL_PART)
load_part(*(*m_objects)[obj_idx], volumes, type, from_galery);
else*/
load_modifier(*(*m_objects)[obj_idx], volumes, type, from_galery);
load_modifier(input_files, *(*m_objects)[obj_idx], volumes, type, from_galery);
if (volumes.empty())
return;
@ -1486,7 +1498,7 @@ void ObjectList::load_part(ModelObject& model_object, std::vector<ModelVolume*>&
}
}
*/
void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
{
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
//if (type == ModelVolumeType::MODEL_PART)
@ -1494,19 +1506,6 @@ void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolum
wxWindow* parent = wxGetApp().tab_panel()->GetPage(0);
wxArrayString input_files;
if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() == wxID_CLOSE)
return;
dlg.get_input_files(input_files);
if (input_files.IsEmpty())
return;
}
else
wxGetApp().import_model(parent, input_files);
wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe, wxPD_AUTO_HIDE);
wxBusyCursor busy;

View File

@ -251,7 +251,7 @@ public:
void load_subobject(ModelVolumeType type, bool from_galery = false);
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
//void load_part(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_modifier(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_generic_subobject(const std::string& type_name, const ModelVolumeType type);
void load_shape_object(const std::string &type_name);
void load_shape_object_from_gallery();

View File

@ -75,8 +75,13 @@ void MsgDialog::SetButtonLabel(wxWindowID btn_id, const wxString& label, bool se
wxButton* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, const wxString& label/* = wxString()*/)
{
wxButton* btn = new wxButton(this, btn_id, label);
if (set_focus)
if (set_focus) {
btn->SetFocus();
// For non-MSW platforms SetFocus is not enought to use it as default, when the dialog is closed by ENTER
// We have to set this button as the (permanently) default one in its dialog
// See https://twitter.com/ZMelmed/status/1472678454168539146
btn->SetDefault();
}
btn_sizer->Add(btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, HORIZ_SPACING);
btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent&) { this->EndModal(btn_id); });
return btn;

View File

@ -556,8 +556,8 @@ SendSystemInfoDialog::SendSystemInfoDialog(wxWindow* parent)
std::string app_name;
{
Semver semver(SLIC3R_VERSION);
bool is_alpha = std::string{semver.prerelease()}.find("alpha") != std::string::npos;
bool is_beta = std::string{semver.prerelease()}.find("beta") != std::string::npos;
bool is_alpha = semver.prerelease() && std::string{semver.prerelease()}.find("alpha") != std::string::npos;
bool is_beta = semver.prerelease() && std::string{semver.prerelease()}.find("beta") != std::string::npos;
app_name = std::string(SLIC3R_APP_NAME) + " " + std::to_string(semver.maj())
+ "." + std::to_string(semver.min()) + " "
+ (is_alpha ? "Alpha" : is_beta ? "Beta" : "");

View File

@ -1690,7 +1690,7 @@ void TabPrint::update_description_lines()
if (m_active_page && m_active_page->title() == "Output options" && m_post_process_explanation) {
m_post_process_explanation->SetText(
_u8L("Post processing scripts shall modify G-code file in place."));
_L("Post processing scripts shall modify G-code file in place."));
#ifndef __linux__
m_post_process_explanation->SetPathEnd("post-processing-scripts_283913");
#endif // __linux__

View File

@ -3,7 +3,7 @@
set(SLIC3R_APP_NAME "PrusaSlicer")
set(SLIC3R_APP_KEY "PrusaSlicer")
set(SLIC3R_VERSION "2.4.0-rc")
set(SLIC3R_VERSION "2.4.0")
set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN")
set(SLIC3R_RC_VERSION "2,4,0,0")
set(SLIC3R_RC_VERSION_DOTS "2.4.0.0")