Merge branch 'main' into feature/OrcaFilamentLibrary

This commit is contained in:
SoftFever
2025-01-24 22:12:38 +08:00
committed by GitHub
111 changed files with 4039 additions and 385 deletions

View File

@@ -795,7 +795,7 @@ static std::vector<std::string> s_Preset_print_options {
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "internal_bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_type", "skirt_loops", "skirt_speed","min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_height", "draft_shield",
"brim_width", "brim_object_gap", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers",
"brim_width", "brim_object_gap", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap","enforce_support_layers",
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
"support_base_pattern", "support_base_pattern_spacing", "support_expansion", "support_style",
"independent_support_layer_height",

View File

@@ -4722,11 +4722,22 @@ void PrintConfigDef::init_fff_params()
def->category = L("Support");
def->tooltip = L("Support will be generated for overhangs whose slope angle is below the threshold.");
def->sidetext = L("°");
def->min = 1;
def->min = 0;
def->max = 90;
def->mode = comSimple;
def->set_default_value(new ConfigOptionInt(30));
def = this->add("support_threshold_overlap", coFloatOrPercent);
def->label = L("Threshold overlap");
def->category = L("Support");
def->tooltip = L("If threshold angle is zero, support will be generated for overhangs whose overlap is below the threshold. The smaller this value is, the steeper the overhang that can be printed without support.");
def->sidetext = L("mm or %");
def->min = 0;
def->max = 100;
def->max_literal = 0.5;
def->mode = comSimple;
def->set_default_value(new ConfigOptionFloatOrPercent(50., true));
def = this->add("tree_support_branch_angle", coFloat);
def->label = L("Tree support branch angle");
def->category = L("Support");

View File

@@ -820,6 +820,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionEnum<InternalBridgeFilter>, dont_filter_internal_bridges))
// Overhang angle threshold.
((ConfigOptionInt, support_threshold_angle))
((ConfigOptionFloatOrPercent, support_threshold_overlap))
((ConfigOptionFloat, support_object_xy_distance))
((ConfigOptionFloat, xy_hole_compensation))
((ConfigOptionFloat, xy_contour_compensation))

View File

@@ -1019,6 +1019,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_expansion"
//|| opt_key == "independent_support_layer_height" // BBS
|| opt_key == "support_threshold_angle"
|| opt_key == "support_threshold_overlap"
|| opt_key == "raft_expansion"
|| opt_key == "raft_first_layer_density"
|| opt_key == "raft_first_layer_expansion"

View File

@@ -1517,8 +1517,8 @@ static inline ExPolygons detect_overhangs(
(threshold_rad > 0. ?
// Overhang defined by an angle.
float(scale_(lower_layer.height / tan(threshold_rad))) :
// Overhang defined by half the extrusion width.
0.5f * fw);
// Overhang defined by overlap.
fw - float(scale_(object_config.support_threshold_overlap.get_abs_value(unscale_(fw)))));
// Overhang polygons for this layer and region.
Polygons diff_polygons;
Polygons layerm_polygons = to_polygons(layerm->slices.surfaces);

View File

@@ -239,7 +239,7 @@ static std::vector<std::pair<TreeSupportSettings, std::vector<size_t>>> group_me
for (const LayerRegion *layerm : lower_layer.regions())
external_perimeter_width += layerm->flow(frExternalPerimeter).scaled_width();
external_perimeter_width /= lower_layer.region_count();
lower_layer_offset = float(0.5 * external_perimeter_width);
lower_layer_offset = external_perimeter_width - float(scale_(config.support_threshold_overlap.get_abs_value(unscale_(external_perimeter_width))));
} else
lower_layer_offset = scaled<float>(lower_layer.height / tan_threshold);
overhangs = lower_layer_offset == 0 ?

View File

@@ -599,6 +599,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"support_object_xy_distance"/*, "independent_support_layer_height"*/})
toggle_field(el, have_support_material);
toggle_field("support_threshold_angle", have_support_material && is_auto(support_type));
toggle_field("support_threshold_overlap", config->opt_int("support_threshold_angle") == 0 && have_support_material && is_auto(support_type));
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);

View File

@@ -61,7 +61,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF =
{ L("Shell"), { "wall_loops", "top_shell_layers", "bottom_shell_layers"} },
{ L("Infill") , { "sparse_infill_density", "sparse_infill_pattern" } },
// BBS
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle",
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap",
"support_base_pattern", "support_on_build_plate_only","support_critical_regions_only",
"support_remove_small_overhang",
"support_base_pattern_spacing", "support_expansion"}},
@@ -88,7 +88,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
}},
{ L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"brim_object_gap", "",3},
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6},{"support_on_build_plate_only", "",7},
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6}, {"support_threshold_overlap", "",6}, {"support_on_build_plate_only", "",7},
{"support_filament", "",8},{"support_interface_filament", "",9},{"support_expansion", "",24},{"support_style", "",25},
{"tree_support_brim_width", "",26}, {"tree_support_branch_angle", "",10},{"tree_support_branch_angle_organic","",10}, {"tree_support_wall_count", "",11},//tree support
{"support_top_z_distance", "",13},{"support_bottom_z_distance", "",12},{"support_base_pattern", "",14},{"support_base_pattern_spacing", "",15},
@@ -150,7 +150,7 @@ std::vector<SimpleSettingData> SettingsFactory::get_visible_options(const std::s
//Quality
"layer_height", "initial_layer_print_height", "adaptive_layer_height", "seam_position", "xy_hole_compensation", "xy_contour_compensation", "elefant_foot_compensation", "support_line_width",
//Support
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
"enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
//tree support
"tree_support_wall_count",
//support

View File

@@ -143,7 +143,9 @@ void GLGizmoFlatten::set_flattening_data(const ModelObject* model_object, int in
{
if (model_object != m_old_model_object || instance_id != m_old_instance_id) {
m_planes.clear();
on_unregister_raycasters_for_picking();
if (get_state() == On) { // Only touch the raycasters if it's current
on_unregister_raycasters_for_picking();
}
}
}

View File

@@ -2227,6 +2227,7 @@ void TabPrint::build()
optgroup->append_single_option_line("support_type", "support#support-types");
optgroup->append_single_option_line("support_style", "support#support-styles");
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
optgroup->append_single_option_line("support_threshold_overlap", "support#threshold-angle");
optgroup->append_single_option_line("raft_first_layer_density");
optgroup->append_single_option_line("raft_first_layer_expansion");
optgroup->append_single_option_line("support_on_build_plate_only");