Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve seam performance #5436

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libslic3r/GCode/SeamPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ void SeamPlacer::calculate_overhangs_and_layer_embedding(const PrintObject *po)
if (prev_layer_distancer.get() != nullptr) {
const auto _dist = prev_layer_distancer->distance_from_lines<true>(point.cast<double>());
perimeter_point.overhang = _dist
+ 0.6f * perimeter_point.perimeter.flow_width
+ 0.65f * perimeter_point.perimeter.flow_width
- tan(SeamPlacer::overhang_angle_threshold)
* po->layers()[layer_idx]->height;
perimeter_point.overhang =
Expand All @@ -1083,7 +1083,7 @@ void SeamPlacer::calculate_overhangs_and_layer_embedding(const PrintObject *po)

if (should_compute_layer_embedding) { // search for embedded perimeter points (points hidden inside the print ,e.g. multimaterial join, best position for seam)
perimeter_point.embedded_distance = current_layer_distancer->distance_from_lines<true>(point.cast<double>())
+ 0.6f * perimeter_point.perimeter.flow_width;
+ 0.65f * perimeter_point.perimeter.flow_width;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/SeamPlacer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class SeamPlacer {
// snapping angle - angles larger than this value will be snapped to during seam painting
static constexpr float sharp_angle_snapping_threshold = 55.0f * float(PI) / 180.0f;
// overhang angle for seam placement that still yields good results, in degrees, measured from vertical direction
static constexpr float overhang_angle_threshold = 50.0f * float(PI) / 180.0f;
static constexpr float overhang_angle_threshold = 45.0f * float(PI) / 180.0f;

// determines angle importance compared to visibility ( neutral value is 1.0f. )
static constexpr float angle_importance_aligned = 0.6f;
Expand Down
Loading