# Path: tessagon/types/hex_tessagon.py
# class HexTessagon(Tessagon):
#     tile_class = HexTile
#     metadata = metadata
# 
# Path: tessagon/misc/shapes.py
# def other_torus(u, v):
#     # u_cyclic = True, v_cyclic = True
#     return torus(v, u)
# 
# Path: tessagon/adaptors/blender_adaptor.py
# class BlenderAdaptor:
#     def __init__(self, **kwargs):
#         self.bm = None
# 
#     def create_empty_mesh(self):
#         self.bm = bmesh.new()
# 
#     def initialize_colors(self):
#         pass
# 
#     def create_vert(self, coords):
#         return self.bm.verts.new(coords)
# 
#     def create_face(self, verts):
#         return self.bm.faces.new(verts)
# 
#     def color_face(self, face, color_index):
#         face.material_index = color_index
# 
#     def finish_mesh(self):
#         bmesh.ops.recalc_face_normals(self.bm, faces=self.bm.faces)
# 
#     def get_mesh(self):
#         return self.bm


import bpy
from tessagon.types.hex_tessagon import HexTessagon
from tessagon.misc.shapes import other_torus
from tessagon_common_demo import TessagonCommonDemo
from tessagon.adaptors.blender_adaptor import BlenderAdaptor
    from wire_skin import WireSkin
        if (blender_version < 2.8):
            self.create_material = self.create_material_27
            self.link_object_scene = self.link_object_scene_27
            self.view_front = self.view_front_27
        else:
            self.create_material = self.create_material_28
            self.link_object_scene = self.link_object_scene_28
            self.view_front = self.view_front_28

        self.create_materials()
        self.create_objects()
        self.update_view()

    def view_front_27(self, override):
        bpy.ops.view3d.viewnumpad(override, type='FRONT')

    def view_front_28(self, override):
        bpy.ops.view3d.view_axis(override, type='FRONT')

    def update_view(self):
        for area in bpy.context.screen.areas:
            if area.type == 'VIEW_3D':
                for region in area.regions:
                    if region.type == 'WINDOW':
                        override = {'area': area, 'region': region}
                        self.view_front(override)
                        bpy.ops.view3d.view_all(override)
                        break

    def material_name(self, value, num_values):

# Path: tessagon/types/hex_tessagon.py
# class HexTessagon(Tessagon):
#     tile_class = HexTile
#     metadata = metadata
# 
# Path: tessagon/misc/shapes.py
# def other_torus(u, v):
#     # u_cyclic = True, v_cyclic = True
#     return torus(v, u)
# 
# Path: tessagon/adaptors/blender_adaptor.py
# class BlenderAdaptor:
#     def __init__(self, **kwargs):
#         self.bm = None
# 
#     def create_empty_mesh(self):
#         self.bm = bmesh.new()
# 
#     def initialize_colors(self):
#         pass
# 
#     def create_vert(self, coords):
#         return self.bm.verts.new(coords)
# 
#     def create_face(self, verts):
#         return self.bm.faces.new(verts)
# 
#     def color_face(self, face, color_index):
#         face.material_index = color_index
# 
#     def finish_mesh(self):
#         bmesh.ops.recalc_face_normals(self.bm, faces=self.bm.faces)
# 
#     def get_mesh(self):
#         return self.bm


# Path: demo/tessagon_blender_demo.py
import bpy
from tessagon.types.hex_tessagon import HexTessagon
from tessagon.misc.shapes import other_torus
from tessagon_common_demo import TessagonCommonDemo
from tessagon.adaptors.blender_adaptor import BlenderAdaptor
    from wire_skin import WireSkin

        if (blender_version < 2.8):
            self.create_material = self.create_material_27
            self.link_object_scene = self.link_object_scene_27
            self.view_front = self.view_front_27
        else:
            self.create_material = self.create_material_28
            self.link_object_scene = self.link_object_scene_28
            self.view_front = self.view_front_28

        self.create_materials()
        self.create_objects()
        self.update_view()

    def view_front_27(self, override):
        bpy.ops.view3d.viewnumpad(override, type='FRONT')

    def view_front_28(self, override):
        bpy.ops.view3d.view_axis(override, type='FRONT')

    def update_view(self):
        for area in bpy.context.screen.areas:
            if area.type == 'VIEW_3D':
                for region in area.regions:
                    if region.type == 'WINDOW':
                        override = {'area': area, 'region': region}
                        self.view_front(override)
                        bpy.ops.view3d.view_all(override)
                        break

    def material_name(self, value, num_values):

        return 'Color-{}-of-{}'.format(value + 1, num_values)