diff --git a/py3dbp/main.py b/py3dbp/main.py index 9083a69..7ec9bd7 100644 --- a/py3dbp/main.py +++ b/py3dbp/main.py @@ -6,7 +6,7 @@ class Item: - def __init__(self, name, width, height, depth, weight): + def __init__(self, name, width, height, depth, weight, overturn=True): self.name = name self.width = width self.height = height @@ -15,6 +15,7 @@ def __init__(self, name, width, height, depth, weight): self.rotation_type = 0 self.position = START_POSITION self.number_of_decimals = DEFAULT_NUMBER_OF_DECIMALS + self.overturn = overturn def format_numbers(self, number_of_decimals): self.width = set_to_decimal(self.width, number_of_decimals) @@ -97,6 +98,10 @@ def put_item(self, item, pivot): for i in range(0, len(RotationType.ALL)): item.rotation_type = i + + if not item.overturn and i not in [RotationType.RT_WHD, RotationType.RT_DHW]: + continue + dimension = item.get_dimension() if ( self.width < pivot[0] + dimension[0] or