Fix of Paint on support ignores some paints.

When projecting the horizontal or nearly horizontal support enforcers or blockers
into object layers, the projection may fall on a layer above or below the layer
where it should in case the nearly horizontal support enforcer or blocker
triangles are intersecting the slicing plane of one of the object layers.
Due to numerical issues, projection of the support blocker or
enforcer triangles may not fall to the same side of the slicing plane
as when slicing the object. To make the projection robust, horizontal triangles
are newly projected to both the layer below and above if they are close
to the object slicing plane.
This commit is contained in:
Vojtech Bubnik 2021-02-23 12:23:06 +01:00
parent e1c201e714
commit 8ba230db9f
2 changed files with 58 additions and 22 deletions
src/libslic3r

View file

@ -1408,8 +1408,18 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_
const ExPolygons &enforcer = enforcers[layer_id];
if (! enforcer.empty()) {
// Enforce supports (as if with 90 degrees of slope) for the regions covered by the enforcer meshes.
Polygons new_contacts = diff(intersection(layerm_polygons, to_polygons(std::move(enforcer))),
offset(lower_layer_polygons, 0.05f * fw, SUPPORT_SURFACES_OFFSET_PARAMETERS));
#ifdef SLIC3R_DEBUG
ExPolygons enforcers_united = union_ex(to_polygons(enforcer), false);
#endif // SLIC3R_DEBUG
Polygons new_contacts = diff(intersection(layerm_polygons, to_polygons(std::move(enforcer))),
offset(lower_layer_polygons, 0.05f * fw, SUPPORT_SURFACES_OFFSET_PARAMETERS));
#ifdef SLIC3R_DEBUG
SVG::export_expolygons(debug_out_path("support-top-contacts-enforcers-run%d-layer%d-z%f.svg", iRun, layer_id, layer.print_z),
{ { { union_ex(layerm_polygons, false) }, { "layerm_polygons", "gray", 0.2f } },
{ { union_ex(lower_layer_polygons, false) }, { "lower_layer_polygons", "green", 0.5f } },
{ enforcers_united, { "enforcers", "blue", 0.5f } },
{ { union_ex(new_contacts, true) }, { "new_contacts", "red", "black", "", scaled<coord_t>(0.1f), 0.5f } } });
#endif /* SLIC3R_DEBUG */
if (! new_contacts.empty()) {
if (diff_polygons.empty())
diff_polygons = std::move(new_contacts);