mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 00:56:00 +08:00
Fix SPE-2297 - slowdown after overhang.
The bug lies in the fact that SmoothPathCache comapare path attributes in `resolve_or_fit_split_with_seam`. For some paths it does the following: If attributes of paths are the same it merges the paths. Since the == operator of ExtrusionAttributes did not consider overhang_attributes in the comparison, some paths were merged even though they had different overhang_attributes. This led to the wrong overhang attributes being applied to some paths. Now the == operator of ExtrusionAttributes takes overhang_attributes into account and it fixes the issue.
This commit is contained in:
parent
b7ce546cfc
commit
80d35831fa
@ -115,6 +115,19 @@ struct OverhangAttributes {
|
||||
float proximity_to_curled_lines; //value between 0 and 1
|
||||
};
|
||||
|
||||
inline bool operator==(const OverhangAttributes &lhs, const OverhangAttributes &rhs) {
|
||||
if (std::abs(lhs.start_distance_from_prev_layer - rhs.start_distance_from_prev_layer) > std::numeric_limits<float>::epsilon()) {
|
||||
return false;
|
||||
}
|
||||
if (std::abs(lhs.end_distance_from_prev_layer - rhs.end_distance_from_prev_layer) > std::numeric_limits<float>::epsilon()) {
|
||||
return false;
|
||||
}
|
||||
if (std::abs(lhs.proximity_to_curled_lines - rhs.proximity_to_curled_lines) > std::numeric_limits<float>::epsilon()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct ExtrusionAttributes : ExtrusionFlow
|
||||
{
|
||||
ExtrusionAttributes() = default;
|
||||
@ -132,7 +145,7 @@ struct ExtrusionAttributes : ExtrusionFlow
|
||||
inline bool operator==(const ExtrusionAttributes &lhs, const ExtrusionAttributes &rhs)
|
||||
{
|
||||
return static_cast<const ExtrusionFlow&>(lhs) == static_cast<const ExtrusionFlow&>(rhs) &&
|
||||
lhs.role == rhs.role;
|
||||
lhs.role == rhs.role && lhs.overhang_attributes == rhs.overhang_attributes;
|
||||
}
|
||||
|
||||
class ExtrusionPath : public ExtrusionEntity
|
||||
|
Loading…
x
Reference in New Issue
Block a user