Add option to only color lower surfaces

This commit is contained in:
sentientstardust
2026-06-11 10:49:03 +01:00
parent 83c287d6f4
commit b4a532622f
6 changed files with 144 additions and 34 deletions

View File

@@ -503,6 +503,7 @@ struct TopSurfaceImageRegionPlan {
bool fixed_coloring = true;
bool same_layer_partition = false;
bool contoning = false;
bool color_upper_surfaces = true;
bool color_lower_surfaces = true;
int colored_top_layers = TextureMappingZone::DefaultTopSurfaceImageColoredTopLayers;
int contoning_stack_layers = TextureMappingZone::DefaultTopSurfaceContoningStackLayers;
@@ -8846,7 +8847,8 @@ static std::vector<TopSurfaceImageRegionPlan> top_surface_image_region_plans(
TextureMappingZone::MinTopSurfaceImageLineWidthMm,
plan.max_width_mm);
plan.fixed_coloring = zone->top_surface_image_fixed_coloring_filaments_active();
plan.color_lower_surfaces = zone->top_surface_contoning_color_lower_surfaces;
plan.color_upper_surfaces = zone->top_surface_contoning_colors_upper_surfaces();
plan.color_lower_surfaces = zone->top_surface_contoning_colors_lower_surfaces();
plan.colored_top_layers = std::clamp(zone->top_surface_image_colored_top_layers,
TextureMappingZone::MinTopSurfaceImageColoredTopLayers,
TextureMappingZone::MaxTopSurfaceImageColoredTopLayers);
@@ -9010,7 +9012,8 @@ static std::vector<TopSurfaceImageRegionPlan> top_surface_image_region_plans(
throw_if_canceled);
}
};
append_contoning_surface(TopSurfaceImageSourceSurface::Top);
if (plan.color_upper_surfaces)
append_contoning_surface(TopSurfaceImageSourceSurface::Top);
if (plan.color_lower_surfaces)
append_contoning_surface(TopSurfaceImageSourceSurface::Bottom);
const bool upper_nearest_sample_fallback = contoning_solver.nearest_measured_sample_fallback_used(false);

View File

