Skip to content

Commit

Permalink
[CURA-12068] Fix missing infill in thin strips of space. (#2156)
Browse files Browse the repository at this point in the history
  • Loading branch information
HellAholic authored Oct 28, 2024
2 parents 5339777 + c0d91c9 commit d15d273
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/TreeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2037,10 +2037,11 @@ void TreeSupport::filterFloatingLines(std::vector<Shape>& support_layer_storage)
{
AABB hole_aabb = AABB(hole);
hole_aabb.expand(EPSILON);
if(hole.size() > 1)
if (hole.size() > 1)
{
// The hole contains other branches! It can not be fully removed.
// This may not fully handle this case as there could be a situation where such a hole becomes invalid, but for now this is the best solution not requiring larger changes.
// This may not fully handle this case as there could be a situation where such a hole becomes invalid, but for now this is the best solution not requiring
// larger changes.
holes_resting_outside[layer_idx].emplace(idx);
}
else if (! hole.intersection(PolygonUtils::clipPolygonWithAABB(outer_walls, hole_aabb)).empty())
Expand All @@ -2057,8 +2058,7 @@ void TreeSupport::filterFloatingLines(std::vector<Shape>& support_layer_storage)
for (auto [idx2, hole2] : holeparts[layer_idx - 1] | ranges::views::enumerate)
{
// TODO should technically be outline: Check if this is fine either way as it would save an offset
if (hole_aabb.hit(AABB(hole2))
&& ! hole.intersection(PolygonUtils::clipPolygonWithAABB(hole2, hole_aabb)).empty())
if (hole_aabb.hit(AABB(hole2)) && ! hole.intersection(PolygonUtils::clipPolygonWithAABB(hole2, hole_aabb)).empty())
{
hole_rest_map[layer_idx][idx].emplace_back(idx2);
}
Expand Down
5 changes: 2 additions & 3 deletions src/skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,16 +529,15 @@ void SkinInfillAreaComputation::generateGradualInfill(SliceMeshStorage& mesh)
part.infill_area_per_combine_per_density.emplace_back();
std::vector<Shape>& infill_area_per_combine_current_density = part.infill_area_per_combine_per_density.back();
const Shape more_dense_infill = infill_area.difference(less_dense_infill);
infill_area_per_combine_current_density.push_back(
simplifier.polygon(more_dense_infill.difference(sum_more_dense).offset(-infill_wall_width).offset(infill_wall_width)));
infill_area_per_combine_current_density.push_back(simplifier.polygon(more_dense_infill.difference(sum_more_dense)));
if (is_connected)
{
sum_more_dense = sum_more_dense.unionPolygons(more_dense_infill);
}
}
part.infill_area_per_combine_per_density.emplace_back();
std::vector<Shape>& infill_area_per_combine_current_density = part.infill_area_per_combine_per_density.back();
infill_area_per_combine_current_density.push_back(simplifier.polygon(infill_area.difference(sum_more_dense).offset(-infill_wall_width).offset(infill_wall_width)));
infill_area_per_combine_current_density.push_back(simplifier.polygon(infill_area.difference(sum_more_dense)));
part.infill_area_own = std::nullopt; // clear infill_area_own, it's not needed any more.
assert(! part.infill_area_per_combine_per_density.empty() && "infill_area_per_combine_per_density is now initialized");
}
Expand Down

0 comments on commit d15d273

Please sign in to comment.