mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
Fix prime tower wipe volume calculation (#9235)
* Revert "Fixed an bug that filament_minimal_purge_on_wipe_tower option doesn't work for soluable filament (#8397)"
This reverts commit fcc5489911
.
* Fixed an bug that filament_minimal_purge_on_wipe_tower option doesn't work for soluable filament (#8397)
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
d9c27f3dee
commit
cd2077ebaf
1 changed files with 18 additions and 18 deletions
|
@ -1601,24 +1601,20 @@ void WipeTower2::save_on_last_wipe()
|
||||||
auto& toolchange = m_layer_info->tool_changes[i];
|
auto& toolchange = m_layer_info->tool_changes[i];
|
||||||
tool_change(toolchange.new_tool);
|
tool_change(toolchange.new_tool);
|
||||||
|
|
||||||
// Orca: allow calculation of the required depth and wipe volume for soluable toolchanges as well
|
if (i == idx) {
|
||||||
// NOTE: it's not clear if this is the right way, technically we should disable wipe tower if soluble filament is used as it
|
float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into
|
||||||
// will will make the wipe tower unstable. Need to revist this in the future.
|
|
||||||
|
|
||||||
// if (i == idx) {
|
float volume_to_save = length_to_volume(finish_layer().total_extrusion_length_in_plane(), m_perimeter_width, m_layer_info->height);
|
||||||
float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into
|
float volume_left_to_wipe = std::max(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, toolchange.wipe_volume_total - volume_to_save);
|
||||||
|
float volume_we_need_depth_for = std::max(0.f, volume_left_to_wipe - length_to_volume(toolchange.first_wipe_line, m_perimeter_width*m_extra_flow, m_layer_info->height));
|
||||||
|
float depth_to_wipe = get_wipe_depth(volume_we_need_depth_for, m_layer_info->height, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width);
|
||||||
|
|
||||||
float volume_to_save = length_to_volume(finish_layer().total_extrusion_length_in_plane(), m_perimeter_width, m_layer_info->height);
|
toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe;
|
||||||
float volume_left_to_wipe = std::max(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, toolchange.wipe_volume_total - volume_to_save);
|
toolchange.wipe_volume = volume_left_to_wipe;
|
||||||
float volume_we_need_depth_for = std::max(0.f, volume_left_to_wipe - length_to_volume(toolchange.first_wipe_line, m_perimeter_width*m_extra_flow, m_layer_info->height));
|
}
|
||||||
float depth_to_wipe = get_wipe_depth(volume_we_need_depth_for, m_layer_info->height, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width);
|
}
|
||||||
|
|
||||||
toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe;
|
|
||||||
toolchange.wipe_volume = volume_left_to_wipe;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Return index of first toolchange that switches to non-soluble extruder
|
// Return index of first toolchange that switches to non-soluble extruder
|
||||||
|
@ -1626,10 +1622,14 @@ void WipeTower2::save_on_last_wipe()
|
||||||
int WipeTower2::first_toolchange_to_nonsoluble(
|
int WipeTower2::first_toolchange_to_nonsoluble(
|
||||||
const std::vector<WipeTowerInfo::ToolChange>& tool_changes) const
|
const std::vector<WipeTowerInfo::ToolChange>& tool_changes) const
|
||||||
{
|
{
|
||||||
for (size_t idx=0; idx<tool_changes.size(); ++idx)
|
// Orca: allow calculation of the required depth and wipe volume for soluable toolchanges as well
|
||||||
if (! m_filpar[tool_changes[idx].new_tool].is_soluble)
|
// NOTE: it's not clear if this is the right way, technically we should disable wipe tower if soluble filament is used as it
|
||||||
return idx;
|
// will will make the wipe tower unstable. Need to revist this in the future.
|
||||||
return -1;
|
return tool_changes.empty() ? -1 : 0;
|
||||||
|
//for (size_t idx=0; idx<tool_changes.size(); ++idx)
|
||||||
|
// if (! m_filpar[tool_changes[idx].new_tool].is_soluble)
|
||||||
|
// return idx;
|
||||||
|
//return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WipeTower::ToolChangeResult merge_tcr(WipeTower::ToolChangeResult& first,
|
static WipeTower::ToolChangeResult merge_tcr(WipeTower::ToolChangeResult& first,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue