mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:51:51 +08:00
Avoid creating bridges on very tiny surface cracks (SoftFever/OrcaSlicer#8563)
This commit is contained in:
parent
41450b3a64
commit
6bd2355a69
@ -1383,13 +1383,26 @@ void PrintObject::detect_surfaces_type()
|
|||||||
// and top surfaces; let's do an intersection to discover them and consider them
|
// and top surfaces; let's do an intersection to discover them and consider them
|
||||||
// as bottom surfaces (to allow for bridge detection)
|
// as bottom surfaces (to allow for bridge detection)
|
||||||
if (! top.empty() && ! bottom.empty()) {
|
if (! top.empty() && ! bottom.empty()) {
|
||||||
// Polygons overlapping = intersection(to_polygons(top), to_polygons(bottom));
|
const auto cracks = intersection_ex(top, bottom);
|
||||||
// Slic3r::debugf " layer %d contains %d membrane(s)\n", $layerm->layer->id, scalar(@$overlapping)
|
if (!cracks.empty()) {
|
||||||
// if $Slic3r::debug;
|
const float small_crack_threshold = -(layerm->flow(frExternalPerimeter).scaled_width());
|
||||||
|
|
||||||
|
for (const auto& crack : cracks) {
|
||||||
|
if (offset_ex(crack, small_crack_threshold).empty()) {
|
||||||
|
// Crack too small, leave it as part of the top surface, remove it from bottom surfaces
|
||||||
|
Surfaces bot_tmp;
|
||||||
|
for (auto& b : bottom) {
|
||||||
|
surfaces_append(bot_tmp, diff_ex(b.expolygon, crack), b.surface_type);
|
||||||
|
}
|
||||||
|
bottom = std::move(bot_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Polygons top_polygons = to_polygons(std::move(top));
|
Polygons top_polygons = to_polygons(std::move(top));
|
||||||
top.clear();
|
top.clear();
|
||||||
surfaces_append(top, diff_ex(top_polygons, bottom), stTop);
|
surfaces_append(top, diff_ex(top_polygons, bottom), stTop);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user