mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 10:17:55 -06:00
Supports - trimming base support layers with the bottom surfaces.
This commit is contained in:
parent
22124e5f61
commit
0ca230a197
1 changed files with 20 additions and 7 deletions
|
@ -861,8 +861,9 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
|
||||||
// top surfaces above layer.print_z falls onto this top surface.
|
// top surfaces above layer.print_z falls onto this top surface.
|
||||||
// Touching are the contact surfaces supported exclusively by this top surfaces.
|
// Touching are the contact surfaces supported exclusively by this top surfaces.
|
||||||
// Don't use a safety offset as it has been applied during insertion of polygons.
|
// Don't use a safety offset as it has been applied during insertion of polygons.
|
||||||
|
Polygons touching;
|
||||||
if (! top.empty()) {
|
if (! top.empty()) {
|
||||||
Polygons touching = intersection(top, projection, false);
|
touching = intersection(top, projection, false);
|
||||||
if (! touching.empty()) {
|
if (! touching.empty()) {
|
||||||
// Allocate a new bottom contact layer.
|
// Allocate a new bottom contact layer.
|
||||||
MyLayer &layer_new = layer_allocate(layer_storage, sltBottomContact);
|
MyLayer &layer_new = layer_allocate(layer_storage, sltBottomContact);
|
||||||
|
@ -887,9 +888,23 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
|
||||||
debug_out_path("support-bottom-contacts-%d-%lf.svg", iRun, layer_new.print_z),
|
debug_out_path("support-bottom-contacts-%d-%lf.svg", iRun, layer_new.print_z),
|
||||||
union_ex(layer_new.polygons, false));
|
union_ex(layer_new.polygons, false));
|
||||||
#endif /* SLIC3R_DEBUG */
|
#endif /* SLIC3R_DEBUG */
|
||||||
|
// Trim the already created base layers above the current layer intersecting with the bottom contacts layer.
|
||||||
|
touching = offset(touching, float(SCALED_EPSILON));
|
||||||
|
for (int layer_id_above = layer_id + 1; layer_id_above < int(object.total_layer_count()); ++ layer_id_above) {
|
||||||
|
const Layer &layer_above = *object.layers[layer_id_above];
|
||||||
|
if (layer_above.print_z > layer_new.print_z + EPSILON)
|
||||||
|
break;
|
||||||
|
if (! layer_support_areas[layer_id_above].empty())
|
||||||
|
layer_support_areas[layer_id_above] = diff(layer_support_areas[layer_id_above], touching);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // ! top.empty()
|
} // ! top.empty()
|
||||||
|
|
||||||
|
// Remove the areas that touched from the projection that will continue on next, lower, top surfaces.
|
||||||
|
// Polygons trimming = union_(to_polygons(layer.slices.expolygons), touching, true);
|
||||||
|
Polygons trimming = offset(layer.slices.expolygons, float(SCALED_EPSILON));
|
||||||
|
projection = diff(projection, trimming, false);
|
||||||
|
|
||||||
remove_sticks(projection);
|
remove_sticks(projection);
|
||||||
remove_degenerate(projection);
|
remove_degenerate(projection);
|
||||||
|
|
||||||
|
@ -926,13 +941,11 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
|
||||||
// to allow a placement of suppot zig-zag snake along the grid lines.
|
// to allow a placement of suppot zig-zag snake along the grid lines.
|
||||||
layer_support_areas[layer_id] = diff(
|
layer_support_areas[layer_id] = diff(
|
||||||
grid.contours_simplified(m_support_material_flow.scaled_spacing()/2 + 25),
|
grid.contours_simplified(m_support_material_flow.scaled_spacing()/2 + 25),
|
||||||
to_polygons(layer.slices.expolygons),
|
trimming,
|
||||||
true);
|
false);
|
||||||
|
|
||||||
// Remove the areas that touched from the projection that will continue on next, lower, top surfaces.
|
// Trim the base layer by the object layer.
|
||||||
// projection = diff(projection, touching);
|
projection = diff(projection_simplified, trimming, false);
|
||||||
projection = diff(projection_simplified, to_polygons(layer.slices.expolygons), true);
|
|
||||||
// layer_support_areas[layer_id] = projection;
|
|
||||||
}
|
}
|
||||||
std::reverse(bottom_contacts.begin(), bottom_contacts.end());
|
std::reverse(bottom_contacts.begin(), bottom_contacts.end());
|
||||||
} // ! top_contacts.empty()
|
} // ! top_contacts.empty()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue