Partial refactoring of wipe tower code (got rid of global constants, etc)

This commit is contained in:
Lukas Matena 2018-03-21 15:57:17 +01:00
parent e30405d672
commit 9519fae490
4 changed files with 79 additions and 126 deletions

View file

@ -33,7 +33,6 @@ TODO LIST
#define strcasecmp _stricmp
#endif
const bool peters_wipe_tower = false; // sparse wipe tower inspired by Peter's post processor - not finished yet
namespace Slic3r
{
@ -119,7 +118,7 @@ public:
if (! m_preview_suppressed && e > 0.f && len > 0.) {
// Width of a squished extrusion, corrected for the roundings of the squished extrusions.
// This is left zero if it is a travel move.
float width = float(double(e) * Filament_Area / (len * m_layer_height));
float width = float(double(e) * /*Filament_Area*/2.40528 / (len * m_layer_height));
// Correct for the roundings of a squished extrusion.
width += m_layer_height * float(1. - M_PI / 4.);
if (m_extrusions.empty() || m_extrusions.back().pos != rotated_current_pos)
@ -415,33 +414,12 @@ private:
}
Writer& operator=(const Writer &rhs);
};
/*
class Material
{
public:
std::string name;
std::string type;
struct RammingStep {
// float length;
float extrusion_multiplier; // sirka linky
float extrusion;
float speed;
};
std::vector<RammingStep> ramming_sequence;
// Number and speed of the cooling moves.
std::vector<float> cooling_moves;
// Percentage of the speed overide, in pairs of <z, percentage>
std::vector<std::pair<float, int>> speed_override;
};
*/
}; // class Writer
}; // namespace PrusaMultiMaterial
WipeTowerPrusaMM::material_type WipeTowerPrusaMM::parse_material(const char *name)
{
if (strcasecmp(name, "PLA") == 0)
@ -476,6 +454,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
bool last_wipe_inside_wipe_tower)
{
this->set_layer(first_layer_height, first_layer_height, tools.size(), true, false);
this->m_num_layer_changes = 0;
this->m_current_tool = tools.front();
@ -484,8 +463,8 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
// Due to the XYZ calibration, this working space may shrink slightly from all directions,
// therefore the homing position is shifted inside the bed by 0.2 in the firmware to [0.2, -2.0].
// box_coordinates cleaning_box(xy(0.5f, - 1.5f), m_wipe_tower_width, wipe_area);
//FIXME: set the width properly
const float prime_section_width = 55.f;
const float prime_section_width = std::min(240.f / tools.size(), 60.f);
box_coordinates cleaning_box(xy(5.f, 0.f), prime_section_width, 100.f);
PrusaMultiMaterial::Writer writer;
@ -556,7 +535,6 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
if ( m_print_brim )
return toolchange_Brim();
float wipe_area = 0.f;
bool last_change_in_layer = false;
float wipe_volume = 0.f;
@ -589,7 +567,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
.set_layer_height(m_layer_height)
.set_initial_tool(m_current_tool)
.set_rotation(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_wipe_tower_rotation_angle)
.set_y_shift(m_y_shift + (tool!=(unsigned int)(-1) && (m_current_shape == SHAPE_REVERSED && !peters_wipe_tower) ? m_layer_info->depth - m_layer_info->toolchanges_depth(): 0.f))
.set_y_shift(m_y_shift + (tool!=(unsigned int)(-1) && (m_current_shape == SHAPE_REVERSED && !m_peters_wipe_tower) ? m_layer_info->depth - m_layer_info->toolchanges_depth(): 0.f))
.append(";--------------------\n"
"; CP TOOLCHANGE START\n")
.comment_with_value(" toolchange #", m_num_tool_changes)
@ -625,7 +603,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
if (last_change_in_layer) {// draw perimeter line
writer.set_y_shift(m_y_shift);
if (peters_wipe_tower)
if (m_peters_wipe_tower)
writer.rectangle(m_wipe_tower_pos,m_layer_info->depth + 3*m_perimeter_width,m_wipe_tower_depth);
else {
writer.rectangle(m_wipe_tower_pos,m_wipe_tower_width, m_layer_info->depth + m_perimeter_width);
@ -724,7 +702,7 @@ void WipeTowerPrusaMM::toolchange_Unload(
writer.append("; CP TOOLCHANGE UNLOAD\n");
const float line_width = m_line_width * m_filpar[m_current_tool].ramming_line_width_multiplicator; // desired ramming line thickness
const float line_width = m_perimeter_width * m_filpar[m_current_tool].ramming_line_width_multiplicator; // desired ramming line thickness
const float y_step = line_width * m_filpar[m_current_tool].ramming_step_multiplicator * m_extra_spacing; // spacing between lines in mm
unsigned i = 0; // iterates through ramming_speed
@ -757,7 +735,7 @@ void WipeTowerPrusaMM::toolchange_Unload(
if (tch.old_tool == m_current_tool) {
sum_of_depths += tch.ramming_depth;
float ramming_end_y = m_wipe_tower_pos.y + sum_of_depths;
ramming_end_y -= (y_step/m_extra_spacing-m_line_width) / 2.f; // center of final ramming line
ramming_end_y -= (y_step/m_extra_spacing-m_perimeter_width) / 2.f; // center of final ramming line
// debugging:
/*float oldx = writer.x();
@ -851,7 +829,7 @@ void WipeTowerPrusaMM::toolchange_Unload(
// this is to align ramming and future wiping extrusions, so the future y-steps can be uniform from the start:
// the perimeter_width will later be subtracted, it is there to not load while moving over just extruded material
writer.travel(end_of_ramming.x, end_of_ramming.y + (y_step/m_extra_spacing-m_line_width) / 2.f + m_perimeter_width, 2400.f);
writer.travel(end_of_ramming.x, end_of_ramming.y + (y_step/m_extra_spacing-m_perimeter_width) / 2.f + m_perimeter_width, 2400.f);
writer.resume_preview()
.flush_planner_queue();
@ -925,8 +903,8 @@ void WipeTowerPrusaMM::toolchange_Wipe(
// the ordered volume, even if it means violating the box. This can later be removed and simply
// wipe until the end of the assigned area.
float x_to_wipe = volume_to_length(wipe_volume, m_line_width, m_layer_height);
float dy = m_extra_spacing*m_line_width;
float x_to_wipe = volume_to_length(wipe_volume, m_perimeter_width, m_layer_height);
float dy = m_extra_spacing*m_perimeter_width;
float wipe_speed = 1600.f;
// if there is less than 2.5*m_perimeter_width to the edge, advance straightaway (there is likely a blob anyway)
@ -990,7 +968,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
.set_layer_height(m_layer_height)
.set_initial_tool(m_current_tool)
.set_rotation(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_wipe_tower_rotation_angle)
.set_y_shift(m_y_shift - (m_current_shape == SHAPE_REVERSED && !peters_wipe_tower ? m_layer_info->toolchanges_depth() : 0.f))
.set_y_shift(m_y_shift - (m_current_shape == SHAPE_REVERSED && !m_peters_wipe_tower ? m_layer_info->toolchanges_depth() : 0.f))
.append(";--------------------\n"
"; CP EMPTY GRID START\n")
// m_num_layer_changes is incremented by set_z, so it is 1 based.
@ -1024,11 +1002,11 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
if (m_is_first_layer && m_adhesion) {
// Extrude a dense infill at the 1st layer to improve 1st layer adhesion of the wipe tower.
box.expand(-m_perimeter_width/2.f);
unsigned nsteps = int(floor((box.lu.y - box.ld.y) / (2*m_perimeter_width)));
int nsteps = int(floor((box.lu.y - box.ld.y) / (2*m_perimeter_width)));
float step = (box.lu.y - box.ld.y) / nsteps;
writer.travel(box.ld-xy(m_perimeter_width/2.f,m_perimeter_width/2.f));
if (nsteps >= 0)
for (size_t i = 0; i < nsteps; ++i) {
for (int i = 0; i < nsteps; ++i) {
writer.extrude(box.ld.x+m_perimeter_width/2.f, writer.y() + 0.5f * step);
writer.extrude(box.rd.x - m_perimeter_width / 2.f, writer.y());
writer.extrude(box.rd.x - m_perimeter_width / 2.f, writer.y() + 0.5f * step);
@ -1076,7 +1054,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
// Appends a toolchange into m_plan and calculates neccessary depth of the corresponding box
void WipeTowerPrusaMM::plan_toolchange(float z_par, float layer_height_par, unsigned int old_tool, unsigned int new_tool,bool brim)
{
{
assert(m_plan.back().z <= z_par + WT_EPSILON ); // refuses to add a layer below the last one
if (m_plan.empty() || m_plan.back().z + WT_EPSILON < z_par) // if we moved to a new layer, we'll add it to m_plan first
@ -1094,16 +1072,16 @@ void WipeTowerPrusaMM::plan_toolchange(float z_par, float layer_height_par, unsi
float depth = 0.f;
float width = m_wipe_tower_width - 3*m_perimeter_width;
float length_to_extrude = volume_to_length(0.25f * std::accumulate(m_filpar[old_tool].ramming_speed.begin(), m_filpar[old_tool].ramming_speed.end(), 0.f),
m_line_width * m_filpar[old_tool].ramming_line_width_multiplicator,
m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator,
layer_height_par);
depth = (int(length_to_extrude / width) + 1) * (m_line_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator);
depth = (int(length_to_extrude / width) + 1) * (m_perimeter_width * m_filpar[old_tool].ramming_line_width_multiplicator * m_filpar[old_tool].ramming_step_multiplicator);
float ramming_depth = depth;
length_to_extrude = width*((length_to_extrude / width)-int(length_to_extrude / width)) - width;
float first_wipe_line = -length_to_extrude;
length_to_extrude += volume_to_length(wipe_volumes[old_tool][new_tool], m_line_width, layer_height_par);
length_to_extrude += volume_to_length(wipe_volumes[old_tool][new_tool], m_perimeter_width, layer_height_par);
length_to_extrude = std::max(length_to_extrude,0.f);
depth += (int(length_to_extrude / width) + 1) * m_line_width;
depth += (int(length_to_extrude / width) + 1) * m_perimeter_width;
depth *= m_extra_spacing;
m_plan.back().tool_changes.push_back(WipeTowerInfo::ToolChange(old_tool, new_tool, depth, ramming_depth,first_wipe_line));
@ -1147,12 +1125,12 @@ void WipeTowerPrusaMM::save_on_last_wipe()
float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into
float length_to_save = 2*(m_wipe_tower_width+m_wipe_tower_depth) + (!layer_finished() ? finish_layer().total_extrusion_length_in_plane() : 0.f);
float length_to_wipe = volume_to_length(wipe_volumes[m_layer_info->tool_changes.back().old_tool][m_layer_info->tool_changes.back().new_tool],
m_line_width,m_layer_info->height) - m_layer_info->tool_changes.back().first_wipe_line - length_to_save;
m_perimeter_width,m_layer_info->height) - m_layer_info->tool_changes.back().first_wipe_line - length_to_save;
length_to_wipe = std::max(length_to_wipe,0.f);
float depth_to_wipe = m_line_width * (std::floor(length_to_wipe/width) + ( length_to_wipe > 0.f ? 1.f : 0.f ) ) * m_extra_spacing;
float depth_to_wipe = m_perimeter_width * (std::floor(length_to_wipe/width) + ( length_to_wipe > 0.f ? 1.f : 0.f ) ) * m_extra_spacing;
//depth += (int(length_to_extrude / width) + 1) * m_line_width;
//depth += (int(length_to_extrude / width) + 1) * m_perimeter_width;
m_layer_info->tool_changes.back().required_depth = m_layer_info->tool_changes.back().ramming_depth + depth_to_wipe;
}
}
@ -1172,7 +1150,7 @@ void WipeTowerPrusaMM::generate(std::vector<std::vector<WipeTower::ToolChangeRes
plan_tower();
}
if (peters_wipe_tower)
if (m_peters_wipe_tower)
make_wipe_tower_square();
m_layer_info = m_plan.begin();
@ -1183,35 +1161,33 @@ void WipeTowerPrusaMM::generate(std::vector<std::vector<WipeTower::ToolChangeRes
set_layer(layer.z,layer.height,0,layer.z == m_plan.front().z,layer.z == m_plan.back().z);
if (peters_wipe_tower)
if (m_peters_wipe_tower)
m_wipe_tower_rotation_angle += 90.f;
else
m_wipe_tower_rotation_angle += 180.f;
if (!peters_wipe_tower && m_layer_info->depth < m_wipe_tower_depth - m_perimeter_width)
if (!m_peters_wipe_tower && m_layer_info->depth < m_wipe_tower_depth - m_perimeter_width)
m_y_shift = (m_wipe_tower_depth-m_layer_info->depth-m_perimeter_width)/2.f;
for (const auto &toolchange : layer.tool_changes)
layer_result.emplace_back(tool_change(toolchange.new_tool, false));
if (! layer_finished()) {
layer_result.emplace_back(finish_layer());
if (layer_result.size() > 1) {
// Merge the two last tool changes into one.
WipeTower::ToolChangeResult &tc1 = layer_result[layer_result.size() - 2];
WipeTower::ToolChangeResult &tc2 = layer_result.back();
if (tc1.end_pos != tc2.start_pos) {
// Add a travel move from tc1.end_pos to tc2.start_pos.
char buf[2048];
sprintf(buf, "G1 X%.3f Y%.3f F7200\n", tc2.start_pos.x, tc2.start_pos.y);
tc1.gcode += buf;
auto finish_layer_toolchange = finish_layer();
if (layer_result.size() > 1) { // we will merge it to the last toolchange
auto& last_toolchange = layer_result.back();
if (last_toolchange.end_pos != finish_layer_toolchange.start_pos) {
char buf[2048]; // Add a travel move from tc1.end_pos to tc2.start_pos.
sprintf(buf, "G1 X%.3f Y%.3f F7200\n", finish_layer_toolchange.start_pos.x, finish_layer_toolchange.start_pos.y);
last_toolchange.gcode += buf;
}
tc1.gcode += tc2.gcode;
tc1.extrusions.insert(tc1.extrusions.end(), tc2.extrusions.begin(), tc2.extrusions.end());
tc1.end_pos = tc2.end_pos;
layer_result.pop_back();
}
}
last_toolchange.gcode += finish_layer_toolchange.gcode;
last_toolchange.extrusions.insert(last_toolchange.extrusions.end(),finish_layer_toolchange.extrusions.begin(),finish_layer_toolchange.extrusions.end());
last_toolchange.end_pos = finish_layer_toolchange.end_pos;
}
else
layer_result.emplace_back(std::move(finish_layer_toolchange));
}
result.emplace_back(std::move(layer_result));
m_is_first_layer = false;

View file

@ -8,19 +8,6 @@
#include "WipeTower.hpp"
// Following is used to calculate extrusion flow - should be taken from config in future
const float Filament_Area = M_PI * 1.75f * 1.75f / 4.f; // filament area in mm^3
const float Nozzle_Diameter = 0.4f; // nozzle diameter in mm
// desired line width (oval) in multiples of nozzle diameter - may not be actually neccessary to adjust
const float Width_To_Nozzle_Ratio = 1.25f;
// m_perimeter_width was hardcoded until now as 0.5 (for 0.4 nozzle and 0.2 layer height)
// FIXME m_perimeter_width is used in plan_toolchange - take care of proper initialization value when changing to variable
const float Konst = 1.f;
const float m_perimeter_width = Nozzle_Diameter * Width_To_Nozzle_Ratio * Konst;
const float WT_EPSILON = 1e-3f;
namespace Slic3r
{
@ -31,7 +18,6 @@ namespace PrusaMultiMaterial {
class WipeTowerPrusaMM : public WipeTower
{
public:
@ -65,40 +51,27 @@ public:
m_y_shift(0.f),
m_z_pos(0.f),
m_is_first_layer(false),
m_is_last_layer(false),
m_cooling_tube_retraction(cooling_tube_retraction),
m_cooling_tube_length(cooling_tube_length),
m_parking_pos_retraction(parking_pos_retraction),
m_bridging(bridging),
m_current_tool(initial_tool)
{
const unsigned int number_of_extruders = int(sqrt(wiping_matrix.size())+WT_EPSILON);
unsigned int number_of_extruders = (unsigned int)(sqrt(wiping_matrix.size())+WT_EPSILON);
for (unsigned int i = 0; i<number_of_extruders; ++i)
wipe_volumes.push_back(std::vector<float>(wiping_matrix.begin()+i*number_of_extruders,wiping_matrix.begin()+(i+1)*number_of_extruders));
/*for (size_t i = 0; i < number_of_extruders; ++ i) {
// Extruder specific parameters.
m_filpar[i].material = PLA;
m_filpar[i].temperature = 0;
m_filpar[i].first_layer_temperature = 0;
}*/
}
virtual ~WipeTowerPrusaMM() {}
// _retract - retract value in mm
void set_retract(float retract) { m_retract = retract; }
// _zHop - z hop value in mm
void set_zhop(float zhop) { m_zhop = zhop; }
// Set the extruder properties.
void set_extruder(size_t idx, material_type material, int temp, int first_layer_temp, float loading_speed,
float unloading_speed, float delay, int cooling_time, std::string ramming_parameters)
{
while (m_filpar.size() < idx+1) // makes sure the required element is in the vector
m_filpar.push_back(FilamentParameters());
//while (m_filpar.size() < idx+1) // makes sure the required element is in the vector
m_filpar.push_back(FilamentParameters());
m_filpar[idx].material = material;
m_filpar[idx].temperature = temp;
m_filpar[idx].first_layer_temperature = first_layer_temp;
@ -106,7 +79,7 @@ public:
m_filpar[idx].unloading_speed = unloading_speed;
m_filpar[idx].delay = delay;
m_filpar[idx].cooling_time = cooling_time;
std::stringstream stream{ramming_parameters};
float speed = 0.f;
stream >> m_filpar[idx].ramming_line_width_multiplicator >> m_filpar[idx].ramming_step_multiplicator;
@ -117,21 +90,14 @@ public:
}
// Setter for internal structure m_plan containing info about the future wipe tower
// Appends into internal structure m_plan containing info about the future wipe tower
// to be used before building begins. The entries must be added ordered in z.
void plan_toolchange(float z_par, float layer_height_par, unsigned int old_tool, unsigned int new_tool, bool brim);
// Iterates through prepared m_plan, generates ToolChangeResults and appends them to "result"
void generate(std::vector<std::vector<WipeTower::ToolChangeResult>> &result);
// Calculates depth for all layers and propagates them downwards
void plan_tower();
// Goes through m_plan and recalculates depths and width of the WT to make it exactly square - experimental
void make_wipe_tower_square();
// Goes through m_plan, calculates border and finish_layer extrusions and subtracts them from last wipe
void save_on_last_wipe();
// Switch to a next layer.
virtual void set_layer(
@ -150,15 +116,16 @@ public:
m_layer_height = layer_height;
m_is_first_layer = is_first_layer;
m_print_brim = is_first_layer;
m_depth_traversed = 0.f; // to make room for perimeter line
m_depth_traversed = 0.f;
m_current_shape = (! is_first_layer && m_current_shape == SHAPE_NORMAL) ? SHAPE_REVERSED : SHAPE_NORMAL;
++ m_num_layer_changes;
// Calculates extrusion flow from desired line width, nozzle diameter, filament diameter and layer_height
// Calculate extrusion flow from desired line width, nozzle diameter, filament diameter and layer_height:
m_extrusion_flow = extrusion_flow(layer_height);
while (!m_plan.empty() && m_layer_info->z < print_z - WT_EPSILON && m_layer_info+1!=m_plan.end())
// Advance m_layer_info iterator, making sure we got it right
while (!m_plan.empty() && m_layer_info->z < print_z - WT_EPSILON && m_layer_info+1 != m_plan.end())
++m_layer_info;
}
@ -183,7 +150,7 @@ public:
// On the first layer, extrude a brim around the future wipe tower first.
virtual ToolChangeResult tool_change(unsigned int new_tool, bool last_in_layer);
// Fill the unfilled space with a zig-zag.
// Fill the unfilled space with a sparse infill.
// Call this method only if layer_finished() is false.
virtual ToolChangeResult finish_layer();
@ -196,34 +163,38 @@ public:
private:
WipeTowerPrusaMM();
enum wipe_shape // A fill-in direction (positive Y, negative Y) alternates with each layer.
enum wipe_shape // A fill-in direction
{
SHAPE_NORMAL = 1,
SHAPE_REVERSED = -1
};
const bool m_peters_wipe_tower = false; // sparse wipe tower inspired by Peter's post processor - not finished yet
const float Filament_Area = M_PI * 1.75f * 1.75f / 4.f; // filament area in mm^3
const float Nozzle_Diameter = 0.4f; // nozzle diameter in mm
const float Width_To_Nozzle_Ratio = 1.25f; // desired line width (oval) in multiples of nozzle diameter - may not be actually neccessary to adjust
const float WT_EPSILON = 1e-3f;
xy m_wipe_tower_pos; // Left front corner of the wipe tower in mm.
float m_wipe_tower_width; // Width of the wipe tower.
float m_wipe_tower_depth = 0.f; // Depth of the wipe tower
float m_wipe_tower_rotation_angle = 0.f; // Wipe tower rotation angle in degrees (with respect to x axis
float m_wipe_tower_rotation_angle = 0.f; // Wipe tower rotation angle in degrees (with respect to x axis)
float m_y_shift = 0.f; // y shift passed to writer
float m_z_pos = 0.f; // Current Z position.
float m_layer_height = 0.f; // Current layer height.
size_t m_max_color_changes = 0; // Maximum number of color changes per layer.
bool m_is_first_layer = false;// Is this the 1st layer of the print? If so, print the brim around the waste tower.
bool m_is_last_layer = false;// Is this the last layer of this waste tower?
bool m_layer_parity = false;
// G-code generator parameters.
float m_zhop = 0.5f;
float m_retract = 4.f;
float m_cooling_tube_retraction = 0.f;
float m_cooling_tube_length = 0.f;
float m_parking_pos_retraction = 0.f;
float m_bridging = 0.f;
bool m_adhesion = true;
float m_line_width = Nozzle_Diameter * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_perimeter_width = Nozzle_Diameter * 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.
@ -244,7 +215,7 @@ private:
std::vector<FilamentParameters> m_filpar;
// State of the wiper tower generator.
// State of the wipe tower generator.
unsigned int m_num_layer_changes = 0; // Layer change counter for the output statistics.
unsigned int m_num_tool_changes = 0; // Tool change change counter for the output statistics.
///unsigned int m_idx_tool_change_in_layer = 0; // Layer change counter in this layer. Counting up to m_max_color_changes.
@ -254,12 +225,10 @@ private:
unsigned int m_current_tool = 0;
std::vector<std::vector<float>> wipe_volumes;
float m_depth_traversed = 0.f; // Current y position at the wipe tower.
// How much to wipe the 1st extruder over the wipe tower at the 1st layer
// after the wipe tower brim has been extruded?
float m_initial_extra_wipe = 0.f;
bool m_left_to_right = true;
float m_extra_spacing = 1.f;
float m_depth_traversed = 0.f; // Current y position at the wipe tower.
bool m_left_to_right = true;
float m_extra_spacing = 1.f;
// 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
@ -274,6 +243,15 @@ private:
return volume / (layer_height * (line_width - layer_height * (1. - M_PI / 4.)));
}
// Calculates depth for all layers and propagates them downwards
void plan_tower();
// Goes through m_plan and recalculates depths and width of the WT to make it exactly square - experimental
void make_wipe_tower_square();
// Goes through m_plan, calculates border and finish_layer extrusions and subtracts them from last wipe
void save_on_last_wipe();
struct box_coordinates
{

View file

@ -1075,7 +1075,6 @@ void Print::_make_wipe_tower()
// Lets go through the wipe tower layers and determine pairs of extruder changes for each
// to pass to wipe_tower (so that it can use it for planning the layout of the tower)
{
unsigned int current_extruder_id = m_tool_ordering.all_extruders().back();
for (const auto &layer_tools : m_tool_ordering.layer_tools()) { // for all layers

View file

@ -40,7 +40,7 @@ RammingPanel::RammingPanel(wxWindow* parent, const std::string& parameters)
{
new wxStaticText(this,wxID_ANY,wxString("Total ramming time (s):"), wxPoint(500,105), wxSize(200,25),wxALIGN_LEFT);
m_widget_time = new wxSpinCtrlDouble(this,wxID_ANY,wxEmptyString, wxPoint(700,100), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0.,5.0,3.,0.5);
new wxStaticText(this,wxID_ANY,wxString("Total rammed volume (mm3):"), wxPoint(500,135), wxSize(200,25),wxALIGN_LEFT);
new wxStaticText(this,wxID_ANY,wxString("Total rammed volume (mm\u00B3):"), wxPoint(500,135), wxSize(200,25),wxALIGN_LEFT);
m_widget_volume = new wxSpinCtrl(this,wxID_ANY,wxEmptyString, wxPoint(700,130), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,10000,0);
new wxStaticText(this,wxID_ANY,wxString("Ramming line width (%):"), wxPoint(500,205), wxSize(200,25),wxALIGN_LEFT);
m_widget_ramming_line_width_multiplicator = new wxSpinCtrl(this,wxID_ANY,wxEmptyString, wxPoint(700,200), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,10,200,100);