From 77ef07b83f1a9a6e30daf54ef8458f426f7fdd06 Mon Sep 17 00:00:00 2001 From: tao wang Date: Mon, 24 Oct 2022 15:54:03 +0800 Subject: [PATCH 01/26] FIX:fixed incorrect display after adding files via add Change-Id: Id812b40cb85a882a8c490ccdc2375e0d9b8e312d --- src/slic3r/GUI/Plater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 62156490de4..fdbb243b8ad 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7200,7 +7200,7 @@ void Plater::add_model(bool imperial_units/* = false*/) if (!load_files(paths, strategy, ask_multi).empty()) { if (get_project_name() == _L("Untitled") && paths.size() > 0) { - p->set_project_filename(wxString(paths[0].string())); + p->set_project_filename(wxString::FromUTF8(paths[0].string())); } wxGetApp().mainframe->update_title(); From 1b7f15489fb0bd33bbd203226490849837cb35d6 Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 21 Oct 2022 15:34:11 +0800 Subject: [PATCH 02/26] FIX:change the downloading plugin url of the wiki Change-Id: I0eb1c42105e5e27e16b9888f8c415aa157cd6f03 (cherry picked from commit 6a35a3546722d16e6118539ab60b748aa9666097) --- src/slic3r/GUI/DownloadProgressDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DownloadProgressDialog.cpp b/src/slic3r/GUI/DownloadProgressDialog.cpp index c5f018befd3..9c943d1c3ab 100644 --- a/src/slic3r/GUI/DownloadProgressDialog.cpp +++ b/src/slic3r/GUI/DownloadProgressDialog.cpp @@ -31,8 +31,8 @@ namespace GUI { DownloadProgressDialog::DownloadProgressDialog(wxString title) : DPIDialog(static_cast(wxGetApp().mainframe), wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) { - wxString download_failed_url = wxT("https://wiki.bambulab.com/e/en/software/bambu-studio/failed-to-get-network-plugin"); - wxString install_failed_url = wxT("https://wiki.bambulab.com/e/en/software/bambu-studio/failed-to-get-network-plugin"); + wxString download_failed_url = wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-get-network-plugin"); + wxString install_failed_url = wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-get-network-plugin"); wxString download_failed_msg = _L("Failed to download the plug-in. Please check your firewall settings and vpn software, check and retry."); wxString install_failed_msg = _L("Failed to install the plug-in. Please check whether it is blocked or deleted by anti-virus software."); From 5fe648a866cb6c24031d044d9d1c5157d706b6f5 Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 21 Oct 2022 11:20:49 +0800 Subject: [PATCH 03/26] FIX:fixed description messages not refreshing the scrollbar Change-Id: Ie067784144031d4f9418b4af1b08420bf919d7f1 (cherry picked from commit 520703c1823bdf6ec802467b4bc035da8e797d8f) --- src/slic3r/GUI/ReleaseNote.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 28ecd8fd210..8d2667ba098 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -89,6 +89,7 @@ void ReleaseNoteDialog::update_release_note(wxString release_note, std::string v sizer_text_release_note->Add(m_staticText_release_note, 0, wxALL, 5); m_vebview_release_note->SetSizer(sizer_text_release_note); m_vebview_release_note->Layout(); + m_vebview_release_note->Fit(); } void UpdateVersionDialog::alter_choice(wxCommandEvent& event) @@ -333,6 +334,7 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve sizer_text_release_note->Add(m_staticText_release_note, 0, wxALL, 5); m_scrollwindows_release_note->SetSizer(sizer_text_release_note); m_scrollwindows_release_note->Layout(); + m_scrollwindows_release_note->Fit(); } } From b6ade27fadc99c14295453aac6de0e6c84799529 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Thu, 20 Oct 2022 15:35:27 +0800 Subject: [PATCH 04/26] FIX: fix the empty layer after adding modifier Signed-off-by: qing.zhang Change-Id: Iad6c149cb5f1a50a199fdf1dd50f4971898972e2 (cherry picked from commit 6065729c6febb9f3a704dde12bda6ad34f62caec) --- src/libslic3r/Fill/Fill.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 0e22ac9b188..3cf98c547c5 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -468,7 +468,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: LayerRegion* layerm = this->m_regions[surface_fill.region_id]; for (ExPolygon& expoly : surface_fill.expolygons) { - f->no_overlap_expolygons = intersection_ex(layerm->fill_no_overlap_expolygons, ExPolygons() = { expoly }); + f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}); // Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon. f->spacing = surface_fill.params.spacing; surface_fill.surface.expolygon = std::move(expoly); From dc90d5e1700e674efad3a761c4801c68da2d581e Mon Sep 17 00:00:00 2001 From: Arthur Tang Date: Sat, 22 Oct 2022 23:31:02 +0800 Subject: [PATCH 05/26] FIX: rewrite per-object printing order logic 1. Previous logic can't guarantee left-to-right printing order, so toolhead may crash on the right side. In the new algorithm printing order is guaranteed. 2. Clearance radius should be the max of 3 directions (left, bottom, up), not including right, otherwise collision may happen on bottom or up directions. 3. Add is_extrusion_cali_object property to handle extrusion brim overlap better. Change-Id: I44868b9925d983f5cca0c31d35dfa28d895fadbf --- .../BBL/machine/fdm_bbl_3dp_001_common.json | 3 +- src/libslic3r/Arrange.hpp | 1 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 82 +++++++++++++++---- src/libslic3r/PrintConfig.cpp | 8 ++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/Jobs/ArrangeJob.cpp | 20 +++-- src/slic3r/GUI/PartPlate.cpp | 1 + src/slic3r/GUI/Plater.cpp | 3 +- 9 files changed, 97 insertions(+), 24 deletions(-) diff --git a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json index 4ebec9633d5..310b3b4bc17 100644 --- a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json +++ b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json @@ -111,7 +111,8 @@ "0.08" ], "printable_height": "250", - "extruder_clearance_radius": "32", + "extruder_clearance_radius": "57", + "extruder_clearance_max_radius": "68", "extruder_clearance_height_to_rod": "36", "extruder_clearance_height_to_lid": "140", "nozzle_volume": "118", diff --git a/src/libslic3r/Arrange.hpp b/src/libslic3r/Arrange.hpp index d9a510a45bf..09b32536561 100644 --- a/src/libslic3r/Arrange.hpp +++ b/src/libslic3r/Arrange.hpp @@ -52,6 +52,7 @@ struct ArrangePolygon { //BBS: add locked_plate to indicate whether it is in the locked plate int locked_plate{ -1 }; bool is_virt_object{ false }; + bool is_extrusion_cali_object{ false }; bool is_wipe_tower{false}; //BBS: add row/col for sudoku-style layout int row{0}; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 862f35ad2b9..9daf935e279 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -759,7 +759,7 @@ static std::vector s_Preset_printer_options { "printer_technology", "printable_area", "bed_exclude_area", "gcode_flavor", "single_extruder_multi_material", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "layer_change_gcode", "change_filament_gcode", - "printer_model", "printer_variant", "printable_height", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", + "printer_model", "printer_variant", "printable_height", "extruder_clearance_radius", "extruder_clearance_max_radius","extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "default_print_profile", "inherits", "silent_mode", // BBS diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 2eadc0cd6a6..1ab618b65e7 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -80,6 +80,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid", "extruder_clearance_radius", + "extruder_clearance_max_radius", "extruder_colour", "extruder_offset", "filament_flow_ratio", @@ -389,6 +390,8 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print const PrintInstance *print_instance; BoundingBox bounding_box; Polygon hull_polygon; + int index; + double arrange_score; }; std::vector print_instance_with_bounding_box; { @@ -480,22 +483,71 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } } - //sort the print instance + // calc sort order + auto bed_points = get_bed_shape(print_config); + float bed_width = bed_points[1].x() - bed_points[0].x(); + // 如果扩大以后的多边形的距离小于这个值,就需要严格保证从左到右的打印顺序,否则会撞工具头右侧 + float unsafe_dist = scale_(print_config.extruder_clearance_max_radius.value - print_config.extruder_clearance_radius.value); + std::vector left_right_pair; // pairs in this vector must strictly obey the left-right order + for (size_t i = 0; i < print_instance_with_bounding_box.size();i++) { + auto &inst = print_instance_with_bounding_box[i]; + inst.index = i; + Point pt = inst.bounding_box.center(); + inst.arrange_score = pt.x() / 2 + pt.y(); // we prefer print row-by-row, so cost on x-direction is smaller + } + for (size_t i = 0; i < print_instance_with_bounding_box.size(); i++) { + auto &inst = print_instance_with_bounding_box[i]; + for (size_t j = 0; j < print_instance_with_bounding_box.size(); j++) { + if (j != i) { + auto &l = print_instance_with_bounding_box[i]; + auto &r = print_instance_with_bounding_box[j]; + auto ly1 = l.bounding_box.min.y(); + auto ly2 = l.bounding_box.max.y(); + auto ry1 = r.bounding_box.min.y(); + auto ry2 = r.bounding_box.max.y(); + auto lx1 = l.bounding_box.min.x(); + auto rx1 = r.bounding_box.min.x(); + auto lx2 = l.bounding_box.max.x(); + auto rx2 = r.bounding_box.max.x(); + auto inter_min = std::max(ly1, ry1); + auto inter_max = std::min(ly2, ry2); + auto inter_y = inter_max - inter_min; + inter_min = std::max(lx1, rx1); + inter_max = std::min(lx2, rx2); + auto inter_x = inter_max - inter_min; + + // 如果y方向有重合,说明两个物体在一行,应该先打左边的物体,即先比较二者的x坐标。 + if (inter_y > 0) { + if (std::max(rx1 - lx2, lx1 - rx2) < unsafe_dist) { + std::string dir = "left"; + if (lx1 > rx1) { + left_right_pair.emplace_back(j, i); + print_instance_with_bounding_box[i].arrange_score = std::max(inst.arrange_score, r.arrange_score + bed_width); + } else { + left_right_pair.emplace_back(i, j); + print_instance_with_bounding_box[j].arrange_score = std::max(r.arrange_score, l.arrange_score + bed_width); + dir = "right"; + } + BOOST_LOG_TRIVIAL(debug) << "print_instance " << inst.print_instance->model_instance->get_object()->name + << ", right=" << r.print_instance->model_instance->get_object()->name << ", l.score: " << l.arrange_score + << ", r.score: " << r.arrange_score << ", dist:" << std::max(rx1 - lx2, lx1 - rx2) << ", dir: " << dir; + } + } + } + } + } + BOOST_LOG_TRIVIAL(debug) << "bed width: " << bed_width << ", unsafe_dist:" << unsafe_dist; + for (auto& inst:print_instance_with_bounding_box) { + BOOST_LOG_TRIVIAL(debug) << "print_instance " << inst.print_instance->model_instance->get_object()->name + << ", score: " << inst.arrange_score; + } + // sort the print instance std::sort(print_instance_with_bounding_box.begin(), print_instance_with_bounding_box.end(), - [](auto &l, auto &r) { - auto ly1 = l.bounding_box.min.y(); - auto ly2 = l.bounding_box.max.y(); - auto ry1 = r.bounding_box.min.y(); - auto ry2 = r.bounding_box.max.y(); - auto inter_min = std::max(ly1, ry1); - auto inter_max = std::min(ly2, ry2); - auto lx = l.bounding_box.min.x(); - auto rx = r.bounding_box.min.x(); - if (inter_max - inter_min > 0) - return (lx < rx) || ((lx == rx) && (ly1 < ry1)); - else - return (ly1 < ry1); - }); + [&left_right_pair](print_instance_info& l, print_instance_info& r) { + if (std::find(left_right_pair.begin(),left_right_pair.end(), Vec2i(l.index, r.index)) != left_right_pair.end()) + return true; + else + return l.arrange_score < r.arrange_score;}); // sequential_print_vertical_clearance_valid { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 31a76b9a83d..bfd56bf65fc 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -992,6 +992,14 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(40)); + def = this->add("extruder_clearance_max_radius", coFloat); + def->label = L("Max Radius"); + def->tooltip = L("Max clearance radius around extruder. Used as input of auto-arranging to avoid collision when printing by object"); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(68)); + def = this->add("extruder_colour", coStrings); def->label = L("Extruder Color"); def->tooltip = L("Only used as a visual help on UI"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index b1becfdc870..4734d84bb8e 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -824,6 +824,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, extruder_clearance_height_to_rod))//BBs ((ConfigOptionFloat, extruder_clearance_height_to_lid))//BBS ((ConfigOptionFloat, extruder_clearance_radius)) + ((ConfigOptionFloat, extruder_clearance_max_radius)) ((ConfigOptionStrings, extruder_colour)) ((ConfigOptionPoints, extruder_offset)) ((ConfigOptionBools, reduce_fan_stop_start_freq)) diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index 077ec438097..d481ee83df0 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -503,6 +503,9 @@ void ArrangeJob::process() if (params.is_seq_print) params.min_obj_distance = std::max(params.min_obj_distance, scaled(params.cleareance_radius)); + if (params.avoid_extrusion_cali_region && print.full_print_config().opt_bool("scan_first_layer")) + m_plater->get_partplate_list().preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES); + double skirt_distance = print.has_skirt() ? print.config().skirt_distance.value : 0; double brim_max = 0; std::for_each(m_selected.begin(), m_selected.end(), [&](ArrangePolygon ap) { brim_max = std::max(brim_max, ap.brim_width); }); @@ -514,21 +517,26 @@ void ArrangeJob::process() params.bed_shrink_y = settings.bed_shrink_y + params.brim_skirt_distance; // for sequential print, we need to inflate the bed because cleareance_radius is so large if (params.is_seq_print) { - params.bed_shrink_x -= params.cleareance_radius/2; - params.bed_shrink_y -= params.cleareance_radius/2; + float shift_dist = params.cleareance_radius / 2 - 5; + params.bed_shrink_x -= shift_dist; + params.bed_shrink_y -= shift_dist; // dont forget to move the excluded region for (auto& region : m_unselected) { if (region.is_virt_object) - region.poly.translate(-scaled(params.cleareance_radius/2), -scaled(params.cleareance_radius/2)); + region.poly.translate(-scaled(shift_dist), -scaled(shift_dist)); } } // do not inflate brim_width. Objects are allowed to have overlapped brim. std::for_each(m_selected.begin(), m_selected.end(), [&](auto& ap) {ap.inflation = params.min_obj_distance / 2; }); - std::for_each(m_unselected.begin(), m_unselected.end(), [&](auto& ap) {ap.inflation = ap.is_virt_object ? scaled(params.brim_skirt_distance) : params.min_obj_distance / 2; }); + // For occulusion regions, inflation should be larger to prevent genrating brim on them. + // However, extrusion cali regions are exceptional, since we can allow brim overlaps them. + std::for_each(m_unselected.begin(), m_unselected.end(), [&](auto &ap) { + ap.inflation = !ap.is_virt_object ? + params.min_obj_distance / 2 : + (ap.is_extrusion_cali_object ? scaled(params.cleareance_radius / 2) : scaled(params.brim_skirt_distance + params.cleareance_radius / 2)); + }); - if (params.avoid_extrusion_cali_region && print.full_print_config().opt_bool("scan_first_layer")) - m_plater->get_partplate_list().preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES); m_plater->get_partplate_list().preprocess_exclude_areas(params.excluded_regions, 1); diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index a3295aa421d..1c41948423c 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -3461,6 +3461,7 @@ bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& r ret.translation = Vec2crd(0, 0); ret.rotation = 0.0f; ret.is_virt_object = true; + ret.is_extrusion_cali_object = true; ret.bed_idx = j; ret.height = 1; ret.name = "NonpreferedRegion" + std::to_string(index); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index fdbb243b8ad..665a31e1e08 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2001,7 +2001,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) //BBS: add bed_exclude_area , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ "printable_area", "bed_exclude_area", "print_sequence", - "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "skirt_loops", "skirt_distance", + "extruder_clearance_radius", "extruder_clearance_max_radius", + "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "skirt_loops", "skirt_distance", "brim_width", "brim_object_gap", "brim_type", "nozzle_diameter", "single_extruder_multi_material", "enable_prime_tower", "wipe_tower_x", "wipe_tower_y", "prime_tower_width", "prime_tower_brim_width", "prime_volume", "extruder_colour", "filament_colour", "material_colour", "printable_height", "printer_model", "printer_technology", From 510f78c0f8a49c1d224d80a6920976b6a1a370b1 Mon Sep 17 00:00:00 2001 From: gerrit Date: Tue, 25 Oct 2022 13:10:31 +0800 Subject: [PATCH 06/26] ci: update build version to 01.03.00.13 Change-Id: Iedf30b5615da18c0b5e3a1e86e12cfd9d7de6af2 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 02813d839fa..ca58affbf85 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.12") +set(SLIC3R_VERSION "01.03.00.13") From 1d8b38fc180f3cb7495e6337d08993e25b1b02e8 Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 26 Oct 2022 14:42:08 +0800 Subject: [PATCH 07/26] FIX:fixed cant not link to wiki on macos Change-Id: I8c7fc943e9c6eb46c1f7a63dcd32f0a9a7f120d3 (cherry picked from commit 1fd7ef86e39c979e8b986c9f6d6db239949682cd) --- src/slic3r/GUI/SelectMachine.cpp | 8 +++++++- src/slic3r/GUI/SelectMachine.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 40cb0bc04c2..5255b2b291f 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -643,7 +643,7 @@ void SelectMachinePopup::update_other_devices() m_placeholder_panel = new wxWindow(m_scrolledWindow, wxID_ANY, wxDefaultPosition, wxSize(-1,FromDIP(26))); wxBoxSizer* placeholder_sizer = new wxBoxSizer(wxVERTICAL); - auto m_hyperlink = new wxHyperlinkCtrl(m_placeholder_panel, wxID_ANY, _L("Can't find my devices?"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + m_hyperlink = new wxHyperlinkCtrl(m_placeholder_panel, wxID_ANY, _L("Can't find my devices?"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); placeholder_sizer->Add(m_hyperlink, 0, wxALIGN_CENTER | wxALL, 5); @@ -860,6 +860,12 @@ void SelectMachinePopup::OnLeftUp(wxMouseEvent &event) wxPostEvent(p->mPanel, event); } } + + //hyper link + auto h_rect = m_hyperlink->ClientToScreen(wxPoint(0, 0)); + if (mouse_pos.x > h_rect.x && mouse_pos.y > h_rect.y && mouse_pos.x < (h_rect.x + m_hyperlink->GetSize().x) && mouse_pos.y < (h_rect.y + m_hyperlink->GetSize().y)) { + wxLaunchDefaultBrowser(wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer")); + } } } diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index fe83a1cc6c5..1529ecb8b2b 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -198,6 +198,7 @@ private: int m_my_devices_count{0}; int m_other_devices_count{0}; wxWindow* m_placeholder_panel{nullptr}; + wxHyperlinkCtrl* m_hyperlink{nullptr}; wxBoxSizer * m_sizer_body{nullptr}; wxBoxSizer * m_sizer_my_devices{nullptr}; wxBoxSizer * m_sizer_other_devices{nullptr}; From 16b22cfbd1dc986b010878562830544986304cef Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 26 Oct 2022 21:12:19 +0800 Subject: [PATCH 08/26] FIX: print ordering didn't consider object height This may cause tall objects be printed before short ones. There are two possible solutions: 1. do strict ordering only when y-overlap is large enough (the one chosen in this commit) 2. when considering vertical collision with rod, the actual expansion can be much smaller (because the rod is only slightly off extruder). But this solution requires an extra parameter. Let's hold it for a while. Change-Id: Icc9a4796d49dad93cbcc20d4103e641a48886e5e (cherry picked from commit 6a958b1fa9e58e4ca3be63b4918da77bcdc53314) (cherry picked from commit ceff67789c27ea576afd663a2e5bae9a10241728) --- src/libslic3r/Print.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1ab618b65e7..5a93877ea31 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -392,6 +392,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print Polygon hull_polygon; int index; double arrange_score; + double height; }; std::vector print_instance_with_bounding_box; { @@ -469,6 +470,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } } struct print_instance_info print_info {&instance, convex_hull.bounding_box(), convex_hull}; + print_info.height = instance.print_object->height(); print_instance_with_bounding_box.push_back(std::move(print_info)); convex_hulls_other.emplace_back(std::move(convex_hull)); } @@ -484,6 +486,10 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } // calc sort order + double hc1 = scale_(print.config().extruder_clearance_height_to_lid); + double hc2 = scale_(print.config().extruder_clearance_height_to_rod); + double printable_height = scale_(print.config().printable_height); + auto bed_points = get_bed_shape(print_config); float bed_width = bed_points[1].x() - bed_points[0].x(); // 如果扩大以后的多边形的距离小于这个值,就需要严格保证从左到右的打印顺序,否则会撞工具头右侧 @@ -497,9 +503,9 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } for (size_t i = 0; i < print_instance_with_bounding_box.size(); i++) { auto &inst = print_instance_with_bounding_box[i]; + auto &l = print_instance_with_bounding_box[i]; for (size_t j = 0; j < print_instance_with_bounding_box.size(); j++) { if (j != i) { - auto &l = print_instance_with_bounding_box[i]; auto &r = print_instance_with_bounding_box[j]; auto ly1 = l.bounding_box.min.y(); auto ly2 = l.bounding_box.max.y(); @@ -516,22 +522,30 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print inter_max = std::min(lx2, rx2); auto inter_x = inter_max - inter_min; - // 如果y方向有重合,说明两个物体在一行,应该先打左边的物体,即先比较二者的x坐标。 - if (inter_y > 0) { + // 如果y方向的重合超过轮廓的膨胀量,说明两个物体在一行,应该先打左边的物体,即先比较二者的x坐标。 + if (inter_y > scale_(0.5 * print.config().extruder_clearance_radius.value)) { if (std::max(rx1 - lx2, lx1 - rx2) < unsafe_dist) { std::string dir = "left"; if (lx1 > rx1) { left_right_pair.emplace_back(j, i); - print_instance_with_bounding_box[i].arrange_score = std::max(inst.arrange_score, r.arrange_score + bed_width); + l.arrange_score = std::max(l.arrange_score, r.arrange_score + bed_width); } else { left_right_pair.emplace_back(i, j); - print_instance_with_bounding_box[j].arrange_score = std::max(r.arrange_score, l.arrange_score + bed_width); + r.arrange_score = std::max(r.arrange_score, l.arrange_score + bed_width); dir = "right"; } BOOST_LOG_TRIVIAL(debug) << "print_instance " << inst.print_instance->model_instance->get_object()->name << ", right=" << r.print_instance->model_instance->get_object()->name << ", l.score: " << l.arrange_score << ", r.score: " << r.arrange_score << ", dist:" << std::max(rx1 - lx2, lx1 - rx2) << ", dir: " << dir; } + } + if (l.height>hc2) { + // 如果当前物体的高度超过滑杆,且比r高,就给它加一点代价 + if (l.height > r.height) + l.arrange_score = std::max(l.arrange_score, r.arrange_score + bed_width); + BOOST_LOG_TRIVIAL(debug) << "height print_instance " << inst.print_instance->model_instance->get_object()->name + << ", right=" << r.print_instance->model_instance->get_object()->name << ", l.score: " << l.arrange_score + << ", r.score: " << r.arrange_score; } } } @@ -549,6 +563,10 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print else return l.arrange_score < r.arrange_score;}); + for (auto &inst : print_instance_with_bounding_box) + BOOST_LOG_TRIVIAL(debug) << "after sorting print_instance " << inst.print_instance->model_instance->get_object()->name << ", score: " << inst.arrange_score + << ", height:"<< inst.height; + // sequential_print_vertical_clearance_valid { // Ignore the last instance printed. @@ -578,9 +596,6 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print break; }*/ - double hc1 = scale_(print.config().extruder_clearance_height_to_lid); - double hc2 = scale_(print.config().extruder_clearance_height_to_rod); - double printable_height = scale_(print.config().printable_height); // if objects are not overlapped on y-axis, they will not collide even if they are taller than extruder_clearance_height_to_rod int print_instance_count = print_instance_with_bounding_box.size(); From 4fa7f4564dd572cc1c7c31c205dfce1c920a5c75 Mon Sep 17 00:00:00 2001 From: gerrit Date: Wed, 26 Oct 2022 22:02:53 +0800 Subject: [PATCH 09/26] ci: update build version to 01.03.00.14 Change-Id: I2d9679a72adafd0e0b29cf1da27d98f034cd4abf --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index ca58affbf85..43051ba87b1 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.13") +set(SLIC3R_VERSION "01.03.00.14") From e4840991a522d6ad4488ef7b7d446be944d2da39 Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Wed, 26 Oct 2022 15:18:56 +0800 Subject: [PATCH 10/26] FIX:AssembleViewData crash Change-Id: I759a385621b8a83d89abcc7c1b38786e067dbb33 (cherry picked from commit c218e7dd77fad970f637412dc9c230b1241c1f67) --- src/slic3r/GUI/GUI_Preview.cpp | 1 - src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp | 3 +++ src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index d8f8f2f8918..7e2f8d772fc 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -816,7 +816,6 @@ void AssembleView::reload_scene(bool refresh_immediately, bool force_full_scene_ m_canvas->render(true); } m_canvas->reload_scene(refresh_immediately, force_full_scene_refresh); - m_canvas->reload_scene(refresh_immediately, force_full_scene_refresh); } } diff --git a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp index 2bc950fe34c..a8ef43c85b5 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp @@ -611,6 +611,9 @@ void ModelObjectsInfo::on_update() if (!get_pool()->get_canvas()->get_model()->objects.empty()) { m_model_objects = get_pool()->get_canvas()->get_model()->objects; } + else { + m_model_objects.clear(); + } } void ModelObjectsInfo::on_release() diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index ea92b9adf26..df59dff67f0 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -345,7 +345,7 @@ void GLGizmosManager::update(const Linef3& mouse_ray, const Point& mouse_pos) void GLGizmosManager::update_assemble_view_data() { if (m_assemble_view_data) { - if (m_parent.get_canvas_type() != GLCanvas3D::CanvasAssembleView) + if (!wxGetApp().plater()->get_assmeble_canvas3D()->get_wxglcanvas()->IsShown()) m_assemble_view_data->update(AssembleViewDataID(0)); else m_assemble_view_data->update(AssembleViewDataID((int)AssembleViewDataID::ModelObjectsInfo | (int)AssembleViewDataID::ModelObjectsClipper)); From 04b1698e583c0fdca5371198c4245c5ac0011520 Mon Sep 17 00:00:00 2001 From: gerrit Date: Thu, 27 Oct 2022 10:28:49 +0800 Subject: [PATCH 11/26] ci: update build version to 01.03.00.15 Change-Id: I2936f6922e0ee188575777483d7c12a92dcef024 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 43051ba87b1..ac8e7e15571 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.14") +set(SLIC3R_VERSION "01.03.00.15") From cd2a8c7b0546e7f4b9b1cea9397de4b73795ae69 Mon Sep 17 00:00:00 2001 From: gerrit Date: Thu, 27 Oct 2022 11:48:31 +0800 Subject: [PATCH 12/26] ci: update build version to 01.03.00.16 Change-Id: I44e01e64fcc762c9bc0082b446543f78bfb40279 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index ac8e7e15571..1767193fbec 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.15") +set(SLIC3R_VERSION "01.03.00.16") From d17c3eb42dc8033cca61fd3acaed4a2793bbed5f Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 27 Oct 2022 21:15:46 +0800 Subject: [PATCH 13/26] FIX: 2 auto-arrange bugss with per-object printing 1. use strict ordering to ensure the printing order is right 2. reduce height-to-lid to 100mm considering towline is lower than lid and may collid with objects TODO: printing brim may still collide, need to subtract inflated boundary of others during brim generation Change-Id: Icf0cba10c579d28fabd97764c1b3abec267ebd9b (cherry picked from commit 46c6f5ff94488b2f4481bf1d34555f4a7c45e135) --- .../BBL/machine/fdm_bbl_3dp_001_common.json | 2 +- src/libslic3r/Print.cpp | 72 ++++++++++++------- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json index 310b3b4bc17..84cd251f02d 100644 --- a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json +++ b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json @@ -114,7 +114,7 @@ "extruder_clearance_radius": "57", "extruder_clearance_max_radius": "68", "extruder_clearance_height_to_rod": "36", - "extruder_clearance_height_to_lid": "140", + "extruder_clearance_height_to_lid": "100", "nozzle_volume": "118", "nozzle_diameter": [ "0.4" diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 5a93877ea31..c38ec166cb7 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -486,15 +486,22 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } // calc sort order - double hc1 = scale_(print.config().extruder_clearance_height_to_lid); - double hc2 = scale_(print.config().extruder_clearance_height_to_rod); + double hc1 = scale_(print.config().extruder_clearance_height_to_lid); // height to lid + double hc2 = scale_(print.config().extruder_clearance_height_to_rod); // height to rod double printable_height = scale_(print.config().printable_height); auto bed_points = get_bed_shape(print_config); float bed_width = bed_points[1].x() - bed_points[0].x(); // 如果扩大以后的多边形的距离小于这个值,就需要严格保证从左到右的打印顺序,否则会撞工具头右侧 float unsafe_dist = scale_(print_config.extruder_clearance_max_radius.value - print_config.extruder_clearance_radius.value); - std::vector left_right_pair; // pairs in this vector must strictly obey the left-right order + struct VecHash + { + size_t operator()(const Vec2i &n1) const + { + return std::hash()(int(n1(0) * 100 + 100)) + std::hash()(int(n1(1) * 100 + 100)) * 101; + } + }; + std::unordered_set left_right_pair; // pairs in this vector must strictly obey the left-right order for (size_t i = 0; i < print_instance_with_bounding_box.size();i++) { auto &inst = print_instance_with_bounding_box[i]; inst.index = i; @@ -523,27 +530,29 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print auto inter_x = inter_max - inter_min; // 如果y方向的重合超过轮廓的膨胀量,说明两个物体在一行,应该先打左边的物体,即先比较二者的x坐标。 - if (inter_y > scale_(0.5 * print.config().extruder_clearance_radius.value)) { + if (inter_y > scale_(1)) { if (std::max(rx1 - lx2, lx1 - rx2) < unsafe_dist) { - std::string dir = "left"; if (lx1 > rx1) { - left_right_pair.emplace_back(j, i); - l.arrange_score = std::max(l.arrange_score, r.arrange_score + bed_width); + left_right_pair.insert({j, i}); + BOOST_LOG_TRIVIAL(debug) << "in-a-row, print_instance " << r.print_instance->model_instance->get_object()->name << "(" << r.arrange_score << ")" + << " -> " << l.print_instance->model_instance->get_object()->name << "(" << l.arrange_score << ")"; } else { - left_right_pair.emplace_back(i, j); - r.arrange_score = std::max(r.arrange_score, l.arrange_score + bed_width); - dir = "right"; + left_right_pair.insert({i, j}); + BOOST_LOG_TRIVIAL(debug) << "in-a-row, print_instance " << l.print_instance->model_instance->get_object()->name << "(" << l.arrange_score << ")" + << " -> " << r.print_instance->model_instance->get_object()->name << "(" << r.arrange_score << ")"; } - BOOST_LOG_TRIVIAL(debug) << "print_instance " << inst.print_instance->model_instance->get_object()->name - << ", right=" << r.print_instance->model_instance->get_object()->name << ", l.score: " << l.arrange_score - << ", r.score: " << r.arrange_score << ", dist:" << std::max(rx1 - lx2, lx1 - rx2) << ", dir: " << dir; } } - if (l.height>hc2) { - // 如果当前物体的高度超过滑杆,且比r高,就给它加一点代价 - if (l.height > r.height) - l.arrange_score = std::max(l.arrange_score, r.arrange_score + bed_width); - BOOST_LOG_TRIVIAL(debug) << "height print_instance " << inst.print_instance->model_instance->get_object()->name + if (l.height > hc1 && r.height < hc1) { + // 当前物体超过了顶盖高度,必须后打 + left_right_pair.insert({j, i}); + BOOST_LOG_TRIVIAL(debug) << "height>hc1, print_instance " << r.print_instance->model_instance->get_object()->name << "(" << r.arrange_score << ")" + << " -> " << l.print_instance->model_instance->get_object()->name << "(" << l.arrange_score << ")"; + } + else if (l.height > hc2 && l.height > r.height && l.arrange_scorehc2, print_instance " << inst.print_instance->model_instance->get_object()->name << ", right=" << r.print_instance->model_instance->get_object()->name << ", l.score: " << l.arrange_score << ", r.score: " << r.arrange_score; } @@ -551,17 +560,25 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } } BOOST_LOG_TRIVIAL(debug) << "bed width: " << bed_width << ", unsafe_dist:" << unsafe_dist; - for (auto& inst:print_instance_with_bounding_box) { - BOOST_LOG_TRIVIAL(debug) << "print_instance " << inst.print_instance->model_instance->get_object()->name - << ", score: " << inst.arrange_score; + // 多做几次代价传播,因为前一次有些值没有更新。 + // TODO 更好的办法是建立一颗树,一步到位。不过我暂时没精力搞,先就这样吧 + for (int k=0;k<5;k++) + for (auto p : left_right_pair) { + auto &l = print_instance_with_bounding_box[p(0)]; + auto &r = print_instance_with_bounding_box[p(1)]; + if(r.arrange_scoremodel_instance->get_object()->name << "(" << l.arrange_score << ")" + << " -> " << r.print_instance->model_instance->get_object()->name << "(" << r.arrange_score << ")"; } // sort the print instance std::sort(print_instance_with_bounding_box.begin(), print_instance_with_bounding_box.end(), - [&left_right_pair](print_instance_info& l, print_instance_info& r) { - if (std::find(left_right_pair.begin(),left_right_pair.end(), Vec2i(l.index, r.index)) != left_right_pair.end()) - return true; - else - return l.arrange_score < r.arrange_score;}); + [](print_instance_info& l, print_instance_info& r) {return l.arrange_score < r.arrange_score;}); for (auto &inst : print_instance_with_bounding_box) BOOST_LOG_TRIVIAL(debug) << "after sorting print_instance " << inst.print_instance->model_instance->get_object()->name << ", score: " << inst.arrange_score @@ -603,7 +620,8 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print for (int k = 0; k < print_instance_count; k++) { auto inst = print_instance_with_bounding_box[k].print_instance; - auto bbox = print_instance_with_bounding_box[k].bounding_box; + // 只需要考虑喷嘴到滑杆的偏移量,这个比整个工具头的碰撞半径要小得多 + auto bbox = print_instance_with_bounding_box[k].bounding_box.inflated(-scale_(0.5 * print.config().extruder_clearance_radius.value)); auto iy1 = bbox.min.y(); auto iy2 = bbox.max.y(); (const_cast(inst->model_instance))->arrange_order = k+1; From ba3ed9b247a423025486366b278bba0c59a9e178 Mon Sep 17 00:00:00 2001 From: gerrit Date: Fri, 28 Oct 2022 08:51:41 +0800 Subject: [PATCH 14/26] ci: update build version to 01.03.00.17 Change-Id: I4a3695999070a72b9cf59f2273875d788ecb4cb8 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 1767193fbec..650d5963072 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.16") +set(SLIC3R_VERSION "01.03.00.17") From 7e10151e2814c4ea72c5e77534c950c55e7f287a Mon Sep 17 00:00:00 2001 From: gerrit Date: Fri, 28 Oct 2022 09:41:27 +0800 Subject: [PATCH 15/26] ci: update build version to 01.03.00.18 Change-Id: Ic3ad3d2e1314e131178962961c6d8c75afb3ad4c --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 650d5963072..fa77b36b8f2 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.17") +set(SLIC3R_VERSION "01.03.00.18") From 0d2c750ff859b70bea039d5fd78d8a931533176a Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Fri, 28 Oct 2022 10:18:17 +0800 Subject: [PATCH 16/26] ENH: refine the label logic of seq_print use the arrange_order computed by Print turn on label by default when switch to sequent print Change-Id: I7063bcc9494bbfc14a3cee85eaf30a9eb52c99d2 --- src/slic3r/GUI/GLCanvas3D.cpp | 17 ++++++++++++++--- src/slic3r/GUI/Plater.cpp | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 145b0a9f181..ecb49861dde 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -248,7 +248,8 @@ void GLCanvas3D::Labels::render(const std::vector& sorted_ return owner.model_instance_id == id; }); if (it != owners.end()) - it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(i + 1); + //it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(i + 1); + it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(sorted_instances[i]->arrange_order); } } @@ -6037,10 +6038,20 @@ void GLCanvas3D::_render_overlays() bool sequential_print = opt != nullptr && (opt->value == PrintSequence::ByObject); std::vector sorted_instances; if (sequential_print) { - for (ModelObject* model_object : m_model->objects) + const Print* print = fff_print(); + if (print) { + for (const PrintObject *print_object : print->objects()) + { + for (const PrintInstance &instance : print_object->instances()) + { + sorted_instances.emplace_back(instance.model_instance); + } + } + } + /*for (ModelObject* model_object : m_model->objects) for (ModelInstance* model_instance : model_object->instances) { sorted_instances.emplace_back(model_instance); - } + }*/ } m_labels.render(sorted_instances); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 665a31e1e08..5ad47eaaa31 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9370,6 +9370,8 @@ void Plater::on_config_change(const DynamicPrintConfig &config) if (seq_print->value == PrintSequence::ByObject) { std::string info_text = L("Print By Object: \nSuggest to use auto-arrange to avoid collisions when printing."); notify_manager->bbl_show_seqprintinfo_notification(info_text); + //always show label when switch to sequence print + this->show_view3D_labels(true); } else notify_manager->bbl_close_seqprintinfo_notification(); From ae2cd67802d612ec2944b90a5fd8701637e13d36 Mon Sep 17 00:00:00 2001 From: gerrit Date: Fri, 28 Oct 2022 10:43:31 +0800 Subject: [PATCH 17/26] ci: update build version to 01.03.00.19 Change-Id: Ieee2345c952011ef87915bb07134ccb3c36309ec --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index fa77b36b8f2..c4962f34a06 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.18") +set(SLIC3R_VERSION "01.03.00.19") From 230635cc5924792d466c1b8dec67901edf2744f9 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 28 Oct 2022 13:18:57 +0800 Subject: [PATCH 18/26] FIX: reduce height_to_lid to 90mm Towline may be even lower than the upper rod. Let's take away 10mm tolerance. Change-Id: I13972fc4ecb0671e1af4b2c6d102e319417e532f (cherry picked from commit cedcb862556c8c9014a91ef2aad8f39fc118d925) --- resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json index 84cd251f02d..2ffd9700795 100644 --- a/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json +++ b/resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json @@ -114,7 +114,7 @@ "extruder_clearance_radius": "57", "extruder_clearance_max_radius": "68", "extruder_clearance_height_to_rod": "36", - "extruder_clearance_height_to_lid": "100", + "extruder_clearance_height_to_lid": "90", "nozzle_volume": "118", "nozzle_diameter": [ "0.4" From 1e1e0e3500d411fc3115fd069b4dd484254efecb Mon Sep 17 00:00:00 2001 From: gerrit Date: Fri, 28 Oct 2022 14:39:41 +0800 Subject: [PATCH 19/26] ci: update build version to 01.03.00.20 Change-Id: I9245d64eb7ae836581fc2426921b4ecda63a064e --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index c4962f34a06..4acd6bdc94a 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.19") +set(SLIC3R_VERSION "01.03.00.20") From 3f7c0ac5c540448d1d67d698db5f6e8d5eb74172 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 28 Oct 2022 17:57:19 +0800 Subject: [PATCH 20/26] FIX: auto-arrange reads wrongs first_bed_temp Also change words for extruder clearance parameters. Change-Id: I736fd9049d184c140b33078d78f764b4fe172765 (cherry picked from commit e70c0c0ea133cffa5788efbfc9633332b196e8df) --- .../include/libnest2d/selections/firstfit.hpp | 26 ++++++++++++++----- src/libslic3r/Arrange.cpp | 15 +++++------ src/libslic3r/ModelArrange.cpp | 4 +-- src/libslic3r/PrintConfig.cpp | 8 +++--- src/slic3r/GUI/Jobs/ArrangeJob.cpp | 1 + 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/libnest2d/include/libnest2d/selections/firstfit.hpp b/src/libnest2d/include/libnest2d/selections/firstfit.hpp index 713768a4237..bc2b5a96bb5 100644 --- a/src/libnest2d/include/libnest2d/selections/firstfit.hpp +++ b/src/libnest2d/include/libnest2d/selections/firstfit.hpp @@ -84,6 +84,15 @@ public: std::sort(store_.begin(), store_.end(), sortfunc); + // debug: write down intitial order + for (auto it = store_.begin(); it != store_.end(); ++it) { + std::stringstream ss; + ss << "initial order: " << it->get().name << ", p=" << it->get().priority() << ", bed_temp=" << it->get().bed_temp << ", height=" << it->get().height + << ", area=" << it->get().area(); + if (this->unfitindicator_) + this->unfitindicator_(ss.str()); + } + int item_id = 0; auto makeProgress = [this, &item_id](Placer &placer, size_t bin_idx) { packed_bins_[bin_idx] = placer.getItems(); @@ -102,7 +111,7 @@ public: bool was_packed = false; int best_bed_id = -1; int bed_id_firstfit = -1; - double score = LARGE_COST_TO_REJECT, best_score = LARGE_COST_TO_REJECT; + double score = LARGE_COST_TO_REJECT+1, best_score = LARGE_COST_TO_REJECT+1; double score_all_plates = 0, score_all_plates_best = std::numeric_limits::max(); typename Placer::PackResult result, result_best, result_firstfit; size_t j = 0; @@ -130,8 +139,8 @@ public: // item is not fit because we have tried all possible plates to find a good enough fit if (bed_id_firstfit == MAX_NUM_PLATES) { it->get().binId(BIN_ID_UNFIT); - //if (this->unfitindicator_) - // this->unfitindicator_(it->get().name + " bed_id_firstfit == MAX_NUM_PLATES" + ",best_score=" + std::to_string(best_score)); + if (this->unfitindicator_) + this->unfitindicator_(it->get().name + " bed_id_firstfit == MAX_NUM_PLATES" + ",best_score=" + std::to_string(best_score)); break; } else { @@ -152,10 +161,13 @@ public: } if(!was_packed){ - //if (this->unfitindicator_) - // this->unfitindicator_(it->get().name + " ,plate_id=" + std::to_string(j) + ",score=" + std::to_string(score) - // + ", score_all_plates=" + std::to_string(score_all_plates) - // + ", overfit=" + std::to_string(result.overfit())); + if (this->unfitindicator_ && !placers.empty()) + this->unfitindicator_(it->get().name + ", height=" +std::to_string(it->get().height) + + " ,plate_id=" + std::to_string(j-1) + + ", score=" + std::to_string(score) + + ", best_bed_id=" + std::to_string(best_bed_id) + + ", score_all_plates=" + std::to_string(score_all_plates) + +", overfit=" + std::to_string(result.overfit())); placers.emplace_back(bin); placers.back().plateID(placers.size() - 1); diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index cc2f1721a3c..82dcf0c9a1e 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -404,8 +404,8 @@ protected: hasLidHeightConflict |= (p.height > clearance_height_to_lid); } - double lambda3 = LARGE_COST_TO_REJECT; - double lambda4 = LARGE_COST_TO_REJECT; + double lambda3 = LARGE_COST_TO_REJECT*1.1; + double lambda4 = LARGE_COST_TO_REJECT*1.2; for (int i = 0; i < m_items.size(); i++) { Item& p = m_items[i]; if (p.is_virt_object) continue; @@ -556,12 +556,11 @@ public: } }); - //if (progressind) { - // m_pck.unfitIndicator([this, progressind](std::string name) { - // progressind(100, name+" not fit!"); - // BOOST_LOG_TRIVIAL(debug) << "arrange not fit: " + name; - // }); - //} + if (progressind) { + m_pck.unfitIndicator([this, progressind](std::string name) { + BOOST_LOG_TRIVIAL(debug) << "arrange not fit: " + name; + }); + } if (stopcond) m_pck.stopCondition(stopcond); diff --git a/src/libslic3r/ModelArrange.cpp b/src/libslic3r/ModelArrange.cpp index 7e280d76b2c..a1c43cd39e5 100644 --- a/src/libslic3r/ModelArrange.cpp +++ b/src/libslic3r/ModelArrange.cpp @@ -127,11 +127,11 @@ ArrangePolygon get_instance_arrange_poly(ModelInstance* instance, const Slic3r:: const ConfigOptionInts* bed_opt = config.option(get_bed_temp_key(curr_bed_type)); if (bed_opt != nullptr) - ap.bed_temp = bed_opt->get_at(ap.extrude_ids.back()); + ap.bed_temp = bed_opt->get_at(ap.extrude_ids.back()-1); const ConfigOptionInts* bed_opt_1st_layer = config.option(get_bed_temp_1st_layer_key(curr_bed_type)); if (bed_opt_1st_layer != nullptr) - ap.first_bed_temp = bed_opt_1st_layer->get_at(ap.extrude_ids.back()); + ap.first_bed_temp = bed_opt_1st_layer->get_at(ap.extrude_ids.back()-1); } if (config.has("nozzle_temperature")) //get the print temperature diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index bfd56bf65fc..55cd810d763 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -968,7 +968,7 @@ void PrintConfigDef::init_fff_params() def = this->add("extruder_clearance_height_to_rod", coFloat); def->label = L("Height to rod"); def->tooltip = L("Distance of the nozzle tip to the lower rod. " - "Used as input of auto-arranging to avoid collision when printing by object"); + "Used for collision avoidance in by-object printing."); def->sidetext = L("mm"); def->min = 0; def->mode = comAdvanced; @@ -978,7 +978,7 @@ void PrintConfigDef::init_fff_params() def = this->add("extruder_clearance_height_to_lid", coFloat); def->label = L("Height to lid"); def->tooltip = L("Distance of the nozzle tip to the lid. " - "Used as input of auto-arranging to avoid collision when printing by object"); + "Used for collision avoidance in by-object printing."); def->sidetext = L("mm"); def->min = 0; def->mode = comAdvanced; @@ -986,7 +986,7 @@ void PrintConfigDef::init_fff_params() def = this->add("extruder_clearance_radius", coFloat); def->label = L("Radius"); - def->tooltip = L("Clearance radius around extruder. Used as input of auto-arranging to avoid collision when printing by object"); + def->tooltip = L("Clearance radius around extruder. Used for collision avoidance in by-object printing."); def->sidetext = L("mm"); def->min = 0; def->mode = comAdvanced; @@ -994,7 +994,7 @@ void PrintConfigDef::init_fff_params() def = this->add("extruder_clearance_max_radius", coFloat); def->label = L("Max Radius"); - def->tooltip = L("Max clearance radius around extruder. Used as input of auto-arranging to avoid collision when printing by object"); + def->tooltip = L("Max clearance radius around extruder. Used for collision avoidance in by-object printing."); def->sidetext = L("mm"); def->min = 0; def->mode = comAdvanced; diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index d481ee83df0..f8a3874eccb 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -575,6 +575,7 @@ void ArrangeJob::process() << ", bed_temp: " << selected.first_bed_temp << ", print_temp: " << selected.print_temp; BOOST_LOG_TRIVIAL(debug) << "items unselected before arrange: "; for (auto item : m_unselected) + if (!item.is_virt_object) BOOST_LOG_TRIVIAL(debug) << item.name << ", extruder: " << item.extrude_ids.back() << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose(); } From 1e1beec65f50c69da00099ca0b9d0322974e9bc4 Mon Sep 17 00:00:00 2001 From: gerrit Date: Fri, 28 Oct 2022 20:48:55 +0800 Subject: [PATCH 21/26] ci: update build version to 01.03.00.21 Change-Id: Iff25f6602a010247776103aa882d2fb1eefe4ec3 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 4acd6bdc94a..30b8b622dd5 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.20") +set(SLIC3R_VERSION "01.03.00.21") From 49aadef59ab0991793ed5845fd412f8669dca589 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Fri, 28 Oct 2022 22:18:40 +0800 Subject: [PATCH 22/26] ENH: add some logs for appconfig::save exception Change-Id: Ic65345af7debdb340fce5dd03fe09257d7c2c395 --- src/libslic3r/AppConfig.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index e2d8b7e6e42..9340ba784d8 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -533,8 +533,10 @@ void AppConfig::save() { // Returns "undefined" if the thread naming functionality is not supported by the operating system. std::optional current_thread_name = get_current_thread_name(); - if (current_thread_name && *current_thread_name != "bambustu_main") - throw CriticalException("Calling AppConfig::save() from a worker thread!"); + if (current_thread_name && *current_thread_name != "bambustu_main") { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__<<", current_thread_name is " << *current_thread_name; + throw CriticalException("Calling AppConfig::save() from a worker thread, thread name: " + *current_thread_name); + } } // The config is first written to a file with a PID suffix and then moved From 957ab42874bb605f890c58489a855844b5be7f8b Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Mon, 31 Oct 2022 17:52:23 +0800 Subject: [PATCH 23/26] ENH: version: increase version of profiles Change-Id: I2dc0bbf8374f60f4e4c43806c9e16bd20d9d08f2 --- resources/profiles/BBL.json | 2 +- resources/profiles/Creality.json | 2 +- resources/profiles/Voron.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/profiles/BBL.json b/resources/profiles/BBL.json index 6bd6e9113e2..237bc1713b8 100644 --- a/resources/profiles/BBL.json +++ b/resources/profiles/BBL.json @@ -1,7 +1,7 @@ { "name": "Bambulab", "url": "http://www.bambulab.com/Parameters/vendor/BBL.json", - "version": "01.03.00.02", + "version": "01.03.00.13", "force_update": "0", "description": "the initial version of BBL configurations", "machine_model_list": [ diff --git a/resources/profiles/Creality.json b/resources/profiles/Creality.json index 6ea8e4f1ce6..f55a3244652 100644 --- a/resources/profiles/Creality.json +++ b/resources/profiles/Creality.json @@ -1,6 +1,6 @@ { "name": "Creality", - "version": "01.02.01.03", + "version": "01.03.00.13", "force_update": "0", "description": "Creality configurations", "machine_model_list": [ diff --git a/resources/profiles/Voron.json b/resources/profiles/Voron.json index 87f39043ca9..88ffa2db89b 100644 --- a/resources/profiles/Voron.json +++ b/resources/profiles/Voron.json @@ -1,6 +1,6 @@ { "name": "Voron", - "version": "01.02.01.03", + "version": "01.03.00.13", "force_update": "0", "description": "Voron configurations", "machine_model_list": [ From e81d49aaae1bd0fbb68c47161858abad225ca4c5 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Mon, 31 Oct 2022 21:22:03 +0800 Subject: [PATCH 24/26] FIX: fix the label switch incorrect issue when print_sequence change 1. only turn on label while switch from by_layer to by_object 2. don't crash when filament_colours mismatch between project_config and PresetBundle Change-Id: Icac9d0d7f88e17fcad3b042ea19cda3ac23ae62c --- src/slic3r/GUI/GUI_Factories.cpp | 6 +++++- src/slic3r/GUI/Plater.cpp | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 5a3ff39590d..6c842038e65 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -1333,7 +1333,7 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) menu->Destroy(item_id); } - const int filaments_cnt = filaments_count(); + int filaments_cnt = filaments_count(); if (filaments_cnt <= 1) return; @@ -1345,6 +1345,10 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) std::vector icons = get_extruder_color_icons(true); if (icons.size() < filaments_cnt) { BOOST_LOG_TRIVIAL(warning) << boost::format("Warning: icons size %1%, filaments_cnt=%2%")%icons.size()%filaments_cnt; + if (icons.size() <= 1) + return; + else + filaments_cnt = icons.size(); } wxMenu* extruder_selection_menu = new wxMenu(); const wxString& name = sels.Count() == 1 ? names[0] : names[1]; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 5ad47eaaa31..c3398f38e39 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9296,6 +9296,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config) { bool update_scheduled = false; bool bed_shape_changed = false; + bool print_sequence_changed = false; t_config_option_keys diff_keys = p->config->diff(config); for (auto opt_key : diff_keys) { if (opt_key == "filament_colour") { @@ -9346,6 +9347,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config) } else if (opt_key == "print_sequence") { update_scheduled = true; + print_sequence_changed = true; } else if (opt_key == "printer_model") { p->reset_gcode_toolpaths(); @@ -9371,7 +9373,8 @@ void Plater::on_config_change(const DynamicPrintConfig &config) std::string info_text = L("Print By Object: \nSuggest to use auto-arrange to avoid collisions when printing."); notify_manager->bbl_show_seqprintinfo_notification(info_text); //always show label when switch to sequence print - this->show_view3D_labels(true); + if (print_sequence_changed) + this->show_view3D_labels(true); } else notify_manager->bbl_close_seqprintinfo_notification(); From a2babc2f433e2ed0b871682a91acb225acbf2fc6 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Tue, 1 Nov 2022 09:45:09 +0800 Subject: [PATCH 25/26] ENH: remove the dulicate warning msg of temp Signed-off-by: qing.zhang Change-Id: I978f2de34e277c6747adc783cb91c341f159a67e --- src/libslic3r/GCode/GCodeProcessor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 312389a4d81..f74e4d6a07b 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3983,18 +3983,21 @@ void GCodeProcessor::update_slice_warnings() auto used_extruders = get_used_extruders(); assert(!used_extruders.empty()); + GCodeProcessorResult::SliceWarning warning; + warning.level = 1; if (m_highest_bed_temp != 0) { for (size_t i = 0; i < used_extruders.size(); i++) { int temperature = get_filament_vitrification_temperature(used_extruders[i]); - if (temperature != 0 && m_highest_bed_temp > temperature) { - GCodeProcessorResult::SliceWarning warning; - warning.level = 1; - warning.msg = BED_TEMP_TOO_HIGH_THAN_FILAMENT; - m_result.warnings.emplace_back(std::move(warning)); - } + if (temperature != 0 && m_highest_bed_temp > temperature) + warning.params.push_back(std::to_string(used_extruders[i])); } } + if (!warning.params.empty()) { + warning.msg = BED_TEMP_TOO_HIGH_THAN_FILAMENT; + m_result.warnings.push_back(warning); + } + m_result.warnings.shrink_to_fit(); } From e073113c3ebc1d607d9ad24d4d0cb7c717c6e259 Mon Sep 17 00:00:00 2001 From: gerrit Date: Tue, 1 Nov 2022 12:58:02 +0800 Subject: [PATCH 26/26] ci: update build version to 01.03.00.22 Change-Id: I69d99b1b3306fd0d191a22b320705f846b82eb9d --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 30b8b622dd5..0d792b0cceb 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.21") +set(SLIC3R_VERSION "01.03.00.22")