Merge branch 'main' into enh-port-edit-gcode-dlg

This commit is contained in:
SoftFever 2024-01-02 18:23:52 +08:00 committed by GitHub
commit 02258b4391
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 93 additions and 34 deletions

View file

@ -90,13 +90,18 @@ std::vector<Slic3r::ColorRGBA> get_extruders_colors()
}
float FullyTransparentMaterialThreshold = 0.1f;
float FullTransparentModdifiedToFixAlpha = 0.3f;
float FULL_BLACK_THRESHOLD = 0.18f;
Slic3r::ColorRGBA adjust_color_for_rendering(const Slic3r::ColorRGBA &colors)
{
if (colors.a() < FullyTransparentMaterialThreshold) { // completely transparent
return {1, 1, 1, FullTransparentModdifiedToFixAlpha};
}
return colors;
else if(colors.r() < FULL_BLACK_THRESHOLD && colors.g() < FULL_BLACK_THRESHOLD && colors.b() < FULL_BLACK_THRESHOLD) { // black
return {FULL_BLACK_THRESHOLD, FULL_BLACK_THRESHOLD, FULL_BLACK_THRESHOLD, colors.a()};
}
else
return colors;
}
namespace Slic3r {

View file

@ -695,7 +695,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_arachne = config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne;
for (auto el : { "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
"min_feature_size", "min_bead_width", "wall_distribution_count", "initial_layer_min_bead_width"})
"min_feature_size", "min_length_factor", "min_bead_width", "wall_distribution_count", "initial_layer_min_bead_width"})
toggle_line(el, have_arachne);
toggle_field("detect_thin_wall", !have_arachne);
@ -712,8 +712,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_line("make_overhang_printable_angle", have_make_overhang_printable);
toggle_line("make_overhang_printable_hole_size", have_make_overhang_printable);
toggle_line("min_width_top_surface",config->opt_bool("only_one_wall_top"));
toggle_line("min_width_top_surface", config->opt_bool("only_one_wall_top") || ((config->opt_float("min_length_factor") > 0.5f) && have_arachne)); // 0.5 is default value
for (auto el : { "hole_to_polyhole_threshold", "hole_to_polyhole_twisted" })
toggle_line(el, config->opt_bool("hole_to_polyhole"));

View file

@ -2484,7 +2484,7 @@ bool GLGizmoEmboss::rev_checkbox(const std::string &name,
// draw offseted input
auto draw_offseted_input = [this, &offset = m_gui_cfg->advanced_input_offset, &name, &value](){
ImGui::SameLine(offset);
return m_imgui->bbl_checkbox(("##" + name).c_str(), value);
return m_imgui->bbl_checkbox(wxString::FromUTF8("##" + name), value);
};
float undo_offset = ImGui::GetStyle().WindowPadding.x;
return revertible(name, value, default_value, undo_tooltip,

View file

@ -1975,6 +1975,7 @@ void TabPrint::build()
optgroup->append_single_option_line("initial_layer_min_bead_width");
optgroup->append_single_option_line("min_bead_width");
optgroup->append_single_option_line("min_feature_size");
optgroup->append_single_option_line("min_length_factor");
optgroup = page->new_optgroup(L("Walls and surfaces"), L"param_advanced");
optgroup->append_single_option_line("wall_sequence");