FIX: z speed smoothing crash while by object print

Jira: none

and add protect for calculating loop connection

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Ie74280403d8afc55e699a30f3d1e69afdc41a86d
This commit is contained in:
qing.zhang 2024-09-05 11:07:11 +08:00 committed by Lane.Wei
parent b52a9de509
commit f82b599bd4
2 changed files with 5 additions and 1 deletions

View File

@ -2619,7 +2619,7 @@ void GCode::process_layers(
for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++layer_idx) {
print.throw_if_canceled();
if (layer_idx > 0) {
LayerToPrint &layer = layers_to_print[layer_idx++];
LayerToPrint &layer = layers_to_print[layer_idx];
cooling_buffer.apply_smooth_speed(smooth_calculator, layers_extruder_adjustments[layer_idx], layer_idx);
}
}

View File

@ -170,6 +170,10 @@ void PrintObject::merge_layer_node(const size_t layer_id, int &max_merged_id, st
continue;
auto it = node_record.find(appear_id[appear_node_idx]);
//protect
if (it == node_record.end())
continue;
std::vector<std::pair<int, int>> &appear_node_pos = it->second;
for (size_t node_idx = 0; node_idx < appear_node_pos.size(); ++node_idx) {