Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub master to 1.10.1 #5285

Merged
merged 27 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
92a9b0e
ENH:modify the button text for cancel print
walterwongbbl Nov 13, 2024
9bb7880
FIX:fixed the issue of the hot bed temperature not updating
walterwongbbl Nov 13, 2024
210eda9
FIX:STEP mesh crashes in specific language
MackBambu Nov 13, 2024
61ed685
FIX:add "split mesh and save relationship" api
Haidiye00 Nov 13, 2024
fdcec63
ENH: adjust scarf seam angle check threshold
QingZhangBambu Nov 13, 2024
390bb32
ci: update build version to 01.10.00.90
Nov 13, 2024
91db671
FIX:m_last_linear and m_last_angle add init value
MackBambu Nov 13, 2024
5322da3
FIX: not use scarf seam as defualt
QingZhangBambu Nov 14, 2024
f173e7f
ci: update build version to 01.10.00.91
Nov 14, 2024
76e28e6
ENH:Update button text
walterwongbbl Nov 14, 2024
55edb69
FIX:add "enable_opengl_multi_instance" option
Haidiye00 Nov 14, 2024
dc2282c
FIX:use ui_and_3d_volume_map to change filament
Haidiye00 Nov 13, 2024
bda343a
ci: update build version to 01.10.00.92
Nov 14, 2024
92b90c7
FIX:delete app_config in GLShadersManager.cpp
Haidiye00 Nov 14, 2024
a63e276
ENH:translate text
Haidiye00 Nov 14, 2024
06f7acf
ENH:update step mesh ui
MackBambu Nov 14, 2024
f109395
ENH:translate step mesh text
MackBambu Nov 14, 2024
763a693
ci: update build version to 01.10.00.93
Nov 14, 2024
de4d6c5
ENH: CLI: refine downward_check logic
lanewei120 Nov 14, 2024
3d6f122
FIX:If the angle and linear deflections get
MackBambu Nov 14, 2024
ea98960
ci: update build version to 01.10.00.94
Nov 14, 2024
aed9dd9
ENH: version: bumped to 1.10.1
lanewei120 Nov 15, 2024
4be2246
ci: update network module based on commit adbaa57
Nov 15, 2024
5f8b686
ci: update network module based on commit bf743ea
Nov 15, 2024
d349a9f
FIX: pause layer not working
XunZhangBambu Nov 15, 2024
c9faf8d
FIX: finish time not display
DanBao-Bambu Nov 15, 2024
f4b18a9
FIX: wrong use of reverse iter
XunZhangBambu Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: pause layer not working
1.The stored layer height differs too much from the generated layer
height.Use a more direct way to locate the layer

github:5253,5275

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ie2428e700c72386349a4f2d64076c940ac4eea71
  • Loading branch information
XunZhangBambu authored and lanewei120 committed Nov 15, 2024
commit d349a9f6416997ed1ee688e5b20f90e4ed4b959d
117 changes: 70 additions & 47 deletions src/libslic3r/GCode/ToolOrdering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,61 +954,84 @@ void ToolOrdering::mark_skirt_layers(const PrintConfig &config, coordf_t max_lay

// BBS: replace model custom gcode with current plate custom gcode
static CustomGCode::Info custom_gcode_per_print_z;
void ToolOrdering::assign_custom_gcodes(const Print &print)
void ToolOrdering::assign_custom_gcodes(const Print& print)
{
// Only valid for non-sequential print.
assert(print.config().print_sequence == PrintSequence::ByLayer);
// Only valid for non-sequential print.
assert(print.config().print_sequence == PrintSequence::ByLayer);

custom_gcode_per_print_z = print.model().get_curr_plate_custom_gcodes();
if (custom_gcode_per_print_z.gcodes.empty())
return;
if (custom_gcode_per_print_z.gcodes.empty())
return;

// BBS
auto num_filaments = unsigned(print.config().filament_diameter.size());
CustomGCode::Mode mode =
(num_filaments == 1) ? CustomGCode::SingleExtruder :
print.object_extruders().size() == 1 ? CustomGCode::MultiAsSingle : CustomGCode::MultiExtruder;
CustomGCode::Mode model_mode = print.model().get_curr_plate_custom_gcodes().mode;
std::vector<unsigned char> extruder_printing_above(num_filaments, false);
auto custom_gcode_it = custom_gcode_per_print_z.gcodes.rbegin();
// Tool changes and color changes will be ignored, if the model's tool/color changes were entered in mm mode and the print is in non mm mode
// or vice versa.
bool ignore_tool_and_color_changes = (mode == CustomGCode::MultiExtruder) != (model_mode == CustomGCode::MultiExtruder);
// If printing on a single extruder machine, make the tool changes trigger color change (M600) events.
bool tool_changes_as_color_changes = mode == CustomGCode::SingleExtruder && model_mode == CustomGCode::MultiAsSingle;

// take the half of the minimum layer height gap as episilon
double layer_height_episilon = std::numeric_limits<double>::max();
for (auto it_prev = m_layer_tools.begin(), it_next = std::next(m_layer_tools.begin()); it_next != m_layer_tools.end(); it_prev = it_next, ++it_next)
layer_height_episilon = std::min(layer_height_episilon, it_next->print_z - it_prev->print_z);
layer_height_episilon *= 0.5;

auto it_lt = m_layer_tools.rbegin();
auto num_filaments = unsigned(print.config().filament_diameter.size());
CustomGCode::Mode mode =
(num_filaments == 1) ? CustomGCode::SingleExtruder :
print.object_extruders().size() == 1 ? CustomGCode::MultiAsSingle : CustomGCode::MultiExtruder;
CustomGCode::Mode model_mode = print.model().get_curr_plate_custom_gcodes().mode;
auto custom_gcode_it = custom_gcode_per_print_z.gcodes.rbegin();
// Tool changes and color changes will be ignored, if the model's tool/color changes were entered in mm mode and the print is in non mm mode
// or vice versa.
bool ignore_tool_and_color_changes = (mode == CustomGCode::MultiExtruder) != (model_mode == CustomGCode::MultiExtruder);
// If printing on a single extruder machine, make the tool changes trigger color change (M600) events.
bool tool_changes_as_color_changes = mode == CustomGCode::SingleExtruder && model_mode == CustomGCode::MultiAsSingle;

auto apply_custom_gcode_to_layer = [mode,
ignore_tool_and_color_changes,
tool_changes_as_color_changes,
num_filaments](LayerTools& lt, const std::vector<unsigned char>& extruder_printing_above, const CustomGCode::Item& item)
{
bool color_change = item.type == CustomGCode::ColorChange;
bool tool_change = item.type == CustomGCode::ToolChange;
bool pause_or_custom_gcode = !color_change && !tool_change;
bool apply_color_change = !ignore_tool_and_color_changes &&
// If it is color change, it will actually be useful as the exturder above will print.
// BBS
(color_change ?
mode == CustomGCode::SingleExtruder ||
(item.extruder <= int(num_filaments) && extruder_printing_above[unsigned(item.extruder - 1)]) :
tool_change && tool_changes_as_color_changes);
if (pause_or_custom_gcode || apply_color_change)
lt.custom_gcode = &item;
};

std::unordered_map<int, std::vector<unsigned char>> extruder_print_above_by_layer;
{
std::vector<unsigned char> extruder_printing_above(num_filaments, false);
for (auto iter = m_layer_tools.rbegin(); iter != m_layer_tools.rend(); ++iter) {
for (unsigned int i : iter->extruders)
extruder_printing_above[i] = true;
int layer_idx = iter.base() - m_layer_tools.begin();
extruder_print_above_by_layer.emplace(layer_idx, extruder_printing_above);
}
}

for (auto custom_gcode_it = custom_gcode_per_print_z.gcodes.rbegin(); custom_gcode_it != custom_gcode_per_print_z.gcodes.rend(); ++custom_gcode_it) {
if (custom_gcode_it->type == CustomGCode::ToolChange)
continue;
for (; it_lt != m_layer_tools.rend(); ++it_lt) {
for (unsigned int i : it_lt->extruders)
extruder_printing_above[i] = true;
if (std::abs(it_lt->print_z - custom_gcode_it->print_z) < layer_height_episilon) {
const CustomGCode::Item &custom_gcode = *custom_gcode_it;
// The custom G-code applies to the current layer.
bool color_change = custom_gcode.type == CustomGCode::ColorChange;
bool tool_change = custom_gcode.type == CustomGCode::ToolChange;
bool pause_or_custom_gcode = ! color_change && ! tool_change;
bool apply_color_change = ! ignore_tool_and_color_changes &&
// If it is color change, it will actually be useful as the exturder above will print.
// BBS
(color_change ?
mode == CustomGCode::SingleExtruder ||
(custom_gcode.extruder <= int(num_filaments) && extruder_printing_above[unsigned(custom_gcode.extruder - 1)]) :
tool_change && tool_changes_as_color_changes);
if (pause_or_custom_gcode || apply_color_change)
it_lt->custom_gcode = &custom_gcode;

++it_lt;
break;
}

auto layer_it_upper = std::upper_bound(m_layer_tools.begin(), m_layer_tools.end(), custom_gcode_it->print_z, [](double z,const LayerTools& lt) {
return z < lt.print_z;
});

int upper_layer_idx = layer_it_upper - m_layer_tools.begin();
if (layer_it_upper == m_layer_tools.begin()) {
apply_custom_gcode_to_layer(*layer_it_upper, extruder_print_above_by_layer[0], *custom_gcode_it);
}
else if (layer_it_upper == m_layer_tools.end()) {
auto layer_it_lower = std::prev(layer_it_upper);
int lower_layer_idx = layer_it_lower - m_layer_tools.begin();
apply_custom_gcode_to_layer(*layer_it_lower, extruder_print_above_by_layer[lower_layer_idx], *custom_gcode_it);
}
else {
auto layer_it_lower = std::prev(layer_it_upper);
int lower_layer_idx = layer_it_lower - m_layer_tools.begin();
double gap_to_lower = std::fabs(custom_gcode_it->print_z - layer_it_lower->print_z);
double gap_to_upper = std::fabs(custom_gcode_it->print_z - layer_it_upper->print_z);
if (gap_to_lower < gap_to_upper)
apply_custom_gcode_to_layer(*layer_it_lower, extruder_print_above_by_layer[lower_layer_idx], *custom_gcode_it);
else
apply_custom_gcode_to_layer(*layer_it_upper, extruder_print_above_by_layer[upper_layer_idx], *custom_gcode_it);
}
}
}
Expand Down