def testBestContactPointRotated(self):
     """
     Item too Big
     Rotation = False
     """
     M = maximal_rectangles.MaximalRectangle(8, 4, rotation=True)
     I = item.Item(4, 8)
     M.insert(I, heuristic='contact_point')
     with self.subTest():
         self.assertEqual(M.freerects, [])
     with self.subTest():
         self.assertEqual(I.rotated, True)
 def testBestBottomLeftRotated(self):
     """
     Item too Big
     Rotation = False
     """
     M = maximal_rectangles.MaximalRectangle(8,
                                             4,
                                             rotation=True,
                                             heuristic='bottom_left')
     I = item.Item(4, 8)
     M.insert(I)
     with self.subTest():
         self.assertEqual(M.freerects, [])
     with self.subTest():
         self.assertEqual(I.rotated, True)
Example #3
0
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8, 4, rotation=True)
Example #4
0
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8, 4)
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8,
                                                  4,
                                                  rotation=True,
                                                  heuristic='best_area')
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8,
                                                  4,
                                                  heuristic='contact_point')
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8,
                                                  4,
                                                  heuristic='bottom_left')
 def setUp(self):
     self.M = maximal_rectangles.MaximalRectangle(8,
                                                  4,
                                                  heuristic='best_longside')