@@ -586,7 +586,9 @@ void PrintObject::prepare_contoning_one_wall_shell_infill_masks()
continue;
auto append_source_surface = [&](bool top_surface) {
if (!top_surface && !zone->top_surface_contoning_color_lower_surfaces)
if (top_surface && !zone->top_surface_contoning_colors_upper_surfaces())
return;
if (!top_surface && !zone->top_surface_contoning_colors_lower_surfaces())
return;
for (int depth = 0; depth < stack_layers; ++depth) {
const int source_layer_idx = top_surface ?

View File

@@ -828,6 +828,27 @@ static int top_surface_image_printing_method_from_name(const std::string &name)
return int(TextureMappingZone::TopSurfaceImageSameAngle45Width);
}
static std::string top_surface_contoning_colored_surfaces_name(int mode)
{
switch (TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(mode)) {
case int(TextureMappingZone::ContoningColoredLowerSurfaces):
return "lower";
case int(TextureMappingZone::ContoningColoredUpperAndLowerSurfaces):
return "both";
default:
return "upper";
}
}
static int top_surface_contoning_colored_surfaces_from_name(const std::string &name)
{
if (name == "lower" || name == "lower_surfaces")
return int(TextureMappingZone::ContoningColoredLowerSurfaces);
if (name == "both" || name == "upper_and_lower_surfaces")
return int(TextureMappingZone::ContoningColoredUpperAndLowerSurfaces);
return int(TextureMappingZone::ContoningColoredUpperSurfaces);
}
static std::string top_surface_contoning_flat_surface_infill_mode_name(int mode)
{
switch (clamp_int(mode,
@@ -2405,7 +2426,8 @@ bool TextureMappingZone::operator==(const TextureMappingZone &rhs) const
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 &&
top_surface_contoning_color_lower_surfaces == rhs.top_surface_contoning_color_lower_surfaces &&
TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(top_surface_contoning_colored_surfaces) ==
TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(rhs.top_surface_contoning_colored_surfaces) &&
effective_top_surface_contoning_only_color_surface_infill() == rhs.effective_top_surface_contoning_only_color_surface_infill() &&
top_surface_contoning_only_one_perimeter_around_shell_infill == rhs.top_surface_contoning_only_one_perimeter_around_shell_infill &&
effective_top_surface_contoning_replace_top_perimeters_with_infill() == rhs.effective_top_surface_contoning_replace_top_perimeters_with_infill() &&
@@ -2813,7 +2835,9 @@ std::string TextureMappingManager::serialize_entries()
TextureMappingZone::DefaultTopSurfaceContoningMinFeatureMm),
TextureMappingZone::MinTopSurfaceContoningMinFeatureMm,
TextureMappingZone::MaxTopSurfaceContoningMinFeatureMm);
texture["top_surface_contoning_color_lower_surfaces"] = zone.top_surface_contoning_color_lower_surfaces;
texture["top_surface_contoning_colored_surfaces"] =
top_surface_contoning_colored_surfaces_name(zone.top_surface_contoning_colored_surfaces);
texture["top_surface_contoning_color_lower_surfaces"] = zone.top_surface_contoning_colors_lower_surfaces();
texture["top_surface_contoning_only_color_surface_infill"] =
zone.effective_top_surface_contoning_only_color_surface_infill();
texture["top_surface_contoning_only_one_perimeter_around_shell_infill"] =
@@ -3125,9 +3149,22 @@ void TextureMappingManager::load_entries(const std::string &serialized,
TextureMappingZone::DefaultTopSurfaceContoningMinFeatureMm),
TextureMappingZone::MinTopSurfaceContoningMinFeatureMm,
TextureMappingZone::MaxTopSurfaceContoningMinFeatureMm);
auto colored_surfaces_it = texture.find("top_surface_contoning_colored_surfaces");
if (colored_surfaces_it != texture.end() && colored_surfaces_it->is_string()) {
zone.top_surface_contoning_colored_surfaces =
top_surface_contoning_colored_surfaces_from_name(colored_surfaces_it->get<std::string>());
} else if (colored_surfaces_it != texture.end() && colored_surfaces_it->is_number_integer()) {
zone.top_surface_contoning_colored_surfaces =
TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(colored_surfaces_it->get<int>());
} else if (texture.value("top_surface_contoning_color_lower_surfaces", false)) {
zone.top_surface_contoning_colored_surfaces =
int(TextureMappingZone::ContoningColoredUpperAndLowerSurfaces);
} else {
zone.top_surface_contoning_colored_surfaces =
TextureMappingZone::DefaultTopSurfaceContoningColoredSurfaces;
}
zone.top_surface_contoning_color_lower_surfaces =
texture.value("top_surface_contoning_color_lower_surfaces",
TextureMappingZone::DefaultTopSurfaceContoningColorLowerSurfaces);
zone.top_surface_contoning_colors_lower_surfaces();
zone.top_surface_contoning_only_color_surface_infill =
texture.value("top_surface_contoning_only_color_surface_infill",
TextureMappingZone::DefaultTopSurfaceContoningOnlyColorSurfaceInfill);

View File

@@ -81,6 +81,12 @@ struct TextureMappingZone
ContoningPerimeterSegmentInfill = 2
};
enum TopSurfaceContoningColoredSurfaces : uint8_t {
ContoningColoredUpperSurfaces = 0,
ContoningColoredLowerSurfaces = 1,
ContoningColoredUpperAndLowerSurfaces = 2
};
enum TopSurfaceContoningFlatSurfaceInfillMode : uint8_t {
ContoningFlatSurfaceInfillDefault = 0,
ContoningFlatSurfaceInfillRectilinear = 1,
@@ -212,7 +218,8 @@ struct TextureMappingZone
static constexpr float MinTopSurfaceContoningMinFeatureMm = 0.f;
static constexpr float MaxTopSurfaceContoningMinFeatureMm = 20.f;
static constexpr float DefaultTopSurfaceContoningMinFeatureMm = 0.f;
static constexpr bool DefaultTopSurfaceContoningColorLowerSurfaces = true;
static constexpr int DefaultTopSurfaceContoningColoredSurfaces = int(ContoningColoredUpperSurfaces);
static constexpr bool DefaultTopSurfaceContoningColorLowerSurfaces = false;
static constexpr bool DefaultTopSurfaceContoningOnlyColorSurfaceInfill = true;
static constexpr bool DefaultTopSurfaceContoningOnlyOnePerimeterAroundShellInfill = true;
static constexpr bool DefaultTopSurfaceContoningReplaceTopPerimetersWithInfill = false;
@@ -492,6 +499,7 @@ struct TextureMappingZone
int top_surface_contoning_stack_layers = DefaultTopSurfaceContoningStackLayers;
int top_surface_contoning_pattern_filaments = DefaultTopSurfaceContoningPatternFilaments;
float top_surface_contoning_min_feature_mm = DefaultTopSurfaceContoningMinFeatureMm;
int top_surface_contoning_colored_surfaces = DefaultTopSurfaceContoningColoredSurfaces;
bool top_surface_contoning_color_lower_surfaces = DefaultTopSurfaceContoningColorLowerSurfaces;
bool top_surface_contoning_only_color_surface_infill = DefaultTopSurfaceContoningOnlyColorSurfaceInfill;
bool top_surface_contoning_only_one_perimeter_around_shell_infill = DefaultTopSurfaceContoningOnlyOnePerimeterAroundShellInfill;
@@ -588,11 +596,34 @@ struct TextureMappingZone
{
return is_image_texture() &&
top_surface_contoning_active() &&
top_surface_contoning_colors_upper_surfaces() &&
!effective_top_surface_contoning_only_color_surface_infill() &&
!effective_top_surface_contoning_replace_top_perimeters_with_infill() &&
!effective_top_surface_contoning_recolor_surrounding_perimeters();
}
static int normalize_top_surface_contoning_colored_surfaces(int mode)
{
return mode == int(ContoningColoredLowerSurfaces) ||
mode == int(ContoningColoredUpperAndLowerSurfaces) ?
mode :
int(ContoningColoredUpperSurfaces);
}
bool top_surface_contoning_colors_upper_surfaces() const
{
const int mode = normalize_top_surface_contoning_colored_surfaces(top_surface_contoning_colored_surfaces);
return mode == int(ContoningColoredUpperSurfaces) ||
mode == int(ContoningColoredUpperAndLowerSurfaces);
}
bool top_surface_contoning_colors_lower_surfaces() const
{
const int mode = normalize_top_surface_contoning_colored_surfaces(top_surface_contoning_colored_surfaces);
return mode == int(ContoningColoredLowerSurfaces) ||
mode == int(ContoningColoredUpperAndLowerSurfaces);
}
float effective_top_surface_contoning_angle_threshold_deg() const
{
return TextureMappingZone::effective_top_surface_contoning_angle_threshold_deg(
@@ -799,6 +830,7 @@ struct TextureMappingZone
top_surface_contoning_stack_layers = DefaultTopSurfaceContoningStackLayers;
top_surface_contoning_pattern_filaments = DefaultTopSurfaceContoningPatternFilaments;
top_surface_contoning_min_feature_mm = DefaultTopSurfaceContoningMinFeatureMm;
top_surface_contoning_colored_surfaces = DefaultTopSurfaceContoningColoredSurfaces;
top_surface_contoning_color_lower_surfaces = DefaultTopSurfaceContoningColorLowerSurfaces;
top_surface_contoning_only_color_surface_infill = DefaultTopSurfaceContoningOnlyColorSurfaceInfill;
top_surface_contoning_only_one_perimeter_around_shell_infill = DefaultTopSurfaceContoningOnlyOnePerimeterAroundShellInfill;

View File

@@ -6443,7 +6443,8 @@ static size_t texture_preview_settings_signature_impl(size_t num_physical,
signature_mix(std::hash<int>{}(zone.top_surface_image_printing_method));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_stack_layers));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_pattern_filaments));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_color_lower_surfaces ? 1 : 0));
signature_mix(std::hash<int>{}(TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(
zone.top_surface_contoning_colored_surfaces)));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_td_adjustment_enabled ? 1 : 0));
signature_mix(std::hash<int>{}(zone.effective_top_surface_contoning_color_prediction_mode()));
signature_mix(std::hash<int>{}(zone.effective_top_surface_contoning_surface_scatter_enabled() ? 1 : 0));
@@ -6550,9 +6551,16 @@ static bool texture_preview_flat_surface_texture_for_filament(unsigned int filam
return false;
if (zone->top_surface_image_printing_enabled) {
top_quantization = true;
const bool contoning = zone->top_surface_contoning_active() &&
zone->texture_mapping_mode != int(TextureMappingZone::TextureMappingRawValues);
const bool color_upper = !contoning || zone->top_surface_contoning_colors_upper_surfaces();
const bool color_lower = contoning && zone->top_surface_contoning_colors_lower_surfaces();
if (color_upper)
top_quantization = true;
else
top_pattern_blend = true;
if (zone->texture_mapping_mode != int(TextureMappingZone::TextureMappingRawValues)) {
if (zone->top_surface_contoning_active() && zone->top_surface_contoning_color_lower_surfaces)
if (color_lower)
bottom_quantization = true;
else
bottom_pattern_blend = true;
@@ -6608,7 +6616,8 @@ static void texture_preview_mix_zone_baked_model_settings(size_t &signature,
signature_mix(std::hash<int>{}(zone.top_surface_image_printing_method));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_stack_layers));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_pattern_filaments));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_color_lower_surfaces ? 1 : 0));
signature_mix(std::hash<int>{}(TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(
zone.top_surface_contoning_colored_surfaces)));
signature_mix(std::hash<int>{}(zone.top_surface_contoning_td_adjustment_enabled ? 1 : 0));
signature_mix(std::hash<int>{}(zone.effective_top_surface_contoning_color_prediction_mode()));
signature_mix(std::hash<int>{}(zone.effective_top_surface_contoning_surface_scatter_enabled() ? 1 : 0));

