Fixed an extruder ordering bug on the 1st layer wipe tower.
This is a regression after introducing the extruder priming areas at the edge of the print bed.
This commit is contained in:
parent
73a539780a
commit
16bd3fc624
@ -53,14 +53,14 @@ public:
|
|||||||
|
|
||||||
void clear() { m_layer_tools.clear(); }
|
void clear() { m_layer_tools.clear(); }
|
||||||
|
|
||||||
// Get the first extruder printing the layer_tools, returns -1 if there is no layer printed.
|
// Get the first extruder printing, including the extruder priming areas, returns -1 if there is no layer printed.
|
||||||
unsigned int first_extruder() const { return m_first_printing_extruder; }
|
unsigned int first_extruder() const { return m_first_printing_extruder; }
|
||||||
|
|
||||||
// Get the first extruder printing the layer_tools, returns -1 if there is no layer printed.
|
// Get the first extruder printing the layer_tools, returns -1 if there is no layer printed.
|
||||||
unsigned int last_extruder() const { return m_last_printing_extruder; }
|
unsigned int last_extruder() const { return m_last_printing_extruder; }
|
||||||
|
|
||||||
// For a multi-material print, the printing extruders are ordered in the order they shall be primed.
|
// For a multi-material print, the printing extruders are ordered in the order they shall be primed.
|
||||||
std::vector<unsigned int> all_extruders() const { return m_all_printing_extruders; }
|
const std::vector<unsigned int>& all_extruders() const { return m_all_printing_extruders; }
|
||||||
|
|
||||||
// Find LayerTools with the closest print_z.
|
// Find LayerTools with the closest print_z.
|
||||||
LayerTools& tools_for_layer(coordf_t print_z);
|
LayerTools& tools_for_layer(coordf_t print_z);
|
||||||
|
@ -109,7 +109,7 @@ public:
|
|||||||
// print_z of the first layer.
|
// print_z of the first layer.
|
||||||
float first_layer_height,
|
float first_layer_height,
|
||||||
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
||||||
std::vector<unsigned int> tools,
|
const std::vector<unsigned int> &tools,
|
||||||
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
||||||
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
||||||
bool last_wipe_inside_wipe_tower,
|
bool last_wipe_inside_wipe_tower,
|
||||||
|
@ -368,7 +368,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
|
|||||||
// print_z of the first layer.
|
// print_z of the first layer.
|
||||||
float first_layer_height,
|
float first_layer_height,
|
||||||
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
||||||
std::vector<unsigned int> tools,
|
const std::vector<unsigned int> &tools,
|
||||||
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
||||||
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
||||||
bool last_wipe_inside_wipe_tower,
|
bool last_wipe_inside_wipe_tower,
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
// print_z of the first layer.
|
// print_z of the first layer.
|
||||||
float first_layer_height,
|
float first_layer_height,
|
||||||
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
// Extruder indices, in the order to be primed. The last extruder will later print the wipe tower brim, print brim and the object.
|
||||||
std::vector<unsigned int> tools,
|
const std::vector<unsigned int> &tools,
|
||||||
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
// If true, the last priming are will be the same as the other priming areas, and the rest of the wipe will be performed inside the wipe tower.
|
||||||
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
// If false, the last priming are will be large enough to wipe the last extruder sufficiently.
|
||||||
bool last_wipe_inside_wipe_tower,
|
bool last_wipe_inside_wipe_tower,
|
||||||
|
@ -974,7 +974,6 @@ void Print::_make_wipe_tower()
|
|||||||
|
|
||||||
// Let the ToolOrdering class know there will be initial priming extrusions at the start of the print.
|
// Let the ToolOrdering class know there will be initial priming extrusions at the start of the print.
|
||||||
m_tool_ordering = ToolOrdering(*this, (unsigned int)-1, true);
|
m_tool_ordering = ToolOrdering(*this, (unsigned int)-1, true);
|
||||||
unsigned int initial_extruder_id = m_tool_ordering.first_extruder();
|
|
||||||
if (! m_tool_ordering.has_wipe_tower())
|
if (! m_tool_ordering.has_wipe_tower())
|
||||||
// Don't generate any wipe tower.
|
// Don't generate any wipe tower.
|
||||||
return;
|
return;
|
||||||
@ -983,7 +982,7 @@ void Print::_make_wipe_tower()
|
|||||||
WipeTowerPrusaMM wipe_tower(
|
WipeTowerPrusaMM wipe_tower(
|
||||||
float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value),
|
float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value),
|
||||||
float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value),
|
float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value),
|
||||||
initial_extruder_id);
|
m_tool_ordering.first_extruder());
|
||||||
|
|
||||||
//wipe_tower.set_retract();
|
//wipe_tower.set_retract();
|
||||||
//wipe_tower.set_zhop();
|
//wipe_tower.set_zhop();
|
||||||
@ -1006,7 +1005,8 @@ void Print::_make_wipe_tower()
|
|||||||
|
|
||||||
// Generate the wipe tower layers.
|
// Generate the wipe tower layers.
|
||||||
m_wipe_tower_tool_changes.reserve(m_tool_ordering.layer_tools().size());
|
m_wipe_tower_tool_changes.reserve(m_tool_ordering.layer_tools().size());
|
||||||
unsigned int current_extruder_id = initial_extruder_id;
|
// Set current_extruder_id to the last extruder primed.
|
||||||
|
unsigned int current_extruder_id = m_tool_ordering.all_extruders().back();
|
||||||
for (const ToolOrdering::LayerTools &layer_tools : m_tool_ordering.layer_tools()) {
|
for (const ToolOrdering::LayerTools &layer_tools : m_tool_ordering.layer_tools()) {
|
||||||
if (! layer_tools.has_wipe_tower)
|
if (! layer_tools.has_wipe_tower)
|
||||||
// This is a support only layer, or the wipe tower does not reach to this height.
|
// This is a support only layer, or the wipe tower does not reach to this height.
|
||||||
@ -1021,7 +1021,11 @@ void Print::_make_wipe_tower()
|
|||||||
last_layer);
|
last_layer);
|
||||||
std::vector<WipeTower::ToolChangeResult> tool_changes;
|
std::vector<WipeTower::ToolChangeResult> tool_changes;
|
||||||
for (unsigned int extruder_id : layer_tools.extruders)
|
for (unsigned int extruder_id : layer_tools.extruders)
|
||||||
if ((first_layer && extruder_id == initial_extruder_id) || extruder_id != current_extruder_id) {
|
// Call the wipe_tower.tool_change() at the first layer for the initial extruder
|
||||||
|
// to extrude the wipe tower brim,
|
||||||
|
if ((first_layer && extruder_id == m_tool_ordering.all_extruders().back()) ||
|
||||||
|
// or when an extruder shall be switched.
|
||||||
|
extruder_id != current_extruder_id) {
|
||||||
tool_changes.emplace_back(wipe_tower.tool_change(extruder_id, extruder_id == layer_tools.extruders.back(), WipeTower::PURPOSE_EXTRUDE));
|
tool_changes.emplace_back(wipe_tower.tool_change(extruder_id, extruder_id == layer_tools.extruders.back(), WipeTower::PURPOSE_EXTRUDE));
|
||||||
current_extruder_id = extruder_id;
|
current_extruder_id = extruder_id;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user