# Path: lasercut/helper.py
# class ObjectProperties(object):
# class Segment:
# class MaterialElement:
#     def __init__(self, **kwargs):
#     def __init__(self, first=FreeCAD.Vector(0, 0, 0), second=FreeCAD.Vector(0, 0, 0)):
#     def a(self):
#     def b(self):
#     def clone_a(self):
#     def clone_b(self):
#     def vector(self):
#     def length(self):
#     def mid_point(self):
#     def get_angle(self, segment):
#     def add(self, vector):
#     def rotate_z(self, angle):
#     def __repr__(self):
# def rotate_vector_z(vector, angle):
# def get_screw_nut_spec(metric_diameter, metric_length):
# def transform_part(tab_to_add, face):
# def check_intersect(tab_to_add, face, part_interactor_properties):
# def transform(part, referentiel_face, transform_matrix=None, y_invert = False):
# def get_matrix_transform(face):
# def get_local_axis(face):
# def get_local_axis_normalized(face):
# def compare_freecad_vector(vector1, vector2, epsilon=10e-6):
# def compare_value(value1, value2, epsilon=10e-6):
# def compare_freecad_vector_direction(vector1, vector2, epsilon=10e-6):
# def sort_quad_vertex(list_edges, reverse):
# def biggest_area_faces(freecad_shape):
# def smallest_area_faces(freecad_shape):
# def sort_area_shape_faces(shape):
# def sort_area_shape_list(faces_list):
# def sort_area_face_common(faces, test_function=compare_freecad_vector_direction):
# def check_limit_z(tab_face, width, pos_y, material_face, material_plane):
# def check_limit_y(tab_face, height, pos_y, width, material_plane):
# def check_limit_y_on_for_tab(tab_face, height, pos_y, width, thickness, material_face):
# def tab_join_create_hole_on_plane(tab_face, width, pos_y, material_face, material_plane, dog_bone=False):
# def make_dog_bone_on_limits_on_yz(shape, length,
#                                   y_min_z_min=True, y_max_z_min=True, y_min_z_max=True, y_max_z_max=True):
# def make_dog_bone_on_xy(pos_x, pos_y, height, radius):
# def make_dog_bone_on_yz(pos_y, pos_z, height, radius):
# def make_dog_bone_on_limits_on_xy(shape, length, x_min_only=False):
# def assemble_list_element(el_list):
# def assemble_list_element_fast(el_list):
#     def __init__(self, properties):
#     def reset_add_remove(self):
#     def get_name(self):
#     def get_new_name(self):
#     def get_shape(self, fast_assemble=False):


import FreeCAD
from lasercut import helper
                'y_invert', 'half_tab_ratio', 'interval_ratio', 'freecad_obj_name',
                'tab_type', 'group_id', 'description', 'link_name', 'tab_name', 'transform_matrix')

    __count = 0

    @classmethod
    def _count(cls):
        TabProperties.__count += 1
        return TabProperties.__count

    def __init__(self, **kwargs):
        super(TabProperties, self).__init__(**kwargs)
        self.freecad_object = None
        self.freecad_face = None
        self.transform_matrix = None
        if not kwargs['freecad_face']:
            raise ValueError("Must init with freecad face")
        if not hasattr(self, 'freecad_obj_name') :#or not hasattr(self, 'freecad_face'):
            raise ValueError("Must defined freecad face/object")
        if not hasattr(self, 'tab_type'):
            raise ValueError("no type of tab defined")
        if not hasattr(self, 'face_name'):
            #self.face_name = self.freecad_face['name']
            raise ValueError("name not defined")
        if not hasattr(self, 'tab_name'):
            self.tab_name = "%s.%s" % (self.freecad_obj_name, self.face_name)
        if not hasattr(self, 'description'):
            self.description = "%s.%s (%s)" % (self.freecad_obj_name, self.face_name, self.tab_type)
        if not hasattr(self, 'y_length') or not hasattr(self, 'thickness') or not hasattr(self, 'transform_matrix'):
            try:

