# Path: lasercut/helper.py
# class ObjectProperties(object):
#     def __init__(self, **kwargs):
#         self.obj_class = str(type(self).__name__)
#         for k, v in kwargs.items():
#             if not hasattr(self, "_allowed") or str(k) in self._allowed:
#                 setattr(self, k, v)
#             #else:
#             #    FreeCAD.Console.PrintWarning(str(k) + " is not allowed for " + str(type(self)))


from lasercut.helper import ObjectProperties
import math

    def __init__(self, **kwargs):
        super(RoundedBoxProperties, self).__init__(**kwargs)
        if not hasattr(self, 'nb_face'):
            self.nb_face = int(5)
        if not hasattr(self, 'inradius'):
            self.inradius = 50.
        if not hasattr(self, 'height'):
            self.height = 30.
        if not hasattr(self, 'thickness'):
            self.thickness = 3.
        if not hasattr(self, 'cut_nb'):
            self.cut = int(0)

        self.side_length = 0.
        self.max_side_length = 0.
        self.compute_information(True)

    def compute_information(self, update_side_length = False):
        circumradius =  self.inradius / math.cos(math.pi / float(self.nb_face))
        self.max_side_length = 2 * circumradius * math.sin(math.pi / float(self.nb_face))
        self.max_side_length = round(self.max_side_length - 0.01, 2)

        if update_side_length is True or self.side_length >= self.max_side_length :
            self.side_length = math.floor(self.max_side_length * 0.75)

        if self.cut > self.nb_face:
            self.cut = int(self.nb_face)



# Path: lasercut/helper.py
# class ObjectProperties(object):
#     def __init__(self, **kwargs):
#         self.obj_class = str(type(self).__name__)
#         for k, v in kwargs.items():
#             if not hasattr(self, "_allowed") or str(k) in self._allowed:
#                 setattr(self, k, v)
#             #else:
#             #    FreeCAD.Console.PrintWarning(str(k) + " is not allowed for " + str(type(self)))


# Path: lasercut/roundedboxproperties.py
from lasercut.helper import ObjectProperties
import math


    def __init__(self, **kwargs):
        super(RoundedBoxProperties, self).__init__(**kwargs)
        if not hasattr(self, 'nb_face'):
            self.nb_face = int(5)
        if not hasattr(self, 'inradius'):
            self.inradius = 50.
        if not hasattr(self, 'height'):
            self.height = 30.
        if not hasattr(self, 'thickness'):
            self.thickness = 3.
        if not hasattr(self, 'cut_nb'):
            self.cut = int(0)

        self.side_length = 0.
        self.max_side_length = 0.
        self.compute_information(True)

    def compute_information(self, update_side_length = False):
        circumradius =  self.inradius / math.cos(math.pi / float(self.nb_face))
        self.max_side_length = 2 * circumradius * math.sin(math.pi / float(self.nb_face))
        self.max_side_length = round(self.max_side_length - 0.01, 2)

        if update_side_length is True or self.side_length >= self.max_side_length :
            self.side_length = math.floor(self.max_side_length * 0.75)

        if self.cut > self.nb_face:
            self.cut = int(self.nb_face)



class TopBottomRoundedProperties(ObjectProperties):