summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
efa80b1)
Reuse get_triangle_center_in_plan() also in draw_plan_template() instead
of open coding the calculations.
self.backend.draw_centered_text(tx, ty, corner_text, text_theta, color)
def draw_plan_template(self):
self.backend.draw_centered_text(tx, ty, corner_text, text_theta, color)
def draw_plan_template(self):
- x0, y0 = self.plan_origin
for hexagon in self.hexaflexagon.hexagons:
for triangle in hexagon.triangles:
for hexagon in self.hexaflexagon.hexagons:
for triangle in hexagon.triangles:
- i, j = self.hexaflexagon.get_triangle_plan_position(triangle)
- x, y = triangle.calc_plan_coordinates(self.triangle_radius, i, j)
+ x, y = self.get_triangle_center_in_plan(triangle)
theta = triangle.get_angle_in_plan()
theta = triangle.get_angle_in_plan()
- self.draw_triangle_template(triangle, x0 + x, y0 + y, theta)
+ self.draw_triangle_template(triangle, x, y, theta)
def draw_template(self):
for hexagon in self.hexaflexagon.hexagons:
def draw_template(self):
for hexagon in self.hexaflexagon.hexagons: