class HexTessagon(Tessagon):
    tile_class = HexTile
    metadata = metadata class TriTessagon(Tessagon):
    tile_class = TriTile
    metadata = metadata class OctoTessagon(Tessagon):
    tile_class = OctoTile
    metadata = metadata class RhombusTessagon(Tessagon):
    tile_class = RhombusTile
    metadata = metadata class HexTriTessagon(Tessagon):
    tile_class = HexTriTile
    metadata = metadata class HexSquareTriTessagon(Tessagon):
    tile_class = HexSquareTriTile
    metadata = metadata class SquareTessagon(Tessagon):
    tile_class = SquareTile
    metadata = metadata class PythagoreanTessagon(Tessagon):
    tile_class = PythagoreanTile
    metadata = metadata class BrickTessagon(Tessagon):
    tile_class = BrickTile
    metadata = metadata class DodecaTessagon(Tessagon):
    tile_class = DodecaTile
    metadata = metadata class SquareTriTessagon(Tessagon):
    tile_class = SquareTriTile
    metadata = metadata class WeaveTessagon(Tessagon):
    tile_class = WeaveTile
    metadata = metadata class FloretTessagon(Stamp14Tessagon):
    tile_class = FloretTile
    metadata = metadata

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.vert_types = {'center': [], 'edge_to_center': [], 'other': []}

    def _calculate_colors(self):
        self.mesh_adaptor.initialize_colors()
        if self.color_pattern == 3:
            for tile in self.tiles:
                tile.set_default_color(0)
        for tile in self.tiles:
            tile.calculate_colors() class HexBigTriTessagon(Stamp14Tessagon):
    tile_class = HexBigTriTile
    metadata = metadata class ZigZagTessagon(Tessagon):
    tile_class = ZigZagTile
    metadata = metadata class DissectedSquareTessagon(Tessagon):
    tile_class = DissectedSquareTile
    metadata = metadata class SquareTri2Tessagon(Tessagon):
    tile_class = SquareTri2Tile
    metadata = metadata class DodecaTriTessagon(Tessagon):
    tile_class = DodecaTriTile
    metadata = metadata class DissectedTriangleTessagon(Tessagon):
    tile_class = DissectedTriangleTile
    metadata = metadata class DissectedHexQuadTessagon(Tessagon):
    tile_class = DissectedHexQuadTile
    metadata = metadata class DissectedHexTriTessagon(Tessagon):
    tile_class = DissectedHexTriTile
    metadata = metadata class PentaTessagon(Tessagon):
    tile_class = PentaTile
    metadata = metadata class Penta2Tessagon(Tessagon):
    tile_class = Penta2Tile
    metadata = metadata def cylinder(u, v):
    # u_cyclic = True, v_cyclic = False
    r = 5.0
    h = 3.5
    return general_cylinder(r, h, u, v) def torus(u, v):
    # u_cyclic = True, v_cyclic = True
    r1 = 5.0
    r2 = 1.0
    return general_torus(r1, r2, u, warp_var(v, 0.2)) def one_sheet_hyperboloid(u, v):
    # u_cyclic = False, v_cyclic = True
    return general_one_sheet_hyperboloid(3, 2, u, v) def klein(u, v):
    # u_cyclic = True, v_cyclic = True
    # u_twist = False, v_twist = True
    return general_klein(0.25, u, v) def mobius(u, v):
    # u_cyclic = False, v_cyclic = True
    # u_twist = True, v_twist = False
    r = 5.0
    h = 2.0
    return general_mobius(r, h, v, u) def sphere(u, v):
    return general_ellipsoid(4, 4, 4, u, v) def paraboloid(u, v):
    # u_cyclic = False, v_cyclic = False
    return general_paraboloid(4, 3, -3, u, v) def general_torus(r1, r2, u, v):
    x = (r1 + r2*cos(v*2*pi))*cos(u*2*pi)
    y = (r1 + r2*cos(v*2*pi))*sin(u*2*pi)
    z = r2*sin(v*2*pi)
    return [x, y, z] def warp_var(v, factor):
    # For any factor, maps 0-->0, 1-->1
    # factor = 0 is identity
    # factor > 0 for a wee pinch at v = 1/2
    v = normalize_value(v)
    h = 2 * (v - 0.5)
    i = h + factor*h**3
    return 0.5*(1.0 + i / (1.0 + factor))
