@@ -164,7 +164,7 @@ BranchingScheme::BranchingScheme(
164164 // std::cout << cleaned_shape.to_string(0) << std::endl;
165165 if (cleaned_shape.elements .size () > 2 ) {
166166 // inflate shape first
167- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing );
167+ Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing ). first ;
168168 // then trapezoidate the inflated shape
169169 auto trapezoids = trapezoidation (inflated_shape);
170170 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
@@ -180,7 +180,7 @@ BranchingScheme::BranchingScheme(
180180 Shape cleaned_shape = clean_shape (sym_shape);
181181 if (cleaned_shape.elements .size () > 2 ) {
182182 // inflate shape first
183- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing );
183+ Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing ). first ;
184184 // then trapezoidate the inflated shape
185185 auto trapezoids = trapezoidation (inflated_shape);
186186 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
@@ -207,9 +207,10 @@ BranchingScheme::BranchingScheme(
207207 cleaned_holes.push_back (clean_shape (hole));
208208 {
209209 // inflate shape first, and pass holes
210- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
210+ auto inflation_result = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
211+ Shape inflated_shape = inflation_result.first ;
211212 // then trapezoidate the inflated shape
212- auto trapezoids = trapezoidation (inflated_shape);
213+ auto trapezoids = trapezoidation (inflated_shape, inflation_result. second );
213214 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
214215 UncoveredTrapezoid defect (
215216 defect_id,
@@ -231,9 +232,10 @@ BranchingScheme::BranchingScheme(
231232 cleaned_holes.push_back (clean_shape (hole));
232233
233234 // inflate shape first, and pass holes
234- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
235+ auto inflation_result = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
236+ Shape inflated_shape = inflation_result.first ;
235237 // then trapezoidate the inflated shape
236- auto trapezoids = trapezoidation (inflated_shape);
238+ auto trapezoids = trapezoidation (inflated_shape, inflation_result. second );
237239 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
238240 UncoveredTrapezoid defect (
239241 defect_id,
@@ -865,13 +867,15 @@ void BranchingScheme::compute_inflated_trapezoid_sets()
865867 }
866868
867869 // inflate the shape with holes
868- Shape inflated_shape = inflate (
870+ auto inflation_result = inflate (
869871 cleaned_shape,
870872 instance ().parameters ().item_item_minimum_spacing ,
871873 cleaned_holes);
874+ Shape inflated_shape = inflation_result.first ;
875+ std::vector<Shape> inflated_holes = inflation_result.second ;
872876
873877 // then perform the trapezoidation on the inflated shape
874- std::vector<GeneralizedTrapezoid> inflated_trapezoids = trapezoidation (inflated_shape);
878+ std::vector<GeneralizedTrapezoid> inflated_trapezoids = trapezoidation (inflated_shape, inflated_holes );
875879
876880 // store the trapezoidation result
877881 trapezoid_sets_inflated_.back ().back ().back () = inflated_trapezoids;
0 commit comments