mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 02:52:00 +08:00
Fix first positions on layers with wipe tower with not toolchange
This commit is contained in:
parent
6cfad69a5a
commit
dbc8300a59
@ -525,11 +525,14 @@ std::vector<ExtruderExtrusions> get_extrusions(
|
||||
ExtruderExtrusions extruder_extrusions{extruder_id};
|
||||
|
||||
if (layer_tools.has_wipe_tower && wipe_tower != nullptr) {
|
||||
if (is_toolchange_required(is_first_layer, layer_tools.extruders.back(), extruder_id, current_extruder_id)) {
|
||||
const WipeTower::ToolChangeResult tool_change{wipe_tower->get_toolchange(toolchange_number++)};
|
||||
previous_position = Point::new_scale(wipe_tower->transform_wt_pt(tool_change.end_pos));
|
||||
current_extruder_id = tool_change.new_tool;
|
||||
extruder_extrusions.wipe_tower_start = Point::new_scale(wipe_tower->transform_wt_pt(tool_change.start_pos));
|
||||
const bool finish_wipe_tower{extruder_id == layer_tools.extruders.back()};
|
||||
if (finish_wipe_tower || is_toolchange_required(is_first_layer, layer_tools.extruders.back(), extruder_id, current_extruder_id)) {
|
||||
if (const auto tool_change{wipe_tower->get_toolchange(toolchange_number)}) {
|
||||
toolchange_number++;
|
||||
previous_position = Point::new_scale(wipe_tower->transform_wt_pt(tool_change->end_pos));
|
||||
current_extruder_id = tool_change->new_tool;
|
||||
extruder_extrusions.wipe_tower_start = Point::new_scale(wipe_tower->transform_wt_pt(tool_change->start_pos));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,10 @@ public:
|
||||
std::string tool_change(GCodeGenerator &gcodegen, int extruder_id, bool finish_layer);
|
||||
std::string finalize(GCodeGenerator &gcodegen);
|
||||
std::vector<float> used_filament_length() const;
|
||||
WipeTower::ToolChangeResult get_toolchange(std::size_t index) const {
|
||||
std::optional<WipeTower::ToolChangeResult> get_toolchange(std::size_t index) const {
|
||||
if (m_layer_idx >= m_tool_changes.size()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return m_tool_changes.at(m_layer_idx).at(index);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user