FIX: scale problem in needs_retraction

jira:[NEW]

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Idfbe954b22fa6aa5769c55e46874fa6a80ecbf45
(cherry picked from commit 4e853f50b748e3af11e2d64862b6ee557fda361b)
This commit is contained in:
xun.zhang 2023-11-09 14:32:41 +08:00 committed by Lane.Wei
parent 693aa8d259
commit 1d5c7bd442
1 changed files with 3 additions and 2 deletions

View File

@ -4642,10 +4642,11 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp
travel_bbox.inflated(1); travel_bbox.inflated(1);
travel_bbox.defined = true; travel_bbox.defined = true;
const float protect_z_scaled = scale_(0.4); // do not scale for z
const float protect_z = 0.4;
std::pair<float, float> z_range; std::pair<float, float> z_range;
z_range.second = m_layer ? m_layer->print_z : 0.f; z_range.second = m_layer ? m_layer->print_z : 0.f;
z_range.first = std::max(0.f, z_range.second - protect_z_scaled); z_range.first = std::max(0.f, z_range.second - protect_z);
std::vector<LayerPtrs> layers_of_objects; std::vector<LayerPtrs> layers_of_objects;
std::vector<BoundingBox> boundingBox_for_objects; std::vector<BoundingBox> boundingBox_for_objects;
std::vector<Points> objects_instances_shift; std::vector<Points> objects_instances_shift;