X-Git-Url: https://git.ao2.it/experiments/RadialSymmetry.git/blobdiff_plain/aad1044b2a0ad5ca47d21f74da7066708b9c584a..c9af9befec0d61da74f67cbbe9f035ae5a486d9d:/RadialSymmetryDiagram.py diff --git a/RadialSymmetryDiagram.py b/RadialSymmetryDiagram.py index e6bc383..e21694b 100755 --- a/RadialSymmetryDiagram.py +++ b/RadialSymmetryDiagram.py @@ -43,9 +43,6 @@ class RadialSymmetryModel(): class RadialSymmetryDiagram(Diagram.Diagram): - def __init__(self, width, height, background=[1, 1, 1]): - Diagram.Diagram.__init__(self, width, height, background) - def draw(self, model): cx = self.width / 2.0 cy = self.height / 2.0 @@ -69,7 +66,7 @@ class RadialSymmetryDiagram(Diagram.Diagram): base_polygon_orientation) if model.show_base_polygon: - self.draw_polygon(verts, [0, 0, 0]) + self.draw_polygon(verts, None, [0, 0, 0]) for i, v in enumerate(verts[:]): radial_orientation_angle = (i + 1) * central_angle @@ -92,14 +89,14 @@ class RadialSymmetryDiagram(Diagram.Diagram): if model.show_labels: ta = self.normalized_angle_01(rotated_radial_orientation_angle) text = ("%.2f" % (ta * 360)).rstrip('0').rstrip('.') - color = colorsys.hsv_to_rgb(a, 1.0, 1.0) self.draw_centered_text(v[0], v[1], text, - rotated_radial_orientation_angle, color) + rotated_radial_orientation_angle, color, + align_baseline=True) def draw_element(self, x, y, model, theta, color=[0, 0, 0]): if model.show_elements: tverts = self.get_regular_polygon(x, y, model.element_sides, model.element_radius, theta) - self.draw_polygon(tverts, color) + self.draw_polygon(tverts, None, color) if model.show_stars: apothem = model.element_radius * cos(pi / model.element_sides)