from math import sqrt from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Other Pentagons', classification='laves', shapes=['pentagons'], sides=[5]) class Penta2Tile(Tile): # 11 verts, 6 faces (2 internal, 4 on boundary) # # O---O # |...| # O...O # .\./. # ^ ..O.. # | ..|.. # | --O-- # | ..|.. # ..O.. # V ./.\. # O...O # |...| # O---O # # U -----> def __init__(self, tessagon, **kwargs):
from tessagon.core.tessagon import Tessagon from tessagon.core.tile import Tile from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Regular Triangles', num_color_patterns=3, classification='regular', shapes=['triangles'], sides=[3]) class TriTile(Tile): # ^ 0.|.1 This is the topology of the tile. # | |\|/| (Not a Dead Kennedy's logo ...). # | |.2.| # | |/|\| # V 3.|.4 # # U -----> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self): return { 'left': { 'top': None, 'bottom': None
from math import sqrt from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Dodecagons and Triangles', classification='archimedean', shapes=['dodecagons', 'triangles'], sides=[12, 3]) class DodecaTriTile(Tile): # 14 verts, 11 faces (3 internal, 8 on boundary) # The angles make it hard to draw all edges, some excluded # . ....|3.o---o.3|...... # ^ . o o . # | . 12 / \ 12 . # | . o o . # | .-o3| 12 |3o-. Number is verts in face # | . o o . # . \ / . # V . 12 o o 12 . # . ....|3.o---o.3|...... # # U ----> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True
from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Bricks', classification='non_edge', shapes=['rectangles'], sides=[4]) class BrickTile(Tile): # top # # -o..o- -o..o- r # ^ .|..|. l .|..|. i # | .o--o. e .o--o. g # | .|..|. f .|..|. h # | -o..o- t -o..o- t # V # U ---> bottom def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self): return { 'left': { 'top': None, 'middle': None,
from math import sqrt from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata # TODO: gulp, 'octagon' does not begin with 'octo' metadata = TessagonMetadata(name='Octagons and Squares', classification='archimedean', shapes=['octagons', 'squares'], sides=[8, 4]) class OctoTile(Tile): # ^ ..o-o.. # | ./...\. # | o.....o # | |.....| # | o.....o # | .\.../. # ..o-o.. # V # U ----> CORNER_TO_VERT_RATIO = 1.0 / (2.0 + sqrt(2)) def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True
from tessagon.types.dissected_hex_quad_tessagon import DissectedHexQuadTile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Hexagons Dissected with Triangles', classification='laves', shapes=['triangles'], sides=[3]) # Uses the same configuration of vertices as DissectedHexQuadTile class DissectedHexTriTile(DissectedHexQuadTile): # 19 verts, 24 internal triangle faces # # O+++++++++++++++++++O+++++++++++++++++++O # ++ ++ + ++ ++ # + + ++ + ++ + + # + + ++ + ++ + + # + + + + + + + # + + ++ + ++ + + # + + +O+ + + # + + ++ + ++ + + # + + ++ + ++ + + # + ++O + O++ + # + ++ + + + ++ + # +++ ++ + ++ +++ # O+ + + + +O # + ++ + + + ++ + # + ++ + + + ++ + # + ++ + + + ++ +
from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Hexagons Dissected with Quads', classification='laves', shapes=['quads'], sides=[4]) class DissectedHexQuadTile(Tile): # 19 verts, 14 quad faces (10 internal, 4 on boundary) # # O+++++++++++++++++++O+++++++++++++++++++O # + + + # + + + # + + + # + + + # + + + # + +O+ + # + ++ ++ + # + ++ ++ + # ++O O++ # ++ + + ++ # ++ ++ ++ ++ # O + + O # + + + + # + + + + # + + + + # + + + + # O+++++++++++++++++++O+++++++++++++++++++O
from tessagon.core.tessagon import Tessagon from tessagon.core.tile import Tile from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Regular Squares', num_color_patterns=8, classification='regular', shapes=['squares'], sides=[4]) class SquareTile(Tile): def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self): return { 'top': { 'left': None, 'right': None }, 'bottom': { 'left': None, 'right': None } } def init_faces(self): return {'middle': None}
from tessagon.core.stamp14_tessagon \ import Stamp14, Stamp14Tile, Stamp14Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Hexagons and Big Triangles', classification='non_edge', shapes=['hexagons', 'triangles'], sides=[6, 3]) # To get a sense of how Thingies repeat over tiles, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/thingies_repeat.png # To see how the Thingies are arranged on a tile, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/thingies_tiles.png # To see how Thingy neighbors, verts and faces are arranged, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/thingies_neighbors_verts_faces.png class Thingy(Stamp14): def init_verts(self): return [None]*13 def init_faces(self): return [None]*3 def calculate_verts(self): unit_u = 1.0 / 14.0 unit_v = 1.0 / 14.0 # Hexagon (face 0) d_u = unit_u d_v = unit_v
from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Pythagorean', classification='non_edge', shapes=['squares'], sides=[4]) class PythagoreanTile(Tile): # 29 verts in six rows, six columns # 12 faces (2 sets shared with neighbors) # # o...o-o-o-o row6 o.1.o-o-o-o # |...|.|...| |...|2|...| # o-o-o-o...o row5 o-o-o-o.3.o # ^ |.|...|...| |4|...|...| # | o-o...o-o-o row4 o-o.5.o-o-o # | ..|...|.|.. ..|...|7|.. # | ..o-o-o-o.. row3 6.o-o-o-o.8 # ..|.|...|.. ..|9|...|.. # V o-o-o...o-o row2 o-o-o10.o-o # |...|...|.| |...|...12| # o...o-o-o-o row1 o11.o-o-o-o # # 1 2 3 4 5 6 <-cols # # U ------> def init_verts(self):
from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Weave', classification='non_edge', shapes=['quads', 'rectangles'], sides=[4]) class WeaveTile(Tile): # 16 verts, 13 faces (5 internal, 8 on boundary) # # ....|..|.... .8..|.8|.8.. # -o--o..o--o- -o--o..o--o- # ^ .|..|..|..|. .|4.|..|4.|. # | .o--o--o--o. .o--o--o--o. # | .|........|. 8|...8....|8 # | .o--o--o--o. .o--o--o--o. # .|..|..|..|. .|4.|..|4.|. # V -o--o..o--o. -o--o..o--o. # ....|..|.... 8...|8.|...8 # # U -----> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self):
from tessagon.core.tessagon import Tessagon from tessagon.core.tile import Tile from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Regular Hexagons', num_color_patterns=2, classification='regular', shapes=['hexagons'], sides=[6]) class HexTile(Tile): # VERTS: # ..|.. # ..a.. a = ['top', 'center'] # ^ ./.\. b = ['top', 'left'] # | b...c c = ['top', 'right'] # | |...| d = ['bottom', 'left'] # | d...e e = ['bottom', 'right'] # | .\./. f = ['bottom', 'center'] # ..f.. # V ..|.. # # U ---> # FACES: # A.|.B # ..o.. A = ['top', 'left'] # ^ ./.\. B = ['top', 'right'] # | o...o C = ['middle'] # | |.C.| D = ['bottom', 'left']
from tessagon.core.stamp14_tessagon \ import Stamp14, Stamp14Tile, Stamp14Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Florets', num_color_patterns=3, classification='laves', shapes=['pentagons'], sides=[5]) # To get a sense of how Florets repeat over tiles, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/florets_repeat.png # To see how the Florets are arranged on a tile, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/florets_tiles.png # To see how Floret neighbors, verts and faces are arranged, see: # https://github.com/cwant/tessagon/blob/master/documentation/images/florets_neighbors_verts_faces.png class Floret(Stamp14): def init_verts(self): return [None]*19 def init_faces(self): return [None]*6 def add_offset_vert(self, i, offset_u, offset_v): vert = super().add_offset_vert(i, offset_u, offset_v) if vert: if i == 18: self.tile.tessagon.vert_types['center'].append(vert) elif i % 3 == 2:
from tessagon.core.tessagon import Tessagon from tessagon.core.tile import Tile from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Dissected Square', num_color_patterns=2, classification='laves', shapes=['triangles'], sides=[3]) class DissectedSquareTile(Tile): # VERTS: a = ['top', 'left'] # a---b---c b = ['top', 'center'] # ^ |\..|../| c = ['top', 'right'] # | |.\.|./.| d = ['middle', 'left'] # | d---e---f e = ['middle', 'center'] # | |../|\..| f = ['middle', 'right'] # |./.|.\.| g = ['bottom', 'left'] # V g---h---i h = ['bottom', 'center'] # i = ['bottom', 'right'] # U ---> # FACES: # o---o---o A = ['top', 'left', 'middle'] # ^ |\.B|C./| B = ['top', 'left', 'center'] # | |A\.|./D| C = ['top', 'right', 'center'] # | o---o---o D = ['top', 'right', 'middle'] # | |E./|\.H| E = ['bottom', 'left', 'middle'] # |./F|G\.| F = ['bottom', 'left', 'center']
from math import sqrt from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Hexagons, Squares, and Triangles', classification='archimedean', shapes=['hexagons', 'squares', 'triangles'], sides=[6, 4, 3]) class HexSquareTriTile(Tile): # 14 verts, 19 faces (7 internal, 12 on boundary) # The angles make it hard to draw all edges, some excluded # # ...|...|... 6..|.4.|..6 # ...o---o... ...o---o... # ^ o ..\./...o o.4.\3/.4.o # | .\...o.../. 3\...o.../3 Numbers are faces with # sides # | --o.....o-- --o.....o-- # | ..|.....|.. 4.|..6..|.4 # | --o.... o-- --o.... o-- # ./.. o...\. 3/.. o...\3 # V o.../.\...o o.4./3\.4.o # ...o---o... ...o---o... # ...|...|... 6..|.4.|..6 # # U ----> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs)
from math import sqrt from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Squares and Triangles', classification='archimedean', shapes=['squares', 'triangles'], sides=[4, 3]) class SquareTriTile(Tile): # 12 verts, 16 faces (8 internal, 8 on boundary) # The angles make it hard to draw all edges, some excluded # # # ^ ..o..|..o.. 3.o.3|3.o.3 # | ./...o...\. ./...o...\. # | o.../.\...o o.4./3\.4.o # | ...o---o... .3.o---o.3. # o...\./...o o.4.\3/.4.o # V .\...o.../. .\...o.../. # ..o..|..o.. 3.o.3|3.o.3 # U -----> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self):
from tessagon.core.tile import Tile from tessagon.core.tessagon import Tessagon from tessagon.core.tessagon_metadata import TessagonMetadata metadata = TessagonMetadata(name='Rhombuses', classification='laves', shapes=['rhombuses'], sides=[4]) class RhombusTile(Tile): # ..o.. # ./|\. # o.|.o # ^ |.o.| # | |/.\| # | o...o # | |\./| # | |.o.| # | o.|.o # .\|/. # V ..o.. # # U ---> def __init__(self, tessagon, **kwargs): super().__init__(tessagon, **kwargs) self.u_symmetric = True self.v_symmetric = True def init_verts(self):