diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index eb7c46861f..5664768242 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3378,9 +3378,9 @@ void GCodeProcessor::process_T(const std::string_view command) extra_time += m_kissslicer_toolchange_time_correction; simulate_st_synchronize(extra_time); - // specific to single extruder multi material, set the extruder temperature - // if not done yet - if (m_single_extruder_multi_material && m_extruder_temps[m_extruder_id] == 0.0f) + // specific to single extruder multi material, set the new extruder temperature + // to match the old one + if (m_single_extruder_multi_material) m_extruder_temps[m_extruder_id] = m_extruder_temps[old_extruder_id]; m_result.extruders_count = std::max(m_result.extruders_count, m_extruder_id + 1); diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index b070806f16..588aca51fb 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -493,6 +493,9 @@ int GLVolumeCollection::load_wipe_tower_preview( if (height == 0.0f) height = 0.1f; + static const float brim_height = 0.2f; + const float scaled_brim_height = brim_height / height; + TriangleMesh mesh; ColorRGBA color = ColorRGBA::DARK_YELLOW(); @@ -506,8 +509,6 @@ int GLVolumeCollection::load_wipe_tower_preview( depth = std::max(depth, 10.f); float min_width = 30.f; - const float scaled_brim_height = 0.2f / height; - // We'll now create the box with jagged edge. y-coordinates of the pre-generated model // are shifted so that the front edge has y=0 and centerline of the back edge has y=depth: // We split the box in three main pieces, @@ -553,6 +554,10 @@ int GLVolumeCollection::load_wipe_tower_preview( // central parts generator auto generate_central = [&]() { const std::vector vertices = { + // this part is not watertight to avoid to have different geometries for the cases + // brim_width < 10.0 + // brim_width == 10.0 + // brim_width > 10.0 { 38.453f, -(depth + brim_width), 0.0f }, { 61.547f, -(depth + brim_width), 0.0f }, { 38.453f, -(depth + brim_width), scaled_brim_height }, @@ -562,33 +567,33 @@ int GLVolumeCollection::load_wipe_tower_preview( { 38.453f, -depth, 1.0f }, { 61.547f, -depth, 1.0f }, { 38.453f, 0.0f, 1.0f }, - { 38.453f + 0.57735f * brim_width, brim_width, 1.0f }, { 44.2265f, 10.0f, 1.0f }, - { 50.0f - 0.57735f * brim_width, brim_width, 1.0f }, { 50.0f, 0.0f, 1.0f }, { 55.7735f, -10.0f, 1.0f }, { 61.547f, 0.0f, 1.0f }, { 38.453f, 0.0f, scaled_brim_height }, - { 38.453f, brim_width, scaled_brim_height }, - { 38.453f + 0.57735f * brim_width, brim_width, scaled_brim_height }, - { 50.0f - 0.57735f * brim_width, brim_width, scaled_brim_height }, + { 44.2265f, 10.0f, scaled_brim_height }, { 50.0f, 0.0f, scaled_brim_height }, { 55.7735f, -10.0f, scaled_brim_height }, { 61.547f, 0.0f, scaled_brim_height }, + { 38.453f, 0.0f, 0.0f }, + { 44.2265f, 10.0f, 0.0f }, + { 50.0f, 0.0f, 0.0f }, + { 55.7735f, -10.0f, 0.0f }, + { 61.547f, 0.0f, 0.0f }, + { 38.453f, brim_width, scaled_brim_height }, { 61.547f, brim_width, scaled_brim_height }, { 38.453f, brim_width, 0.0f }, - { 38.453f + 0.57735f * brim_width, brim_width, 0.0f }, - { 44.2265f, 10.0f, 0.0f }, - { 50.0f - 0.57735f * brim_width, brim_width, 0.0f }, - { 61.547f, brim_width, 0.0f } + { 61.547f, brim_width, 0.0f }, }; const std::vector triangles = { - { 0, 1, 3 }, { 0, 3, 2 }, { 2, 3, 5 }, { 2, 5, 4 }, { 4, 5, 7 }, { 4, 7, 6 }, { 7, 14, 13 }, { 7, 13, 6 }, - { 6, 13, 12 }, { 6, 12, 8 }, { 8, 12, 11 }, { 8, 11, 9 }, { 9, 11, 10 }, { 18, 19, 22 }, { 22, 19, 21 }, { 19, 20, 21 }, - { 15, 17, 16 }, { 17, 15, 8 }, { 17, 8, 9 }, { 21, 13, 14 }, { 21, 20, 13 }, { 20, 19, 12 }, { 20, 12, 13 }, { 19, 18, 11 }, - { 19, 11, 12 }, { 27, 26, 18 }, { 27, 18, 22 }, { 26, 25, 18 }, { 18, 25, 11 }, { 11, 25, 10 }, { 25, 24, 17 }, { 25, 17, 9 }, - { 25, 9, 10 }, { 24, 23, 16 }, { 24, 16, 17 }, { 1, 26, 27 }, { 1, 23, 26 }, { 1, 0, 23 }, { 0, 23, 24 }, { 24, 25, 26 } + { 0, 1, 3 }, { 0, 3, 2 }, { 2, 3, 5 }, { 2, 5, 4 }, { 4, 5, 7 }, { 4, 7, 6 }, + { 6, 7, 11 }, { 6, 11, 10 }, { 6, 10, 8 }, { 8, 10, 9 }, { 11, 7, 12 }, { 14, 13, 8 }, + { 14, 8, 9 }, { 19, 18, 13 }, { 19, 13, 14 }, { 15, 14, 9 }, { 15, 9, 10 }, { 20, 19, 14 }, + { 20, 14, 15 }, { 16, 15, 10 }, { 16, 10, 11 }, { 21, 20, 15 }, { 21, 15, 16 }, { 17, 16, 11 }, + { 17, 11, 12 }, { 22, 21, 16 }, { 22, 16, 17 }, { 15, 16, 17 }, { 13, 15, 23 }, { 15, 17, 24 }, + { 15, 24, 23 }, { 26, 25, 23 }, { 26, 23, 24 }, { 0, 25, 1 }, { 1, 25, 26 }, { 20, 18, 19 } }; indexed_triangle_set its; @@ -614,7 +619,7 @@ int GLVolumeCollection::load_wipe_tower_preview( // We have the mesh ready. It has one tooth and width of min_width. We will now // append several of these together until we are close to the required width // of the block. Than we can scale it precisely. - size_t n = std::max(1, int(width / min_width)); // How many shall be merged? + const size_t n = std::max(1, int(width / min_width)); // How many shall be merged? for (size_t i = 0; i < n; ++i) { mesh.merge(tooth_mesh); tooth_mesh.translate(100.0f, 0.0f, 0.0f); @@ -695,8 +700,13 @@ int GLVolumeCollection::load_wipe_tower_preview( mesh.merge(TriangleMesh(std::move(data))); mesh.scale(Vec3f(width / (n * 100.0f), 1.0f, height)); // Scaling to proper width } - else - mesh = make_cube(width, depth, height); + else { + mesh = make_cube(width, depth, height - brim_height); + mesh.translate(0.0f, 0.0f, brim_height); + TriangleMesh brim_mesh = make_cube(width + 2.0f * brim_width, depth + 2.0f * brim_width, brim_height); + brim_mesh.translate(-brim_width, -brim_width, 0.0f); + mesh.merge(brim_mesh); + } volumes.emplace_back(new GLVolume(color)); GLVolume& v = *volumes.back(); diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index dee08727a0..6057570518 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; @@ -2060,7 +2060,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); diff --git a/version.inc b/version.inc index 1891f98197..0e4612fe00 100644 --- a/version.inc +++ b/version.inc @@ -3,7 +3,7 @@ set(SLIC3R_APP_NAME "PrusaSlicer") set(SLIC3R_APP_KEY "PrusaSlicer") -set(SLIC3R_VERSION "2.6.0-alpha3") +set(SLIC3R_VERSION "2.6.0-alpha4") set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN") set(SLIC3R_RC_VERSION "2,6,0,0") set(SLIC3R_RC_VERSION_DOTS "2.6.0.0")