FIX: contact_polygons were not accurate and interface missing

In normal support, contact_polygons were slightly larger than allowed region, so sampling to the wrong points, which were then removed when "on buildplate only" was turned on.

Jira: STUDIO-2742
Github: issue 1352
Change-Id: I2f131bac48eb30997f37818f312da3386516a5ea
(cherry picked from commit ed25a89c0e8c5358ea803344fbce482be172d2ee)
This commit is contained in:
Arthur 2023-04-21 11:36:43 +08:00 committed by Lane.Wei
parent d5017bd9b0
commit da7353dd6b

View file

@ -1790,13 +1790,21 @@ static inline std::tuple<Polygons, Polygons, double> detect_contacts(
// For the same reason, the non-bridging support area may be smaller than the bridging support area!
slices_margin_update(std::min(lower_layer_offset, float(scale_(gap_xy))), no_interface_offset);
// Offset the contact polygons outside.
// BBS: already trim the support in trim_support_layers_by_object()
#if 0
for (size_t i = 0; i < NUM_MARGIN_STEPS; ++ i) {
diff_polygons = diff(
offset(
diff_polygons,
scaled<float>(SUPPORT_MATERIAL_MARGIN / NUM_MARGIN_STEPS),
ClipperLib::jtRound,
// round mitter limit
scale_(0.05)),
slices_margin.polygons);
}
#else
diff_polygons = diff(diff_polygons, slices_margin.polygons);
#endif
}
polygons_append(contact_polygons, diff_polygons);
} // for each layer.region