def get_tiles(self):
# Create an initial wheel of red triangles around the origin
# (from the comments section of the reference):
radiusR = DEFAULT_RADIUS_R;
triangles = []
for i in xrange(10):
B = cmath.rect(1, (2*i - 1) * math.pi / radiusR)
C = cmath.rect(1, (2*i + 1) * math.pi / radiusR)
if i % 2 == 0:
B, C = C, B # Make sure to mirror every second triangle
##
triangles.append((COLOR_RED, B, 0j, C))
##
for i in range(self.num_steps):
triangles = self.subdivide(triangles)
point_to_vector = lambda pt: PenroseKD_Tiling.complex_to_vector(pt);
tile_list = [];
for (color, A, B, C) in triangles:
tile_list.append([point_to_vector(A), point_to_vector(B), \
point_to_vector(C)]);
return tile_list;
## def
## class
评论列表
文章目录