Merge branch 'corner_improvements'

# Conflicts:
#	src/libslic3r/TextureMapping.cpp
#	src/libslic3r/TextureMapping.hpp
#	src/slic3r/GUI/Plater.cpp
This commit is contained in:
sentientstardust
2026-06-14 11:47:18 +01:00
4 changed files with 1672 additions and 105 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2441,6 +2441,7 @@ bool TextureMappingZone::operator==(const TextureMappingZone &rhs) const
use_modulated_overhang_geometry_for_support == rhs.use_modulated_overhang_geometry_for_support &&
(!uses_perimeter_path_modulation_v2() ||
disable_v2_perimeter_path_modulation_smoothing == rhs.disable_v2_perimeter_path_modulation_smoothing) &&
join_extrusion_path_at_corners == rhs.join_extrusion_path_at_corners &&
modulation_mode_manually_changed == rhs.modulation_mode_manually_changed &&
recolor_small_perimeter_loops == rhs.recolor_small_perimeter_loops &&
recolor_top_visible_perimeter_sections == rhs.recolor_top_visible_perimeter_sections &&
@@ -2819,6 +2820,7 @@ std::string TextureMappingManager::serialize_entries()
texture["modulation_mode"] = modulation_mode_name(zone.modulation_mode);
texture["use_modulated_overhang_geometry_for_support"] = zone.use_modulated_overhang_geometry_for_support;
texture["disable_v2_perimeter_path_modulation_smoothing"] = zone.disable_v2_perimeter_path_modulation_smoothing;
texture["join_extrusion_path_at_corners"] = zone.join_extrusion_path_at_corners;
texture["modulation_mode_manually_changed"] = zone.modulation_mode_manually_changed;
texture["recolor_small_perimeter_loops"] = zone.recolor_small_perimeter_loops || zone.recolor_top_visible_perimeter_sections;
texture["recolor_top_visible_perimeter_sections"] = zone.recolor_top_visible_perimeter_sections;
@@ -3109,6 +3111,9 @@ void TextureMappingManager::load_entries(const std::string &serialized,
zone.disable_v2_perimeter_path_modulation_smoothing =
texture.value("disable_v2_perimeter_path_modulation_smoothing",
TextureMappingZone::DefaultDisableV2PerimeterPathModulationSmoothing);
zone.join_extrusion_path_at_corners =
texture.value("join_extrusion_path_at_corners",
TextureMappingZone::DefaultJoinExtrusionPathAtCorners);
const auto modulation_mode_it = texture.find("modulation_mode");
const bool has_modulation_mode =
modulation_mode_it != texture.end() && modulation_mode_it->is_string();

View File

@@ -192,6 +192,7 @@ struct TextureMappingZone
static constexpr bool DefaultModulationModeManuallyChanged = false;
static constexpr bool DefaultUseModulatedOverhangGeometryForSupport = false;
static constexpr bool DefaultDisableV2PerimeterPathModulationSmoothing = false;
static constexpr bool DefaultJoinExtrusionPathAtCorners = false;
static constexpr bool DefaultRecolorSmallPerimeterLoops = false;
static constexpr bool DefaultRecolorTopVisiblePerimeterSections = false;
static constexpr int DefaultTopVisiblePerimeterRecolorAggressiveness = int(TopVisibleRecolorAggressive);
@@ -489,6 +490,7 @@ struct TextureMappingZone
int modulation_mode = DefaultModulationMode;
bool use_modulated_overhang_geometry_for_support = DefaultUseModulatedOverhangGeometryForSupport;
bool disable_v2_perimeter_path_modulation_smoothing = DefaultDisableV2PerimeterPathModulationSmoothing;
bool join_extrusion_path_at_corners = DefaultJoinExtrusionPathAtCorners;
bool modulation_mode_manually_changed = DefaultModulationModeManuallyChanged;
bool recolor_small_perimeter_loops = DefaultRecolorSmallPerimeterLoops;
bool recolor_top_visible_perimeter_sections = DefaultRecolorTopVisiblePerimeterSections;
@@ -816,6 +818,7 @@ struct TextureMappingZone
nonlinear_offset_adjustment = DefaultNonlinearOffsetAdjustment;
use_modulated_overhang_geometry_for_support = DefaultUseModulatedOverhangGeometryForSupport;
disable_v2_perimeter_path_modulation_smoothing = DefaultDisableV2PerimeterPathModulationSmoothing;
join_extrusion_path_at_corners = DefaultJoinExtrusionPathAtCorners;
modulation_mode = default_modulation_mode_for_surface_pattern(surface_pattern);
modulation_mode_manually_changed = DefaultModulationModeManuallyChanged;
recolor_small_perimeter_loops = DefaultRecolorSmallPerimeterLoops;

View File

@@ -2504,6 +2504,7 @@ public:
int modulation_mode,
bool use_modulated_overhang_geometry_for_support,
bool disable_v2_perimeter_path_modulation_smoothing,
bool join_extrusion_path_at_corners,
bool modulation_mode_manually_changed,
bool recolor_small_perimeter_loops,
bool recolor_top_visible_perimeter_sections,
@@ -2993,6 +2994,10 @@ public:
m_disable_v2_perimeter_path_modulation_smoothing_checkbox->SetToolTip(
_L("Leaves v2 perimeter path modulation insets unsmoothed so fine texture changes can produce bumpier path geometry."));
experimental_box->Add(m_disable_v2_perimeter_path_modulation_smoothing_checkbox, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, gap);
m_join_extrusion_path_at_corners_checkbox =
new wxCheckBox(experimental_page, wxID_ANY, _L("Join extrusion path at corners"));
m_join_extrusion_path_at_corners_checkbox->SetValue(join_extrusion_path_at_corners);
experimental_box->Add(m_join_extrusion_path_at_corners_checkbox, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, gap);
m_top_visible_perimeter_recolor_point_sampling_checkbox =
new wxCheckBox(experimental_page, wxID_ANY, _L("Point-sample visible layer-line recolor"));
m_top_visible_perimeter_recolor_point_sampling_checkbox->SetValue(top_visible_perimeter_recolor_point_sampling);
@@ -3921,6 +3926,11 @@ public:
m_disable_v2_perimeter_path_modulation_smoothing_checkbox != nullptr &&
m_disable_v2_perimeter_path_modulation_smoothing_checkbox->GetValue();
}
bool join_extrusion_path_at_corners() const
{
return m_join_extrusion_path_at_corners_checkbox != nullptr &&
m_join_extrusion_path_at_corners_checkbox->GetValue();
}
int modulation_mode() const
{
if (m_modulation_mode_choice == nullptr)
@@ -5457,6 +5467,8 @@ private:
m_use_modulated_overhang_geometry_for_support_checkbox->Enable(perimeter_path_v2_mode);
if (m_disable_v2_perimeter_path_modulation_smoothing_checkbox != nullptr)
m_disable_v2_perimeter_path_modulation_smoothing_checkbox->Enable(perimeter_path_v2_mode);
if (m_join_extrusion_path_at_corners_checkbox != nullptr)
m_join_extrusion_path_at_corners_checkbox->Enable(modulation_mode() == int(TextureMappingZone::ModulationLineWidth));
if (m_top_visible_perimeter_recolor_point_sampling_checkbox != nullptr)
m_top_visible_perimeter_recolor_point_sampling_checkbox->Enable(perimeter_path_v2_mode);
const bool top_visible_enabled =
@@ -5777,6 +5789,7 @@ private:
wxSpinCtrl *m_filament_overhang_contrast_spin {nullptr};
wxCheckBox *m_use_modulated_overhang_geometry_for_support_checkbox {nullptr};
wxCheckBox *m_disable_v2_perimeter_path_modulation_smoothing_checkbox {nullptr};
wxCheckBox *m_join_extrusion_path_at_corners_checkbox {nullptr};
wxChoice *m_modulation_mode_choice {nullptr};
std::vector<int> m_modulation_mode_choice_values;
bool m_modulation_mode_manually_changed {false};
@@ -10882,6 +10895,7 @@ void Sidebar::update_texture_mapping_panel(bool sync_manager)
updated.modulation_mode,
updated.use_modulated_overhang_geometry_for_support,
updated.disable_v2_perimeter_path_modulation_smoothing,
updated.join_extrusion_path_at_corners,
updated.modulation_mode_manually_changed,
updated.recolor_small_perimeter_loops,
updated.recolor_top_visible_perimeter_sections,
@@ -10976,6 +10990,7 @@ void Sidebar::update_texture_mapping_panel(bool sync_manager)
updated.nonlinear_offset_adjustment = dlg.nonlinear_offset_adjustment();
updated.modulation_mode = dlg.modulation_mode();
updated.use_modulated_overhang_geometry_for_support = dlg.use_modulated_overhang_geometry_for_support();
updated.join_extrusion_path_at_corners = dlg.join_extrusion_path_at_corners();
updated.modulation_mode_manually_changed = dlg.modulation_mode_manually_changed();
updated.apply_default_modulation_mode();
updated.disable_v2_perimeter_path_modulation_smoothing =