@@ -163,7 +163,7 @@ BranchingScheme::BranchingScheme(
163163 // std::cout << cleaned_shape.to_string(0) << std::endl;
164164 if (cleaned_shape.elements .size () > 2 ) {
165165 // inflate shape first
166- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing );
166+ Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing ). first ;
167167 // then trapezoidate the inflated shape
168168 auto trapezoids = trapezoidation (inflated_shape);
169169 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
@@ -179,7 +179,7 @@ BranchingScheme::BranchingScheme(
179179 Shape cleaned_shape = clean_shape (sym_shape);
180180 if (cleaned_shape.elements .size () > 2 ) {
181181 // inflate shape first
182- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing );
182+ Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing ). first ;
183183 // then trapezoidate the inflated shape
184184 auto trapezoids = trapezoidation (inflated_shape);
185185 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
@@ -206,9 +206,10 @@ BranchingScheme::BranchingScheme(
206206 cleaned_holes.push_back (clean_shape (hole));
207207 {
208208 // inflate shape first, and pass holes
209- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
209+ auto inflation_result = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
210+ Shape inflated_shape = inflation_result.first ;
210211 // then trapezoidate the inflated shape
211- auto trapezoids = trapezoidation (inflated_shape);
212+ auto trapezoids = trapezoidation (inflated_shape, inflation_result. second );
212213 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
213214 UncoveredTrapezoid defect (
214215 defect_id,
@@ -230,9 +231,10 @@ BranchingScheme::BranchingScheme(
230231 cleaned_holes.push_back (clean_shape (hole));
231232
232233 // inflate shape first, and pass holes
233- Shape inflated_shape = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
234+ auto inflation_result = inflate (cleaned_shape, instance ().parameters ().item_bin_minimum_spacing , cleaned_holes);
235+ Shape inflated_shape = inflation_result.first ;
234236 // then trapezoidate the inflated shape
235- auto trapezoids = trapezoidation (inflated_shape);
237+ auto trapezoids = trapezoidation (inflated_shape, inflation_result. second );
236238 for (const GeneralizedTrapezoid& trapezoid: trapezoids) {
237239 UncoveredTrapezoid defect (
238240 defect_id,
@@ -864,13 +866,15 @@ void BranchingScheme::compute_inflated_trapezoid_sets()
864866 }
865867
866868 // inflate the shape with holes
867- Shape inflated_shape = inflate (
869+ auto inflation_result = inflate (
868870 cleaned_shape,
869871 instance ().parameters ().item_item_minimum_spacing ,
870872 cleaned_holes);
873+ Shape inflated_shape = inflation_result.first ;
874+ std::vector<Shape> inflated_holes = inflation_result.second ;
871875
872876 // then perform the trapezoidation on the inflated shape
873- std::vector<GeneralizedTrapezoid> inflated_trapezoids = trapezoidation (inflated_shape);
877+ std::vector<GeneralizedTrapezoid> inflated_trapezoids = trapezoidation (inflated_shape, inflated_holes );
874878
875879 // store the trapezoidation result
876880 trapezoid_sets_inflated_.back ().back ().back () = inflated_trapezoids;
0 commit comments