# Path: lasercut/helper.py
# class ObjectProperties(object):
# class Segment:
# class MaterialElement:
#     def __init__(self, **kwargs):
#     def __init__(self, first=FreeCAD.Vector(0, 0, 0), second=FreeCAD.Vector(0, 0, 0)):
#     def a(self):
#     def b(self):
#     def clone_a(self):
#     def clone_b(self):
#     def vector(self):
#     def length(self):
#     def mid_point(self):
#     def get_angle(self, segment):
#     def add(self, vector):
#     def rotate_z(self, angle):
#     def __repr__(self):
# def rotate_vector_z(vector, angle):
# def get_screw_nut_spec(metric_diameter, metric_length):
# def transform_part(tab_to_add, face):
# def check_intersect(tab_to_add, face, part_interactor_properties):
# def transform(part, referentiel_face, transform_matrix=None, y_invert = False):
# def get_matrix_transform(face):
# def get_local_axis(face):
# def get_local_axis_normalized(face):
# def compare_freecad_vector(vector1, vector2, epsilon=10e-6):
# def compare_value(value1, value2, epsilon=10e-6):
# def compare_freecad_vector_direction(vector1, vector2, epsilon=10e-6):
# def sort_quad_vertex(list_edges, reverse):
# def biggest_area_faces(freecad_shape):
# def smallest_area_faces(freecad_shape):
# def sort_area_shape_faces(shape):
# def sort_area_shape_list(faces_list):
# def sort_area_face_common(faces, test_function=compare_freecad_vector_direction):
# def check_limit_z(tab_face, width, pos_y, material_face, material_plane):
# def check_limit_y(tab_face, height, pos_y, width, material_plane):
# def check_limit_y_on_for_tab(tab_face, height, pos_y, width, thickness, material_face):
# def tab_join_create_hole_on_plane(tab_face, width, pos_y, material_face, material_plane, dog_bone=False):
# def make_dog_bone_on_limits_on_yz(shape, length,
#                                   y_min_z_min=True, y_max_z_min=True, y_min_z_max=True, y_max_z_max=True):
# def make_dog_bone_on_xy(pos_x, pos_y, height, radius):
# def make_dog_bone_on_yz(pos_y, pos_z, height, radius):
# def make_dog_bone_on_limits_on_xy(shape, length, x_min_only=False):
# def assemble_list_element(el_list):
# def assemble_list_element_fast(el_list):
#     def __init__(self, properties):
#     def reset_add_remove(self):
#     def get_name(self):
#     def get_new_name(self):
#     def get_shape(self, fast_assemble=False):


# Path: lasercut/tabproperties.py
import FreeCAD
from lasercut import helper

                'y_invert', 'half_tab_ratio', 'interval_ratio', 'freecad_obj_name',
                'tab_type', 'group_id', 'description', 'link_name', 'tab_name', 'transform_matrix')

    __count = 0

    @classmethod
    def _count(cls):
        TabProperties.__count += 1
        return TabProperties.__count

    def __init__(self, **kwargs):
        super(TabProperties, self).__init__(**kwargs)
        self.freecad_object = None
        self.freecad_face = None
        self.transform_matrix = None
        if not kwargs['freecad_face']:
            raise ValueError("Must init with freecad face")
        if not hasattr(self, 'freecad_obj_name') :#or not hasattr(self, 'freecad_face'):
            raise ValueError("Must defined freecad face/object")
        if not hasattr(self, 'tab_type'):
            raise ValueError("no type of tab defined")
        if not hasattr(self, 'face_name'):
            #self.face_name = self.freecad_face['name']
            raise ValueError("name not defined")
        if not hasattr(self, 'tab_name'):
            self.tab_name = "%s.%s" % (self.freecad_obj_name, self.face_name)
        if not hasattr(self, 'description'):
            self.description = "%s.%s (%s)" % (self.freecad_obj_name, self.face_name, self.tab_type)
        if not hasattr(self, 'y_length') or not hasattr(self, 'thickness') or not hasattr(self, 'transform_matrix'):
            try:

                x_local, y_length, thickness = helper.get_local_axis(kwargs['freecad_face'])