mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 11:41:20 -06:00
Merge branch 'lm_improving_wipe_tower'. Summary of changes:
- wipe tower respects max volumetric flow, slowing down with PVA etc is not hardcoded anymore
- wipe tower is now allowed for multiple-extruder printers. single extruder stuff is not used in that case (ramming, cooling, etc.)
- start/end filament and toolchange custom gcodes are now inserted differently than before - see 41164a9
- some refactoring, e.g. the abstract WipeTower class was eradicated
This commit is contained in:
commit
e674c586b0
12 changed files with 897 additions and 942 deletions
|
|
@ -2038,11 +2038,10 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
// Should the wipe tower be visualized ?
|
||||
unsigned int extruders_count = (unsigned int)dynamic_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"))->values.size();
|
||||
|
||||
bool semm = dynamic_cast<const ConfigOptionBool*>(m_config->option("single_extruder_multi_material"))->value;
|
||||
bool wt = dynamic_cast<const ConfigOptionBool*>(m_config->option("wipe_tower"))->value;
|
||||
bool co = dynamic_cast<const ConfigOptionBool*>(m_config->option("complete_objects"))->value;
|
||||
|
||||
if ((extruders_count > 1) && semm && wt && !co)
|
||||
if ((extruders_count > 1) && wt && !co)
|
||||
{
|
||||
// Height of a print (Show at least a slab)
|
||||
double height = std::max(m_model->bounding_box().max(2), 10.0);
|
||||
|
|
@ -4617,7 +4616,7 @@ void GLCanvas3D::_load_wipe_tower_toolpaths(const std::vector<std::string>& str_
|
|||
{
|
||||
const Print *print;
|
||||
const std::vector<float> *tool_colors;
|
||||
WipeTower::xy wipe_tower_pos;
|
||||
Vec2f wipe_tower_pos;
|
||||
float wipe_tower_angle;
|
||||
|
||||
// Number of vertices (each vertex is 6x4=24 bytes long)
|
||||
|
|
@ -4648,12 +4647,13 @@ void GLCanvas3D::_load_wipe_tower_toolpaths(const std::vector<std::string>& str_
|
|||
ctxt.print = print;
|
||||
ctxt.tool_colors = tool_colors.empty() ? nullptr : &tool_colors;
|
||||
if (print->wipe_tower_data().priming && print->config().single_extruder_multi_material_priming)
|
||||
ctxt.priming.emplace_back(*print->wipe_tower_data().priming.get());
|
||||
for (int i=0; i<print->wipe_tower_data().priming.get()->size(); ++i)
|
||||
ctxt.priming.emplace_back(print->wipe_tower_data().priming.get()->at(i));
|
||||
if (print->wipe_tower_data().final_purge)
|
||||
ctxt.final.emplace_back(*print->wipe_tower_data().final_purge.get());
|
||||
|
||||
ctxt.wipe_tower_angle = ctxt.print->config().wipe_tower_rotation_angle.value/180.f * PI;
|
||||
ctxt.wipe_tower_pos = WipeTower::xy(ctxt.print->config().wipe_tower_x.value, ctxt.print->config().wipe_tower_y.value);
|
||||
ctxt.wipe_tower_pos = Vec2f(ctxt.print->config().wipe_tower_x.value, ctxt.print->config().wipe_tower_y.value);
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Loading wipe tower toolpaths in parallel - start";
|
||||
|
||||
|
|
@ -4715,19 +4715,19 @@ void GLCanvas3D::_load_wipe_tower_toolpaths(const std::vector<std::string>& str_
|
|||
WipeTower::Extrusion e_prev = extrusions.extrusions[i-1];
|
||||
|
||||
if (!extrusions.priming) { // wipe tower extrusions describe the wipe tower at the origin with no rotation
|
||||
e_prev.pos.rotate(ctxt.wipe_tower_angle);
|
||||
e_prev.pos.translate(ctxt.wipe_tower_pos);
|
||||
e_prev.pos = Eigen::Rotation2Df(ctxt.wipe_tower_angle) * e_prev.pos;
|
||||
e_prev.pos += ctxt.wipe_tower_pos;
|
||||
}
|
||||
|
||||
for (; i < j; ++i) {
|
||||
WipeTower::Extrusion e = extrusions.extrusions[i];
|
||||
assert(e.width > 0.f);
|
||||
if (!extrusions.priming) {
|
||||
e.pos.rotate(ctxt.wipe_tower_angle);
|
||||
e.pos.translate(ctxt.wipe_tower_pos);
|
||||
e.pos = Eigen::Rotation2Df(ctxt.wipe_tower_angle) * e.pos;
|
||||
e.pos += ctxt.wipe_tower_pos;
|
||||
}
|
||||
|
||||
lines.emplace_back(Point::new_scale(e_prev.pos.x, e_prev.pos.y), Point::new_scale(e.pos.x, e.pos.y));
|
||||
lines.emplace_back(Point::new_scale(e_prev.pos.x(), e_prev.pos.y()), Point::new_scale(e.pos.x(), e.pos.y()));
|
||||
widths.emplace_back(e.width);
|
||||
|
||||
e_prev = e;
|
||||
|
|
@ -5271,7 +5271,7 @@ void GLCanvas3D::_load_fff_shells()
|
|||
double max_z = print->objects()[0]->model_object()->get_model()->bounding_box().max(2);
|
||||
const PrintConfig& config = print->config();
|
||||
unsigned int extruders_count = config.nozzle_diameter.size();
|
||||
if ((extruders_count > 1) && config.single_extruder_multi_material && config.wipe_tower && !config.complete_objects) {
|
||||
if ((extruders_count > 1) && config.wipe_tower && !config.complete_objects) {
|
||||
float depth = print->get_wipe_tower_depth();
|
||||
|
||||
// Calculate wipe tower brim spacing.
|
||||
|
|
|
|||
|
|
@ -874,11 +874,10 @@ void Tab::update_wiping_button_visibility() {
|
|||
return; // ys_FIXME
|
||||
bool wipe_tower_enabled = dynamic_cast<ConfigOptionBool*>( (m_preset_bundle->prints.get_edited_preset().config ).option("wipe_tower"))->value;
|
||||
bool multiple_extruders = dynamic_cast<ConfigOptionFloats*>((m_preset_bundle->printers.get_edited_preset().config).option("nozzle_diameter"))->values.size() > 1;
|
||||
bool single_extruder_mm = dynamic_cast<ConfigOptionBool*>( (m_preset_bundle->printers.get_edited_preset().config).option("single_extruder_multi_material"))->value;
|
||||
|
||||
auto wiping_dialog_button = wxGetApp().sidebar().get_wiping_dialog_button();
|
||||
if (wiping_dialog_button) {
|
||||
wiping_dialog_button->Show(wipe_tower_enabled && multiple_extruders && single_extruder_mm);
|
||||
wiping_dialog_button->Show(wipe_tower_enabled && multiple_extruders);
|
||||
wiping_dialog_button->GetParent()->Layout();
|
||||
}
|
||||
}
|
||||
|
|
@ -1557,6 +1556,9 @@ void TabFilament::build()
|
|||
};
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Wipe tower parameters")));
|
||||
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers")));
|
||||
optgroup->append_single_option_line("filament_loading_speed_start");
|
||||
optgroup->append_single_option_line("filament_loading_speed");
|
||||
|
|
@ -1568,7 +1570,6 @@ void TabFilament::build()
|
|||
optgroup->append_single_option_line("filament_cooling_moves");
|
||||
optgroup->append_single_option_line("filament_cooling_initial_speed");
|
||||
optgroup->append_single_option_line("filament_cooling_final_speed");
|
||||
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower");
|
||||
|
||||
line = optgroup->create_single_option_line("filament_ramming_parameters");// { _(L("Ramming")), "" };
|
||||
line.widget = [this](wxWindow* parent) {
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ void WipingPanel::format_sizer(wxSizer* sizer, wxPanel* page, wxGridSizer* grid_
|
|||
wxSize text_size = GetTextExtent(info);
|
||||
auto info_str = new wxStaticText(page, wxID_ANY, info ,wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
||||
info_str->Wrap(int(0.6*text_size.x));
|
||||
sizer->Add( info_str, 0, wxALIGN_CENTER_HORIZONTAL | wxEXPAND);
|
||||
sizer->Add( info_str, 0, wxEXPAND);
|
||||
auto table_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
sizer->Add(table_sizer, 0, wxALIGN_CENTER | wxCENTER, table_lshift);
|
||||
table_sizer->Add(new wxStaticText(page, wxID_ANY, table_title), 0, wxALIGN_CENTER | wxTOP, 50);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue