Skip to content

Commit

Permalink
Fix bad usage of "min_feature_size"
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill authored Sep 26, 2024
1 parent 5dc04b4 commit ef846ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libslic3r/Support/TreeSupportCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(const PrintObject &pr
assert(config.support_material_style == smsTree || config.support_material_style == smsOrganic);

// Calculate maximum external perimeter width over all printing regions, taking into account the default layer height.
coordf_t external_perimeter_width = 0.;
double external_perimeter_width = 0.;
for (size_t region_id = 0; region_id < print_object.num_printing_regions(); ++ region_id) {
const PrintRegion &region = print_object.printing_region(region_id);
external_perimeter_width = std::max<coordf_t>(external_perimeter_width, region.flow(print_object, frExternalPerimeter, config.layer_height).width());
external_perimeter_width = std::max<double>(external_perimeter_width, region.flow(print_object, frExternalPerimeter, config.layer_height).width());
}

this->layer_height = scaled<coord_t>(config.layer_height.value);
this->resolution = scaled<coord_t>(print_config.gcode_resolution.value);
// Arache feature
this->min_feature_size = scaled<coord_t>(config.min_feature_size.value);
this->min_feature_size = scaled<coord_t>(external_perimeter_width * 0.25);
// +1 makes the threshold inclusive
this->support_angle = 0.5 * M_PI - std::clamp<double>((config.support_material_threshold + 1) * M_PI / 180., 0., 0.5 * M_PI);
this->support_line_width = support_material_flow(&print_object, config.layer_height).scaled_width();
Expand Down Expand Up @@ -200,4 +200,4 @@ void tree_supports_show_error(std::string_view message, bool critical)
#endif // TREE_SUPPORT_SHOW_ERRORS_WIN32
}

} // namespace Slic3r::FFFTreeSupport
} // namespace Slic3r::FFFTreeSupport

0 comments on commit ef846ac

Please sign in to comment.