WipeTower brim with first layer from first layer width parameter.

This commit is contained in:
supermerill 2018-06-27 15:37:53 +02:00 committed by supermerill
parent d21c33e9b5
commit 0be468e893
3 changed files with 14 additions and 9 deletions

View File

@ -646,7 +646,9 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::toolchange_Brim(bool sideOnly, flo
m_wipe_tower_width,
m_wipe_tower_depth);
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
//use first layer width parameter
PrusaMultiMaterial::Writer writer(m_layer_height, m_brim_width);
writer.set_extrusion_flow(m_extrusion_flow * 1.1f)
.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)
@ -654,21 +656,21 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::toolchange_Brim(bool sideOnly, flo
.append(";-------------------------------------\n"
"; CP WIPE TOWER FIRST LAYER BRIM START\n");
xy initial_position = wipeTower_box.lu - xy(m_perimeter_width * 6.f, 0);
xy initial_position = wipeTower_box.lu - xy(m_brim_width * 6.f, 0);
writer.set_initial_position(initial_position);
writer.extrude_explicit(wipeTower_box.ld - xy(m_perimeter_width * 6.f, 0), // Prime the extruder left of the wipe tower.
writer.extrude_explicit(wipeTower_box.ld - xy(m_brim_width * 6.f, 0), // Prime the extruder left of the wipe tower.
1.5f * m_extrusion_flow * (wipeTower_box.lu.y - wipeTower_box.ld.y), 2400);
// The tool is supposed to be active and primed at the time when the wipe tower brim is extruded.
// Extrude 4 rounds of a brim around the future wipe tower.
box_coordinates box(wipeTower_box);
box.expand(m_perimeter_width);
box.expand(m_brim_width);
for (size_t i = 0; i < 4; ++ i) {
writer.travel (box.ld, 7000)
.extrude(box.lu, 2100).extrude(box.ru)
.extrude(box.rd ).extrude(box.ld);
box.expand(m_perimeter_width);
box.expand(m_brim_width);
}
writer.travel(wipeTower_box.ld, 7000); // Move to the front left corner.

View File

@ -44,7 +44,7 @@ public:
// wipe_area -- space available for one toolchange in mm
WipeTowerPrusaMM(float x, float y, float width, float rotation_angle, float cooling_tube_retraction,
float cooling_tube_length, float parking_pos_retraction, float bridging, const std::vector<float>& wiping_matrix,
unsigned int initial_tool) :
unsigned int initial_tool, float first_layer_width) :
m_wipe_tower_pos(x, y),
m_wipe_tower_width(width),
m_wipe_tower_rotation_angle(rotation_angle),
@ -55,7 +55,8 @@ public:
m_cooling_tube_length(cooling_tube_length),
m_parking_pos_retraction(parking_pos_retraction),
m_bridging(bridging),
m_current_tool(initial_tool)
m_current_tool(initial_tool),
m_brim_width(first_layer_width)
{
unsigned int number_of_extruders = (unsigned int)(sqrt(wiping_matrix.size())+WT_EPSILON);
for (unsigned int i = 0; i<number_of_extruders; ++i)
@ -200,7 +201,8 @@ private:
float m_bridging = 0.f;
bool m_adhesion = true;
float m_perimeter_width = 0.4 * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_perimeter_width = 0.4 * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_brim_width = 0.4 * Width_To_Nozzle_Ratio * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_extrusion_flow = 0.038; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.

View File

@ -1087,7 +1087,8 @@ void Print::_make_wipe_tower()
float(this->config.wipe_tower_width.value),
float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
float(this->config.wipe_tower_bridging), wiping_volumes, m_tool_ordering.first_extruder());
float(this->config.wipe_tower_bridging), wiping_volumes, m_tool_ordering.first_extruder(),
float(this->config.first_layer_extrusion_width));
//wipe_tower.set_retract();
//wipe_tower.set_zhop();