#639 fix wipe tower brim width

This commit is contained in:
supermerill 2020-11-06 19:05:08 +01:00
parent 835ffc6564
commit 21e6094530
4 changed files with 6 additions and 8 deletions

View File

@ -87,7 +87,7 @@ public:
bool operator==(const Flow &rhs) const { return this->width == rhs.width && this->height == rhs.height && this->nozzle_diameter == rhs.nozzle_diameter && this->bridge == rhs.bridge; } bool operator==(const Flow &rhs) const { return this->width == rhs.width && this->height == rhs.height && this->nozzle_diameter == rhs.nozzle_diameter && this->bridge == rhs.bridge; }
static Flow new_from_config_width(FlowRole role, const ConfigOptionFloatOrPercent &width, float nozzle_diameter, float height, float bridge_flow_ratio); static Flow new_from_config_width(FlowRole role, const ConfigOptionFloatOrPercent &width, float nozzle_diameter, float height, float bridge_flow_ratio = 0);
// Create a flow from the spacing of extrusion lines. // Create a flow from the spacing of extrusion lines.
// This method is used exclusively to calculate new flow of 100% infill, where the extrusion width was allowed to scale // This method is used exclusively to calculate new flow of 100% infill, where the extrusion width was allowed to scale
// to fit a region with integer number of lines. // to fit a region with integer number of lines.

View File

@ -363,7 +363,7 @@ void FanMover::_process_gcode_line(GCodeReader& reader, const GCodeReader::GCode
remove_from_buffer(m_buffer.begin()); remove_from_buffer(m_buffer.begin());
} }
} }
float sum = 0; double sum = 0;
for (auto& data : m_buffer) sum += data.time; for (auto& data : m_buffer) sum += data.time;
assert( std::abs(m_buffer_time_size - sum) < 0.01); assert( std::abs(m_buffer_time_size - sum) < 0.01);
} }

View File

@ -955,10 +955,9 @@ WipeTower::ToolChangeResult WipeTower::toolchange_Brim(bool sideOnly, float y_of
m_wipe_tower_width, m_wipe_tower_width,
m_wipe_tower_depth); m_wipe_tower_depth);
double unscaled_brim_width = m_config->wipe_tower_brim.get_abs_value(m_nozzle_diameter); double unscaled_brim_width = m_config->wipe_tower_brim.get_abs_value(m_nozzle_diameter);
Slic3r::Flow brim_flow(m_config->first_layer_extrusion_width.get_abs_value(m_nozzle_diameter), m_layer_height, m_nozzle_diameter); Slic3r::Flow brim_flow = Flow::new_from_config_width(FlowRole::frPerimeter, m_config->first_layer_extrusion_width, m_layer_height, m_nozzle_diameter);
WipeTowerWriter writer(m_layer_height, brim_flow.width, m_gcode_flavor, m_filpar); WipeTowerWriter writer(m_layer_height, brim_flow.width, m_gcode_flavor, m_filpar);
std::cout << "flow from " << (m_extrusion_flow * 1.1f) << " to " << brim_flow.mm3_per_mm() << "\n";
writer.set_extrusion_flow(brim_flow.mm3_per_mm()) writer.set_extrusion_flow(brim_flow.mm3_per_mm())
.set_z(m_z_pos) // Let the writer know the current Z position as a base for Z-hop. .set_z(m_z_pos) // Let the writer know the current Z position as a base for Z-hop.
.set_initial_tool(m_current_tool) .set_initial_tool(m_current_tool)
@ -969,6 +968,7 @@ WipeTower::ToolChangeResult WipeTower::toolchange_Brim(bool sideOnly, float y_of
// Extrude X rounds of a brim around the future wipe tower. // Extrude X rounds of a brim around the future wipe tower.
box_coordinates box(wipeTower_box); box_coordinates box(wipeTower_box);
box.expand(brim_flow.spacing()- brim_flow.width); // ensure that the brim is attached to the wipe tower box.expand(brim_flow.spacing()- brim_flow.width); // ensure that the brim is attached to the wipe tower
writer.set_initial_position(box.ld);
// the brim shall have 'normal' spacing with no extra void space // the brim shall have 'normal' spacing with no extra void space
for (float i = 0; i < unscaled_brim_width; i += brim_flow.spacing()) { for (float i = 0; i < unscaled_brim_width; i += brim_flow.spacing()) {
box.expand(brim_flow.spacing()); box.expand(brim_flow.spacing());

View File

@ -1640,8 +1640,7 @@ Flow Print::brim_flow(size_t extruder_id) const
frPerimeter, frPerimeter,
width, width,
(float)m_config.nozzle_diameter.get_at(extruder_id), (float)m_config.nozzle_diameter.get_at(extruder_id),
(float)this->skirt_first_layer_height(), (float)this->skirt_first_layer_height()
0
); );
} }
@ -1665,8 +1664,7 @@ Flow Print::skirt_flow(size_t extruder_id) const
frPerimeter, frPerimeter,
width, width,
(float)m_config.nozzle_diameter.get_at(extruder_id), (float)m_config.nozzle_diameter.get_at(extruder_id),
(float)this->skirt_first_layer_height(), (float)this->skirt_first_layer_height()
0
); );
} }