# 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
    def link_object_scene_27(self, object, scn):
        scn.objects.link(object)

    def link_object_scene_28(self, object, scn):
        scn.collection.objects.link(object)

    def new_or_create_object(self, name):
        if name in bpy.data.objects:
            object = bpy.data.objects[name]
        else:
            me = bpy.data.meshes.new(name)
            object = bpy.data.objects.new(name, me)
            scn = bpy.context.scene
            self.link_object_scene(object, scn)
        return object

    def tessellate(self, f, tessagon_class, **kwargs):
        out_name = kwargs.get('object_name')
        if not out_name:
            out_name = tessagon_class.__name__
            color_pattern = kwargs.get('color_pattern') or None
            if color_pattern is not None:
                out_name += "Color%d" % (color_pattern)

        output_object = self.new_or_create_object(out_name)
        me = output_object.data

        me.materials.clear()

        extra_args = {'function': f,

# 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

    def link_object_scene_27(self, object, scn):
        scn.objects.link(object)

    def link_object_scene_28(self, object, scn):
        scn.collection.objects.link(object)

    def new_or_create_object(self, name):
        if name in bpy.data.objects:
            object = bpy.data.objects[name]
        else:
            me = bpy.data.meshes.new(name)
            object = bpy.data.objects.new(name, me)
            scn = bpy.context.scene
            self.link_object_scene(object, scn)
        return object

    def tessellate(self, f, tessagon_class, **kwargs):
        out_name = kwargs.get('object_name')
        if not out_name:
            out_name = tessagon_class.__name__
            color_pattern = kwargs.get('color_pattern') or None
            if color_pattern is not None:
                out_name += "Color%d" % (color_pattern)

        output_object = self.new_or_create_object(out_name)
        me = output_object.data

        me.materials.clear()

        extra_args = {'function': f,

                      'adaptor_class': BlenderAdaptor}