From f65949cd74cbc6d93d8feda68a7e38389e57a6e7 Mon Sep 17 00:00:00 2001 From: Andrew Toporivskiy Date: Fri, 20 Sep 2024 17:26:31 +0300 Subject: [PATCH] add methods for get Report Properties Add methods for get next report properties: 1) get fitted volume 2) get unfitted volume 3) get total bin space used, % --- py3dbp/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/py3dbp/main.py b/py3dbp/main.py index 9083a69..03075d6 100644 --- a/py3dbp/main.py +++ b/py3dbp/main.py @@ -90,6 +90,15 @@ def get_total_weight(self): return set_to_decimal(total_weight, self.number_of_decimals) + def get_fitted_volume(self): + return sum(item.get_volume() for item in self.items) + + def get_unfitted_volume(self): + return sum(unfitted_item.get_volume() for unfitted_item in self.unfitted_items) + + def get_total_bin_space_used(self): + return set_to_decimal(self.get_fitted_volume()/self.get_volume(), self.number_of_decimals) + def put_item(self, item, pivot): fit = False valid_item_position = item.position