diff --git a/src/Rotation.php b/src/Rotation.php new file mode 100644 index 0000000..a4bd361 --- /dev/null +++ b/src/Rotation.php @@ -0,0 +1,20 @@ +addBox(new TestBox('Le petite box', 300, 300, 10, 10, 296, 296, 8, 1000)); $packer->addBox(new TestBox('Le grande box', 3000, 3000, 100, 100, 2960, 2960, 80, 10000)); - $packer->addItem(new TestItem('Item 1', 2500, 2500, 20, 2000, true)); - $packer->addItem(new TestItem('Item 2', 25000, 2500, 20, 2000, true)); - $packer->addItem(new TestItem('Item 3', 2500, 2500, 20, 2000, true)); + $packer->addItem(new TestItem('Item 1', 2500, 2500, 20, 2000, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 2', 25000, 2500, 20, 2000, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 3', 2500, 2500, 20, 2000, Rotation::KeepFlat)); $packedBoxes = $packer->pack(); @@ -38,9 +38,9 @@ public function testUnpackableItemsHandled(): void $packer = new InfalliblePacker(); $packer->addBox(new TestBox('Le petite box', 300, 300, 10, 10, 296, 296, 8, 1000)); $packer->addBox(new LimitedSupplyTestBox('Le grande box', 3000, 3000, 100, 100, 2960, 2960, 80, 10000, 0)); - $packer->addItem(new TestItem('Item 1', 2500, 2500, 20, 2000, true)); - $packer->addItem(new TestItem('Item 2', 25000, 2500, 20, 2000, true)); - $packer->addItem(new TestItem('Item 3', 2500, 2500, 20, 2000, true)); + $packer->addItem(new TestItem('Item 1', 2500, 2500, 20, 2000, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 2', 25000, 2500, 20, 2000, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 3', 2500, 2500, 20, 2000, Rotation::KeepFlat)); $packedBoxes = $packer->pack(); @@ -64,424 +64,424 @@ public function testIssue182B(): void $packer->addBox(new TestBox('6', 333, 613, 308, 567, 307, 567, 284, 15876)); $packer->addBox(new TestBox('7', 473, 692, 378, 1089, 437, 641, 349, 15876)); - $packer->addItem(new TestItem('1', 191, 381, 203, 4536, false)); - $packer->addItem(new TestItem('2', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('3', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('4', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('5', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('6', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('7', 457, 610, 381, 8165, false)); - $packer->addItem(new TestItem('8', 191, 381, 203, 4536, false)); - $packer->addItem(new TestItem('9', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('10', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('11', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('12', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('13', 191, 203, 368, 3992, false)); - $packer->addItem(new TestItem('14', 457, 610, 381, 8165, false)); - $packer->addItem(new TestItem('15', 368, 419, 533, 12909, false)); - $packer->addItem(new TestItem('16', 368, 419, 533, 12909, false)); - $packer->addItem(new TestItem('17', 368, 419, 533, 12909, false)); - $packer->addItem(new TestItem('18', 368, 419, 533, 12909, false)); - $packer->addItem(new TestItem('19', 419, 457, 483, 14751, false)); - $packer->addItem(new TestItem('20', 419, 457, 483, 14751, false)); - $packer->addItem(new TestItem('21', 432, 572, 178, 6749, false)); - $packer->addItem(new TestItem('22', 432, 572, 178, 6749, false)); - $packer->addItem(new TestItem('23', 419, 559, 165, 9770, false)); - $packer->addItem(new TestItem('24', 419, 559, 165, 9770, false)); - $packer->addItem(new TestItem('25', 361, 361, 165, 5330, false)); - $packer->addItem(new TestItem('26', 361, 361, 165, 5330, false)); - $packer->addItem(new TestItem('27', 381, 483, 152, 3738, false)); - $packer->addItem(new TestItem('28', 152, 305, 51, 726, false)); - $packer->addItem(new TestItem('29', 318, 406, 102, 2631, false)); - $packer->addItem(new TestItem('30', 254, 279, 102, 1479, false)); - $packer->addItem(new TestItem('31', 254, 279, 102, 1479, false)); - $packer->addItem(new TestItem('32', 133, 248, 76, 526, false)); - $packer->addItem(new TestItem('33', 133, 248, 76, 526, false)); - $packer->addItem(new TestItem('34', 133, 248, 76, 526, false)); - $packer->addItem(new TestItem('35', 133, 248, 76, 526, false)); - $packer->addItem(new TestItem('36', 173, 305, 91, 1451, false)); - $packer->addItem(new TestItem('37', 203, 381, 140, 2087, false)); - $packer->addItem(new TestItem('38', 191, 318, 140, 1225, false)); - $packer->addItem(new TestItem('39', 140, 356, 76, 962, false)); - $packer->addItem(new TestItem('40', 140, 356, 76, 962, false)); - $packer->addItem(new TestItem('41', 137, 356, 69, 816, false)); - $packer->addItem(new TestItem('42', 137, 356, 69, 816, false)); - $packer->addItem(new TestItem('43', 137, 356, 69, 816, false)); - $packer->addItem(new TestItem('44', 381, 467, 89, 3266, false)); - $packer->addItem(new TestItem('45', 241, 305, 66, 1089, false)); - $packer->addItem(new TestItem('46', 178, 335, 119, 1179, false)); - $packer->addItem(new TestItem('47', 178, 335, 119, 1179, false)); - $packer->addItem(new TestItem('48', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('49', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('50', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('51', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('52', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('53', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('54', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('55', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('56', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('57', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('58', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('59', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('60', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('61', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('62', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('63', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('64', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('65', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('66', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('67', 229, 254, 127, 839, false)); - $packer->addItem(new TestItem('68', 254, 305, 102, 1733, false)); - $packer->addItem(new TestItem('69', 254, 305, 102, 1733, false)); - $packer->addItem(new TestItem('70', 254, 305, 102, 1733, false)); - $packer->addItem(new TestItem('71', 254, 305, 102, 1733, false)); - $packer->addItem(new TestItem('72', 254, 305, 102, 1733, false)); - $packer->addItem(new TestItem('73', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('74', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('75', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('76', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('77', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('78', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('79', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('80', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('81', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('82', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('83', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('84', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('85', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('86', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('87', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('88', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('89', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('90', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('91', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('92', 184, 375, 108, 1461, false)); - $packer->addItem(new TestItem('93', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('94', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('95', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('96', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('97', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('98', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('99', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('100', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('101', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('102', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('103', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('104', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('105', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('106', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('107', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('108', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('109', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('110', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('111', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('112', 152, 229, 57, 871, false)); - $packer->addItem(new TestItem('113', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('114', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('115', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('116', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('117', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('118', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('119', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('120', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('121', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('122', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('123', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('124', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('125', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('126', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('127', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('128', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('129', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('130', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('131', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('132', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('133', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('134', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('135', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('136', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('137', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('138', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('139', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('140', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('141', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('142', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('143', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('144', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('145', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('146', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('147', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('148', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('149', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('150', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('151', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('152', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('153', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('154', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('155', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('156', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('157', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('158', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('159', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('160', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('161', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('162', 178, 178, 25, 363, false)); - $packer->addItem(new TestItem('163', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('164', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('165', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('166', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('167', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('168', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('169', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('170', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('171', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('172', 140, 241, 25, 272, false)); - $packer->addItem(new TestItem('173', 457, 457, 178, 6123, false)); - $packer->addItem(new TestItem('174', 457, 457, 178, 6123, false)); - $packer->addItem(new TestItem('175', 457, 457, 178, 6123, false)); - $packer->addItem(new TestItem('176', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('177', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('178', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('179', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('180', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('181', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('182', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('183', 267, 305, 76, 2921, false)); - $packer->addItem(new TestItem('184', 178, 540, 89, 1960, false)); - $packer->addItem(new TestItem('185', 178, 540, 89, 1960, false)); - $packer->addItem(new TestItem('186', 178, 540, 89, 1960, false)); - $packer->addItem(new TestItem('187', 178, 540, 89, 1960, false)); - $packer->addItem(new TestItem('188', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('189', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('190', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('191', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('192', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('193', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('194', 178, 279, 76, 299, false)); - $packer->addItem(new TestItem('195', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('196', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('197', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('198', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('199', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('200', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('201', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('202', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('203', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('204', 203, 203, 25, 417, false)); - $packer->addItem(new TestItem('205', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('206', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('207', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('208', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('209', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('210', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('211', 108, 159, 76, 635, false)); - $packer->addItem(new TestItem('212', 127, 279, 70, 1188, false)); - $packer->addItem(new TestItem('213', 508, 1143, 127, 18144, false)); - $packer->addItem(new TestItem('214', 508, 1143, 127, 18144, false)); - $packer->addItem(new TestItem('215', 508, 1143, 127, 18144, false)); - $packer->addItem(new TestItem('216', 508, 1143, 127, 18144, false)); - $packer->addItem(new TestItem('217', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('218', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('219', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('220', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('221', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('222', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('223', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('224', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('225', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('226', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('227', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('228', 112, 831, 109, 2177, false)); - $packer->addItem(new TestItem('229', 305, 737, 394, 16012, false)); - $packer->addItem(new TestItem('230', 305, 737, 394, 16012, false)); - $packer->addItem(new TestItem('231', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('232', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('233', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('234', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('235', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('236', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('237', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('238', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('239', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('240', 188, 231, 84, 544, false)); - $packer->addItem(new TestItem('241', 531, 1049, 112, 22680, false)); - $packer->addItem(new TestItem('242', 531, 1049, 112, 22680, false)); - $packer->addItem(new TestItem('243', 531, 1049, 112, 22680, false)); - $packer->addItem(new TestItem('244', 531, 1049, 112, 22680, false)); - $packer->addItem(new TestItem('245', 211, 206, 221, 1270, false)); - $packer->addItem(new TestItem('246', 211, 206, 221, 1270, false)); - $packer->addItem(new TestItem('247', 211, 206, 221, 1270, false)); - $packer->addItem(new TestItem('248', 211, 206, 221, 1270, false)); - $packer->addItem(new TestItem('249', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('250', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('251', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('252', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('253', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('254', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('255', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('256', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('257', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('258', 241, 559, 89, 3257, false)); - $packer->addItem(new TestItem('259', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('260', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('261', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('262', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('263', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('264', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('265', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('266', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('267', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('268', 191, 279, 61, 1361, false)); - $packer->addItem(new TestItem('269', 660, 1022, 330, 29102, false)); - $packer->addItem(new TestItem('270', 413, 413, 681, 15876, false)); - $packer->addItem(new TestItem('271', 413, 413, 681, 15876, false)); - $packer->addItem(new TestItem('272', 413, 413, 681, 15876, false)); - $packer->addItem(new TestItem('273', 413, 413, 681, 15876, false)); - $packer->addItem(new TestItem('274', 508, 508, 737, 13608, false)); - $packer->addItem(new TestItem('275', 508, 508, 737, 13608, false)); - $packer->addItem(new TestItem('276', 578, 635, 787, 40007, false)); - $packer->addItem(new TestItem('277', 578, 635, 787, 40007, false)); - $packer->addItem(new TestItem('278', 203, 203, 25, 753, false)); - $packer->addItem(new TestItem('279', 203, 203, 25, 753, false)); - $packer->addItem(new TestItem('280', 203, 203, 25, 753, false)); - $packer->addItem(new TestItem('281', 203, 203, 25, 753, false)); - $packer->addItem(new TestItem('282', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('283', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('284', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('285', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('286', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('287', 203, 203, 25, 481, false)); - $packer->addItem(new TestItem('288', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('289', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('290', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('291', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('292', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('293', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('294', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('295', 124, 254, 86, 635, false)); - $packer->addItem(new TestItem('296', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('297', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('298', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('299', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('300', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('301', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('302', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('303', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('304', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('305', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('306', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('307', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('308', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('309', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('310', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('311', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('312', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('313', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('314', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('315', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('316', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('317', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('318', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('319', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('320', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('321', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('322', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('323', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('324', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('325', 146, 229, 13, 227, false)); - $packer->addItem(new TestItem('326', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('327', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('328', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('329', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('330', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('331', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('332', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('333', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('334', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('335', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('336', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('337', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('338', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('339', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('340', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('341', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('342', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('343', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('344', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('345', 140, 267, 38, 372, false)); - $packer->addItem(new TestItem('346', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('347', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('348', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('349', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('350', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('351', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('352', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('353', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('354', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('355', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('356', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('357', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('358', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('359', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('360', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('361', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('362', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('363', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('364', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('365', 89, 909, 89, 3447, false)); - $packer->addItem(new TestItem('366', 107, 163, 81, 635, false)); - $packer->addItem(new TestItem('367', 107, 163, 81, 635, false)); - $packer->addItem(new TestItem('368', 107, 163, 81, 635, false)); - $packer->addItem(new TestItem('369', 107, 163, 81, 635, false)); - $packer->addItem(new TestItem('370', 107, 163, 81, 635, false)); - $packer->addItem(new TestItem('371', 241, 559, 89, 3284, false)); - $packer->addItem(new TestItem('372', 318, 445, 114, 3475, false)); - $packer->addItem(new TestItem('373', 330, 292, 292, 6350, false)); - $packer->addItem(new TestItem('374', 330, 292, 292, 6350, false)); - $packer->addItem(new TestItem('375', 330, 292, 292, 6350, false)); - $packer->addItem(new TestItem('376', 330, 292, 292, 6350, false)); - $packer->addItem(new TestItem('377', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('378', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('379', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('380', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('381', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('382', 324, 445, 318, 3819, false)); - $packer->addItem(new TestItem('383', 229, 572, 127, 3411, false)); - $packer->addItem(new TestItem('384', 279, 330, 51, 1157, false)); - $packer->addItem(new TestItem('385', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('386', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('387', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('388', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('389', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('390', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('391', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('392', 203, 203, 25, 159, false)); - $packer->addItem(new TestItem('393', 203, 203, 51, 354, false)); - $packer->addItem(new TestItem('394', 178, 178, 25, 91, false)); - $packer->addItem(new TestItem('395', 178, 178, 25, 91, false)); - $packer->addItem(new TestItem('396', 178, 178, 25, 91, false)); - $packer->addItem(new TestItem('397', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('398', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('399', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('400', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('401', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('402', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('403', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('404', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('405', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('406', 95, 127, 25, 73, false)); - $packer->addItem(new TestItem('407', 64, 165, 122, 1134, false)); - $packer->addItem(new TestItem('408', 64, 165, 122, 1134, false)); - $packer->addItem(new TestItem('409', 64, 165, 122, 1134, false)); - $packer->addItem(new TestItem('410', 64, 165, 122, 1134, false)); - $packer->addItem(new TestItem('411', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('412', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('413', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('414', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('415', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('416', 86, 109, 51, 200, false)); - $packer->addItem(new TestItem('417', 305, 521, 108, 2976, false)); - $packer->addItem(new TestItem('418', 305, 521, 108, 2976, false)); + $packer->addItem(new TestItem('1', 191, 381, 203, 4536, Rotation::BestFit)); + $packer->addItem(new TestItem('2', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('3', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('4', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('5', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('6', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('7', 457, 610, 381, 8165, Rotation::BestFit)); + $packer->addItem(new TestItem('8', 191, 381, 203, 4536, Rotation::BestFit)); + $packer->addItem(new TestItem('9', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('10', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('11', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('12', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('13', 191, 203, 368, 3992, Rotation::BestFit)); + $packer->addItem(new TestItem('14', 457, 610, 381, 8165, Rotation::BestFit)); + $packer->addItem(new TestItem('15', 368, 419, 533, 12909, Rotation::BestFit)); + $packer->addItem(new TestItem('16', 368, 419, 533, 12909, Rotation::BestFit)); + $packer->addItem(new TestItem('17', 368, 419, 533, 12909, Rotation::BestFit)); + $packer->addItem(new TestItem('18', 368, 419, 533, 12909, Rotation::BestFit)); + $packer->addItem(new TestItem('19', 419, 457, 483, 14751, Rotation::BestFit)); + $packer->addItem(new TestItem('20', 419, 457, 483, 14751, Rotation::BestFit)); + $packer->addItem(new TestItem('21', 432, 572, 178, 6749, Rotation::BestFit)); + $packer->addItem(new TestItem('22', 432, 572, 178, 6749, Rotation::BestFit)); + $packer->addItem(new TestItem('23', 419, 559, 165, 9770, Rotation::BestFit)); + $packer->addItem(new TestItem('24', 419, 559, 165, 9770, Rotation::BestFit)); + $packer->addItem(new TestItem('25', 361, 361, 165, 5330, Rotation::BestFit)); + $packer->addItem(new TestItem('26', 361, 361, 165, 5330, Rotation::BestFit)); + $packer->addItem(new TestItem('27', 381, 483, 152, 3738, Rotation::BestFit)); + $packer->addItem(new TestItem('28', 152, 305, 51, 726, Rotation::BestFit)); + $packer->addItem(new TestItem('29', 318, 406, 102, 2631, Rotation::BestFit)); + $packer->addItem(new TestItem('30', 254, 279, 102, 1479, Rotation::BestFit)); + $packer->addItem(new TestItem('31', 254, 279, 102, 1479, Rotation::BestFit)); + $packer->addItem(new TestItem('32', 133, 248, 76, 526, Rotation::BestFit)); + $packer->addItem(new TestItem('33', 133, 248, 76, 526, Rotation::BestFit)); + $packer->addItem(new TestItem('34', 133, 248, 76, 526, Rotation::BestFit)); + $packer->addItem(new TestItem('35', 133, 248, 76, 526, Rotation::BestFit)); + $packer->addItem(new TestItem('36', 173, 305, 91, 1451, Rotation::BestFit)); + $packer->addItem(new TestItem('37', 203, 381, 140, 2087, Rotation::BestFit)); + $packer->addItem(new TestItem('38', 191, 318, 140, 1225, Rotation::BestFit)); + $packer->addItem(new TestItem('39', 140, 356, 76, 962, Rotation::BestFit)); + $packer->addItem(new TestItem('40', 140, 356, 76, 962, Rotation::BestFit)); + $packer->addItem(new TestItem('41', 137, 356, 69, 816, Rotation::BestFit)); + $packer->addItem(new TestItem('42', 137, 356, 69, 816, Rotation::BestFit)); + $packer->addItem(new TestItem('43', 137, 356, 69, 816, Rotation::BestFit)); + $packer->addItem(new TestItem('44', 381, 467, 89, 3266, Rotation::BestFit)); + $packer->addItem(new TestItem('45', 241, 305, 66, 1089, Rotation::BestFit)); + $packer->addItem(new TestItem('46', 178, 335, 119, 1179, Rotation::BestFit)); + $packer->addItem(new TestItem('47', 178, 335, 119, 1179, Rotation::BestFit)); + $packer->addItem(new TestItem('48', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('49', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('50', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('51', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('52', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('53', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('54', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('55', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('56', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('57', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('58', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('59', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('60', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('61', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('62', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('63', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('64', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('65', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('66', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('67', 229, 254, 127, 839, Rotation::BestFit)); + $packer->addItem(new TestItem('68', 254, 305, 102, 1733, Rotation::BestFit)); + $packer->addItem(new TestItem('69', 254, 305, 102, 1733, Rotation::BestFit)); + $packer->addItem(new TestItem('70', 254, 305, 102, 1733, Rotation::BestFit)); + $packer->addItem(new TestItem('71', 254, 305, 102, 1733, Rotation::BestFit)); + $packer->addItem(new TestItem('72', 254, 305, 102, 1733, Rotation::BestFit)); + $packer->addItem(new TestItem('73', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('74', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('75', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('76', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('77', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('78', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('79', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('80', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('81', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('82', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('83', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('84', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('85', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('86', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('87', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('88', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('89', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('90', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('91', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('92', 184, 375, 108, 1461, Rotation::BestFit)); + $packer->addItem(new TestItem('93', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('94', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('95', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('96', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('97', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('98', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('99', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('100', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('101', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('102', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('103', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('104', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('105', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('106', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('107', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('108', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('109', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('110', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('111', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('112', 152, 229, 57, 871, Rotation::BestFit)); + $packer->addItem(new TestItem('113', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('114', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('115', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('116', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('117', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('118', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('119', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('120', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('121', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('122', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('123', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('124', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('125', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('126', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('127', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('128', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('129', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('130', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('131', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('132', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('133', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('134', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('135', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('136', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('137', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('138', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('139', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('140', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('141', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('142', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('143', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('144', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('145', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('146', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('147', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('148', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('149', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('150', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('151', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('152', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('153', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('154', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('155', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('156', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('157', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('158', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('159', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('160', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('161', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('162', 178, 178, 25, 363, Rotation::BestFit)); + $packer->addItem(new TestItem('163', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('164', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('165', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('166', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('167', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('168', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('169', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('170', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('171', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('172', 140, 241, 25, 272, Rotation::BestFit)); + $packer->addItem(new TestItem('173', 457, 457, 178, 6123, Rotation::BestFit)); + $packer->addItem(new TestItem('174', 457, 457, 178, 6123, Rotation::BestFit)); + $packer->addItem(new TestItem('175', 457, 457, 178, 6123, Rotation::BestFit)); + $packer->addItem(new TestItem('176', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('177', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('178', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('179', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('180', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('181', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('182', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('183', 267, 305, 76, 2921, Rotation::BestFit)); + $packer->addItem(new TestItem('184', 178, 540, 89, 1960, Rotation::BestFit)); + $packer->addItem(new TestItem('185', 178, 540, 89, 1960, Rotation::BestFit)); + $packer->addItem(new TestItem('186', 178, 540, 89, 1960, Rotation::BestFit)); + $packer->addItem(new TestItem('187', 178, 540, 89, 1960, Rotation::BestFit)); + $packer->addItem(new TestItem('188', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('189', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('190', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('191', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('192', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('193', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('194', 178, 279, 76, 299, Rotation::BestFit)); + $packer->addItem(new TestItem('195', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('196', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('197', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('198', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('199', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('200', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('201', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('202', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('203', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('204', 203, 203, 25, 417, Rotation::BestFit)); + $packer->addItem(new TestItem('205', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('206', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('207', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('208', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('209', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('210', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('211', 108, 159, 76, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('212', 127, 279, 70, 1188, Rotation::BestFit)); + $packer->addItem(new TestItem('213', 508, 1143, 127, 18144, Rotation::BestFit)); + $packer->addItem(new TestItem('214', 508, 1143, 127, 18144, Rotation::BestFit)); + $packer->addItem(new TestItem('215', 508, 1143, 127, 18144, Rotation::BestFit)); + $packer->addItem(new TestItem('216', 508, 1143, 127, 18144, Rotation::BestFit)); + $packer->addItem(new TestItem('217', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('218', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('219', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('220', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('221', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('222', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('223', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('224', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('225', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('226', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('227', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('228', 112, 831, 109, 2177, Rotation::BestFit)); + $packer->addItem(new TestItem('229', 305, 737, 394, 16012, Rotation::BestFit)); + $packer->addItem(new TestItem('230', 305, 737, 394, 16012, Rotation::BestFit)); + $packer->addItem(new TestItem('231', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('232', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('233', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('234', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('235', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('236', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('237', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('238', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('239', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('240', 188, 231, 84, 544, Rotation::BestFit)); + $packer->addItem(new TestItem('241', 531, 1049, 112, 22680, Rotation::BestFit)); + $packer->addItem(new TestItem('242', 531, 1049, 112, 22680, Rotation::BestFit)); + $packer->addItem(new TestItem('243', 531, 1049, 112, 22680, Rotation::BestFit)); + $packer->addItem(new TestItem('244', 531, 1049, 112, 22680, Rotation::BestFit)); + $packer->addItem(new TestItem('245', 211, 206, 221, 1270, Rotation::BestFit)); + $packer->addItem(new TestItem('246', 211, 206, 221, 1270, Rotation::BestFit)); + $packer->addItem(new TestItem('247', 211, 206, 221, 1270, Rotation::BestFit)); + $packer->addItem(new TestItem('248', 211, 206, 221, 1270, Rotation::BestFit)); + $packer->addItem(new TestItem('249', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('250', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('251', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('252', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('253', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('254', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('255', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('256', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('257', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('258', 241, 559, 89, 3257, Rotation::BestFit)); + $packer->addItem(new TestItem('259', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('260', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('261', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('262', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('263', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('264', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('265', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('266', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('267', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('268', 191, 279, 61, 1361, Rotation::BestFit)); + $packer->addItem(new TestItem('269', 660, 1022, 330, 29102, Rotation::BestFit)); + $packer->addItem(new TestItem('270', 413, 413, 681, 15876, Rotation::BestFit)); + $packer->addItem(new TestItem('271', 413, 413, 681, 15876, Rotation::BestFit)); + $packer->addItem(new TestItem('272', 413, 413, 681, 15876, Rotation::BestFit)); + $packer->addItem(new TestItem('273', 413, 413, 681, 15876, Rotation::BestFit)); + $packer->addItem(new TestItem('274', 508, 508, 737, 13608, Rotation::BestFit)); + $packer->addItem(new TestItem('275', 508, 508, 737, 13608, Rotation::BestFit)); + $packer->addItem(new TestItem('276', 578, 635, 787, 40007, Rotation::BestFit)); + $packer->addItem(new TestItem('277', 578, 635, 787, 40007, Rotation::BestFit)); + $packer->addItem(new TestItem('278', 203, 203, 25, 753, Rotation::BestFit)); + $packer->addItem(new TestItem('279', 203, 203, 25, 753, Rotation::BestFit)); + $packer->addItem(new TestItem('280', 203, 203, 25, 753, Rotation::BestFit)); + $packer->addItem(new TestItem('281', 203, 203, 25, 753, Rotation::BestFit)); + $packer->addItem(new TestItem('282', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('283', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('284', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('285', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('286', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('287', 203, 203, 25, 481, Rotation::BestFit)); + $packer->addItem(new TestItem('288', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('289', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('290', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('291', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('292', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('293', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('294', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('295', 124, 254, 86, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('296', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('297', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('298', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('299', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('300', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('301', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('302', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('303', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('304', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('305', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('306', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('307', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('308', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('309', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('310', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('311', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('312', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('313', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('314', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('315', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('316', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('317', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('318', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('319', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('320', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('321', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('322', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('323', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('324', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('325', 146, 229, 13, 227, Rotation::BestFit)); + $packer->addItem(new TestItem('326', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('327', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('328', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('329', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('330', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('331', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('332', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('333', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('334', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('335', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('336', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('337', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('338', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('339', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('340', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('341', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('342', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('343', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('344', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('345', 140, 267, 38, 372, Rotation::BestFit)); + $packer->addItem(new TestItem('346', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('347', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('348', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('349', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('350', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('351', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('352', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('353', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('354', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('355', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('356', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('357', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('358', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('359', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('360', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('361', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('362', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('363', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('364', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('365', 89, 909, 89, 3447, Rotation::BestFit)); + $packer->addItem(new TestItem('366', 107, 163, 81, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('367', 107, 163, 81, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('368', 107, 163, 81, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('369', 107, 163, 81, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('370', 107, 163, 81, 635, Rotation::BestFit)); + $packer->addItem(new TestItem('371', 241, 559, 89, 3284, Rotation::BestFit)); + $packer->addItem(new TestItem('372', 318, 445, 114, 3475, Rotation::BestFit)); + $packer->addItem(new TestItem('373', 330, 292, 292, 6350, Rotation::BestFit)); + $packer->addItem(new TestItem('374', 330, 292, 292, 6350, Rotation::BestFit)); + $packer->addItem(new TestItem('375', 330, 292, 292, 6350, Rotation::BestFit)); + $packer->addItem(new TestItem('376', 330, 292, 292, 6350, Rotation::BestFit)); + $packer->addItem(new TestItem('377', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('378', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('379', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('380', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('381', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('382', 324, 445, 318, 3819, Rotation::BestFit)); + $packer->addItem(new TestItem('383', 229, 572, 127, 3411, Rotation::BestFit)); + $packer->addItem(new TestItem('384', 279, 330, 51, 1157, Rotation::BestFit)); + $packer->addItem(new TestItem('385', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('386', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('387', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('388', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('389', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('390', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('391', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('392', 203, 203, 25, 159, Rotation::BestFit)); + $packer->addItem(new TestItem('393', 203, 203, 51, 354, Rotation::BestFit)); + $packer->addItem(new TestItem('394', 178, 178, 25, 91, Rotation::BestFit)); + $packer->addItem(new TestItem('395', 178, 178, 25, 91, Rotation::BestFit)); + $packer->addItem(new TestItem('396', 178, 178, 25, 91, Rotation::BestFit)); + $packer->addItem(new TestItem('397', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('398', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('399', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('400', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('401', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('402', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('403', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('404', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('405', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('406', 95, 127, 25, 73, Rotation::BestFit)); + $packer->addItem(new TestItem('407', 64, 165, 122, 1134, Rotation::BestFit)); + $packer->addItem(new TestItem('408', 64, 165, 122, 1134, Rotation::BestFit)); + $packer->addItem(new TestItem('409', 64, 165, 122, 1134, Rotation::BestFit)); + $packer->addItem(new TestItem('410', 64, 165, 122, 1134, Rotation::BestFit)); + $packer->addItem(new TestItem('411', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('412', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('413', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('414', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('415', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('416', 86, 109, 51, 200, Rotation::BestFit)); + $packer->addItem(new TestItem('417', 305, 521, 108, 2976, Rotation::BestFit)); + $packer->addItem(new TestItem('418', 305, 521, 108, 2976, Rotation::BestFit)); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); diff --git a/tests/ItemListTest.php b/tests/ItemListTest.php index 450e701..1f07b75 100644 --- a/tests/ItemListTest.php +++ b/tests/ItemListTest.php @@ -25,10 +25,10 @@ class ItemListTest extends TestCase */ public function testDimensionalSorting(): void { - $item1 = new TestItem('Small', 20, 20, 2, 100, true); - $item2 = new TestItem('Large', 200, 200, 20, 1000, true); - $item3 = new TestItem('Medium', 100, 100, 10, 500, true); - $item4 = new TestItem('Medium Heavy', 100, 100, 10, 501, true); + $item1 = new TestItem('Small', 20, 20, 2, 100, Rotation::BestFit); + $item2 = new TestItem('Large', 200, 200, 20, 1000, Rotation::BestFit); + $item3 = new TestItem('Medium', 100, 100, 10, 500, Rotation::BestFit); + $item4 = new TestItem('Medium Heavy', 100, 100, 10, 501, Rotation::BestFit); $list = new ItemList(); $list->insert($item1); @@ -46,10 +46,10 @@ public function testDimensionalSorting(): void */ public function testKeepingItemsOfSameTypeTogether(): void { - $item1 = new TestItem('Item A', 20, 20, 2, 100, true); - $item2 = new TestItem('Item B', 20, 20, 2, 100, true); - $item3 = new TestItem('Item A', 20, 20, 2, 100, true); - $item4 = new TestItem('Item B', 20, 20, 2, 100, true); + $item1 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); + $item2 = new TestItem('Item B', 20, 20, 2, 100, Rotation::BestFit); + $item3 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); + $item4 = new TestItem('Item B', 20, 20, 2, 100, Rotation::BestFit); $list = new ItemList(); $list->insert($item1); @@ -69,15 +69,15 @@ public function testCount(): void $itemList = new ItemList(); self::assertCount(0, $itemList); - $item1 = new TestItem('Item A', 20, 20, 2, 100, true); + $item1 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item1); self::assertCount(1, $itemList); - $item2 = new TestItem('Item B', 20, 20, 2, 100, true); + $item2 = new TestItem('Item B', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item2); self::assertCount(2, $itemList); - $item3 = new TestItem('Item C', 20, 20, 2, 100, true); + $item3 = new TestItem('Item C', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item3); self::assertCount(3, $itemList); @@ -91,7 +91,7 @@ public function testCount(): void public function testTop(): void { $itemList = new ItemList(); - $item1 = new TestItem('Item A', 20, 20, 2, 100, true); + $item1 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item1); self::assertEquals($item1, $itemList->top()); @@ -105,13 +105,13 @@ public function testTopN(): void { $itemList = new ItemList(); - $item1 = new TestItem('Item A', 20, 20, 2, 100, true); + $item1 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item1); - $item2 = new TestItem('Item B', 20, 20, 2, 100, true); + $item2 = new TestItem('Item B', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item2); - $item3 = new TestItem('Item C', 20, 20, 2, 100, true); + $item3 = new TestItem('Item C', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item3); $top2 = $itemList->topN(2); @@ -127,7 +127,7 @@ public function testTopN(): void public function testExtract(): void { $itemList = new ItemList(); - $item1 = new TestItem('Item A', 20, 20, 2, 100, true); + $item1 = new TestItem('Item A', 20, 20, 2, 100, Rotation::BestFit); $itemList->insert($item1); self::assertEquals($item1, $itemList->extract()); diff --git a/tests/NoBoxesAvailableExceptionTest.php b/tests/NoBoxesAvailableExceptionTest.php index 9f1378b..d07c53c 100644 --- a/tests/NoBoxesAvailableExceptionTest.php +++ b/tests/NoBoxesAvailableExceptionTest.php @@ -18,7 +18,7 @@ class NoBoxesAvailableExceptionTest extends TestCase */ public function testCanGetItem(): void { - $item = new TestItem('Item 1', 2500, 2500, 20, 2000, true); + $item = new TestItem('Item 1', 2500, 2500, 20, 2000, Rotation::BestFit); $exception = new NoBoxesAvailableException('Just testing...', $item); self::assertEquals($item, $exception->getItem()); diff --git a/tests/OrientatedItemTest.php b/tests/OrientatedItemTest.php index 9da2ea6..4df91eb 100644 --- a/tests/OrientatedItemTest.php +++ b/tests/OrientatedItemTest.php @@ -21,7 +21,7 @@ class OrientatedItemTest extends TestCase { public function testSerialize(): void { - $item = new OrientatedItem(new TestItem('Test', 1, 2, 3, 4, false), 1, 2, 3); + $item = new OrientatedItem(new TestItem('Test', 1, 2, 3, 4, Rotation::BestFit), 1, 2, 3); $serializedDataKeys = json_decode(json_encode($item), true); self::assertArrayHasKey('item', $serializedDataKeys); diff --git a/tests/PackedBoxListTest.php b/tests/PackedBoxListTest.php index 3e43cfd..b69bd2a 100644 --- a/tests/PackedBoxListTest.php +++ b/tests/PackedBoxListTest.php @@ -25,8 +25,8 @@ class PackedBoxListTest extends TestCase public function testInsertAndCount(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 100); - $itemA = new TestItem('Item A', 5, 10, 10, 10, true); - $itemB = new TestItem('Item B', 5, 10, 10, 20, true); + $itemA = new TestItem('Item A', 5, 10, 10, 10, Rotation::BestFit); + $itemB = new TestItem('Item B', 5, 10, 10, 20, Rotation::BestFit); $packedItemA = new PackedItem($itemA, 0, 0, 0, 5, 10, 10); $packedItemB = new PackedItem($itemB, 0, 0, 0, 5, 10, 10); @@ -52,8 +52,8 @@ public function testInsertAndCount(): void public function testInsertFromArrayAndCount(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 100); - $itemA = new TestItem('Item A', 5, 10, 10, 10, true); - $itemB = new TestItem('Item B', 5, 10, 10, 20, true); + $itemA = new TestItem('Item A', 5, 10, 10, 10, Rotation::BestFit); + $itemB = new TestItem('Item B', 5, 10, 10, 20, Rotation::BestFit); $packedItemA = new PackedItem($itemA, 0, 0, 0, 5, 10, 10); $packedItemB = new PackedItem($itemB, 0, 0, 0, 5, 10, 10); @@ -78,8 +78,8 @@ public function testInsertFromArrayAndCount(): void public function testTop(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 100); - $itemA = new TestItem('Item A', 5, 10, 10, 10, true); - $itemB = new TestItem('Item B', 5, 10, 10, 20, true); + $itemA = new TestItem('Item A', 5, 10, 10, 10, Rotation::BestFit); + $itemB = new TestItem('Item B', 5, 10, 10, 20, Rotation::BestFit); $packedItemA = new PackedItem($itemA, 0, 0, 0, 5, 10, 10); $packedItemB = new PackedItem($itemB, 0, 0, 0, 5, 10, 10); @@ -105,7 +105,7 @@ public function testTop(): void public function testVolumeUtilisation(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 10); - $item = new TestItem('Item', 5, 10, 10, 10, true); + $item = new TestItem('Item', 5, 10, 10, 10, Rotation::BestFit); $packedItem = new PackedItem($item, 0, 0, 0, 5, 10, 10); @@ -126,8 +126,8 @@ public function testVolumeUtilisation(): void public function testWeightVariance(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 100); - $itemA = new TestItem('Item A', 5, 10, 10, 10, true); - $itemB = new TestItem('Item B', 5, 10, 10, 20, true); + $itemA = new TestItem('Item A', 5, 10, 10, 10, Rotation::BestFit); + $itemB = new TestItem('Item B', 5, 10, 10, 20, Rotation::BestFit); $packedItemA = new PackedItem($itemA, 0, 0, 0, 5, 10, 10); $packedItemB = new PackedItem($itemB, 0, 0, 0, 5, 10, 10); @@ -153,8 +153,8 @@ public function testWeightVariance(): void public function testMeanWeight(): void { $box = new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 100); - $itemA = new TestItem('Item A', 5, 10, 10, 10, true); - $itemB = new TestItem('Item B', 5, 10, 10, 20, true); + $itemA = new TestItem('Item A', 5, 10, 10, 10, Rotation::BestFit); + $itemB = new TestItem('Item B', 5, 10, 10, 20, Rotation::BestFit); $packedItemA = new PackedItem($itemA, 0, 0, 0, 5, 10, 10); $packedItemB = new PackedItem($itemB, 0, 0, 0, 5, 10, 10); @@ -180,7 +180,7 @@ public function testMeanWeight(): void public function testJsonSerialize(): void { $box = new TestBox('Box', 10, 10, 20, 10, 10, 10, 20, 10); - $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, true), 4, 10, 10); + $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, Rotation::KeepFlat), 4, 10, 10); $boxItems = new PackedItemList(); $boxItems->insert(PackedItem::fromOrientatedItem($item, 0, 0, 0)); diff --git a/tests/PackedBoxTest.php b/tests/PackedBoxTest.php index 5278bf7..db6d69e 100644 --- a/tests/PackedBoxTest.php +++ b/tests/PackedBoxTest.php @@ -26,7 +26,7 @@ class PackedBoxTest extends TestCase public function testGetters(): void { $box = new TestBox('Box', 370, 375, 60, 140, 364, 374, 40, 3000); - $item = new OrientatedItem(new TestItem('Item', 230, 330, 6, 320, true), 230, 330, 6); + $item = new OrientatedItem(new TestItem('Item', 230, 330, 6, 320, Rotation::BestFit), 230, 330, 6); $packedItemList = new PackedItemList(); $packedItemList->insert(PackedItem::fromOrientatedItem($item, 0, 0, 0)); @@ -49,7 +49,7 @@ public function testGetters(): void public function testVolumeUtilisation(): void { $box = new TestBox('Box', 10, 10, 20, 10, 10, 10, 20, 10); - $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, true), 4, 10, 10); + $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, Rotation::BestFit), 4, 10, 10); $boxItems = new PackedItemList(); $boxItems->insert(PackedItem::fromOrientatedItem($item, 0, 0, 0)); @@ -67,7 +67,7 @@ public function testVolumeUtilisation(): void public function testWeightCalcCaching(): void { $box = new TestBox('Box', 10, 10, 20, 10, 10, 10, 20, 10); - $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, true), 4, 10, 10); + $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, Rotation::BestFit), 4, 10, 10); $boxItems = new PackedItemList(); $boxItems->insert(PackedItem::fromOrientatedItem($item, 0, 0, 0)); @@ -91,7 +91,7 @@ public function testWeightCalcCaching(): void public function testJsonSerialize(): void { $box = new TestBox('Box', 10, 10, 20, 10, 10, 10, 20, 10); - $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, true), 4, 10, 10); + $item = new OrientatedItem(new TestItem('Item', 4, 10, 10, 10, Rotation::KeepFlat), 4, 10, 10); $boxItems = new PackedItemList(); $boxItems->insert(PackedItem::fromOrientatedItem($item, 0, 0, 0)); diff --git a/tests/PackedItemTest.php b/tests/PackedItemTest.php index e581cc7..abb0b48 100644 --- a/tests/PackedItemTest.php +++ b/tests/PackedItemTest.php @@ -23,7 +23,7 @@ class PackedItemTest extends TestCase */ public function testVolumeCalculation(): void { - $packedItem = new PackedItem(new TestItem('Item', 1, 1, 0, 0, false), 0, 0, 0, 3, 5, 7); + $packedItem = new PackedItem(new TestItem('Item', 1, 1, 0, 0, Rotation::BestFit), 0, 0, 0, 3, 5, 7); self::assertSame(105, $packedItem->getVolume()); } @@ -32,7 +32,7 @@ public function testVolumeCalculation(): void */ public function testJsonSerialize(): void { - $packedItem = new PackedItem(new TestItem('Item', 1, 2, 3, 10, false), 100, 20, 300, 3, 5, 7); + $packedItem = new PackedItem(new TestItem('Item', 1, 2, 3, 10, Rotation::BestFit), 100, 20, 300, 3, 5, 7); self::assertJsonStringEqualsJsonString('{"x":100,"y":20,"z":300,"width":3,"length":5,"depth":7,"item":{"description":"Item","width":1,"length":2,"depth":3,"keepFlat":false, "weight":10}}', json_encode($packedItem)); } } diff --git a/tests/PackedLayerTest.php b/tests/PackedLayerTest.php index e9877eb..6835327 100644 --- a/tests/PackedLayerTest.php +++ b/tests/PackedLayerTest.php @@ -15,7 +15,7 @@ class PackedLayerTest extends TestCase { public function testGetters(): void { - $packedItem = new PackedItem(new TestItem('Item', 11, 22, 33, 43, false), 4, 5, 6, 33, 11, 22); + $packedItem = new PackedItem(new TestItem('Item', 11, 22, 33, 43, Rotation::BestFit), 4, 5, 6, 33, 11, 22); $packedLayer = new PackedLayer(); $packedLayer->insert($packedItem); self::assertSame(4, $packedLayer->getStartX()); diff --git a/tests/PackerTest.php b/tests/PackerTest.php index e4e1958..d47d504 100644 --- a/tests/PackerTest.php +++ b/tests/PackerTest.php @@ -27,9 +27,9 @@ public function testPackThreeItemsOneDoesntFitInAnyBox(): void $box1 = new TestBox('Le petite box', 300, 300, 10, 10, 296, 296, 8, 1000); $box2 = new TestBox('Le grande box', 3000, 3000, 100, 100, 2960, 2960, 80, 10000); - $item1 = new TestItem('Item 1', 2500, 2500, 20, 2000, true); - $item2 = new TestItem('Item 2', 25000, 2500, 20, 2000, true); - $item3 = new TestItem('Item 3', 2500, 2500, 20, 2000, true); + $item1 = new TestItem('Item 1', 2500, 2500, 20, 2000, Rotation::BestFit); + $item2 = new TestItem('Item 2', 25000, 2500, 20, 2000, Rotation::BestFit); + $item3 = new TestItem('Item 3', 2500, 2500, 20, 2000, Rotation::BestFit); $packer = new Packer(); $packer->addBox($box1); @@ -43,9 +43,9 @@ public function testPackThreeItemsOneDoesntFitInAnyBox(): void public function testPackWithoutBox(): void { $this->expectException(NoBoxesAvailableException::class); - $item1 = new TestItem('Item 1', 2500, 2500, 20, 2000, true); - $item2 = new TestItem('Item 2', 25000, 2500, 20, 2000, true); - $item3 = new TestItem('Item 3', 2500, 2500, 20, 2000, true); + $item1 = new TestItem('Item 1', 2500, 2500, 20, 2000, Rotation::BestFit); + $item2 = new TestItem('Item 2', 25000, 2500, 20, 2000, Rotation::BestFit); + $item3 = new TestItem('Item 3', 2500, 2500, 20, 2000, Rotation::BestFit); $packer = new Packer(); $packer->addItem($item1); @@ -73,7 +73,7 @@ public function testWeightRedistributionActivatesOrNot(): void $packer = new Packer(); $packer->addBox(new TestBox('Box', 1, 1, 3, 0, 1, 1, 3, 3)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 1, false), 4); + $packer->addItem(new TestItem('Item', 1, 1, 1, 1, Rotation::BestFit), 4); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -84,7 +84,7 @@ public function testWeightRedistributionActivatesOrNot(): void // same items, but with redistribution turned off - expecting 3+1 based on pure fit $packer = new Packer(); $packer->addBox(new TestBox('Box', 1, 1, 3, 0, 1, 1, 3, 3)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 1, false), 4); + $packer->addItem(new TestItem('Item', 1, 1, 1, 1, Rotation::BestFit), 4); $packer->setMaxBoxesToBalanceWeight(1); /** @var PackedBox[] $packedBoxes */ @@ -101,7 +101,7 @@ public function testIssue52A(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 100, 50, 50, 0, 100, 50, 50, 5000)); - $packer->addItem(new TestItem('Item', 15, 13, 8, 407, true), 2); + $packer->addItem(new TestItem('Item', 15, 13, 8, 407, Rotation::KeepFlat), 2); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -117,10 +117,10 @@ public function testIssue52B(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 370, 375, 60, 140, 364, 374, 40, 3000)); - $packer->addItem(new TestItem('Item 1', 220, 310, 12, 679, true)); - $packer->addItem(new TestItem('Item 2', 210, 297, 11, 648, true)); - $packer->addItem(new TestItem('Item 3', 210, 297, 5, 187, true)); - $packer->addItem(new TestItem('Item 4', 148, 210, 32, 880, true)); + $packer->addItem(new TestItem('Item 1', 220, 310, 12, 679, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 2', 210, 297, 11, 648, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 3', 210, 297, 5, 187, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 4', 148, 210, 32, 880, Rotation::KeepFlat)); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -136,9 +136,9 @@ public function testIssue52C(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 230, 300, 240, 160, 230, 300, 240, 15000)); - $packer->addItem(new TestItem('Item 1', 210, 297, 4, 213, true)); - $packer->addItem(new TestItem('Item 2', 80, 285, 70, 199, true)); - $packer->addItem(new TestItem('Item 3', 80, 285, 70, 199, true)); + $packer->addItem(new TestItem('Item 1', 210, 297, 4, 213, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 2', 80, 285, 70, 199, Rotation::KeepFlat)); + $packer->addItem(new TestItem('Item 3', 80, 285, 70, 199, Rotation::KeepFlat)); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -157,8 +157,8 @@ public function testIssue117(): void $packer = new Packer(); $packer->addBox(new TestBox('Box A', 36, 8, 3, 0, 36, 8, 3, 2)); $packer->addBox(new TestBox('Box B', 36, 8, 8, 0, 36, 8, 8, 2)); - $packer->addItem(new TestItem('Item 1', 35, 7, 2, 1, false)); - $packer->addItem(new TestItem('Item 2', 6, 5, 1, 1, false)); + $packer->addItem(new TestItem('Item 1', 35, 7, 2, 1, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 6, 5, 1, 1, Rotation::BestFit)); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); self::assertCount(1, $packedBoxes); @@ -174,15 +174,15 @@ public function testIssue38(): void $packer = new Packer(); $packer->addBox(new TestBox('Box1', 2, 2, 2, 0, 2, 2, 2, 1000)); $packer->addBox(new TestBox('Box2', 4, 4, 4, 0, 4, 4, 4, 1000)); - $packer->addItem(new TestItem('Item 1', 1, 1, 1, 100, false)); - $packer->addItem(new TestItem('Item 2', 1, 1, 1, 100, false)); - $packer->addItem(new TestItem('Item 3', 1, 1, 1, 100, false)); - $packer->addItem(new TestItem('Item 4', 1, 1, 1, 100, false)); - $packer->addItem(new TestItem('Item 5', 2, 2, 2, 100, false)); - $packer->addItem(new TestItem('Item 6', 2, 2, 2, 100, false)); - $packer->addItem(new TestItem('Item 7', 2, 2, 2, 100, false)); - $packer->addItem(new TestItem('Item 8', 2, 2, 2, 100, false)); - $packer->addItem(new TestItem('Item 9', 4, 4, 4, 100, false)); + $packer->addItem(new TestItem('Item 1', 1, 1, 1, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 1, 1, 1, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 1, 1, 1, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 1, 1, 1, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 5', 2, 2, 2, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 6', 2, 2, 2, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 7', 2, 2, 2, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 8', 2, 2, 2, 100, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 9', 4, 4, 4, 100, Rotation::BestFit)); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -198,7 +198,7 @@ public function testIssue168(): void $packer = new Packer(); $packer->addBox(new TestBox('Small', 85, 190, 230, 30, 85, 190, 230, 10000)); $packer->addBox(new TestBox('Medium', 220, 160, 160, 50, 220, 160, 160, 10000)); - $packer->addItem(new TestItem('Item', 55, 85, 122, 350, false)); + $packer->addItem(new TestItem('Item', 55, 85, 122, 350, Rotation::BestFit)); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -222,7 +222,7 @@ public function testIssue182A(): void $packer->addBox(new TestBox('Box', 310, 210, 155, 2000, 310, 210, 155, 60000)); $packer->addBox(new TestBox('Box', 210, 160, 105, 2000, 210, 160, 105, 60000)); - $packer->addItem(new TestItem('Item', 150, 100, 100, 1, false), 200); + $packer->addItem(new TestItem('Item', 150, 100, 100, 1, Rotation::BestFit), 200); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -239,7 +239,7 @@ public function testUnlimitedSupplyBox(): void $packer->addBox(new TestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100)); $packer->addBox(new TestBox('Heavy box', 100, 100, 100, 100, 100, 100, 100, 10000)); - $packer->addItem(new TestItem('Item', 100, 100, 100, 75, false), 3); + $packer->addItem(new TestItem('Item', 100, 100, 100, 75, Rotation::BestFit), 3); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -260,7 +260,7 @@ public function testLimitedSupplyBox(): void $packer->addBox(new LimitedSupplyTestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100, 2)); $packer->addBox(new TestBox('Heavy box', 100, 100, 100, 100, 100, 100, 100, 10000)); - $packer->addItem(new TestItem('Item', 100, 100, 100, 75, false), 3); + $packer->addItem(new TestItem('Item', 100, 100, 100, 75, Rotation::BestFit), 3); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -280,7 +280,7 @@ public function testNotEnoughLimitedSupplyBox(): void $this->expectException(NoBoxesAvailableException::class); $packer = new Packer(); $packer->addBox(new LimitedSupplyTestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100, 2)); - $packer->addItem(new TestItem('Item', 100, 100, 100, 75, false), 3); + $packer->addItem(new TestItem('Item', 100, 100, 100, 75, Rotation::BestFit), 3); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -298,29 +298,29 @@ public function testIssue191(): void { $packer = new Packer(); $packer->addBox(new TestBox('B 1', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 400, 150, 200, 10, false), 2); + $packer->addItem(new TestItem('Item 1', 400, 150, 200, 10, Rotation::BestFit), 2); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('B 1', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 400, 200, 150, 10, false), 2); + $packer->addItem(new TestItem('Item 1', 400, 200, 150, 10, Rotation::BestFit), 2); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('B 1', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 200, 400, 150, 10, false), 2); + $packer->addItem(new TestItem('Item 1', 200, 400, 150, 10, Rotation::BestFit), 2); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('B 1', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 400, 150, 200, 10, false), 1); - $packer->addItem(new TestItem('Item 2', 400, 200, 150, 10, false), 1); + $packer->addItem(new TestItem('Item 1', 400, 150, 200, 10, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 2', 400, 200, 150, 10, Rotation::BestFit), 1); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('B 1', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 400, 200, 150, 10, false), 1); - $packer->addItem(new TestItem('Item 2', 400, 150, 200, 10, false), 1); + $packer->addItem(new TestItem('Item 1', 400, 200, 150, 10, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 2', 400, 150, 200, 10, Rotation::BestFit), 1); self::assertCount(1, $packer->pack()); } @@ -331,42 +331,42 @@ public function testIssue192(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, false)); - $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, false)); - $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, false)); - $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, false)); + $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, Rotation::BestFit)); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('Box', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 345, 250, 55, 10, false)); - $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, false)); - $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, false)); - $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, false)); + $packer->addItem(new TestItem('Item 1', 345, 250, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, Rotation::BestFit)); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('Box', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, false)); - $packer->addItem(new TestItem('Item 2', 225, 180, 50, 10, false)); - $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, false)); - $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, false)); + $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 225, 180, 50, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, Rotation::BestFit)); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('Box', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 360, 250, 55, 10, false)); - $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, false)); - $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, false)); - $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, false)); + $packer->addItem(new TestItem('Item 1', 360, 250, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 225, 180, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, Rotation::BestFit)); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('Box', 400, 300, 200, 10, 400, 300, 200, 1000)); - $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, false)); - $packer->addItem(new TestItem('Item 2', 225, 180, 60, 10, false)); - $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, false)); - $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, false)); + $packer->addItem(new TestItem('Item 1', 350, 250, 55, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 2', 225, 180, 60, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 3', 265, 195, 30, 10, Rotation::BestFit)); + $packer->addItem(new TestItem('Item 4', 260, 190, 30, 10, Rotation::BestFit)); self::assertCount(1, $packer->pack()); } @@ -377,17 +377,17 @@ public function testIssue196(): void { $packer = new Packer(); $packer->addBox(new TestBox('[Box]', 360, 620, 370, 1, 360, 620, 370, 29000)); - $packer->addItem(new TestItem('C5 240 x 165 mm, 1000 vnt.', 259, 375, 99, 5440, false), 4); - $packer->addItem(new TestItem('170x230+30mm', 200, 300, 10, 194, false), 12); - $packer->addItem(new TestItem('50 mm x 66 m, ruda', 100, 100, 50, 165, false), 12); + $packer->addItem(new TestItem('C5 240 x 165 mm, 1000 vnt.', 259, 375, 99, 5440, Rotation::BestFit), 4); + $packer->addItem(new TestItem('170x230+30mm', 200, 300, 10, 194, Rotation::BestFit), 12); + $packer->addItem(new TestItem('50 mm x 66 m, ruda', 100, 100, 50, 165, Rotation::BestFit), 12); self::assertCount(1, $packer->pack()); $packer = new Packer(); $packer->addBox(new TestBox('[Box]', 360, 620, 370, 1, 360, 620, 370, 29000)); - $packer->addItem(new TestItem('C5 240 x 165 mm, 1000 vnt.', 259, 375, 99, 5440, false), 4); - $packer->addItem(new TestItem('170x230+30mm', 200, 300, 10, 194, false), 12); - $packer->addItem(new TestItem('50 mm x 66 m, ruda', 100, 100, 50, 165, false), 12); - $packer->addItem(new TestItem('175 x 255, B5', 130, 210, 30, 391, false), 2); + $packer->addItem(new TestItem('C5 240 x 165 mm, 1000 vnt.', 259, 375, 99, 5440, Rotation::BestFit), 4); + $packer->addItem(new TestItem('170x230+30mm', 200, 300, 10, 194, Rotation::BestFit), 12); + $packer->addItem(new TestItem('50 mm x 66 m, ruda', 100, 100, 50, 165, Rotation::BestFit), 12); + $packer->addItem(new TestItem('175 x 255, B5', 130, 210, 30, 391, Rotation::BestFit), 2); self::assertCount(1, $packer->pack()); } @@ -534,16 +534,16 @@ public function testNumberOfBoxesTorture(): void $packer->addBox(new TestBox('A2 - LQ 10x8x6', 800, 1000, 600, 450, 800, 1000, 600, 60000)); $packer->addBox(new TestBox('A1 - LQ 8x5x3.5', 600, 800, 400, 200, 600, 800, 400, 60000)); - $packer->addItem(new TestItem('Item 1', 725, 1500, 650, 21403, false), 1); - $packer->addItem(new TestItem('Item 2', 562, 731, 568, 6994, false), 6); - $packer->addItem(new TestItem('Item 3', 612, 1475, 650, 25008, false), 3); - $packer->addItem(new TestItem('Item 4', 600, 1225, 650, 13210, false), 2); - $packer->addItem(new TestItem('Item 5', 975, 1200, 500, 18734, false), 4); - $packer->addItem(new TestItem('Item 6', 550, 1495, 550, 14160, false), 2); - $packer->addItem(new TestItem('Item 7', 275, 475, 175, 944, false), 1); - $packer->addItem(new TestItem('Item 8', 625, 1000, 650, 14021, false), 1); - $packer->addItem(new TestItem('Item 9', 612, 650, 637, 5661, false), 1); - $packer->addItem(new TestItem('Item 10', 287, 612, 125, 514, false), 2); + $packer->addItem(new TestItem('Item 1', 725, 1500, 650, 21403, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 2', 562, 731, 568, 6994, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Item 3', 612, 1475, 650, 25008, Rotation::BestFit), 3); + $packer->addItem(new TestItem('Item 4', 600, 1225, 650, 13210, Rotation::BestFit), 2); + $packer->addItem(new TestItem('Item 5', 975, 1200, 500, 18734, Rotation::BestFit), 4); + $packer->addItem(new TestItem('Item 6', 550, 1495, 550, 14160, Rotation::BestFit), 2); + $packer->addItem(new TestItem('Item 7', 275, 475, 175, 944, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 8', 625, 1000, 650, 14021, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 9', 612, 650, 637, 5661, Rotation::BestFit), 1); + $packer->addItem(new TestItem('Item 10', 287, 612, 125, 514, Rotation::BestFit), 2); $packedBoxList = $packer->pack(); self::assertCount(6, $packedBoxList); @@ -554,8 +554,8 @@ public function testIssue206(): void ConstrainedPlacementByCountTestItem::$limit = 2; $packer = new Packer(); $packer->addBox(new TestBox('Box', 6, 10, 6, 0, 6, 10, 5, PHP_INT_MAX)); - $packer->addItem(new ConstrainedPlacementByCountTestItem('ConstrainedItem', 1, 1, 1, 1, false), 3); - $packer->addItem(new TestItem('RegularItem', 2, 4, 1, 2, false), 5); + $packer->addItem(new ConstrainedPlacementByCountTestItem('ConstrainedItem', 1, 1, 1, 1, Rotation::BestFit), 3); + $packer->addItem(new TestItem('RegularItem', 2, 4, 1, 2, Rotation::BestFit), 5); $packedBoxes = $packer->pack(); self::assertCount(2, $packedBoxes); @@ -568,11 +568,11 @@ public function testIssue231(): void $packer->addBox(new TestBox('Box 2.5-1', 30, 20, 20, 2, 30, 20, 20, 1000)); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 20, 20, 2, 0, false), 4); - $itemList->insert(new TestItem('Item 2', 8, 3, 2, 0, false), 5); - $itemList->insert(new TestItem('Item 3', 10, 10, 10, 0, false), 4); - $itemList->insert(new TestItem('Item 4', 12, 12, 10, 0, false), 2); - $itemList->insert(new TestItem('Item 5', 6, 4, 2, 0, false), 2); + $itemList->insert(new TestItem('Item 1', 20, 20, 2, 0, Rotation::BestFit), 4); + $itemList->insert(new TestItem('Item 2', 8, 3, 2, 0, Rotation::BestFit), 5); + $itemList->insert(new TestItem('Item 3', 10, 10, 10, 0, Rotation::BestFit), 4); + $itemList->insert(new TestItem('Item 4', 12, 12, 10, 0, Rotation::BestFit), 2); + $itemList->insert(new TestItem('Item 5', 6, 4, 2, 0, Rotation::BestFit), 2); $packer->setItems($itemList); $packedBoxes = $packer->pack(); @@ -583,16 +583,16 @@ public function testIssue244(): void { $packer = new Packer(); $packer->addBox(new TestBox('11', 4400, 1400, 3400, 0, 4600, 1600, 3600, 30000)); - $packer->addItem(new TestItem('Shakes', 900, 95, 1500, 34, false), 6); - $packer->addItem(new TestItem('Bars', 356, 170, 1056, 56, false), 6); - $packer->addItem(new TestItem('Noodles', 1250, 140, 1650, 45, false), 6); - $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, false), 6); - $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, false), 6); - $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, false), 3); - $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, false), 4); - $packer->addItem(new TestItem('Soups', 1000, 60, 1400, 35, false), 2); - $packer->addItem(new TestItem('Cereals', 850, 60, 1400, 40, false), 3); - $packer->addItem(new TestItem('Snacks', 1600, 300, 2000, 30, false), 1); + $packer->addItem(new TestItem('Shakes', 900, 95, 1500, 34, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Bars', 356, 170, 1056, 56, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Noodles', 1250, 140, 1650, 45, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, Rotation::BestFit), 6); + $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, Rotation::BestFit), 3); + $packer->addItem(new TestItem('Ready Meals', 1250, 285, 1600, 270, Rotation::BestFit), 4); + $packer->addItem(new TestItem('Soups', 1000, 60, 1400, 35, Rotation::BestFit), 2); + $packer->addItem(new TestItem('Cereals', 850, 60, 1400, 40, Rotation::BestFit), 3); + $packer->addItem(new TestItem('Snacks', 1600, 300, 2000, 30, Rotation::BestFit), 1); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -604,17 +604,17 @@ public function testIssue248(): void $packer = new Packer(); $packer->addBox(new LimitedSupplyTestBox('FULL_SLAB', 3150, 1520, 1, 1, 3150, 1520, 1, 10000000, 1000)); - $items[] = new TestItem('Item 1', 1900, 50, 1, 1, false); - $items[] = new TestItem('Item 2', 700, 50, 1, 1, false); - $items[] = new TestItem('Item 3', 600, 50, 1, 1, false); - $items[] = new TestItem('Item 4', 1300, 50, 1, 1, false); - $items[] = new TestItem('Item 5', 1200, 200, 1, 1, false); - $items[] = new TestItem('Item 6', 2500, 50, 1, 1, false); - $items[] = new TestItem('Item 7', 900, 600, 1, 1, false); - $items[] = new TestItem('Item 8', 1900, 600, 1, 1, false); - $items[] = new TestItem('Item 9', 1300, 600, 1, 1, false); - $items[] = new TestItem('Item 10', 1900, 600, 1, 1, false); - $items[] = new TestItem('Item 11', 1500, 600, 1, 1, false); + $items[] = new TestItem('Item 1', 1900, 50, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 2', 700, 50, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 3', 600, 50, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 4', 1300, 50, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 5', 1200, 200, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 6', 2500, 50, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 7', 900, 600, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 8', 1900, 600, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 9', 1300, 600, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 10', 1900, 600, 1, 1, Rotation::BestFit); + $items[] = new TestItem('Item 11', 1500, 600, 1, 1, Rotation::BestFit); $packer->setItems(ItemList::fromArray($items, true)); $packedBoxes = $packer->pack(); @@ -629,7 +629,7 @@ public function testCustomPackedBoxSorterIsUsed(): void $packer->setPackedBoxSorter(new PackedBoxByReferenceSorter()); $packer->addBox(new TestBox('Box #1', 1, 1, 1, 0, 1, 1, 1, PHP_INT_MAX)); $packer->addBox(new TestBox('Box #2', 1, 1, 1, 0, 1, 1, 1, PHP_INT_MAX)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 1, false), 2); + $packer->addItem(new TestItem('Item', 1, 1, 1, 1, Rotation::BestFit), 2); $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(2, $packedBoxes); @@ -640,7 +640,7 @@ public function testCustomPackedBoxSorterIsUsed(): void $packer->setPackedBoxSorter(new PackedBoxByReferenceSorter()); $packer->addBox(new TestBox('Box #1', 1, 1, 1, 0, 1, 1, 1, PHP_INT_MAX)); $packer->addBox(new TestBox('Box #2', 1, 1, 1, 0, 1, 1, 1, PHP_INT_MAX)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 1, false), 2); + $packer->addItem(new TestItem('Item', 1, 1, 1, 1, Rotation::BestFit), 2); $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(2, $packedBoxes); @@ -652,8 +652,8 @@ public function testNotStrictItemOrdering(): void $packer = new Packer(); $packer->setMaxBoxesToBalanceWeight(0); $packer->addBox(new TestBox('Box', 3, 3, 3, 0, 3, 3, 3, PHP_INT_MAX)); - $packer->addItem(new TestItem('Item #1', 1, 1, 1, 1, false), 18); - $packer->addItem(new TestItem('Item #2', 2, 2, 2, 2, false), 2); + $packer->addItem(new TestItem('Item #1', 1, 1, 1, 1, Rotation::BestFit), 18); + $packer->addItem(new TestItem('Item #2', 2, 2, 2, 2, Rotation::BestFit), 2); $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(2, $packedBoxes); @@ -688,8 +688,8 @@ public function testStrictItemOrdering(): void $packer = new Packer(); $packer->beStrictAboutItemOrdering(true); $packer->addBox(new TestBox('Box', 3, 3, 3, 0, 3, 3, 3, PHP_INT_MAX)); - $packer->addItem(new TestItem('Item #1', 1, 1, 1, 1, false), 18); - $packer->addItem(new TestItem('Item #2', 2, 2, 2, 2, false), 2); + $packer->addItem(new TestItem('Item #1', 1, 1, 1, 1, Rotation::BestFit), 18); + $packer->addItem(new TestItem('Item #2', 2, 2, 2, 2, Rotation::BestFit), 2); $packedBoxes = iterator_to_array($packer->pack()); self::assertCount(3, $packedBoxes); diff --git a/tests/Test/TestItem.php b/tests/Test/TestItem.php index f684f96..e2d6680 100644 --- a/tests/Test/TestItem.php +++ b/tests/Test/TestItem.php @@ -68,14 +68,14 @@ public function __construct( int $length, int $depth, int $weight, - bool $keepFlat + int $allowedRotation ) { $this->description = $description; $this->width = $width; $this->length = $length; $this->depth = $depth; $this->weight = $weight; - $this->keepFlat = $keepFlat; + $this->keepFlat = $allowedRotation <= 2; $this->a = new stdClass(); $this->b = new stdClass(); diff --git a/tests/VolumePackerTest.php b/tests/VolumePackerTest.php index 9b4b885..f79b701 100644 --- a/tests/VolumePackerTest.php +++ b/tests/VolumePackerTest.php @@ -26,11 +26,11 @@ public function testUsedDimensionsCalculatedCorrectly(): void { $box = new TestBox('Bundle', 75, 15, 15, 0, 75, 15, 15, 30); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 14, 12, 2, 2, true)); - $itemList->insert(new TestItem('Item 2', 14, 12, 2, 2, true)); - $itemList->insert(new TestItem('Item 3', 14, 12, 2, 2, true)); - $itemList->insert(new TestItem('Item 4', 14, 12, 2, 2, true)); - $itemList->insert(new TestItem('Item 5', 14, 12, 2, 2, true)); + $itemList->insert(new TestItem('Item 1', 14, 12, 2, 2, Rotation::KeepFlat)); + $itemList->insert(new TestItem('Item 2', 14, 12, 2, 2, Rotation::KeepFlat)); + $itemList->insert(new TestItem('Item 3', 14, 12, 2, 2, Rotation::KeepFlat)); + $itemList->insert(new TestItem('Item 4', 14, 12, 2, 2, Rotation::KeepFlat)); + $itemList->insert(new TestItem('Item 5', 14, 12, 2, 2, Rotation::KeepFlat)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -48,7 +48,7 @@ public function testLegacyConstraints(): void // first a regular item $packer = new Packer(); $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new TestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -58,7 +58,7 @@ public function testLegacyConstraints(): void $packer = new Packer(); $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); - $packer->addItem(new ConstrainedTestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new ConstrainedTestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(4, $packedBoxes); @@ -72,7 +72,7 @@ public function testNewConstraintMatchesLegacy(): void // first a regular item $packer = new Packer(); $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new TestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -82,7 +82,7 @@ public function testNewConstraintMatchesLegacy(): void $packer = new Packer(); $packer->addBox(new TestBox('Box', 10, 10, 10, 0, 10, 10, 10, 0)); - $packer->addItem(new ConstrainedPlacementByCountTestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new ConstrainedPlacementByCountTestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(4, $packedBoxes); @@ -96,7 +96,7 @@ public function testNewConstraint(): void // first a regular item $packer = new Packer(); $packer->addBox(new TestBox('Box', 4, 1, 2, 0, 4, 1, 2, 0)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new TestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -105,7 +105,7 @@ public function testNewConstraint(): void $packer = new Packer(); $packer->addBox(new TestBox('Box', 4, 1, 2, 0, 4, 1, 2, 0)); - $packer->addItem(new ConstrainedPlacementNoStackingTestItem('Item', 1, 1, 1, 0, false), 8); + $packer->addItem(new ConstrainedPlacementNoStackingTestItem('Item', 1, 1, 1, 0, Rotation::BestFit), 8); $packedBoxes = $packer->pack(); self::assertCount(2, $packedBoxes); @@ -118,10 +118,10 @@ public function testIssue14(): void { $packer = new Packer(); $packer->addBox(new TestBox('29x1x23Box', 29, 1, 23, 0, 29, 1, 23, 100)); - $packer->addItem(new TestItem('13x1x10Item', 13, 1, 10, 1, true)); - $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, true)); - $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, true)); - $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, true)); + $packer->addItem(new TestItem('13x1x10Item', 13, 1, 10, 1, Rotation::KeepFlat)); + $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, Rotation::KeepFlat)); + $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, Rotation::KeepFlat)); + $packer->addItem(new TestItem('9x1x6Item', 9, 1, 6, 1, Rotation::KeepFlat)); $packedBoxes = $packer->pack(); self::assertCount(1, $packedBoxes); @@ -133,7 +133,7 @@ public function testIssue14(): void public function testIssue47A(): void { $box = new TestBox('165x225x25Box', 165, 225, 25, 0, 165, 225, 25, 100); - $item = new TestItem('20x69x20Item', 20, 69, 20, 0, true); + $item = new TestItem('20x69x20Item', 20, 69, 20, 0, Rotation::KeepFlat); $itemList = new ItemList(); for ($i = 0; $i < 23; ++$i) { $itemList->insert($item); @@ -151,7 +151,7 @@ public function testIssue47A(): void public function testIssue47B(): void { $box = new TestBox('165x225x25Box', 165, 225, 25, 0, 165, 225, 25, 100); - $item = new TestItem('20x69x20Item', 69, 20, 20, 0, true); + $item = new TestItem('20x69x20Item', 69, 20, 20, 0, Rotation::KeepFlat); $itemList = new ItemList(); for ($i = 0; $i < 23; ++$i) { $itemList->insert($item); @@ -170,7 +170,7 @@ public function testIssue47B(): void public function testAllowsRotatedBoxesInNewRow(): void { $box = new TestBox('40x70x30InternalBox', 40, 70, 30, 0, 40, 70, 30, 1000); - $item = new TestItem('30x10x30item', 30, 10, 30, 0, true); + $item = new TestItem('30x10x30item', 30, 10, 30, 0, Rotation::KeepFlat); $itemList = new ItemList(); for ($i = 0; $i < 9; ++$i) { $itemList->insert($item); @@ -189,9 +189,9 @@ public function testUnpackedSpaceInsideLayersIsFilled(): void { $box = new TestBox('Box', 4, 14, 11, 0, 4, 14, 11, 100); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 8, 8, 2, 1, false)); - $itemList->insert(new TestItem('Item 2', 4, 4, 4, 1, false)); - $itemList->insert(new TestItem('Item 3', 4, 4, 4, 1, false)); + $itemList->insert(new TestItem('Item 1', 8, 8, 2, 1, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 2', 4, 4, 4, 1, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 3', 4, 4, 4, 1, Rotation::BestFit)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -200,9 +200,9 @@ public function testUnpackedSpaceInsideLayersIsFilled(): void $box = new TestBox('Box', 14, 11, 4, 0, 14, 11, 4, 100); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 8, 8, 2, 1, false)); - $itemList->insert(new TestItem('Item 2', 4, 4, 4, 1, false)); - $itemList->insert(new TestItem('Item 3', 4, 4, 4, 1, false)); + $itemList->insert(new TestItem('Item 1', 8, 8, 2, 1, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 2', 4, 4, 4, 1, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 3', 4, 4, 4, 1, Rotation::BestFit)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -216,7 +216,7 @@ public function testUnpackedSpaceInsideLayersIsFilled(): void public function testIssue148(): void { $box = new TestBox('Box', 27, 37, 22, 100, 25, 36, 21, 15000); - $item = new TestItem('Item', 6, 12, 20, 100, false); + $item = new TestItem('Item', 6, 12, 20, 100, Rotation::BestFit); $itemList = new ItemList(); for ($i = 0; $i < 12; ++$i) { $itemList->insert($item); @@ -228,7 +228,7 @@ public function testIssue148(): void self::assertCount(12, $packedBox->getItems()); $box = new TestBox('Box', 27, 37, 22, 100, 25, 36, 21, 15000); - $item = new TestItem('Item', 6, 12, 20, 100, true); + $item = new TestItem('Item', 6, 12, 20, 100, Rotation::KeepFlat); $itemList = new ItemList(); for ($i = 0; $i < 12; ++$i) { $itemList->insert($item); @@ -247,7 +247,7 @@ public function testIssue147A(): void { $box = new TestBox('Box', 250, 1360, 260, 0, 250, 1360, 260, 30000); $itemList = new ItemList(); - $item = new TestItem('Item', 90, 200, 200, 150, true); + $item = new TestItem('Item', 90, 200, 200, 150, Rotation::KeepFlat); for ($i = 0; $i < 14; ++$i) { $itemList->insert($item); @@ -271,8 +271,8 @@ public function testIssue147B(): void { $box = new TestBox('Box', 400, 200, 500, 0, 400, 200, 500, 10000); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 447, 62, 303, 965, false)); - $itemList->insert(new TestItem('Item 2', 495, 70, 308, 1018, false)); + $itemList->insert(new TestItem('Item 1', 447, 62, 303, 965, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 2', 495, 70, 308, 1018, Rotation::BestFit)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -281,8 +281,8 @@ public function testIssue147B(): void $box = new TestBox('Box', 400, 200, 500, 0, 400, 200, 500, 10000); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 447, 303, 62, 965, false)); - $itemList->insert(new TestItem('Item 2', 495, 308, 70, 1018, false)); + $itemList->insert(new TestItem('Item 1', 447, 303, 62, 965, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 2', 495, 308, 70, 1018, Rotation::BestFit)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -296,8 +296,8 @@ public function testIssue147B(): void public function testIssue161(): void { $box = new TestBox('Box', 240, 150, 180, 0, 240, 150, 180, 10000); - $item1 = new TestItem('Item 1', 70, 70, 95, 0, false); - $item2 = new TestItem('Item 2', 95, 75, 95, 0, true); + $item1 = new TestItem('Item 1', 70, 70, 95, 0, Rotation::BestFit); + $item2 = new TestItem('Item 2', 95, 75, 95, 0, Rotation::KeepFlat); $itemList = new ItemList(); for ($i = 0; $i < 6; ++$i) { @@ -330,16 +330,16 @@ public function testIssue164(): void $box = new TestBox('Box', 820, 820, 830, 0, 820, 820, 830, 10000); $itemList = new ItemList(); - $itemList->insert(new TestItem('Item 1', 110, 110, 50, 100, false)); - $itemList->insert(new TestItem('Item 2', 100, 300, 30, 100, false)); - $itemList->insert(new TestItem('Item 3', 100, 150, 50, 100, false)); - $itemList->insert(new TestItem('Item 4', 100, 200, 80, 110, false)); - $itemList->insert(new TestItem('Item 5', 80, 150, 80, 50, false)); - $itemList->insert(new TestItem('Item 6', 80, 150, 80, 50, false)); - $itemList->insert(new TestItem('Item 7', 80, 150, 80, 50, false)); - $itemList->insert(new TestItem('Item 8', 270, 70, 60, 350, false)); - $itemList->insert(new TestItem('Item 9', 150, 150, 80, 180, false)); - $itemList->insert(new TestItem('Item 10', 80, 150, 80, 50, false)); + $itemList->insert(new TestItem('Item 1', 110, 110, 50, 100, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 2', 100, 300, 30, 100, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 3', 100, 150, 50, 100, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 4', 100, 200, 80, 110, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 5', 80, 150, 80, 50, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 6', 80, 150, 80, 50, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 7', 80, 150, 80, 50, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 8', 270, 70, 60, 350, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 9', 150, 150, 80, 180, Rotation::BestFit)); + $itemList->insert(new TestItem('Item 10', 80, 150, 80, 50, Rotation::BestFit)); $packer = new VolumePacker($box, $itemList); $packedBox = $packer->pack(); @@ -354,13 +354,13 @@ public function testIssue174(): void $box = new TestBox('Box', 0, 0, 0, 10, 5000, 5000, 5000, 10000); $items = new ItemList(); - $items->insert(new TestItem('Item 0', 1000, 1650, 850, 500, false)); - $items->insert(new TestItem('Item 1', 960, 1640, 800, 500, false)); - $items->insert(new TestItem('Item 2', 950, 1650, 800, 500, false)); - $items->insert(new TestItem('Item 3', 1000, 2050, 800, 500, false)); - $items->insert(new TestItem('Item 4', 1000, 2100, 850, 500, false)); - $items->insert(new TestItem('Item 5', 950, 2050, 800, 500, false)); - $items->insert(new TestItem('Item 6', 940, 970, 800, 500, false)); + $items->insert(new TestItem('Item 0', 1000, 1650, 850, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 1', 960, 1640, 800, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 2', 950, 1650, 800, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 3', 1000, 2050, 800, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 4', 1000, 2100, 850, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 5', 950, 2050, 800, 500, Rotation::BestFit)); + $items->insert(new TestItem('Item 6', 940, 970, 800, 500, Rotation::BestFit)); $volumePacker = new VolumePacker($box, $items); $packedBox = $volumePacker->pack(); @@ -375,7 +375,7 @@ public function testIssue174(): void public function testIssue172A(): void { $box = new TestBox('Box', 800, 1200, 1300, 0, 800, 1200, 1300, 500000); - $items = array_fill(0, 8928, new TestItem('Larger', 150, 110, 5, 56, false)); + $items = array_fill(0, 8928, new TestItem('Larger', 150, 110, 5, 56, Rotation::BestFit)); $volumePacker = new VolumePacker($box, ItemList::fromArray($items, true)); $packedBox = $volumePacker->pack(); @@ -391,13 +391,13 @@ public function testIssue172B(): void $box = new TestBox('Box', 18, 18, 24, 0, 18, 18, 24, 10000); $items = new ItemList(); - $item = new TestItem('Larger', 10, 5, 8, 0, false); + $item = new TestItem('Larger', 10, 5, 8, 0, Rotation::BestFit); for ($i = 0; $i < 10; ++$i) { $items->insert($item); } for ($i = 0; $i < 5; ++$i) { - $item = new TestItem('Smaller', 5, 5, 3, 0, false); + $item = new TestItem('Smaller', 5, 5, 3, 0, Rotation::BestFit); $items->insert($item); } @@ -415,7 +415,7 @@ public function testPassedInItemListKeepsItems(): void $box = new TestBox('Box', 18, 18, 24, 0, 18, 18, 24, 10000); $items = new ItemList(); - $item = new TestItem('Item', 10, 5, 8, 0, false); + $item = new TestItem('Item', 10, 5, 8, 0, Rotation::BestFit); for ($i = 0; $i < 10; ++$i) { $items->insert($item); } @@ -433,7 +433,7 @@ public function testOrientationDecisions(): void { $box = new TestBox('Box', 25, 25, 20, 0, 25, 25, 20, 1000); $items = new ItemList(); - $item = new TestItem('Item', 5, 6, 20, 20, true); + $item = new TestItem('Item', 5, 6, 20, 20, Rotation::KeepFlat); for ($i = 0; $i < 20; ++$i) { $items->insert($item); } @@ -445,7 +445,7 @@ public function testOrientationDecisions(): void $box = new TestBox('Box', 25, 25, 20, 0, 25, 25, 20, 1000); $items = new ItemList(); - $item = new TestItem('Item', 20, 5, 6, 20, false); + $item = new TestItem('Item', 20, 5, 6, 20, Rotation::BestFit); for ($i = 0; $i < 20; ++$i) { $items->insert($item); } @@ -463,7 +463,7 @@ public function testIssue175(): void { $box = new TestBox('Box', 40, 40, 40, 0, 40, 40, 40, 1000); $items = new ItemList(); - $item = new TestItem('Item', 35, 35, 5, 20, false); + $item = new TestItem('Item', 35, 35, 5, 20, Rotation::BestFit); for ($i = 0; $i < 10; ++$i) { $items->insert($item); } @@ -481,8 +481,8 @@ public function testIssue221(): void { $box = new TestBox('Box', 200, 200, 200, 0, 200, 200, 200, 1000); $items = new ItemList(); - $items->insert(new TestItem('Item 1', 150, 150, 150, 1, false)); - $item2 = new TestItem('Item 2', 50, 50, 50, 1, false); + $items->insert(new TestItem('Item 1', 150, 150, 150, 1, Rotation::BestFit)); + $item2 = new TestItem('Item 2', 50, 50, 50, 1, Rotation::BestFit); for ($i = 0; $i < 37; ++$i) { $items->insert($item2); } diff --git a/tests/WeightRedistributorTest.php b/tests/WeightRedistributorTest.php index e97f3a0..b9e9eb1 100644 --- a/tests/WeightRedistributorTest.php +++ b/tests/WeightRedistributorTest.php @@ -27,7 +27,7 @@ public function testWeightRedistributionActivatesOrNot(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 1, 1, 3, 0, 1, 1, 3, 3)); - $packer->addItem(new TestItem('Item', 1, 1, 1, 1, false), 4); + $packer->addItem(new TestItem('Item', 1, 1, 1, 1, Rotation::BestFit), 4); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -43,7 +43,7 @@ public function testIssue166(): void { $packer = new Packer(); $packer->addBox(new TestBox('Pallet', 42, 42, 42, 0, 42, 42, 42, 1120)); - $packer->addItem(new ConstrainedPlacementNoStackingTestItem('Item', 8, 7, 7, 36, false), 84); + $packer->addItem(new ConstrainedPlacementNoStackingTestItem('Item', 8, 7, 7, 36, Rotation::BestFit), 84); /** @var PackedBox[] $packedBoxes */ $packedBoxes = iterator_to_array($packer->pack(), false); @@ -58,8 +58,8 @@ public function testWeightDistributionWorks(): void { $packer = new Packer(); $packer->addBox(new TestBox('Box', 370, 375, 60, 140, 364, 374, 40, 3000)); - $packer->addItem(new TestItem('Item 1', 230, 330, 6, 320, true), 2); - $packer->addItem(new TestItem('Item 2', 210, 297, 8, 300, true), 4); + $packer->addItem(new TestItem('Item 1', 230, 330, 6, 320, Rotation::KeepFlat), 2); + $packer->addItem(new TestItem('Item 2', 210, 297, 8, 300, Rotation::KeepFlat), 4); $packedBoxes = $packer->pack();