# 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
        else:
            material = bpy.data.materials['DefaultColor']
            me.materials.append(material)

        scale = kwargs.get('scale') or None
        if scale is not None:
            output_object.scale = [scale]*3
        location = kwargs.get('position') or None
        if location is not None:
            output_object.location = location
        layer = kwargs.get('layer') or None
        if layer is not None:
            layers = [False] * 20
            # Input layer is 1-based, but array is 0-based
            layers[layer-1] = True
            output_object.layers = layers

        me.update()
        return output_object

    def wire_skin_demo(self):
        position = [-30, 0, 0]
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 8,
            'v_num': 20,
            'object_name': 'HexTorusIn',
            'position': position
        }

# 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

        else:
            material = bpy.data.materials['DefaultColor']
            me.materials.append(material)

        scale = kwargs.get('scale') or None
        if scale is not None:
            output_object.scale = [scale]*3
        location = kwargs.get('position') or None
        if location is not None:
            output_object.location = location
        layer = kwargs.get('layer') or None
        if layer is not None:
            layers = [False] * 20
            # Input layer is 1-based, but array is 0-based
            layers[layer-1] = True
            output_object.layers = layers

        me.update()
        return output_object

    def wire_skin_demo(self):
        position = [-30, 0, 0]
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 8,
            'v_num': 20,
            'object_name': 'HexTorusIn',
            'position': position
        }

        ob = self.tessellate(other_torus, HexTessagon, **options)