View File

@@ -2530,7 +2530,7 @@ public:
int top_surface_contoning_stack_layers,
int top_surface_contoning_pattern_filaments,
float top_surface_contoning_min_feature_mm,
bool top_surface_contoning_color_lower_surfaces,
int top_surface_contoning_colored_surfaces,
bool top_surface_contoning_only_one_perimeter_around_shell_infill,
bool top_surface_contoning_only_color_surface_infill,
bool top_surface_contoning_replace_top_perimeters_with_infill,
@@ -3107,6 +3107,23 @@ public:
int(TextureMappingZone::TopSurfaceImageContoning)));
top_surface_method_row->Add(m_top_surface_image_method_choice, 1, wxALIGN_CENTER_VERTICAL);
top_surface_box->Add(top_surface_method_row, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, gap);
m_top_surface_contoning_colored_surfaces_panel = new wxPanel(top_surface_page, wxID_ANY);
auto *top_surface_color_row = new wxBoxSizer(wxHORIZONTAL);
m_top_surface_contoning_colored_surfaces_panel->SetSizer(top_surface_color_row);
top_surface_color_row->Add(new wxStaticText(m_top_surface_contoning_colored_surfaces_panel, wxID_ANY, _L("Color")),
0,
wxALIGN_CENTER_VERTICAL | wxRIGHT,
gap);
wxArrayString top_surface_color_choices;
top_surface_color_choices.Add(_L("Upper surfaces only"));
top_surface_color_choices.Add(_L("Lower surfaces only"));
top_surface_color_choices.Add(_L("Both upper and lower surfaces"));
m_top_surface_contoning_colored_surfaces_choice =
new wxChoice(m_top_surface_contoning_colored_surfaces_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, top_surface_color_choices);
m_top_surface_contoning_colored_surfaces_choice->SetSelection(
TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(top_surface_contoning_colored_surfaces));
top_surface_color_row->Add(m_top_surface_contoning_colored_surfaces_choice, 1, wxALIGN_CENTER_VERTICAL);
top_surface_box->Add(m_top_surface_contoning_colored_surfaces_panel, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, gap);
auto *top_surface_width_row = new wxBoxSizer(wxHORIZONTAL);
top_surface_width_row->Add(new wxStaticText(top_surface_page, wxID_ANY, _L("Line width")),
0,
@@ -3311,15 +3328,6 @@ public:
m_top_surface_contoning_checkboxes_panel = new wxPanel(top_surface_page, wxID_ANY);
auto *contoning_checkboxes_root = new wxBoxSizer(wxVERTICAL);
m_top_surface_contoning_checkboxes_panel->SetSizer(contoning_checkboxes_root);
m_top_surface_contoning_color_lower_surfaces_checkbox =
new wxCheckBox(m_top_surface_contoning_checkboxes_panel, wxID_ANY, _L("Also color lower surfaces"));
m_top_surface_contoning_color_lower_surfaces_checkbox->SetValue(top_surface_contoning_color_lower_surfaces);
m_top_surface_contoning_color_lower_surfaces_checkbox->SetMinSize(
wxSize(-1, std::max(m_top_surface_contoning_color_lower_surfaces_checkbox->GetBestSize().GetHeight(), FromDIP(24))));
contoning_checkboxes_root->Add(m_top_surface_contoning_color_lower_surfaces_checkbox,
0,
wxEXPAND | wxTOP | wxBOTTOM,
gap / 2);
const int top_surface_contoning_effective_color_prediction_mode =
TextureMappingZone::effective_top_surface_contoning_color_prediction_mode(top_surface_contoning_color_prediction_mode);
const bool top_surface_contoning_td_adjustment_selected = true;
@@ -3643,8 +3651,8 @@ public:
queue_top_surface_contoning_message_update(true);
});
}
if (m_top_surface_contoning_color_lower_surfaces_checkbox != nullptr) {
m_top_surface_contoning_color_lower_surfaces_checkbox->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent &) {
if (m_top_surface_contoning_colored_surfaces_choice != nullptr) {
m_top_surface_contoning_colored_surfaces_choice->Bind(wxEVT_CHOICE, [this](wxCommandEvent &) {
queue_top_surface_contoning_message_update(true);
});
}
@@ -4041,10 +4049,24 @@ public:
{
return TextureMappingZone::DefaultTopSurfaceContoningMinFeatureMm;
}
int top_surface_contoning_colored_surfaces() const
{
return m_top_surface_contoning_colored_surfaces_choice != nullptr ?
TextureMappingZone::normalize_top_surface_contoning_colored_surfaces(
m_top_surface_contoning_colored_surfaces_choice->GetSelection()) :
TextureMappingZone::DefaultTopSurfaceContoningColoredSurfaces;
}
bool top_surface_contoning_color_upper_surfaces() const
{
const int mode = top_surface_contoning_colored_surfaces();
return mode == int(TextureMappingZone::ContoningColoredUpperSurfaces) ||
mode == int(TextureMappingZone::ContoningColoredUpperAndLowerSurfaces);
}
bool top_surface_contoning_color_lower_surfaces() const
{
return m_top_surface_contoning_color_lower_surfaces_checkbox == nullptr ||
m_top_surface_contoning_color_lower_surfaces_checkbox->GetValue();
const int mode = top_surface_contoning_colored_surfaces();
return mode == int(TextureMappingZone::ContoningColoredLowerSurfaces) ||
mode == int(TextureMappingZone::ContoningColoredUpperAndLowerSurfaces);
}
bool top_surface_contoning_only_one_perimeter_around_shell_infill() const
{
@@ -5149,7 +5171,9 @@ private:
return wxEmptyString;
const int pattern_layers = top_surface_contoning_pattern_filaments();
const bool top_too_shallow = m_top_surface_contoning_shell_usage.min_top_shell_layers < pattern_layers;
const bool top_too_shallow =
top_surface_contoning_color_upper_surfaces() &&
m_top_surface_contoning_shell_usage.min_top_shell_layers < pattern_layers;
const bool bottom_too_shallow =
top_surface_contoning_color_lower_surfaces() &&
m_top_surface_contoning_shell_usage.min_bottom_shell_layers < pattern_layers;
@@ -5591,10 +5615,10 @@ private:
update_top_surface_contoning_polygonize_resolution_choices(top_surface_contoning_polygonize_resolution());
if (m_top_surface_contoning_checkboxes_panel != nullptr)
m_top_surface_contoning_checkboxes_panel->Show(contoning);
if (m_top_surface_contoning_color_lower_surfaces_checkbox != nullptr) {
m_top_surface_contoning_color_lower_surfaces_checkbox->Show(contoning);
m_top_surface_contoning_color_lower_surfaces_checkbox->Enable(contoning);
}
if (m_top_surface_contoning_colored_surfaces_panel != nullptr)
m_top_surface_contoning_colored_surfaces_panel->Show(contoning);
if (m_top_surface_contoning_colored_surfaces_choice != nullptr)
m_top_surface_contoning_colored_surfaces_choice->Enable(contoning);
if (m_top_surface_contoning_surface_scatter_checkbox != nullptr) {
const bool td_adjustment =
contoning &&
@@ -5773,6 +5797,8 @@ private:
wxPanel *m_top_surface_image_colored_top_layers_panel {nullptr};
wxSpinCtrl *m_top_surface_image_colored_top_layers_spin {nullptr};
wxCheckBox *m_top_surface_image_fixed_coloring_filaments_checkbox {nullptr};
wxPanel *m_top_surface_contoning_colored_surfaces_panel {nullptr};
wxChoice *m_top_surface_contoning_colored_surfaces_choice {nullptr};
wxPanel *m_top_surface_contoning_panel {nullptr};
wxSpinCtrlDouble *m_top_surface_contoning_angle_threshold_spin {nullptr};
wxSpinCtrl *m_top_surface_contoning_stack_layers_spin {nullptr};
@@ -5782,7 +5808,6 @@ private:
wxChoice *m_top_surface_contoning_flat_surface_infill_choice {nullptr};
std::vector<int> m_top_surface_contoning_flat_surface_infill_modes;
wxPanel *m_top_surface_contoning_checkboxes_panel {nullptr};
wxCheckBox *m_top_surface_contoning_color_lower_surfaces_checkbox {nullptr};
wxCheckBox *m_top_surface_contoning_only_one_perimeter_around_shell_infill_checkbox {nullptr};
wxCheckBox *m_top_surface_contoning_only_color_surface_infill_checkbox {nullptr};
wxCheckBox *m_top_surface_contoning_replace_top_perimeters_checkbox {nullptr};
@@ -10869,7 +10894,7 @@ void Sidebar::update_texture_mapping_panel(bool sync_manager)
updated.top_surface_contoning_stack_layers,
updated.top_surface_contoning_pattern_filaments,
updated.top_surface_contoning_min_feature_mm,
updated.top_surface_contoning_color_lower_surfaces,
updated.top_surface_contoning_colored_surfaces,
updated.top_surface_contoning_only_one_perimeter_around_shell_infill,
updated.top_surface_contoning_only_color_surface_infill,
updated.top_surface_contoning_replace_top_perimeters_with_infill,
@@ -10961,7 +10986,9 @@ void Sidebar::update_texture_mapping_panel(bool sync_manager)
updated.top_surface_contoning_stack_layers = dlg.top_surface_contoning_stack_layers();
updated.top_surface_contoning_pattern_filaments = dlg.top_surface_contoning_pattern_filaments();
updated.top_surface_contoning_min_feature_mm = dlg.top_surface_contoning_min_feature_mm();
updated.top_surface_contoning_color_lower_surfaces = dlg.top_surface_contoning_color_lower_surfaces();
updated.top_surface_contoning_colored_surfaces = dlg.top_surface_contoning_colored_surfaces();
updated.top_surface_contoning_color_lower_surfaces =
updated.top_surface_contoning_colors_lower_surfaces();
updated.top_surface_contoning_only_one_perimeter_around_shell_infill =
dlg.top_surface_contoning_only_one_perimeter_around_shell_infill();
updated.top_surface_contoning_only_color_surface_infill = dlg.top_surface_contoning_only_color_surface_infill();