From 14c3152ac9c68cc20b114d2598affb0454f6d1aa Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 20 Feb 2023 14:27:31 +0100 Subject: [PATCH 01/12] Fix for #9795 - Text emboss input dialog doesn't allow pasting in text from clipboard --- src/slic3r/GUI/ImGuiWrapper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 8908a5ef9..6b85af966 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -1082,7 +1082,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co // The press on Esc key invokes editing of InputText (removes last changes) // So we should save previous value... std::string str = search_str; - ImGui::InputTextEx("", NULL, search_str, 40, search_size, ImGuiInputTextFlags_AutoSelectAll, NULL, NULL); + ImGui::InputTextEx("", NULL, search_str, 240, search_size, ImGuiInputTextFlags_AutoSelectAll, NULL, NULL); edited = ImGui::IsItemEdited(); if (edited) hovered_id = 0; @@ -2056,7 +2056,11 @@ const char* ImGuiWrapper::clipboard_get(void* user_data) const char* res = ""; if (wxTheClipboard->Open()) { - if (wxTheClipboard->IsSupported(wxDF_TEXT)) { + if (wxTheClipboard->IsSupported(wxDF_TEXT) +#if wxUSE_UNICODE + || wxTheClipboard->IsSupported(wxDF_UNICODETEXT) +#endif // wxUSE_UNICODE + ) { wxTextDataObject data; wxTheClipboard->GetData(data); From 5e550709ffbd88e72554629e82ed754582b26368 Mon Sep 17 00:00:00 2001 From: Pavel Mikus Date: Mon, 20 Feb 2023 21:14:34 +0100 Subject: [PATCH 02/12] fix issue 9800 - Avoid Crossing Curled Overhangs Not Respecting Printer Bed Size Fix Avoid curled overhang functionality actually not working correctly, especially on multiple objects/instances --- src/libslic3r/GCode.cpp | 12 ++++++++++-- src/libslic3r/JumpPointSearch.cpp | 20 +++++++++++--------- src/libslic3r/JumpPointSearch.hpp | 14 ++++++++------ src/libslic3r/SupportSpotsGenerator.cpp | 2 ++ 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 16696e49a..460ddc111 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1032,6 +1032,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_pressure_equalizer = make_unique(print.config()); m_enable_extrusion_role_markers = (bool)m_pressure_equalizer; + if (print.config().avoid_crossing_curled_overhangs){ + this->m_avoid_crossing_curled_overhangs.init_bed_shape(get_bed_shape(print.config())); + } + // Write information on the generator. file.write_format("; %s\n\n", Slic3r::header_slic3r_generated().c_str()); @@ -2107,8 +2111,12 @@ LayerResult GCode::process_layer( if (this->config().avoid_crossing_curled_overhangs) { m_avoid_crossing_curled_overhangs.clear(); for (const ObjectLayerToPrint &layer_to_print : layers) { - m_avoid_crossing_curled_overhangs.add_obstacles(layer_to_print.object_layer, Point(scaled(this->origin()))); - m_avoid_crossing_curled_overhangs.add_obstacles(layer_to_print.support_layer, Point(scaled(this->origin()))); + if (layer_to_print.object() == nullptr) + continue; + for (const auto &instance : layer_to_print.object()->instances()) { + m_avoid_crossing_curled_overhangs.add_obstacles(layer_to_print.object_layer, instance.shift); + m_avoid_crossing_curled_overhangs.add_obstacles(layer_to_print.support_layer, instance.shift); + } } } diff --git a/src/libslic3r/JumpPointSearch.cpp b/src/libslic3r/JumpPointSearch.cpp index 888db296b..ef3dba45e 100644 --- a/src/libslic3r/JumpPointSearch.cpp +++ b/src/libslic3r/JumpPointSearch.cpp @@ -1,5 +1,6 @@ #include "JumpPointSearch.hpp" #include "BoundingBox.hpp" +#include "ExPolygon.hpp" #include "Point.hpp" #include "libslic3r/AStar.hpp" #include "libslic3r/KDTreeIndirect.hpp" @@ -181,17 +182,18 @@ public: void JPSPathFinder::clear() { inpassable.clear(); - obstacle_max = Pixel(std::numeric_limits::min(), std::numeric_limits::min()); - obstacle_min = Pixel(std::numeric_limits::max(), std::numeric_limits::max()); + max_search_box.max = Pixel(std::numeric_limits::min(), std::numeric_limits::min()); + max_search_box.min = Pixel(std::numeric_limits::max(), std::numeric_limits::max()); + add_obstacles(bed_shape); } void JPSPathFinder::add_obstacles(const Lines &obstacles) { auto store_obstacle = [&](coord_t x, coord_t y) { - obstacle_max.x() = std::max(obstacle_max.x(), x); - obstacle_max.y() = std::max(obstacle_max.y(), y); - obstacle_min.x() = std::min(obstacle_min.x(), x); - obstacle_min.y() = std::min(obstacle_min.y(), y); + max_search_box.max.x() = std::max(max_search_box.max.x(), x); + max_search_box.max.y() = std::max(max_search_box.max.y(), y); + max_search_box.min.x() = std::min(max_search_box.min.x(), x); + max_search_box.min.y() = std::min(max_search_box.min.y(), y); inpassable.insert(Pixel{x, y}); return true; }; @@ -240,9 +242,9 @@ Polyline JPSPathFinder::find_path(const Point &p0, const Point &p1) }); } - BoundingBox search_box({start, end, obstacle_max, obstacle_min}); - search_box.max += Pixel(1, 1); - search_box.min -= Pixel(1, 1); + BoundingBox search_box = max_search_box; + search_box.max -= Pixel(1, 1); + search_box.min += Pixel(1, 1); BoundingBox bounding_square(Points{start, end}); bounding_square.max += Pixel(5, 5); diff --git a/src/libslic3r/JumpPointSearch.hpp b/src/libslic3r/JumpPointSearch.hpp index b09cc7747..5f3b5fee2 100644 --- a/src/libslic3r/JumpPointSearch.hpp +++ b/src/libslic3r/JumpPointSearch.hpp @@ -2,6 +2,7 @@ #define SRC_LIBSLIC3R_JUMPPOINTSEARCH_HPP_ #include "BoundingBox.hpp" +#include "Polygon.hpp" #include "libslic3r/Layer.hpp" #include "libslic3r/Point.hpp" #include "libslic3r/Polyline.hpp" @@ -16,18 +17,19 @@ class JPSPathFinder using Pixel = Point; std::unordered_set inpassable; coordf_t print_z; - Pixel obstacle_min; - Pixel obstacle_max; + BoundingBox max_search_box; + Lines bed_shape; const coord_t resolution = scaled(1.5); Pixel pixelize(const Point &p) { return p / resolution; } Point unpixelize(const Pixel &p) { return p * resolution; } public: - JPSPathFinder() { clear(); }; - void clear(); - void add_obstacles(const Lines &obstacles); - void add_obstacles(const Layer* layer, const Point& global_origin); + JPSPathFinder() = default; + void init_bed_shape(const Points &bed_shape) { this->bed_shape = (to_lines(Polygon{bed_shape})); }; + void clear(); + void add_obstacles(const Lines &obstacles); + void add_obstacles(const Layer *layer, const Point &global_origin); Polyline find_path(const Point &start, const Point &end); }; diff --git a/src/libslic3r/SupportSpotsGenerator.cpp b/src/libslic3r/SupportSpotsGenerator.cpp index e5f58f91e..d45f82db8 100644 --- a/src/libslic3r/SupportSpotsGenerator.cpp +++ b/src/libslic3r/SupportSpotsGenerator.cpp @@ -1043,6 +1043,7 @@ void estimate_supports_malformations(SupportLayerPtrs &layers, float flow_width, AABBTreeLines::LinesDistancer prev_layer_lines{}; for (SupportLayer *l : layers) { + l->malformed_lines.clear(); std::vector current_layer_lines; for (const ExtrusionEntity *extrusion : l->support_fills.flatten().entities) { @@ -1114,6 +1115,7 @@ void estimate_malformations(LayerPtrs &layers, const Params ¶ms) LD prev_layer_lines{}; for (Layer *l : layers) { + l->malformed_lines.clear(); std::vector boundary_lines = l->lower_layer != nullptr ? to_unscaled_linesf(l->lower_layer->lslices) : std::vector(); AABBTreeLines::LinesDistancer prev_layer_boundary{std::move(boundary_lines)}; std::vector current_layer_lines; From 4e32b7ea5a54685d46c3afac0e0eb48f519b97eb Mon Sep 17 00:00:00 2001 From: David Kocik Date: Fri, 17 Feb 2023 15:05:32 +0100 Subject: [PATCH 03/12] Fix of Config wizard "no filaments selected for a printer" --- src/slic3r/GUI/ConfigWizard.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 35292d803..b0e68dfff 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2785,7 +2785,7 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo { // Walk over all installed Printer presets and verify whether there is a filament or SLA material profile installed at the same PresetBundle, // which is compatible with it. - const auto printer_models_missing_materials = [this, only_for_model_id](PrinterTechnology technology, const std::string §ion) + const auto printer_models_missing_materials = [this, only_for_model_id](PrinterTechnology technology, const std::string §ion, bool no_templates) { const std::map &appconfig_presets = appconfig_new.has_section(section) ? appconfig_new.get_section(section) : std::map(); std::set printer_models_without_material; @@ -2805,15 +2805,16 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo has_material = true; break; } - // find if preset.first is part of the templates profile (up is searching if preset.first is part of printer vendor preset) - for (const auto& bp : bundles) { - if (!bp.second.preset_bundle->vendors.empty() && bp.second.preset_bundle->vendors.begin()->second.templates_profile) { - const PresetCollection& template_materials = bp.second.preset_bundle->materials(technology); - const Preset* template_material = template_materials.find_preset(preset.first, false); - if (template_material && is_compatible_with_printer(PresetWithVendorProfile(*template_material, &bp.second.preset_bundle->vendors.begin()->second), PresetWithVendorProfile(printer, nullptr))) { - has_material = true; - break; + if (!no_templates) { + for (const auto& bp : bundles) { + if (!bp.second.preset_bundle->vendors.empty() && bp.second.preset_bundle->vendors.begin()->second.templates_profile) { + const PresetCollection& template_materials = bp.second.preset_bundle->materials(technology); + const Preset* template_material = template_materials.find_preset(preset.first, false); + if (template_material && is_compatible_with_printer(PresetWithVendorProfile(*template_material, &bp.second.preset_bundle->vendors.begin()->second), PresetWithVendorProfile(printer, nullptr))) { + has_material = true; + break; + } } } } @@ -2872,8 +2873,10 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo return out; }; + bool no_templates = wxGetApp().app_config->get("no_templates") == "1"; + if (any_fff_selected && (technology & T_FFF)) { - std::set printer_models_without_material = printer_models_missing_materials(ptFFF, AppConfig::SECTION_FILAMENTS); + std::set printer_models_without_material = printer_models_missing_materials(ptFFF, AppConfig::SECTION_FILAMENTS, no_templates); if (! printer_models_without_material.empty()) { if (only_for_model_id.empty()) ask_and_select_default_materials( @@ -2891,7 +2894,7 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo } if (any_sla_selected && (technology & T_SLA)) { - std::set printer_models_without_material = printer_models_missing_materials(ptSLA, AppConfig::SECTION_MATERIALS); + std::set printer_models_without_material = printer_models_missing_materials(ptSLA, AppConfig::SECTION_MATERIALS, no_templates); if (! printer_models_without_material.empty()) { if (only_for_model_id.empty()) ask_and_select_default_materials( From a41dd8eeed50b9bfbb9f37769569f091512d8124 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 21 Feb 2023 12:43:55 +0100 Subject: [PATCH 04/12] =?UTF-8?q?Follow-up=20dc0275f70d4c5d163e1906828cfc0?= =?UTF-8?q?8ee46b6d081=20-=20Cut:=20Next=20performance=C2=A0fix.=20Refacto?= =?UTF-8?q?r=20a=20code=20to=20avoid=20redundant=20recalculation=20of=20an?= =?UTF-8?q?=20object=20bounding=20box=20and=20transformed=20bounding=20box?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 106 +++++++++------------------ src/slic3r/GUI/Gizmos/GLGizmoCut.hpp | 8 +- 2 files changed, 39 insertions(+), 75 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index 8c33c3e03..d8064bd04 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -453,15 +453,9 @@ void GLGizmoCut3D::update_clipper() update_raycasters_for_picking_transform(); } -void GLGizmoCut3D::update_clipper_on_render() +void GLGizmoCut3D::set_center(const Vec3d& center, bool update_tbb /*=false*/) { - update_clipper(); - force_update_clipper_on_render = false; -} - -void GLGizmoCut3D::set_center(const Vec3d& center) -{ - set_center_pos(center); + set_center_pos(center, update_tbb); update_clipper(); } @@ -584,7 +578,7 @@ void GLGizmoCut3D::render_move_center_input(int axis) if (in_val != val) { move[axis] = val; - set_center(move); + set_center(move, true); } } @@ -888,21 +882,17 @@ bool GLGizmoCut3D::on_init() void GLGizmoCut3D::on_load(cereal::BinaryInputArchive& ar) { - ar( m_keep_upper, m_keep_lower, m_rotate_lower, m_rotate_upper, m_hide_cut_plane, m_mode, m_connectors_editing,//m_selected, - // m_connector_depth_ratio, m_connector_size, m_connector_mode, m_connector_type, m_connector_style, m_connector_shape_id, + ar( m_keep_upper, m_keep_lower, m_rotate_lower, m_rotate_upper, m_hide_cut_plane, m_mode, m_connectors_editing, m_ar_plane_center, m_rotation_m); set_center_pos(m_ar_plane_center, true); - force_update_clipper_on_render = true; - m_parent.request_extra_frame(); } void GLGizmoCut3D::on_save(cereal::BinaryOutputArchive& ar) const { - ar( m_keep_upper, m_keep_lower, m_rotate_lower, m_rotate_upper, m_hide_cut_plane, m_mode, m_connectors_editing,//m_selected, - // m_connector_depth_ratio, m_connector_size, m_connector_mode, m_connector_type, m_connector_style, m_connector_shape_id, + ar( m_keep_upper, m_keep_lower, m_rotate_lower, m_rotate_upper, m_hide_cut_plane, m_mode, m_connectors_editing, m_ar_plane_center, m_start_dragging_m); } @@ -923,6 +913,7 @@ void GLGizmoCut3D::on_set_state() // initiate archived values m_ar_plane_center = m_plane_center; m_start_dragging_m = m_rotation_m; + m_transformed_bounding_box = transformed_bounding_box(m_plane_center); m_parent.request_extra_frame(); } @@ -934,7 +925,6 @@ void GLGizmoCut3D::on_set_state() m_selected.clear(); m_parent.set_use_color_clip_plane(false); } - force_update_clipper_on_render = m_state == On; } void GLGizmoCut3D::on_register_raycasters_for_picking() @@ -1146,7 +1136,7 @@ void GLGizmoCut3D::dragging_grabber_z(const GLGizmoBase::UpdateData &data) const Vec3d shift = starting_vec * projection; // move cut plane center - set_center(m_plane_center + shift); + set_center(m_plane_center + shift, true); m_was_cut_plane_dragged = true; } @@ -1247,16 +1237,19 @@ void GLGizmoCut3D::on_stop_dragging() } } -void GLGizmoCut3D::set_center_pos(const Vec3d& center_pos, bool force/* = false*/) +void GLGizmoCut3D::set_center_pos(const Vec3d& center_pos, bool update_tbb /*=false*/) { - if (m_plane_center == center_pos) - return; + BoundingBoxf3 tbb = m_transformed_bounding_box; + if (update_tbb) { + Vec3d normal = m_rotation_m.inverse() * Vec3d(m_plane_center - center_pos); + tbb.translate(normal.z() * Vec3d::UnitZ()); + } + const Vec3d& instance_offset = m_parent.get_selection().get_first_volume()->get_instance_offset(); + const Vec3d trans_center_pos = (m_rotation_m.inverse() * (center_pos - instance_offset)) + tbb.center(); - bool can_set_center_pos = force; - BoundingBoxf3 tbb; + bool can_set_center_pos = tbb.contains(trans_center_pos); if (!can_set_center_pos) { - tbb = transformed_bounding_box(center_pos); - if (tbb.max.z() > -1. && tbb.min.z() < 1.) + if (tbb.max.z() > -.5 && tbb.min.z() < .5) can_set_center_pos = true; else { const double old_dist = (m_bb_center - m_plane_center).norm(); @@ -1290,55 +1283,31 @@ BoundingBoxf3 GLGizmoCut3D::bounding_box() const BoundingBoxf3 GLGizmoCut3D::transformed_bounding_box(const Vec3d& plane_center) const { - // #ysFIXME !!! - BoundingBoxf3 ret; - - const CommonGizmosDataObjects::SelectionInfo* sel_info = m_c->selection_info(); - if (!sel_info) - return ret; - const ModelObject* mo = sel_info->model_object(); - if (!mo) - return ret; - const int instance_idx = sel_info->get_active_instance(); - if (instance_idx < 0 || mo->instances.empty()) - return ret; - const ModelInstance* mi = mo->instances[instance_idx]; - - const Vec3d& instance_offset = mi->get_offset(); - Vec3d cut_center_offset = plane_center - instance_offset; - cut_center_offset[Z] -= sel_info->get_sla_shift(); - - const auto cut_matrix = Transform3d::Identity() * m_rotation_m.inverse() * translation_transform(-cut_center_offset); - const Selection& selection = m_parent.get_selection(); + + const Vec3d& instance_offset = selection.get_first_volume()->get_instance_offset(); + const auto cut_matrix = Transform3d::Identity() * m_rotation_m.inverse() * translation_transform(instance_offset - plane_center); + const Selection::IndicesList& idxs = selection.get_volume_idxs(); + BoundingBoxf3 ret; for (unsigned int i : idxs) { const GLVolume* volume = selection.get_volume(i); // respect just to the solid parts for FFF and ignore pad and supports for SLA if (!volume->is_modifier && !volume->is_sla_pad() && !volume->is_sla_support()) { -#if ENABLE_WORLD_COORDINATE const auto instance_matrix = volume->get_instance_transformation().get_matrix_no_offset(); -#else - const auto instance_matrix = assemble_transform( - Vec3d::Zero(), // don't apply offset - volume->get_instance_rotation().cwiseProduct(Vec3d(1.0, 1.0, 1.0)), - volume->get_instance_scaling_factor(), - volume->get_instance_mirror() - ); -#endif // ENABLE_WORLD_COORDINATE - auto volume_trafo = instance_matrix * volume->get_volume_transformation().get_matrix(); - ret.merge(volume->transformed_convex_hull_bounding_box(cut_matrix * volume_trafo)); } } return ret; } -bool GLGizmoCut3D::update_bb() +void GLGizmoCut3D::update_bb() { const BoundingBoxf3 box = bounding_box(); + if (!box.defined) + return; if (m_max_pos != box.max || m_min_pos != box.min) { m_bounding_box = box; @@ -1348,10 +1317,11 @@ bool GLGizmoCut3D::update_bb() m_max_pos = box.max; m_min_pos = box.min; m_bb_center = box.center(); + m_transformed_bounding_box = transformed_bounding_box(m_bb_center); if (box.contains(m_center_offset)) - set_center_pos(m_bb_center + m_center_offset, true); + set_center_pos(m_bb_center + m_center_offset); else - set_center_pos(m_bb_center, true); + set_center_pos(m_bb_center); m_radius = box.radius(); m_grabber_connection_len = 0.5 * m_radius;// std::min(0.75 * m_radius, 35.0); @@ -1376,10 +1346,7 @@ bool GLGizmoCut3D::update_bb() clear_selection(); if (CommonGizmosDataObjects::SelectionInfo* selection = m_c->selection_info()) m_selected.resize(selection->model_object()->cut_connectors.size(), false); - - return true; } - return false; } void GLGizmoCut3D::init_picking_models() @@ -1435,12 +1402,7 @@ void GLGizmoCut3D::render_clipper_cut() void GLGizmoCut3D::on_render() { - if (update_bb() || force_update_clipper_on_render) { - update_clipper_on_render(); - m_c->object_clipper()->set_behavior(m_connectors_editing, m_connectors_editing, 0.4); - } - else - update_clipper(); + update_clipper(); init_picking_models(); @@ -1653,10 +1615,10 @@ void GLGizmoCut3D::render_build_size() void GLGizmoCut3D::reset_cut_plane() { - set_center(m_bb_center); m_rotation_m = Transform3d::Identity(); m_angle_arc.reset(); - update_clipper(); + m_transformed_bounding_box = transformed_bounding_box(m_bb_center); + set_center(m_bb_center); } void GLGizmoCut3D::invalidate_cut_plane() @@ -1671,6 +1633,9 @@ void GLGizmoCut3D::invalidate_cut_plane() void GLGizmoCut3D::set_connectors_editing(bool connectors_editing) { + if (m_connectors_editing == connectors_editing) + return; + m_connectors_editing = connectors_editing; update_raycasters_for_picking(); @@ -2340,7 +2305,7 @@ bool GLGizmoCut3D::process_cut_line(SLAGizmoEventType action, const Vec2d& mouse m_rotation_m = m; m_angle_arc.reset(); - set_center(m_plane_center + cross_dir * (cross_dir.dot(pt - m_plane_center))); + set_center(m_plane_center + cross_dir * (cross_dir.dot(pt - m_plane_center)), true); discard_cut_line_processing(); } @@ -2542,6 +2507,7 @@ CommonGizmosDataID GLGizmoCut3D::on_get_requirements() const { void GLGizmoCut3D::data_changed() { + update_bb(); if (auto oc = m_c->object_clipper()) oc->set_behavior(m_connectors_editing, m_connectors_editing, double(m_contour_width)); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp index 569122d4a..5e6e4146f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp @@ -121,7 +121,6 @@ class GLGizmoCut3D : public GLGizmoBase float m_label_width{ 150.0 }; float m_control_width{ 200.0 }; bool m_imperial_units{ false }; - bool force_update_clipper_on_render{false}; float m_contour_width{ 0.4f }; float m_cut_plane_radius_koef{ 1.5f }; @@ -192,7 +191,6 @@ public: void rotate_vec3d_around_plane_center(Vec3d&vec); void put_connectors_on_cut_plane(const Vec3d& cp_normal, double cp_offset); void update_clipper(); - void update_clipper_on_render(); void invalidate_cut_plane(); BoundingBoxf3 bounding_box() const; @@ -258,7 +256,7 @@ protected: void data_changed() override; private: - void set_center(const Vec3d& center); + void set_center(const Vec3d& center, bool update_tbb = false); bool render_combo(const std::string& label, const std::vector& lines, size_t& selection_idx); bool render_double_input(const std::string& label, double& value_in); bool render_slider_double_input(const std::string& label, float& value_in, float& tolerance_in); @@ -284,8 +282,8 @@ private: void render_cut_plane_grabbers(); void render_cut_line(); void perform_cut(const Selection&selection); - void set_center_pos(const Vec3d¢er_pos, bool force = false); - bool update_bb(); + void set_center_pos(const Vec3d¢er_pos, bool update_tbb = false); + void update_bb(); void init_picking_models(); void init_rendering_items(); void render_clipper_cut(); From db60d23c1889e32767fba7587b27993826ba7b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Tue, 21 Feb 2023 13:48:16 +0100 Subject: [PATCH 05/12] Fix of #9809: Crash after splitting an object into parts. Now after splitting an object into parts, custom supports, seams, and multimaterial painting are removed, and the user is notified about it. Also, this commit fixed the text of the notification about removing custom supports, seams, and multimaterial painting by Simplify gizmo. And it also fixed that info about custom supports, seams, and multimaterial painting was still shown in the right panel after the model simplification event when custom supports, seams, and multimaterial were removed. --- src/slic3r/GUI/GUI_ObjectList.cpp | 11 ++++++++++- src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp | 6 +++++- src/slic3r/GUI/Plater.cpp | 9 ++++++--- src/slic3r/GUI/Plater.hpp | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 1906d2c30..79ae5b896 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2175,6 +2175,10 @@ void ObjectList::split() take_snapshot(_(L("Split to Parts"))); + // Before splitting volume we have to remove all custom supports, seams, and multimaterial painting. + wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were " + "removed after splitting the object.")); + volume->split(nozzle_dmrs_cnt); (*m_objects)[obj_idx]->input_file.clear(); @@ -2186,6 +2190,10 @@ void ObjectList::split() changed_object(obj_idx); // update printable state for new volumes on canvas3D wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(obj_idx); + + // After removing custom supports, seams, and multimaterial painting, we have to update info about the object to remove information about + // custom supports, seams, and multimaterial painting in the right panel. + wxGetApp().obj_list()->update_info_items(obj_idx); } void ObjectList::merge(bool to_multipart_object) @@ -4682,7 +4690,8 @@ void ObjectList::fix_through_netfabb() msg += "\n"; } - plater->clear_before_change_mesh(obj_idx); + plater->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were " + "removed after repairing the mesh.")); std::string res; if (!fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res)) return false; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp index 177d9d5a7..90552c0a5 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp @@ -540,7 +540,11 @@ void GLGizmoSimplify::apply_simplify() { const Selection& selection = m_parent.get_selection(); auto plater = wxGetApp().plater(); plater->take_snapshot(_u8L("Simplify ") + create_volumes_name(m_volume_ids, selection)); - plater->clear_before_change_mesh(selection.get_object_idx()); + plater->clear_before_change_mesh(selection.get_object_idx(), _u8L("Custom supports, seams and multimaterial painting were " + "removed after simplifying the mesh.")); + // After removing custom supports, seams, and multimaterial painting, we have to update info about the object to remove information about + // custom supports, seams, and multimaterial painting in the right panel. + wxGetApp().obj_list()->update_info_items(selection.get_object_idx()); for (const auto &item: m_state.result) { const ObjectID &id = item.first; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index d4e0b8fbd..15c540082 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3127,6 +3127,10 @@ void Plater::priv::split_object() Model new_model = model; ModelObject* current_model_object = new_model.objects[obj_idx]; + // Before splitting object we have to remove all custom supports, seams, and multimaterial painting. + wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were " + "removed after splitting the object.")); + wxBusyCursor wait; ModelObjectPtrs new_objects; current_model_object->split(&new_objects); @@ -7338,7 +7342,7 @@ bool Plater::set_printer_technology(PrinterTechnology printer_technology) return ret; } -void Plater::clear_before_change_mesh(int obj_idx) +void Plater::clear_before_change_mesh(int obj_idx, const std::string ¬ification_msg) { ModelObject* mo = model().objects[obj_idx]; @@ -7356,8 +7360,7 @@ void Plater::clear_before_change_mesh(int obj_idx) get_notification_manager()->push_notification( NotificationType::CustomSupportsAndSeamRemovedAfterRepair, NotificationManager::NotificationLevel::PrintInfoNotificationLevel, - _u8L("Custom supports, seams and multimaterial painting were " - "removed after repairing the mesh.")); + notification_msg); // _u8L("Undo the repair"), // [this, snapshot_time](wxEvtHandler*){ // // Make sure the snapshot is still available and that diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 1ecbeb190..3dcca746d 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -273,7 +273,7 @@ public: void reslice_FFF_until_step(PrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false); void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false); - void clear_before_change_mesh(int obj_idx); + void clear_before_change_mesh(int obj_idx, const std::string ¬ification_msg); void changed_mesh(int obj_idx); void changed_object(int obj_idx); From e463979592d9e778fbc5632c5416fe37a6785db1 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Tue, 21 Feb 2023 15:25:08 +0100 Subject: [PATCH 06/12] Refactoring of dialog text --- src/slic3r/GUI/ConfigWizard.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index b0e68dfff..74f1ba19e 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2881,9 +2881,9 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo if (only_for_model_id.empty()) ask_and_select_default_materials( _L("The following FFF printer models have no filament selected:") + - "\n\n\t" + + "\n\n" + printer_model_list(printer_models_without_material) + - "\n\n\t" + + "\n\n" + _L("Do you want to select default filaments for these FFF printer models?"), printer_models_without_material, T_FFF); @@ -2899,9 +2899,9 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo if (only_for_model_id.empty()) ask_and_select_default_materials( _L("The following SLA printer models have no materials selected:") + - "\n\n\t" + + "\n\n" + printer_model_list(printer_models_without_material) + - "\n\n\t" + + "\n\n" + _L("Do you want to select default SLA materials for these printer models?"), printer_models_without_material, T_SLA); From beabf46e871dcc40a593f4d87daa968aabce5730 Mon Sep 17 00:00:00 2001 From: Pavel Mikus Date: Wed, 22 Feb 2023 11:01:12 +0100 Subject: [PATCH 07/12] Set cooling markers correctly - finally fix of cooperation between dynamic speed and pressure equalizer Fixes the following issues: 9769, 9485 and maybe others where presusre equalier is used with dynamic speeds --- src/libslic3r/GCode.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 460ddc111..7088a158d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2930,19 +2930,19 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de + float_to_string_decimal_point(m_last_height) + "\n"; } - std::string comment; + std::string cooling_marker_setspeed_comments; if (m_enable_cooling_markers) { if (path.role().is_bridge()) gcode += ";_BRIDGE_FAN_START\n"; else - comment = ";_EXTRUDE_SET_SPEED"; + cooling_marker_setspeed_comments = ";_EXTRUDE_SET_SPEED"; if (path.role() == ExtrusionRole::ExternalPerimeter) - comment += ";_EXTERNAL_PERIMETER"; + cooling_marker_setspeed_comments += ";_EXTERNAL_PERIMETER"; } if (!variable_speed) { // F is mm per minute. - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer.set_speed(F, "", cooling_marker_setspeed_comments); double path_length = 0.; std::string comment; if (m_config.gcode_comments) { @@ -2966,7 +2966,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de marked_comment += description_bridge; } double last_set_speed = new_points[0].speed * 60.0; - gcode += m_writer.set_speed(last_set_speed, "", comment); + gcode += m_writer.set_speed(last_set_speed, "", cooling_marker_setspeed_comments); Vec2d prev = this->point_to_gcode_quantized(new_points[0].p); for (size_t i = 1; i < new_points.size(); i++) { const ProcessedPoint& processed_point = new_points[i]; @@ -2976,7 +2976,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de prev = p; double new_speed = processed_point.speed * 60.0; if (last_set_speed != new_speed) { - gcode += m_writer.set_speed(new_speed, "", comment); + gcode += m_writer.set_speed(new_speed, "", cooling_marker_setspeed_comments); last_set_speed = new_speed; } } From 17899adc6957dd5207eb288e36045c533da3f544 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 22 Feb 2023 11:33:39 +0100 Subject: [PATCH 08/12] #9823 - Fixed parsing of gcode generated by Simplify3D --- src/libslic3r/GCode/GCodeProcessor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 566476824..6db0492d0 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -472,7 +472,7 @@ const std::vector> GCodeProces { EProducer::Slic3r, "generated by Slic3r" }, { EProducer::SuperSlicer, "generated by SuperSlicer" }, { EProducer::Cura, "Cura_SteamEngine" }, - { EProducer::Simplify3D, "G-Code generated by Simplify3D(R)" }, + { EProducer::Simplify3D, "generated by Simplify3D(R)" }, { EProducer::CraftWare, "CraftWare" }, { EProducer::ideaMaker, "ideaMaker" }, { EProducer::KissSlicer, "KISSlicer" }, @@ -2025,10 +2025,10 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string_view comment) return true; } - // ; layer - tag = " layer"; + // ; layer | ;layer + tag = "layer"; pos = cmt.find(tag); - if (pos == 0) { + if (pos == 0 || pos == 1) { // skip lines "; layer end" const std::string_view data = cmt.substr(pos + tag.length()); size_t end_start = data.find("end"); From 6a722570f1afe857c083177fd1357e87961c4a9b Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 22 Feb 2023 13:22:45 +0100 Subject: [PATCH 09/12] #9722 - GCodeViewer - Take in account z offset when setting the height of the toolpaths for the purge line in custom start gcode. --- src/libslic3r/GCode/GCodeProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 6db0492d0..555aab0c1 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2402,7 +2402,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line) if (m_forced_height > 0.0f) m_height = m_forced_height; else if (m_layer_id == 0) - m_height = (m_end_position[Z] <= double(m_first_layer_height)) ? m_end_position[Z] : m_first_layer_height; + m_height = std::min((float)m_end_position[Z], m_first_layer_height + m_z_offset); else if (line.comment() != INTERNAL_G2G3_TAG){ if (m_end_position[Z] > m_extruded_last_z + EPSILON && delta_pos[Z] == 0.0) m_height = m_end_position[Z] - m_extruded_last_z; From d6c731218102bfc4e6f1f432b74bc705b1e7bcef Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 22 Feb 2023 16:58:49 +0100 Subject: [PATCH 10/12] FOllow-up a41dd8eeed50b9bfbb9f37769569f091512d8124 - Fix for SPE-1521 - Use the arrows to move the cut plane out of the object --- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index d8064bd04..b7470a854 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -364,7 +364,7 @@ void GLGizmoCut3D::shift_cut_z(double delta) { Vec3d new_cut_center = m_plane_center; new_cut_center[Z] += delta; - set_center(new_cut_center); + set_center(new_cut_center, true); } void GLGizmoCut3D::rotate_vec3d_around_plane_center(Vec3d&vec) From be74338e534f3d29953c6372974acc487753bb64 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 23 Feb 2023 10:01:40 +0100 Subject: [PATCH 11/12] Follow-up a41dd8eeed50b9bfbb9f37769569f091512d8124 - Added missed updates for transformed bounding box + Fixed Arrow Up/Down action. Cut plane is moved during the its own normal instead of during the Z axes --- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 18 ++++++++++++------ src/slic3r/GUI/Gizmos/GLGizmoCut.hpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index b7470a854..fb457f5f6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -360,11 +360,12 @@ bool GLGizmoCut3D::on_mouse(const wxMouseEvent &mouse_event) return false; } -void GLGizmoCut3D::shift_cut_z(double delta) +void GLGizmoCut3D::shift_cut(double delta) { - Vec3d new_cut_center = m_plane_center; - new_cut_center[Z] += delta; - set_center(new_cut_center, true); + Vec3d starting_vec = m_rotation_m * Vec3d::UnitZ(); + if (starting_vec.norm() != 0.0) + starting_vec.normalize(); + set_center(m_plane_center + starting_vec * delta, true); } void GLGizmoCut3D::rotate_vec3d_around_plane_center(Vec3d&vec) @@ -1175,9 +1176,10 @@ void GLGizmoCut3D::dragging_grabber_xy(const GLGizmoBase::UpdateData &data) rotation[m_hover_id] = theta; const Transform3d rotation_tmp = m_start_dragging_m * rotation_transform(rotation); - if (m_rotation_m.rotation() != rotation_tmp.rotation()) - m_transformed_bounding_box = transformed_bounding_box(m_plane_center); + const bool update_tbb = m_rotation_m.rotation() != rotation_tmp.rotation(); m_rotation_m = rotation_tmp; + if (update_tbb) + m_transformed_bounding_box = transformed_bounding_box(m_plane_center); m_angle = theta; while (m_angle > two_pi) @@ -1647,6 +1649,8 @@ void GLGizmoCut3D::set_connectors_editing(bool connectors_editing) void GLGizmoCut3D::flip_cut_plane() { m_rotation_m = m_rotation_m * rotation_transform(PI * Vec3d::UnitX()); + m_transformed_bounding_box = transformed_bounding_box(m_plane_center); + Plater::TakeSnapshot snapshot(wxGetApp().plater(), _L("Flip cut plane"), UndoRedo::SnapshotType::GizmoAction); m_start_dragging_m = m_rotation_m; @@ -2303,6 +2307,8 @@ bool GLGizmoCut3D::process_cut_line(SLAGizmoEventType action, const Vec2d& mouse m.matrix().block(0, 0, 3, 3) = q.setFromTwoVectors(Vec3d::UnitZ(), cross_dir).toRotationMatrix(); m_rotation_m = m; + // update transformed bb + m_transformed_bounding_box = transformed_bounding_box(m_plane_center); m_angle_arc.reset(); set_center(m_plane_center + cross_dir * (cross_dir.dot(pt - m_plane_center)), true); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp index 5e6e4146f..1f07f561f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.hpp @@ -187,7 +187,7 @@ public: /// Return True when use the information otherwise False. bool on_mouse(const wxMouseEvent &mouse_event) override; - void shift_cut_z(double delta); + void shift_cut(double delta); void rotate_vec3d_around_plane_center(Vec3d&vec); void put_connectors_on_cut_plane(const Vec3d& cp_normal, double cp_offset); void update_clipper(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index d7d6f309d..af93c07df 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -623,7 +623,7 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt) else if (m_current == Cut) { auto do_move = [this, &processed](double delta_z) { GLGizmoCut3D* cut = dynamic_cast(get_current()); - cut->shift_cut_z(delta_z); + cut->shift_cut(delta_z); processed = true; }; From 575422c7b74c2fe71bedf0ea20a3d0b253d97418 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 23 Feb 2023 10:12:29 +0100 Subject: [PATCH 12/12] Follow-up of 3b174c37a0291d630df3ac37b292c3c1dd360197 - Fixed update of wipe tower brim width after loading a 3mf project --- src/slic3r/GUI/GCodeViewer.cpp | 6 +++--- src/slic3r/GUI/GLCanvas3D.cpp | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 186f1f4ff..24f692d11 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2250,9 +2250,9 @@ void GCodeViewer::load_shells(const Print& print) const PrintConfig& config = print.config(); const size_t extruders_count = config.nozzle_diameter.size(); if (extruders_count > 1 && config.wipe_tower && !config.complete_objects) { - const float depth = print.wipe_tower_data(extruders_count).depth; - const float brim_width = print.wipe_tower_data(extruders_count).brim_width; - + const WipeTowerData& wipe_tower_data = print.wipe_tower_data(extruders_count); + const float depth = wipe_tower_data.depth; + const float brim_width = wipe_tower_data.brim_width; m_shells.volumes.load_wipe_tower_preview(config.wipe_tower_x, config.wipe_tower_y, config.wipe_tower_width, depth, max_z, config.wipe_tower_rotation_angle, !print.is_step_done(psWipeTower), brim_width); } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 79ceae9ec..427c0e99f 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1972,31 +1972,30 @@ 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(m_config->option("nozzle_diameter"))->values.size(); - bool wt = dynamic_cast(m_config->option("wipe_tower"))->value; - bool co = dynamic_cast(m_config->option("complete_objects"))->value; + const bool wt = dynamic_cast(m_config->option("wipe_tower"))->value; + const bool co = dynamic_cast(m_config->option("complete_objects"))->value; 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); + const double height = std::max(m_model->bounding_box().max.z(), 10.0); - float x = dynamic_cast(m_config->option("wipe_tower_x"))->value; - float y = dynamic_cast(m_config->option("wipe_tower_y"))->value; - float w = dynamic_cast(m_config->option("wipe_tower_width"))->value; - float a = dynamic_cast(m_config->option("wipe_tower_rotation_angle"))->value; + const float x = dynamic_cast(m_config->option("wipe_tower_x"))->value; + const float y = dynamic_cast(m_config->option("wipe_tower_y"))->value; + const float w = dynamic_cast(m_config->option("wipe_tower_width"))->value; + const float a = dynamic_cast(m_config->option("wipe_tower_rotation_angle"))->value; + const float bw = dynamic_cast(m_config->option("wipe_tower_brim_width"))->value; const Print *print = m_process->fff_print(); - - float depth = print->wipe_tower_data(extruders_count).depth; - float brim_width = print->wipe_tower_data(extruders_count).brim_width; + const float depth = print->wipe_tower_data(extruders_count).depth; #if ENABLE_OPENGL_ES int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview( x, y, w, depth, (float)height, a, !print->is_step_done(psWipeTower), - brim_width, &m_wipe_tower_mesh); + bw, &m_wipe_tower_mesh); #else int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview( x, y, w, depth, (float)height, a, !print->is_step_done(psWipeTower), - brim_width); + bw); #endif // ENABLE_OPENGL_ES if (volume_idx_wipe_tower_old != -1) map_glvolume_old_to_new[volume_idx_wipe_tower_old] = volume_idx_wipe_tower_new;