mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 13:45:57 +08:00
Fixed Layer::sort_perimeters_into_islands() for fuzzy skin
Follow-up to 52ea2edf842e81e0f81fcd8303b69d288d903ae3 1) There was a bug in accessing the "perimeter is external" property, ExtrusionCollection returns "mixed", the embedded ExtrusionPath has to be queried directly. 2) The search bounding box has to be extended by the maximum offset introduced by fuzzy skin algorithm. For Arachne the fuzzy skin algorithm observes fuzzy_skin_point_dist.
This commit is contained in:
parent
644deef392
commit
b70571cd79
@ -577,12 +577,22 @@ void Layer::sort_perimeters_into_islands(
|
||||
}
|
||||
if (! sample_set) {
|
||||
// If there is no infill, take a sample of some inner perimeter.
|
||||
for (uint32_t iperimeter : extrusions.first)
|
||||
if (const ExtrusionEntity &ee = *this_layer_region.perimeters().entities[iperimeter]; ! ee.role().is_external()) {
|
||||
sample = ee.first_point();
|
||||
for (uint32_t iperimeter : extrusions.first) {
|
||||
const ExtrusionEntity &ee = *this_layer_region.perimeters().entities[iperimeter];
|
||||
if (ee.is_collection()) {
|
||||
for (const ExtrusionEntity *ee2 : dynamic_cast<const ExtrusionEntityCollection&>(ee).entities)
|
||||
if (! ee2->role().is_external()) {
|
||||
sample = ee2->first_point();
|
||||
sample_set = true;
|
||||
goto loop_end;
|
||||
}
|
||||
} else if (! ee.role().is_external()) {
|
||||
sample = ee.first_point();
|
||||
sample_set = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
loop_end:
|
||||
if (! sample_set) {
|
||||
if (! extrusions.second.empty()) {
|
||||
// If there is no inner perimeter, take a sample of some gap fill extrusion.
|
||||
@ -752,7 +762,9 @@ void Layer::sort_perimeters_into_islands(
|
||||
const PrintRegionConfig ®ion_config = this_layer_region.region().config();
|
||||
const auto bbox_eps = scaled<coord_t>(
|
||||
EPSILON + print_config.gcode_resolution.value +
|
||||
(region_config.fuzzy_skin.value == FuzzySkinType::None ? 0. : region_config.fuzzy_skin_thickness.value));
|
||||
(region_config.fuzzy_skin.value == FuzzySkinType::None ? 0. : region_config.fuzzy_skin_thickness.value
|
||||
//FIXME it looks as if Arachne could extend open lines by fuzzy_skin_point_dist, which does not seem right.
|
||||
+ region_config.fuzzy_skin_point_dist.value));
|
||||
auto point_inside_surface_dist2 =
|
||||
[&lslices = this->lslices, &lslices_ex = this->lslices_ex, bbox_eps]
|
||||
(const size_t lslice_idx, const Point &point) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user