Fixing zero elevation bug when concave hull overlap was not detected.

Backported from tm_perf_optims
This commit is contained in:
tamasmeszaros 2019-07-30 14:24:42 +02:00
parent 7f33e23fbb
commit 320f964847
4 changed files with 32 additions and 10 deletions

View file

@ -618,15 +618,25 @@ struct Pad {
}
}
ExPolygons concaveh = offset_ex(
concave_hull(basep, pcfg.max_merge_distance_mm, thr),
scaled<float>(pcfg.min_wall_thickness_mm));
// Punching the breaksticks across the offsetted polygon perimeters
ExPolygons pad_stickholes; pad_stickholes.reserve(modelbase.size());
auto pad_stickholes = reserve_vector<ExPolygon>(modelbase.size());
for(auto& poly : modelbase_offs) {
bool overlap = false;
for (const ExPolygon &p : concaveh)
overlap = overlap || poly.overlaps(p);
auto bb = poly.contour.bounding_box();
bb.offset(scaled<float>(pcfg.min_wall_thickness_mm));
std::vector<BoxIndexEl> qres =
bindex.query(poly.contour.bounding_box(),
BoxIndex::qtIntersects);
if (!qres.empty()) {
bindex.query(bb, BoxIndex::qtIntersects);
if (!qres.empty() || overlap) {
// The model silhouette polygon 'poly' HAS an intersection
// with the support silhouettes. Include this polygon