diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index a5195222bdf..fccc5fd15bc 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -2145,7 +2145,7 @@ static std::optional top_surface_image_co TopSurfaceImageContoningSourceContext out; out.offset_context = std::move(*offset_context); out.threshold_deg = - std::clamp(zone.top_surface_contoning_angle_threshold_deg, + std::clamp(zone.effective_top_surface_contoning_angle_threshold_deg(), TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg, TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg); out.stack_layers = std::clamp(plan.contoning_stack_layers, @@ -2610,7 +2610,8 @@ static TopSurfaceImageContoningStackPlanKey top_surface_image_contoning_stack_pl key.min_width_mm = top_surface_image_contoning_float_key(plan.min_width_mm); key.max_width_mm = top_surface_image_contoning_float_key(plan.max_width_mm); key.external_width_mm = top_surface_image_contoning_float_key(plan.contoning_external_width_mm); - key.angle_threshold_deg = top_surface_image_contoning_float_key(zone.top_surface_contoning_angle_threshold_deg); + key.angle_threshold_deg = + top_surface_image_contoning_float_key(zone.effective_top_surface_contoning_angle_threshold_deg()); key.layer_phase = plan.contoning_layer_phase_enabled; key.replace_top_perimeters = plan.contoning_replace_top_perimeters_with_infill; key.recolor_surrounding_perimeters = plan.contoning_recolor_surrounding_perimeters; @@ -3272,10 +3273,12 @@ static std::vector top_surface_image_region_plans( std::clamp(zone->effective_top_surface_contoning_flat_surface_infill_mode(), int(TextureMappingZone::ContoningFlatSurfaceInfillRectilinear), int(TextureMappingZone::ContoningFlatSurfaceInfillRectilinearWithBoundary)); - plan.contoning_layer_phase_enabled = zone->top_surface_contoning_layer_phase_enabled; + plan.contoning_layer_phase_enabled = zone->effective_top_surface_contoning_layer_phase_enabled(); plan.contoning_varied_infill_angles_enabled = zone->top_surface_contoning_varied_infill_angles_enabled; - plan.contoning_blue_noise_error_diffusion_enabled = zone->top_surface_contoning_blue_noise_error_diffusion_enabled; - plan.contoning_supersampled_cells_enabled = zone->top_surface_contoning_supersampled_cells_enabled; + plan.contoning_blue_noise_error_diffusion_enabled = + zone->effective_top_surface_contoning_blue_noise_error_diffusion_enabled(); + plan.contoning_supersampled_cells_enabled = + zone->effective_top_surface_contoning_supersampled_cells_enabled(); plan.contoning_polygonize_color_regions_enabled = zone->top_surface_contoning_polygonize_color_regions_enabled; plan.contoning_polygonize_resolution = TextureMappingZone::normalize_top_surface_contoning_polygonize_resolution(zone->top_surface_contoning_polygonize_resolution); diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index fe477c3e34f..75dbe96c48d 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -541,7 +541,7 @@ static std::optional perimeter_texture_make_reco TextureMappingZone::MinTopSurfaceContoningPatternFilaments, TextureMappingZone::MaxTopSurfaceContoningPatternFilaments); sampler.contoning_angle_threshold_deg = - std::clamp(zone.top_surface_contoning_angle_threshold_deg, + std::clamp(zone.effective_top_surface_contoning_angle_threshold_deg(), TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg, TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg); if (!sampler.contoning_solver.valid()) @@ -2828,7 +2828,7 @@ void LayerRegion::make_perimeters(const SurfaceCollection &slices, const LayerRe wall_depth_mm, perimeter_path_zone->top_visible_perimeter_recolor_above_layers, &wall_band); - if (perimeter_path_zone->top_surface_contoning_angle_threshold_deg >= + if (perimeter_path_zone->effective_top_surface_contoning_angle_threshold_deg() >= TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg - 1e-4f) top_visible_recolor_path_mask = std::move(wall_band); contoning_min_recolor_run_length_mm = diff --git a/src/libslic3r/TextureMapping.cpp b/src/libslic3r/TextureMapping.cpp index f54d634bcdb..89d9701a224 100644 --- a/src/libslic3r/TextureMapping.cpp +++ b/src/libslic3r/TextureMapping.cpp @@ -1129,7 +1129,8 @@ bool TextureMappingZone::operator==(const TextureMappingZone &rhs) const std::abs(top_surface_image_max_line_width_mm - rhs.top_surface_image_max_line_width_mm) <= eps && top_surface_image_colored_top_layers == rhs.top_surface_image_colored_top_layers && top_surface_image_fixed_coloring_filaments_active() == rhs.top_surface_image_fixed_coloring_filaments_active() && - std::abs(top_surface_contoning_angle_threshold_deg - rhs.top_surface_contoning_angle_threshold_deg) <= eps && + std::abs(effective_top_surface_contoning_angle_threshold_deg() - + rhs.effective_top_surface_contoning_angle_threshold_deg()) <= eps && top_surface_contoning_stack_layers == rhs.top_surface_contoning_stack_layers && top_surface_contoning_pattern_filaments == rhs.top_surface_contoning_pattern_filaments && std::abs(top_surface_contoning_min_feature_mm - rhs.top_surface_contoning_min_feature_mm) <= eps && @@ -1140,10 +1141,12 @@ bool TextureMappingZone::operator==(const TextureMappingZone &rhs) const effective_top_surface_contoning_recolor_surrounding_perimeters() == rhs.effective_top_surface_contoning_recolor_surrounding_perimeters() && stored_top_surface_contoning_perimeter_mode() == rhs.stored_top_surface_contoning_perimeter_mode() && stored_top_surface_contoning_flat_surface_infill_mode() == rhs.stored_top_surface_contoning_flat_surface_infill_mode() && - top_surface_contoning_layer_phase_enabled == rhs.top_surface_contoning_layer_phase_enabled && + effective_top_surface_contoning_layer_phase_enabled() == rhs.effective_top_surface_contoning_layer_phase_enabled() && top_surface_contoning_varied_infill_angles_enabled == rhs.top_surface_contoning_varied_infill_angles_enabled && - top_surface_contoning_blue_noise_error_diffusion_enabled == rhs.top_surface_contoning_blue_noise_error_diffusion_enabled && - top_surface_contoning_supersampled_cells_enabled == rhs.top_surface_contoning_supersampled_cells_enabled && + effective_top_surface_contoning_blue_noise_error_diffusion_enabled() == + rhs.effective_top_surface_contoning_blue_noise_error_diffusion_enabled() && + effective_top_surface_contoning_supersampled_cells_enabled() == + rhs.effective_top_surface_contoning_supersampled_cells_enabled() && top_surface_contoning_polygonize_color_regions_enabled == rhs.top_surface_contoning_polygonize_color_regions_enabled && TextureMappingZone::normalize_top_surface_contoning_polygonize_resolution(top_surface_contoning_polygonize_resolution) == TextureMappingZone::normalize_top_surface_contoning_polygonize_resolution(rhs.top_surface_contoning_polygonize_resolution) && @@ -1504,7 +1507,7 @@ std::string TextureMappingManager::serialize_entries() TextureMappingZone::MaxTopSurfaceImageColoredTopLayers); texture["top_surface_image_fixed_coloring_filaments"] = zone.top_surface_image_fixed_coloring_filaments_active(); texture["top_surface_contoning_angle_threshold_deg"] = - std::clamp(finite_or(zone.top_surface_contoning_angle_threshold_deg, + std::clamp(finite_or(zone.effective_top_surface_contoning_angle_threshold_deg(), TextureMappingZone::DefaultTopSurfaceContoningAngleThresholdDeg), TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg, TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg); @@ -1538,13 +1541,13 @@ std::string TextureMappingManager::serialize_entries() int(TextureMappingZone::ContoningPerimeterSegmentInfill)); texture["top_surface_contoning_flat_surface_infill_mode"] = top_surface_contoning_flat_surface_infill_mode_name(zone.stored_top_surface_contoning_flat_surface_infill_mode()); - texture["top_surface_contoning_layer_phase_enabled"] = zone.top_surface_contoning_layer_phase_enabled; + texture["top_surface_contoning_layer_phase_enabled"] = zone.effective_top_surface_contoning_layer_phase_enabled(); texture["top_surface_contoning_varied_infill_angles_enabled"] = zone.top_surface_contoning_varied_infill_angles_enabled; texture["top_surface_contoning_blue_noise_error_diffusion_enabled"] = - zone.top_surface_contoning_blue_noise_error_diffusion_enabled; + zone.effective_top_surface_contoning_blue_noise_error_diffusion_enabled(); texture["top_surface_contoning_supersampled_cells_enabled"] = - zone.top_surface_contoning_supersampled_cells_enabled; + zone.effective_top_surface_contoning_supersampled_cells_enabled(); texture["top_surface_contoning_polygonize_color_regions_enabled"] = zone.top_surface_contoning_polygonize_color_regions_enabled; texture["top_surface_contoning_polygonize_resolution"] = diff --git a/src/libslic3r/TextureMapping.hpp b/src/libslic3r/TextureMapping.hpp index e671c28aea0..8561ec3a3ec 100644 --- a/src/libslic3r/TextureMapping.hpp +++ b/src/libslic3r/TextureMapping.hpp @@ -259,6 +259,11 @@ struct TextureMappingZone return ShowExperimentalTopSurfaceContoningOptions ? mode : DefaultTopSurfaceContoningPerimeterMode; } + static constexpr float effective_top_surface_contoning_angle_threshold_deg(float value) + { + return ShowExperimentalTopSurfaceContoningOptions ? value : MaxTopSurfaceContoningAngleThresholdDeg; + } + static constexpr bool effective_top_surface_contoning_only_color_surface_infill(bool value) { return ShowExperimentalTopSurfaceContoningOptions ? value : true; @@ -279,6 +284,21 @@ struct TextureMappingZone return ShowExperimentalTopSurfaceContoningOptions && value; } + static constexpr bool effective_top_surface_contoning_layer_phase_enabled(bool value) + { + return ShowExperimentalTopSurfaceContoningOptions && value; + } + + static constexpr bool effective_top_surface_contoning_blue_noise_error_diffusion_enabled(bool value) + { + return ShowExperimentalTopSurfaceContoningOptions && value; + } + + static constexpr bool effective_top_surface_contoning_supersampled_cells_enabled(bool value) + { + return ShowExperimentalTopSurfaceContoningOptions && value; + } + static constexpr int normalize_top_surface_contoning_polygonize_resolution(int value) { return value <= 1 ? 1 : (value >= 4 ? 4 : 2); @@ -436,6 +456,12 @@ struct TextureMappingZone !effective_top_surface_contoning_recolor_surrounding_perimeters(); } + float effective_top_surface_contoning_angle_threshold_deg() const + { + return TextureMappingZone::effective_top_surface_contoning_angle_threshold_deg( + top_surface_contoning_angle_threshold_deg); + } + bool effective_top_surface_contoning_only_color_surface_infill() const { return effective_top_surface_contoning_only_color_surface_infill(top_surface_contoning_only_color_surface_infill); @@ -475,6 +501,24 @@ struct TextureMappingZone top_surface_contoning_surface_anchored_stacks_enabled); } + bool effective_top_surface_contoning_layer_phase_enabled() const + { + return TextureMappingZone::effective_top_surface_contoning_layer_phase_enabled( + top_surface_contoning_layer_phase_enabled); + } + + bool effective_top_surface_contoning_blue_noise_error_diffusion_enabled() const + { + return TextureMappingZone::effective_top_surface_contoning_blue_noise_error_diffusion_enabled( + top_surface_contoning_blue_noise_error_diffusion_enabled); + } + + bool effective_top_surface_contoning_supersampled_cells_enabled() const + { + return TextureMappingZone::effective_top_surface_contoning_supersampled_cells_enabled( + top_surface_contoning_supersampled_cells_enabled); + } + void apply_top_surface_contoning_experimental_defaults() { if (top_surface_image_printing_enabled && @@ -484,12 +528,16 @@ struct TextureMappingZone top_surface_image_fixed_coloring_filaments = true; } if (!ShowExperimentalTopSurfaceContoningOptions) { + top_surface_contoning_angle_threshold_deg = MaxTopSurfaceContoningAngleThresholdDeg; top_surface_contoning_only_color_surface_infill = true; top_surface_contoning_replace_top_perimeters_with_infill = false; top_surface_contoning_recolor_surrounding_perimeters = false; top_surface_contoning_perimeter_mode = DefaultTopSurfaceContoningPerimeterMode; top_surface_contoning_flat_surface_infill_mode = DefaultTopSurfaceContoningFlatSurfaceInfillMode; top_surface_contoning_surface_anchored_stacks_enabled = false; + top_surface_contoning_layer_phase_enabled = false; + top_surface_contoning_blue_noise_error_diffusion_enabled = false; + top_surface_contoning_supersampled_cells_enabled = false; } else if (top_surface_contoning_replace_top_perimeters_with_infill) { top_surface_contoning_recolor_surrounding_perimeters = false; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 9eb75e0fbb4..b9a3b94eb06 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2108,6 +2108,7 @@ public: { (void) generic_solver_mix_model; (void) reduce_outer_surface_texture; + (void) top_surface_contoning_min_feature_mm; m_modulation_mode_manually_changed = modulation_mode_manually_changed; m_strength_offsets_expanded = initial_strength_offsets_expanded; m_top_surface_contoning_shell_usage = top_surface_contoning_shell_usage; @@ -2649,28 +2650,30 @@ public: m_top_surface_contoning_panel = new wxPanel(top_surface_page, wxID_ANY); auto *top_surface_contoning_root = new wxBoxSizer(wxVERTICAL); m_top_surface_contoning_panel->SetSizer(top_surface_contoning_root); - auto *contoning_angle_row = new wxBoxSizer(wxHORIZONTAL); - contoning_angle_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("Surface angle threshold")), - 0, - wxALIGN_CENTER_VERTICAL | wxRIGHT, - gap); - m_top_surface_contoning_angle_threshold_spin = - new wxSpinCtrlDouble(m_top_surface_contoning_panel, - wxID_ANY, - wxEmptyString, - wxDefaultPosition, - wxSize(FromDIP(84), -1), - wxSP_ARROW_KEYS | wxALIGN_RIGHT | wxTE_PROCESS_ENTER, - double(TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg), - double(TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg), - std::clamp(double(top_surface_contoning_angle_threshold_deg), - double(TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg), - double(TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg)), - 1.0); - m_top_surface_contoning_angle_threshold_spin->SetDigits(0); - contoning_angle_row->Add(m_top_surface_contoning_angle_threshold_spin, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap / 2); - contoning_angle_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("deg")), 0, wxALIGN_CENTER_VERTICAL); - top_surface_contoning_root->Add(contoning_angle_row, 0, wxEXPAND | wxBOTTOM, gap); + if (TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) { + auto *contoning_angle_row = new wxBoxSizer(wxHORIZONTAL); + contoning_angle_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("Surface angle threshold")), + 0, + wxALIGN_CENTER_VERTICAL | wxRIGHT, + gap); + m_top_surface_contoning_angle_threshold_spin = + new wxSpinCtrlDouble(m_top_surface_contoning_panel, + wxID_ANY, + wxEmptyString, + wxDefaultPosition, + wxSize(FromDIP(84), -1), + wxSP_ARROW_KEYS | wxALIGN_RIGHT | wxTE_PROCESS_ENTER, + double(TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg), + double(TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg), + std::clamp(double(top_surface_contoning_angle_threshold_deg), + double(TextureMappingZone::MinTopSurfaceContoningAngleThresholdDeg), + double(TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg)), + 1.0); + m_top_surface_contoning_angle_threshold_spin->SetDigits(0); + contoning_angle_row->Add(m_top_surface_contoning_angle_threshold_spin, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap / 2); + contoning_angle_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("deg")), 0, wxALIGN_CENTER_VERTICAL); + top_surface_contoning_root->Add(contoning_angle_row, 0, wxEXPAND | wxBOTTOM, gap); + } const int clamped_contoning_pattern_filaments = std::clamp(top_surface_contoning_pattern_filaments, TextureMappingZone::MinTopSurfaceContoningPatternFilaments, @@ -2728,28 +2731,6 @@ public: evt.Skip(); queue_top_surface_contoning_message_resize_wrap(); }); - auto *contoning_feature_row = new wxBoxSizer(wxHORIZONTAL); - contoning_feature_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("Minimum feature")), - 0, - wxALIGN_CENTER_VERTICAL | wxRIGHT, - gap); - m_top_surface_contoning_min_feature_spin = - new wxSpinCtrlDouble(m_top_surface_contoning_panel, - wxID_ANY, - wxEmptyString, - wxDefaultPosition, - wxSize(FromDIP(84), -1), - wxSP_ARROW_KEYS | wxALIGN_RIGHT | wxTE_PROCESS_ENTER, - double(TextureMappingZone::MinTopSurfaceContoningMinFeatureMm), - double(TextureMappingZone::MaxTopSurfaceContoningMinFeatureMm), - std::clamp(double(top_surface_contoning_min_feature_mm), - double(TextureMappingZone::MinTopSurfaceContoningMinFeatureMm), - double(TextureMappingZone::MaxTopSurfaceContoningMinFeatureMm)), - 0.1); - m_top_surface_contoning_min_feature_spin->SetDigits(1); - contoning_feature_row->Add(m_top_surface_contoning_min_feature_spin, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap / 2); - contoning_feature_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("mm")), 0, wxALIGN_CENTER_VERTICAL); - top_surface_contoning_root->Add(contoning_feature_row, 0, wxEXPAND); if (TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) { auto *contoning_flat_infill_row = new wxBoxSizer(wxHORIZONTAL); contoning_flat_infill_row->Add(new wxStaticText(m_top_surface_contoning_panel, wxID_ANY, _L("Flat surface infill mode")), @@ -2862,15 +2843,17 @@ public: wxEXPAND | wxTOP | wxBOTTOM, gap / 2); } - m_top_surface_contoning_layer_phase_checkbox = - new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Layer phase detail")); - m_top_surface_contoning_layer_phase_checkbox->SetValue(top_surface_contoning_layer_phase_enabled); - m_top_surface_contoning_layer_phase_checkbox->SetMinSize( - wxSize(-1, std::max(m_top_surface_contoning_layer_phase_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); - contoning_checkboxes_root->Add(m_top_surface_contoning_layer_phase_checkbox, - 0, - wxEXPAND | wxTOP | wxBOTTOM, - gap / 2); + if (TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) { + m_top_surface_contoning_layer_phase_checkbox = + new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Layer phase detail")); + m_top_surface_contoning_layer_phase_checkbox->SetValue(top_surface_contoning_layer_phase_enabled); + m_top_surface_contoning_layer_phase_checkbox->SetMinSize( + wxSize(-1, std::max(m_top_surface_contoning_layer_phase_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); + contoning_checkboxes_root->Add(m_top_surface_contoning_layer_phase_checkbox, + 0, + wxEXPAND | wxTOP | wxBOTTOM, + gap / 2); + } m_top_surface_contoning_varied_infill_angles_checkbox = new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Varied infill angles")); m_top_surface_contoning_varied_infill_angles_checkbox->SetValue(top_surface_contoning_varied_infill_angles_enabled); @@ -2880,24 +2863,26 @@ public: 0, wxEXPAND | wxTOP | wxBOTTOM, gap / 2); - m_top_surface_contoning_blue_noise_error_diffusion_checkbox = - new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Blue-noise error diffusion")); - m_top_surface_contoning_blue_noise_error_diffusion_checkbox->SetValue(top_surface_contoning_blue_noise_error_diffusion_enabled); - m_top_surface_contoning_blue_noise_error_diffusion_checkbox->SetMinSize( - wxSize(-1, std::max(m_top_surface_contoning_blue_noise_error_diffusion_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); - contoning_checkboxes_root->Add(m_top_surface_contoning_blue_noise_error_diffusion_checkbox, - 0, - wxEXPAND | wxTOP | wxBOTTOM, - gap / 2); - m_top_surface_contoning_supersampled_cells_checkbox = - new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Supersampled cell colors")); - m_top_surface_contoning_supersampled_cells_checkbox->SetValue(top_surface_contoning_supersampled_cells_enabled); - m_top_surface_contoning_supersampled_cells_checkbox->SetMinSize( - wxSize(-1, std::max(m_top_surface_contoning_supersampled_cells_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); - contoning_checkboxes_root->Add(m_top_surface_contoning_supersampled_cells_checkbox, - 0, - wxEXPAND | wxTOP | wxBOTTOM, - gap / 2); + if (TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) { + m_top_surface_contoning_blue_noise_error_diffusion_checkbox = + new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Blue-noise error diffusion")); + m_top_surface_contoning_blue_noise_error_diffusion_checkbox->SetValue(top_surface_contoning_blue_noise_error_diffusion_enabled); + m_top_surface_contoning_blue_noise_error_diffusion_checkbox->SetMinSize( + wxSize(-1, std::max(m_top_surface_contoning_blue_noise_error_diffusion_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); + contoning_checkboxes_root->Add(m_top_surface_contoning_blue_noise_error_diffusion_checkbox, + 0, + wxEXPAND | wxTOP | wxBOTTOM, + gap / 2); + m_top_surface_contoning_supersampled_cells_checkbox = + new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Supersampled cell colors")); + m_top_surface_contoning_supersampled_cells_checkbox->SetValue(top_surface_contoning_supersampled_cells_enabled); + m_top_surface_contoning_supersampled_cells_checkbox->SetMinSize( + wxSize(-1, std::max(m_top_surface_contoning_supersampled_cells_checkbox->GetBestSize().GetHeight(), FromDIP(24)))); + contoning_checkboxes_root->Add(m_top_surface_contoning_supersampled_cells_checkbox, + 0, + wxEXPAND | wxTOP | wxBOTTOM, + gap / 2); + } m_top_surface_contoning_polygonize_color_regions_checkbox = new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Polygonize color regions")); m_top_surface_contoning_polygonize_color_regions_checkbox->SetValue(top_surface_contoning_polygonize_color_regions_enabled); @@ -3326,6 +3311,8 @@ public: } float top_surface_contoning_angle_threshold_deg() const { + if (!TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) + return TextureMappingZone::MaxTopSurfaceContoningAngleThresholdDeg; return float(std::clamp(m_top_surface_contoning_angle_threshold_spin != nullptr ? m_top_surface_contoning_angle_threshold_spin->GetValue() : double(TextureMappingZone::DefaultTopSurfaceContoningAngleThresholdDeg), @@ -3351,11 +3338,7 @@ public: } float top_surface_contoning_min_feature_mm() const { - return float(std::clamp(m_top_surface_contoning_min_feature_spin != nullptr ? - m_top_surface_contoning_min_feature_spin->GetValue() : - double(TextureMappingZone::DefaultTopSurfaceContoningMinFeatureMm), - double(TextureMappingZone::MinTopSurfaceContoningMinFeatureMm), - double(TextureMappingZone::MaxTopSurfaceContoningMinFeatureMm))); + return TextureMappingZone::DefaultTopSurfaceContoningMinFeatureMm; } bool top_surface_contoning_color_lower_surfaces() const { @@ -3411,6 +3394,8 @@ public: } bool top_surface_contoning_layer_phase_enabled() const { + if (!TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) + return false; return m_top_surface_contoning_layer_phase_checkbox != nullptr && m_top_surface_contoning_layer_phase_checkbox->GetValue(); } @@ -3421,11 +3406,15 @@ public: } bool top_surface_contoning_blue_noise_error_diffusion_enabled() const { + if (!TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) + return false; return m_top_surface_contoning_blue_noise_error_diffusion_checkbox != nullptr && m_top_surface_contoning_blue_noise_error_diffusion_checkbox->GetValue(); } bool top_surface_contoning_supersampled_cells_enabled() const { + if (!TextureMappingZone::ShowExperimentalTopSurfaceContoningOptions) + return false; return m_top_surface_contoning_supersampled_cells_checkbox != nullptr && m_top_surface_contoning_supersampled_cells_checkbox->GetValue(); } @@ -3820,10 +3809,8 @@ private: return _L("Recommendation based on TD: 1-3 layers."); upper = std::max(upper, lower); strong = std::max(strong, upper); - return wxString::Format(_L("Recommendation based on highest TD: %d-%d layers (%d+ to show highest TD at strong saturation)."), - lower, - upper, - strong); + return wxString::Format(_L("Recommendation based on highest TD: %d+ layers"), + lower); } wxString top_surface_contoning_shell_warning_text() const @@ -4227,8 +4214,6 @@ private: m_top_surface_contoning_stack_layers_spin->Enable(contoning); if (m_top_surface_contoning_pattern_filaments_spin != nullptr) m_top_surface_contoning_pattern_filaments_spin->Enable(contoning); - if (m_top_surface_contoning_min_feature_spin != nullptr) - m_top_surface_contoning_min_feature_spin->Enable(contoning); if (m_top_surface_contoning_flat_surface_infill_choice != nullptr) m_top_surface_contoning_flat_surface_infill_choice->Enable(contoning); if (m_top_surface_contoning_checkboxes_panel != nullptr) @@ -4369,7 +4354,6 @@ private: wxSpinCtrl *m_top_surface_contoning_pattern_filaments_spin {nullptr}; wxStaticText *m_top_surface_contoning_pattern_recommendation_text {nullptr}; wxStaticText *m_top_surface_contoning_shell_warning_text {nullptr}; - wxSpinCtrlDouble *m_top_surface_contoning_min_feature_spin {nullptr}; wxChoice *m_top_surface_contoning_flat_surface_infill_choice {nullptr}; wxPanel *m_top_surface_contoning_checkboxes_panel {nullptr}; wxCheckBox *m_top_surface_contoning_color_lower_surfaces_checkbox {nullptr};