mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-03 01:20:35 +08:00
fix first layer over sparse sometimes not labeled as bridge when there was no expand space
This commit is contained in:
parent
ce73bce780
commit
7c603a53e0
@ -1560,10 +1560,10 @@ void PrintObject::bridge_over_infill()
|
|||||||
double bridge_angle;
|
double bridge_angle;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unordered_map<const LayerSlice *, std::vector<ModifiedSurface>> expanded_briding_surfaces;
|
std::unordered_map<const LayerSlice *, std::vector<ModifiedSurface>> briding_surfaces;
|
||||||
|
|
||||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, this->layers().size()), [po = this,
|
tbb::parallel_for(tbb::blocked_range<size_t>(0, this->layers().size()), [po = this,
|
||||||
&expanded_briding_surfaces](tbb::blocked_range<size_t> r) {
|
&briding_surfaces](tbb::blocked_range<size_t> r) {
|
||||||
for (size_t lidx = r.begin(); lidx < r.end(); lidx++) {
|
for (size_t lidx = r.begin(); lidx < r.end(); lidx++) {
|
||||||
const Layer *layer = po->get_layer(lidx);
|
const Layer *layer = po->get_layer(lidx);
|
||||||
|
|
||||||
@ -1710,7 +1710,11 @@ void PrintObject::bridge_over_infill()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (expansion_space[candidates.first].empty() && special_infill.empty()) {
|
if (expansion_space[candidates.first].empty() && special_infill.empty()) {
|
||||||
// there is no expansion space to which can anchors expand on this island, skip
|
// there is no expansion space to which can anchors expand on this island, add back original polygons and skip the island
|
||||||
|
for (const Surface *candidate : candidates.second) {
|
||||||
|
briding_surfaces[candidates.first].emplace_back(candidate, to_polygons(candidate->expolygon),
|
||||||
|
surface_to_region[candidate], 0);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2015,7 +2019,7 @@ void PrintObject::bridge_over_infill()
|
|||||||
expanded_bridged_area = opening(expanded_bridged_area, flow.scaled_spacing());
|
expanded_bridged_area = opening(expanded_bridged_area, flow.scaled_spacing());
|
||||||
expand_area = diff(expand_area, expanded_bridged_area);
|
expand_area = diff(expand_area, expanded_bridged_area);
|
||||||
|
|
||||||
expanded_briding_surfaces[candidates.first].emplace_back(candidate, expanded_bridged_area, surface_to_region[candidate],
|
briding_surfaces[candidates.first].emplace_back(candidate, expanded_bridged_area, surface_to_region[candidate],
|
||||||
bridging_angle);
|
bridging_angle);
|
||||||
#ifdef DEBUG_BRIDGE_OVER_INFILL
|
#ifdef DEBUG_BRIDGE_OVER_INFILL
|
||||||
debug_draw(std::to_string(lidx) + "cadidate_added", to_lines(expanded_bridged_area), to_lines(bridged_area),
|
debug_draw(std::to_string(lidx) + "cadidate_added", to_lines(expanded_bridged_area), to_lines(bridged_area),
|
||||||
@ -2029,13 +2033,13 @@ void PrintObject::bridge_over_infill()
|
|||||||
BOOST_LOG_TRIVIAL(info) << "Bridge over infill - Directions and expanded surfaces computed" << log_memory_info();
|
BOOST_LOG_TRIVIAL(info) << "Bridge over infill - Directions and expanded surfaces computed" << log_memory_info();
|
||||||
|
|
||||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, this->layers().size()), [po = this,
|
tbb::parallel_for(tbb::blocked_range<size_t>(0, this->layers().size()), [po = this,
|
||||||
&expanded_briding_surfaces](tbb::blocked_range<size_t> r) {
|
&briding_surfaces](tbb::blocked_range<size_t> r) {
|
||||||
for (size_t lidx = r.begin(); lidx < r.end(); lidx++) {
|
for (size_t lidx = r.begin(); lidx < r.end(); lidx++) {
|
||||||
Layer *layer = po->get_layer(lidx);
|
Layer *layer = po->get_layer(lidx);
|
||||||
|
|
||||||
for (const LayerSlice &slice : layer->lslices_ex) {
|
for (const LayerSlice &slice : layer->lslices_ex) {
|
||||||
if (const auto &modified_surfaces = expanded_briding_surfaces.find(&slice);
|
if (const auto &modified_surfaces = briding_surfaces.find(&slice);
|
||||||
modified_surfaces != expanded_briding_surfaces.end()) {
|
modified_surfaces != briding_surfaces.end()) {
|
||||||
std::unordered_set<LayerRegion *> regions_to_check;
|
std::unordered_set<LayerRegion *> regions_to_check;
|
||||||
for (const LayerIsland &island : slice.islands) {
|
for (const LayerIsland &island : slice.islands) {
|
||||||
regions_to_check.insert(layer->regions()[island.perimeters.region()]);
|
regions_to_check.insert(layer->regions()[island.perimeters.region()]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user