from tessagon.types.hex_tessagon import HexTessagon
from tessagon.types.tri_tessagon import TriTessagon
from tessagon.types.octo_tessagon import OctoTessagon
from tessagon.types.rhombus_tessagon import RhombusTessagon
from tessagon.types.hex_tri_tessagon import HexTriTessagon
from tessagon.types.hex_square_tri_tessagon import HexSquareTriTessagon
from tessagon.types.square_tessagon import SquareTessagon
from tessagon.types.pythagorean_tessagon import PythagoreanTessagon
from tessagon.types.brick_tessagon import BrickTessagon
from tessagon.types.dodeca_tessagon import DodecaTessagon
from tessagon.types.square_tri_tessagon import SquareTriTessagon
from tessagon.types.weave_tessagon import WeaveTessagon
from tessagon.types.floret_tessagon import FloretTessagon
from tessagon.types.hex_big_tri_tessagon import HexBigTriTessagon
from tessagon.types.zig_zag_tessagon import ZigZagTessagon
from tessagon.types.dissected_square_tessagon import DissectedSquareTessagon
from tessagon.types.square_tri2_tessagon import SquareTri2Tessagon
from tessagon.types.dodeca_tri_tessagon import DodecaTriTessagon
from tessagon.types.dissected_triangle_tessagon \
    import DissectedTriangleTessagon
from tessagon.types.dissected_hex_quad_tessagon \
    import DissectedHexQuadTessagon
from tessagon.types.dissected_hex_tri_tessagon \
    import DissectedHexTriTessagon
from tessagon.types.penta_tessagon import PentaTessagon
from tessagon.types.penta2_tessagon import Penta2Tessagon
from tessagon.misc.shapes import cylinder, torus, one_sheet_hyperboloid, \
    klein, mobius, sphere, paraboloid, general_torus, warp_var
        self.penta_tessagon([column, 0, row])
        column += offset
        self.penta2_tessagon([column, 0, row])

    def hex_tessagon(self, position, **kwargs):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 45,
            'v_num': 3,
            'u_cyclic': True,
            'v_cyclic': False,
            'position': position
        }
        return self.tessellate(cylinder, HexTessagon,
                               **{**kwargs, **options})

    def tri_tessagon(self, position, **kwargs):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 36,
            'v_num': 12,
            'position': position
        }
        return self.tessellate(torus, TriTessagon, **{**kwargs, **options})

    def square_tessagon(self, position, **kwargs):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 24,
            'v_num': 6,
            'rot_factor': 2,
            'position': position
        }
        return self.tessellate(torus, SquareTessagon,
                               **{**kwargs, **options})

    def rhombus_klein(self, u, v):
        (x, y, z) = klein(u, v)
        return (x, z, -y)

    def rhombus_tessagon(self, position):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 40,
            'v_num': 6,
            'v_twist': True,
            'position': position
        }
        return self.tessellate(self.rhombus_klein, RhombusTessagon, **options)

    def octo_tessagon(self, position):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 4,
            'v_num': 40,
            'v_cyclic': True,
            'u_cyclic': False,
            'u_twist': True,
            'position': position
        }
        return self.tessellate(mobius, OctoTessagon, **options)

    def hex_tri_tessagon(self, position):
        options = {
            'u_range': [-1.0, 1.0],
            'v_range': [-1.0, 1.0],
            'u_num': 15,
            'v_num': 10,
            'u_cyclic': False,
            'v_cyclic': False,
            'position': position
        }
        return self.tessellate(paraboloid, HexTriTessagon, **options)

    def hex_square_tri_tessagon(self, position):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 45,
            'v_num': 5,
            'position': position
        }
        return self.tessellate(torus, HexSquareTriTessagon, **options)

    def pythagorean_tessagon(self, position):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 25,
            'v_num': 6,
            'position': position
        }
        return self.tessellate(torus, PythagoreanTessagon, **options)

    def brick_tessagon(self, position):
        options = {
            'u_range': [0.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 15,
            'v_num': 3,
            'rot_factor': 3,
            'position': position
        }
        return self.tessellate(torus, BrickTessagon, **options)

    def dodeca_tessagon(self, position):
        options = {
            'u_range': [-1.0, 1.0],
            'v_range': [0.0, 1.0],
            'u_num': 4,
            'v_num': 10,
            'u_cyclic': False,
            'v_cyclic': True,
            'position': position
        }

        return self.tessellate(one_sheet_hyperboloid, DodecaTessagon,