# Path: lasercut/boxproperties.py
# class BoxProperties(ObjectProperties):
# 
#     _allowed = ('length', 'width', 'height', 'thickness', 'outside_measure',
#                 'length_width_priority', 'length_outside', 'width_outside',
#                 'bottom_position', 'bottom_shift', 'inner_radius',
#                 'length_shift', 'width_shift')
# 
#     LENGTH_PRIORTY = "Length"
#     WIDTH_PRIORTY = "Width"
#     CROSS_PRIORTY = "No - Cross"
#     ROUND_PRIORTY = "No - For rounding"
# 
#     BOTTOM_OUTSIDE = "Outside"
#     BOTTOM_INSIDE = "Inside"
# 
#     def __init__(self, **kwargs):
#         super(BoxProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'length'):
#             self.length = 90.
#         if not hasattr(self, 'width'):
#             self.width = 50.
#         if not hasattr(self, 'height'):
#             self.height = 30.
#         if not hasattr(self, 'thickness'):
#             self.thickness = 3.
#         if not hasattr(self, 'outside_measure'):
#             self.outside_measure = True
#         # Length/width
#         if not hasattr(self, 'length_width_priority'):
#             self.length_width_priority = self.LENGTH_PRIORTY
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'inner_radius'):
#             self.inner_radius = 0.
#         if not hasattr(self, 'length_shift'):
#             self.length_shift = 0.
#         if not hasattr(self, 'width_shift'):
#             self.width_shift = 0.
# 
# class TopBottomProperties(ObjectProperties):
#     _allowed = ('position', 'height_shis notift', 'length_outside', 'width_outside', 'top_type', 'cover_length_tolerance')
# 
#     POSITION_OUTSIDE = "Outside"
#     POSITION_INSIDE = "Inside"
#     TOP_TYPE_NORMAL = "Normal"
#     TOP_TYPE_COVER = "Openable"
# 
#     def __init__(self, **kwargs):
#         super(TopBottomProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'position'):
#             self.position = self.POSITION_OUTSIDE
#         if not hasattr(self, 'height_shift'):
#             self.height_shift = 0.
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'top_type'):
#             self.top_type = self.TOP_TYPE_NORMAL
#         if not hasattr(self, 'cover_length_tolerance'):
#             self.cover_length_tolerance = 3.


from FreeCAD import Gui
from lasercut.boxproperties import BoxProperties, TopBottomProperties
import FreeCAD
import FreeCADGui
import Part
        width_spacing = dimension_properties.length - 2. * thickness
    else:
        raise ValueError("Length/Width priority not defined")

    if bottom_properties.position == TopBottomProperties.POSITION_OUTSIDE:
        height -= thickness
        shift_height -= -thickness / 2.0
        exceeding_length = max(exceeding_length, bottom_properties.length_outside)
        exceeding_width = max(exceeding_width, bottom_properties.width_outside)

    if top_properties.position == TopBottomProperties.POSITION_OUTSIDE:
        height -= thickness
        shift_height -= thickness / 2.0
        exceeding_length = max(exceeding_length, top_properties.length_outside)
        exceeding_width = max(exceeding_width, top_properties.width_outside)

    if exceeding_length > 0.:
        length -= exceeding_length
        width_spacing -= exceeding_length

    if exceeding_width > 0.:
        width -= exceeding_width
        length_spacing -= exceeding_width

    down_z_ref = -height / 2.0
    up_z_ref = height / 2.0
    face_panel, behind_panel = make_front_panels(length, height, thickness, length_spacing)
    if dimension_properties.length_width_priority == BoxProperties.ROUND_PRIORTY:
        face_panel = None
        face_panel_1, face_panel_2 = make_twice_half_front_panel(length, height, thickness, length_spacing)

# Path: lasercut/boxproperties.py
# class BoxProperties(ObjectProperties):
# 
#     _allowed = ('length', 'width', 'height', 'thickness', 'outside_measure',
#                 'length_width_priority', 'length_outside', 'width_outside',
#                 'bottom_position', 'bottom_shift', 'inner_radius',
#                 'length_shift', 'width_shift')
# 
#     LENGTH_PRIORTY = "Length"
#     WIDTH_PRIORTY = "Width"
#     CROSS_PRIORTY = "No - Cross"
#     ROUND_PRIORTY = "No - For rounding"
# 
#     BOTTOM_OUTSIDE = "Outside"
#     BOTTOM_INSIDE = "Inside"
# 
#     def __init__(self, **kwargs):
#         super(BoxProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'length'):
#             self.length = 90.
#         if not hasattr(self, 'width'):
#             self.width = 50.
#         if not hasattr(self, 'height'):
#             self.height = 30.
#         if not hasattr(self, 'thickness'):
#             self.thickness = 3.
#         if not hasattr(self, 'outside_measure'):
#             self.outside_measure = True
#         # Length/width
#         if not hasattr(self, 'length_width_priority'):
#             self.length_width_priority = self.LENGTH_PRIORTY
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'inner_radius'):
#             self.inner_radius = 0.
#         if not hasattr(self, 'length_shift'):
#             self.length_shift = 0.
#         if not hasattr(self, 'width_shift'):
#             self.width_shift = 0.
# 
# class TopBottomProperties(ObjectProperties):
#     _allowed = ('position', 'height_shis notift', 'length_outside', 'width_outside', 'top_type', 'cover_length_tolerance')
# 
#     POSITION_OUTSIDE = "Outside"
#     POSITION_INSIDE = "Inside"
#     TOP_TYPE_NORMAL = "Normal"
#     TOP_TYPE_COVER = "Openable"
# 
#     def __init__(self, **kwargs):
#         super(TopBottomProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'position'):
#             self.position = self.POSITION_OUTSIDE
#         if not hasattr(self, 'height_shift'):
#             self.height_shift = 0.
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'top_type'):
#             self.top_type = self.TOP_TYPE_NORMAL
#         if not hasattr(self, 'cover_length_tolerance'):
#             self.cover_length_tolerance = 3.


# Path: lasercut/makebox.py
from FreeCAD import Gui
from lasercut.boxproperties import BoxProperties, TopBottomProperties
import FreeCAD
import FreeCADGui
import Part

        width_spacing = dimension_properties.length - 2. * thickness
    else:
        raise ValueError("Length/Width priority not defined")

    if bottom_properties.position == TopBottomProperties.POSITION_OUTSIDE:
        height -= thickness
        shift_height -= -thickness / 2.0
        exceeding_length = max(exceeding_length, bottom_properties.length_outside)
        exceeding_width = max(exceeding_width, bottom_properties.width_outside)

    if top_properties.position == TopBottomProperties.POSITION_OUTSIDE:
        height -= thickness
        shift_height -= thickness / 2.0
        exceeding_length = max(exceeding_length, top_properties.length_outside)
        exceeding_width = max(exceeding_width, top_properties.width_outside)

    if exceeding_length > 0.:
        length -= exceeding_length
        width_spacing -= exceeding_length

    if exceeding_width > 0.:
        width -= exceeding_width
        length_spacing -= exceeding_width

    down_z_ref = -height / 2.0
    up_z_ref = height / 2.0
    face_panel, behind_panel = make_front_panels(length, height, thickness, length_spacing)
    if dimension_properties.length_width_priority == BoxProperties.ROUND_PRIORTY:
        face_panel = None
        face_panel_1, face_panel_2 = make_twice_half_front_panel(length, height, thickness, length_spacing)

    left_panel, right_panel = make_side_panels(width, height, thickness, width_spacing)