mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 01:15:53 +08:00
Merge branch 'master' into fs_undoredo
This commit is contained in:
commit
bf79062842
@ -1019,13 +1019,23 @@ std::tuple<std::vector<ExtrusionPaths>, Polygons> generate_extra_perimeters_over
|
|||||||
overhang_region.end());
|
overhang_region.end());
|
||||||
|
|
||||||
if (!overhang_region.empty()) {
|
if (!overhang_region.empty()) {
|
||||||
|
// there is a special case, where the first (or last) generated overhang perimeter eats all anchor space.
|
||||||
|
// When this happens, the first overhang perimeter is also a closed loop, and needs special check
|
||||||
|
// instead of the following simple is_anchored lambda, which checks only the first and last point (not very useful on closed
|
||||||
|
// polyline)
|
||||||
|
bool first_overhang_is_closed_and_anchored =
|
||||||
|
(overhang_region.front().first_point() == overhang_region.front().last_point() &&
|
||||||
|
!intersection_pl(overhang_region.front().polyline, optimized_lower_slices).empty());
|
||||||
|
|
||||||
auto is_anchored = [&lower_layer_aabb_tree](const ExtrusionPath &path) {
|
auto is_anchored = [&lower_layer_aabb_tree](const ExtrusionPath &path) {
|
||||||
return lower_layer_aabb_tree.distance_from_lines<true>(path.first_point()) <= 0 ||
|
return lower_layer_aabb_tree.distance_from_lines<true>(path.first_point()) <= 0 ||
|
||||||
lower_layer_aabb_tree.distance_from_lines<true>(path.last_point()) <= 0;
|
lower_layer_aabb_tree.distance_from_lines<true>(path.last_point()) <= 0;
|
||||||
};
|
};
|
||||||
std::reverse(overhang_region.begin(), overhang_region.end());
|
if (!first_overhang_is_closed_and_anchored) {
|
||||||
auto first_unanchored = std::stable_partition(overhang_region.begin(), overhang_region.end(), is_anchored);
|
std::reverse(overhang_region.begin(), overhang_region.end());
|
||||||
int index_of_first_unanchored = first_unanchored - overhang_region.begin();
|
}
|
||||||
|
auto first_unanchored = std::stable_partition(overhang_region.begin(), overhang_region.end(), is_anchored);
|
||||||
|
int index_of_first_unanchored = first_unanchored - overhang_region.begin();
|
||||||
overhang_region = sort_extra_perimeters(overhang_region, index_of_first_unanchored, overhang_flow.scaled_spacing());
|
overhang_region = sort_extra_perimeters(overhang_region, index_of_first_unanchored, overhang_flow.scaled_spacing());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "SLAPrintSteps.hpp"
|
#include "SLAPrintSteps.hpp"
|
||||||
#include "CSGMesh/CSGMeshCopy.hpp"
|
#include "CSGMesh/CSGMeshCopy.hpp"
|
||||||
#include "CSGMesh/PerformCSGMeshBooleans.hpp"
|
#include "CSGMesh/PerformCSGMeshBooleans.hpp"
|
||||||
|
#include "format.hpp"
|
||||||
|
|
||||||
#include "Geometry.hpp"
|
#include "Geometry.hpp"
|
||||||
#include "Thread.hpp"
|
#include "Thread.hpp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user