Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CURA-12068] Fix missing infill in thin strips of space. #2156

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading