@@ -647,13 +647,13 @@ def setup_hex_colouring(unit:"TileUnit") -> None:
647
647
elif unit .n == 5 :
648
648
hexagon = affine .rotate (hexagon , 30 , origin = (0 , 0 ))
649
649
w , h = h , w
650
- tr = [(- w , 3 * h / 8 ), (0 , 3 * h / 8 ), ( w , 3 * h / 8 ),
651
- (- w / 2 , - 3 * h / 8 ), (w / 2 , - 3 * h / 8 )]
650
+ tr = [(- w , h / 4 ), (0 , h / 4 ), ( w , h / 4 ),
651
+ (- w / 2 , - h / 2 ), (w / 2 , - h / 2 )]
652
652
hexes = [affine .translate (hexagon , v [0 ], v [1 ]) for v in tr ]
653
653
_setup_base_tile (unit , TileShape .HEXAGON )
654
654
unit .prototile .geometry = [geom .Polygon ([
655
- (- 9 * w / 8 , - 3 * h / 4 ), (- 11 * w / 8 , 0 ), (- 9 * w / 8 , 3 * h / 4 ),
656
- ( 9 * w / 8 , 3 * h / 4 ), ( 11 * w / 8 , 0 ), ( 9 * w / 8 , - 3 * h / 4 )
655
+ (- w , - 3 * h / 4 ), (- 3 * w / 2 , 0 ), (- w , 3 * h / 4 ),
656
+ ( w , 3 * h / 4 ), ( 3 * w / 2 , 0 ), ( w , - 3 * h / 4 )
657
657
])]
658
658
elif unit .n == 6 :
659
659
hexagon = affine .rotate (hexagon , 30 , origin = (0 , 0 ))
@@ -686,12 +686,10 @@ def setup_hex_colouring(unit:"TileUnit") -> None:
686
686
hexes = [affine .translate (hexagon , v [0 ], v [1 ]) for v in tr ]
687
687
_setup_base_tile (unit , TileShape .HEXAGON )
688
688
unit .prototile .geometry = [geom .Polygon ([
689
- (- 11 * w / 8 , - 7 * h / 8 ), (- 13 * w / 8 , - 5 * h / 8 ), (- 7 * w / 8 , 11 * h / 8 ),
690
- ( 11 * w / 8 , 7 * h / 8 ), ( 13 * w / 8 , 5 * h / 8 ), ( 7 * w / 8 , - 11 * h / 8 )
689
+ (- 3 * w / 2 , - h ), (- 3 * w / 2 , - h / 2 ), (- w , 5 * h / 4 ),
690
+ ( 3 * w / 2 , h ), ( 3 * w / 2 , h / 2 ), ( w , - 5 * h / 4 )
691
691
])]
692
692
elif unit .n == 9 :
693
- # Make a hexagon and displace in the direction of its
694
- # own 6 corners, scaled as needed
695
693
_setup_base_tile (unit , TileShape .HEXAGON )
696
694
offsets = [
697
695
(- 3 * w / 4 , - 5 * h / 4 ), (0 , - 3 * h / 4 ), ( 3 * w / 4 , - 5 * h / 4 ),
@@ -737,8 +735,8 @@ def setup_square_colouring(unit:"TileUnit") -> None:
737
735
_setup_base_tile (unit , TileShape .HEXAGON )
738
736
x = s * np .sqrt (2 )
739
737
unit .prototile .geometry = [geom .Polygon ([
740
- (- 5 * x / 8 , - x / 2 ), (- 7 * x / 8 , 0 ), (- 5 * x / 8 , x / 2 ),
741
- ( 5 * x / 8 , x / 2 ), ( 7 * x / 8 , 0 ), ( 5 * x / 8 , - x / 2 ),
738
+ (- x / 2 , - x / 2 ), (- x , 0 ), (- x / 2 , x / 2 ),
739
+ ( x / 2 , x / 2 ), ( x , 0 ), ( x / 2 , - x / 2 ),
742
740
])]
743
741
elif unit .n == 4 :
744
742
# Copy and translate square
@@ -753,7 +751,7 @@ def setup_square_colouring(unit:"TileUnit") -> None:
753
751
_setup_base_tile (unit , TileShape .RECTANGLE )
754
752
# Copy and translate square
755
753
tr = [( 0 , 0 ),
756
- (s , 0 ), (0 , s ),
754
+ ( s , 0 ), (0 , s ),
757
755
(- s , 0 ), (0 , - s )]
758
756
squares = [affine .translate (sq , v [0 ], v [1 ]) for v in tr ]
759
757
rotation = np .degrees (np .arctan2 (1 , 2 ))
@@ -780,10 +778,11 @@ def setup_square_colouring(unit:"TileUnit") -> None:
780
778
squares = [affine .translate (sq , v [0 ], v [1 ]) for v in tr ]
781
779
squares = [affine .rotate (sq , - 45 , (0 , 0 )) for sq in squares ]
782
780
_setup_base_tile (unit , TileShape .HEXAGON )
783
- unit .prototile .geometry = [affine .rotate (geom .Polygon ([
784
- (- 11 * s / 14 , - 23 * s / 14 ), (- 17 * s / 14 , - 19 * s / 14 ), (- 25 * s / 14 , 5 * s / 14 ),
785
- ( 11 * s / 14 , 23 * s / 14 ), ( 17 * s / 14 , 19 * s / 14 ), ( 25 * s / 14 , - 5 * s / 14 )
786
- ]), - 45 , (0 , 0 ))]
781
+ x = s * np .sqrt (2 )
782
+ unit .prototile .geometry = [geom .Polygon ([
783
+ (- x , - x / 2 ), (- 3 * x / 2 , 0 ), (- x / 2 , x ),
784
+ ( x , x / 2 ), ( 3 * x / 2 , 0 ), ( x / 2 , - x )
785
+ ])]
787
786
elif unit .n == 8 :
788
787
# Copy and translate square
789
788
tr = [(- s , - s ), (0 , - s ), ( s , - s ),
@@ -794,8 +793,8 @@ def setup_square_colouring(unit:"TileUnit") -> None:
794
793
_setup_base_tile (unit , TileShape .HEXAGON )
795
794
x = s * np .sqrt (2 )
796
795
unit .prototile .geometry = [geom .Polygon ([
797
- (- 3 * x / 4 , - x ), ( 3 * x / 4 , - x ), ( 5 * x / 4 , 0 ),
798
- ( 3 * x / 4 , x ), (- 3 * x / 4 , x ), (- 5 * x / 4 , 0 )
796
+ (- x / 2 , - x ), ( x / 2 , - x ), ( 3 * x / 2 , 0 ),
797
+ ( x / 2 , x ), (- x / 2 , x ), (- 3 * x / 2 , 0 )
799
798
])]
800
799
elif unit .n == 9 :
801
800
# Copy and translate square
0 commit comments