From e3b37facb2191e7b1a260c1667bac3ab3171a0a9 Mon Sep 17 00:00:00 2001 From: Rad Date: Sun, 19 Apr 2026 22:21:42 +0200 Subject: [PATCH] remove useless features --- src/libslic3r/GCode.cpp | 5 +++++ src/libslic3r/MixedFilament.cpp | 29 ++++++++++++++++++++++++++++- src/libslic3r/PrintApply.cpp | 3 +++ src/libslic3r/PrintConfig.cpp | 10 ++++++---- src/libslic3r/PrintObjectSlice.cpp | 11 +++++++++++ src/slic3r/GUI/Plater.cpp | 26 +++++++++++--------------- src/slic3r/GUI/Tab.cpp | 8 +++++--- 7 files changed, 69 insertions(+), 23 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c131bb91d4..93c04acbfb 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3796,6 +3796,7 @@ static size_t unique_extruder_count_for_gcode(const std::vector& s static std::vector pointillism_sequence_for_row_for_gcode(const MixedFilament& mf, size_t num_physical) { +#if 0 if (!mf.enabled || num_physical == 0 || mf.distribution_mode != int(MixedFilament::SameLayerPointillisme)) return {}; @@ -3856,6 +3857,10 @@ static std::vector pointillism_sequence_for_row_for_gcode(const Mi if (!seen_a || !seen_b) return {}; return sequence; +#endif + (void)mf; + (void)num_physical; + return {}; } static void split_polyline_by_length_for_pointillism(const Polyline& src, diff --git a/src/libslic3r/MixedFilament.cpp b/src/libslic3r/MixedFilament.cpp index 5723920f89..3f1921772b 100644 --- a/src/libslic3r/MixedFilament.cpp +++ b/src/libslic3r/MixedFilament.cpp @@ -211,6 +211,8 @@ static int clamp_int(int v, int lo, int hi) return std::max(lo, std::min(hi, v)); } +static int normalize_distribution_mode_without_pointillism(int distribution_mode, const std::string &gradient_component_ids); + static float clamp_surface_offset(float v) { return std::clamp(v, -2.f, 2.f); @@ -568,9 +570,14 @@ static bool parse_row_definition(const std::string &row, manual_pattern = joined_pattern.str(); } - // Compatibility for early same-layer prototype rows. + // Compatibility for early same-layer prototype rows is intentionally + // disabled while pointillisme is retired from the mixed-filament path. +#if 0 if (distribution_mode == int(MixedFilament::LayerCycle) && pointillism_all_filaments) distribution_mode = int(MixedFilament::SameLayerPointillisme); +#endif + pointillism_all_filaments = false; + distribution_mode = normalize_distribution_mode_without_pointillism(distribution_mode, gradient_component_ids); return true; } @@ -699,6 +706,22 @@ static std::vector decode_gradient_component_ids(const std::string return ids; } +static int normalize_distribution_mode_without_pointillism(int distribution_mode, const std::string &gradient_component_ids) +{ + const int clamped_mode = clamp_int(distribution_mode, int(MixedFilament::LayerCycle), int(MixedFilament::Simple)); + if (clamped_mode != int(MixedFilament::SameLayerPointillisme)) + return clamped_mode; + + const size_t gradient_count = decode_gradient_component_ids(gradient_component_ids, 9).size(); + return gradient_count >= 3 ? int(MixedFilament::LayerCycle) : int(MixedFilament::Simple); +} + +static void disable_pointillism_mode(MixedFilament &mf) +{ + mf.pointillism_all_filaments = false; + mf.distribution_mode = normalize_distribution_mode_without_pointillism(mf.distribution_mode, mf.gradient_component_ids); +} + static std::vector parse_gradient_weight_tokens(const std::string &weights) { std::vector out; @@ -1661,6 +1684,7 @@ void MixedFilamentManager::apply_gradient_settings(int gradient_mode, m_advanced_dithering = advanced_dithering; for (MixedFilament &mf : m_mixed) { + disable_pointillism_mode(mf); if (!mf.custom) { mf.ratio_a = 1; mf.ratio_b = 1; @@ -1678,6 +1702,7 @@ std::string MixedFilamentManager::serialize_custom_entries() if (!first) ss << ';'; first = false; + disable_pointillism_mode(mf); mf.stable_id = normalize_stable_id(mf.stable_id); const std::string normalized_ids = normalize_gradient_component_ids(mf.gradient_component_ids); const std::string normalized_weights = normalize_gradient_component_weights(mf.gradient_component_weights, normalized_ids.size()); @@ -1825,6 +1850,7 @@ void MixedFilamentManager::load_custom_entries(const std::string &serialized, co mf.enabled = false; mf.custom = false; mf.origin_auto = true; + disable_pointillism_mode(mf); rebuilt.push_back(std::move(mf)); consumed_auto_pairs.insert(key); @@ -1856,6 +1882,7 @@ void MixedFilamentManager::load_custom_entries(const std::string &serialized, co mf.enabled = false; mf.custom = custom; mf.origin_auto = origin_auto; + disable_pointillism_mode(mf); rebuilt.push_back(std::move(mf)); ++loaded_rows; } diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index d99667932d..fe6e17c5b4 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1180,9 +1180,12 @@ static void append_mixed_component_extruders(const MixedFilamentManager &mixed_m static bool same_layer_pointillism_enabled(const MixedFilamentManager &mixed_mgr) { +#if 0 for (const MixedFilament &mf : mixed_mgr.mixed_filaments()) if (mf.enabled && mf.distribution_mode == int(MixedFilament::SameLayerPointillisme)) return true; +#endif + (void)mixed_mgr; return false; } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index bf137502bf..cb5cea6dea 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4180,9 +4180,10 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionBool(false)); def = this->add("mixed_filament_height_lower_bound", coFloat); - def->label = L("Mixed filament lower height bound"); + def->label = L("Local-Z lower height bound"); def->category = L("Others"); - def->tooltip = L("Lower bound used by the height-weighted mixed filament gradient mode.\n\n" + def->tooltip = L("Lower bound used when Local-Z mixed-filament dithering chooses per-color sublayer heights.\n\n" + "Smaller values let Local-Z use thinner sublayers for a color when needed.\n\n" "Detailed mixed filament setting explanations will be published once the project wiki is available."); def->sidetext = "mm"; def->min = 0.01; @@ -4190,9 +4191,10 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionFloat(0.04)); def = this->add("mixed_filament_height_upper_bound", coFloat); - def->label = L("Mixed filament upper height bound"); + def->label = L("Local-Z upper height bound"); def->category = L("Others"); - def->tooltip = L("Upper bound used by the height-weighted mixed filament gradient mode.\n\n" + def->tooltip = L("Upper bound used when Local-Z mixed-filament dithering chooses per-color sublayer heights.\n\n" + "Larger values let Local-Z use thicker sublayers for a color when needed.\n\n" "Detailed mixed filament setting explanations will be published once the project wiki is available."); def->sidetext = "mm"; def->min = 0.01; diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 7953db7311..11e8c9c476 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1811,6 +1811,7 @@ static std::vector build_weighted_gradient_sequence(const std::vec static std::vector pointillism_sequence_for_row(const MixedFilament &mf, size_t num_physical) { +#if 0 if (!mf.enabled || num_physical == 0) return {}; @@ -1873,6 +1874,10 @@ static std::vector pointillism_sequence_for_row(const MixedFilamen if (!seen_a || !seen_b) return {}; return sequence; +#endif + (void)mf; + (void)num_physical; + return {}; } static bool local_z_eligible_mixed_row(const MixedFilament &mf) @@ -2137,6 +2142,7 @@ static size_t non_empty_mask_count(const std::vector &masks_by_extru template static bool apply_pointillism_mixed_segmentation(PrintObject &print_object, std::vector> &segmentation, ThrowOnCancel throw_on_cancel) { +#if 0 const Print *print = print_object.print(); if (print == nullptr || segmentation.empty()) return false; @@ -2335,6 +2341,11 @@ static bool apply_pointillism_mixed_segmentation(PrintObject &print_object, std: << " skipped_states=" << skipped_states; } return false; +#endif + (void)print_object; + (void)segmentation; + (void)throw_on_cancel; + return false; } static ExPolygons collect_layer_region_slices(const Layer &layer) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index fed7687401..169b72fe9e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6069,6 +6069,10 @@ void MixedFilamentConfigPanel::build_ui() const int component_b = std::clamp(int(m_mf.component_b), 1, int(m_num_physical)); const std::vector initial_gradient_ids = decode_gradient_ids(m_mf.gradient_component_ids); + if (m_mf.distribution_mode == int(MixedFilament::SameLayerPointillisme)) { + m_mf.distribution_mode = initial_gradient_ids.size() >= 3 ? int(MixedFilament::LayerCycle) : int(MixedFilament::Simple); + m_mf.pointillism_all_filaments = false; + } const int stored_distribution_mode = std::clamp(m_mf.distribution_mode, int(MixedFilament::LayerCycle), int(MixedFilament::Simple)); @@ -6213,7 +6217,6 @@ void MixedFilamentConfigPanel::build_ui() wxColour color_b = (component_b >= 1 && component_b <= int(m_palette.size())) ? m_palette[component_b - 1] : wxColour("#26A69A"); m_blend_selector = new MixedGradientSelector(this, color_a, color_b, std::clamp(m_mf.mix_b_percent, 0, 100)); m_blend_selector->SetBackgroundColour(panel_bg); - const bool same_layer_mode = row_distribution_mode == int(MixedFilament::SameLayerPointillisme); m_blend_label = nullptr; picker_row->AddSpacer(gap); picker_row->Add(m_blend_selector, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxLEFT, gap); @@ -6242,7 +6245,7 @@ void MixedFilamentConfigPanel::build_ui() const wxString bias_tooltip = _L("Positive bias recesses the second filament in the pair; negative bias recesses the first filament.\n\n" "The color chip shows which filament the current value affects.\n\n" - "Grouped wall patterns, same-layer pointillisme, and Local-Z dithering ignore it."); + "Grouped wall patterns and Local-Z dithering ignore it."); auto *surface_offset_label = new wxStaticText(this, wxID_ANY, _L("Bias")); surface_offset_label->SetForegroundColour(is_dark ? wxColour(236, 236, 236) : wxColour(20, 20, 20)); @@ -6359,7 +6362,6 @@ void MixedFilamentConfigPanel::build_ui() m_local_z_limit_spin->Enable(m_local_z_limit_checkbox != nullptr && m_local_z_limit_checkbox->GetValue()); - const bool preserve_same_layer_mode = m_mf.distribution_mode == int(MixedFilament::SameLayerPointillisme); m_mf.component_a = unsigned(a); m_mf.component_b = unsigned(b); if (m_bias_mode_enabled) { @@ -6413,11 +6415,8 @@ void MixedFilamentConfigPanel::build_ui() if (m_choice_d && m_choice_d->GetSelection() > 0) add_unique(unsigned(m_choice_d->GetSelection())); const bool multi_gradient_mode = selected_ids.size() >= 3; - m_mf.distribution_mode = multi_gradient_mode ? - (preserve_same_layer_mode ? int(MixedFilament::SameLayerPointillisme) : int(MixedFilament::LayerCycle)) : - int(MixedFilament::Simple); + m_mf.distribution_mode = multi_gradient_mode ? int(MixedFilament::LayerCycle) : int(MixedFilament::Simple); simple_mode = m_mf.distribution_mode == int(MixedFilament::Simple); - same_layer_mode = m_mf.distribution_mode == int(MixedFilament::SameLayerPointillisme); m_mf.mix_b_percent = std::clamp(m_blend_selector ? m_blend_selector->value() : 50, 0, 100); m_mf.manual_pattern.clear(); m_mf.pointillism_all_filaments = false; @@ -6494,12 +6493,10 @@ void MixedFilamentConfigPanel::build_ui() m_mf.display_color = blend_from_sequence(m_physical_colors, preview_sequence, "#26A69A"); if (m_blend_label) { if (selected_gradient_ids.size() >= 3) { - m_blend_label->SetLabel(wxString::Format(same_layer_mode ? _L("%d-color pointillisme") : _L("%d-color layer cycle"), - int(selected_gradient_ids.size()))); + m_blend_label->SetLabel(wxString::Format(_L("%d-color layer cycle"), int(selected_gradient_ids.size()))); } else { - m_blend_label->SetLabel(wxString::Format(simple_mode ? _L("Simple %d%%/%d%%") : - (same_layer_mode ? _L("Pointillisme %d%%/%d%%") : _L("%d%%/%d%%")), - 100 - preview_mix_b_percent, preview_mix_b_percent)); + m_blend_label->SetLabel(wxString::Format(simple_mode ? _L("Simple %d%%/%d%%") : _L("%d%%/%d%%"), + 100 - preview_mix_b_percent, preview_mix_b_percent)); } } } else { @@ -6507,9 +6504,8 @@ void MixedFilamentConfigPanel::build_ui() m_physical_colors[size_t(a - 1)], m_physical_colors[size_t(b - 1)], 100 - preview_mix_b_percent, preview_mix_b_percent); if (m_blend_label) - m_blend_label->SetLabel(wxString::Format(simple_mode ? _L("Simple %d%%/%d%%") : - (same_layer_mode ? _L("Pointillisme %d%%/%d%%") : _L("%d%%/%d%%")), - 100 - preview_mix_b_percent, preview_mix_b_percent)); + m_blend_label->SetLabel(wxString::Format(simple_mode ? _L("Simple %d%%/%d%%") : _L("%d%%/%d%%"), + 100 - preview_mix_b_percent, preview_mix_b_percent)); } if (m_mix_preview) { diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c9e0673063..2fda8ce4d3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2544,12 +2544,14 @@ optgroup->append_single_option_line("skirt_loops", "others_settings_skirt#loops" // Use default (no icon) here to avoid runtime bitmap load failures. optgroup = page->new_optgroup(L("Mixed Filaments")); - optgroup->append_single_option_line("mixed_filament_gradient_mode"); + // Height-weighted cadence is no longer exposed in the Others tab. + // optgroup->append_single_option_line("mixed_filament_gradient_mode"); optgroup->append_single_option_line("mixed_filament_height_lower_bound"); optgroup->append_single_option_line("mixed_filament_height_upper_bound"); optgroup->append_single_option_line("mixed_filament_advanced_dithering"); - optgroup->append_single_option_line("mixed_filament_pointillism_pixel_size"); - optgroup->append_single_option_line("mixed_filament_pointillism_line_gap"); + // Pointillisme controls are retired; keep config keys for compatibility only. + // optgroup->append_single_option_line("mixed_filament_pointillism_pixel_size"); + // optgroup->append_single_option_line("mixed_filament_pointillism_line_gap"); optgroup->append_single_option_line("mixed_filament_component_bias_enabled"); optgroup->append_single_option_line("mixed_filament_surface_indentation"); optgroup->append_single_option_line("mixed_filament_region_collapse");