FIX: auto-arrange may crash due to clipper

1. Use nlopt and clipper offset togather seems not stable, very easy to
crash. We do the offset outside nlopt now.
2. Fix a bug with finalAlign where objects may be translated to overlap
   with excluded region.
3. change the words of support_expansion

Change-Id: I22e37b20e4ae16f47bde206de90845616e4cefad
(cherry picked from commit 1c26e5d2862fd3f3292971b5c749420bfb2cdf0e)
This commit is contained in:
Arthur 2022-11-25 21:56:08 +08:00 committed by Lane.Wei
parent 95ed039879
commit 4eba8a2a2d
6 changed files with 47 additions and 55 deletions

View file

@ -3557,7 +3557,7 @@ bool PartPlateList::preprocess_arrange_polygon_other_locked(int obj_index, int i
return locked;
}
bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, int num_plates)
bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, int num_plates, float inflation)
{
bool added = false;
@ -3585,6 +3585,7 @@ bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons& unsel
ret.bed_idx = j;
ret.height = 1;
ret.name = "ExcludedRegion" + std::to_string(index);
ret.inflation = inflation;
unselected.emplace_back(std::move(ret));
}
@ -3595,7 +3596,7 @@ bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons& unsel
return added;
}
bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& regions, int num_plates)
bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& regions, int num_plates, float inflation)
{
bool added = false;
@ -3619,6 +3620,7 @@ bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& r
ret.bed_idx = j;
ret.height = 1;
ret.name = "NonpreferedRegion" + std::to_string(index);
ret.inflation = inflation;
regions.emplace_back(std::move(ret));
}