# 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
                        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)

    def diffuse_color(self, value, num_values):
        # Curated colors
        colors = {2: [[1.0, 1.0, 1.0],
                      [0.0, 0.0, 0.3]],
                  3: [[1.0, 1.0, 1.0],
                      [0.1, 0.3, 0.5],
                      [0.0, 0.0, 0.3]],
                  4: [[1.0, 1.0, 1.0],
                      [0.3, 0.5, 0.7],
                      [0.1, 0.3, 0.5],
                      [0.0, 0.0, 0.3]]}
        return colors[num_values][value]

    def create_materials(self):
        # Default material
        if 'DefaultColor' not in bpy.data.materials:
            self.create_material('DefaultColor', [1.0, 0.8, 0.5])

        # Create palletes based on how many different colors the object has
        for num_values in [2, 3, 4]:
            for value in range(num_values):
                name = self.material_name(value, num_values)
                if name in bpy.data.materials:

# 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

                        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)

    def diffuse_color(self, value, num_values):
        # Curated colors
        colors = {2: [[1.0, 1.0, 1.0],
                      [0.0, 0.0, 0.3]],
                  3: [[1.0, 1.0, 1.0],
                      [0.1, 0.3, 0.5],
                      [0.0, 0.0, 0.3]],
                  4: [[1.0, 1.0, 1.0],
                      [0.3, 0.5, 0.7],
                      [0.1, 0.3, 0.5],
                      [0.0, 0.0, 0.3]]}
        return colors[num_values][value]

    def create_materials(self):
        # Default material
        if 'DefaultColor' not in bpy.data.materials:
            self.create_material('DefaultColor', [1.0, 0.8, 0.5])

        # Create palletes based on how many different colors the object has
        for num_values in [2, 3, 4]:
            for value in range(num_values):
                name = self.material_name(value, num_values)
                if name in bpy.data.materials:

                    continue