ENH: enable thick bridge for wipe tower

Change-Id: I96dae7753995af1862fe4ad33a00fa56cfbb7d3c
(cherry picked from commit 5f98ff50613e3358de10fa1b6d4429ce71e526c2)
This commit is contained in:
zhimin.zeng 2022-11-11 12:15:18 +08:00 committed by Lane.Wei
parent 148f6ba05d
commit 2f12ad7bf2
2 changed files with 96 additions and 9 deletions

View file

@ -223,6 +223,17 @@ public:
// Call this method only if layer_finished() is false.
ToolChangeResult finish_layer(bool extruder_perimeter = true, bool extruder_fill = true);
// Calculates extrusion flow needed to produce required line width for given layer height
float extrusion_flow(float layer_height = -1.f) const // negative layer_height - return current m_extrusion_flow
{
if (layer_height < 0) return m_extrusion_flow;
return layer_height * (m_perimeter_width - layer_height * (1.f - float(M_PI) / 4.f)) / filament_area();
}
bool get_floating_area(float& start_pos_y, float& end_pos_y) const;
bool need_thick_bridge_flow(float pos_y) const;
float get_extrusion_flow() const { return m_extrusion_flow; }
// Is the current layer finished?
bool layer_finished() const {
return m_current_layer_finished;
@ -336,14 +347,6 @@ private:
bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; }
// Calculates extrusion flow needed to produce required line width for given layer height
float extrusion_flow(float layer_height = -1.f) const // negative layer_height - return current m_extrusion_flow
{
if ( layer_height < 0 )
return m_extrusion_flow;
return layer_height * ( m_perimeter_width - layer_height * (1.f-float(M_PI)/4.f)) / filament_area();
}
// Calculates length of extrusion line to extrude given volume
float volume_to_length(float volume, float line_width, float layer_height) const {
return std::max(0.f, volume / (layer_height * (line_width - layer_height * (1.f - float(M_PI) / 4.f))));