I would like to reproduce the beautiful Moroccan Mosaic's as seen here. The code is using Turtle. I would like to translate that to Tkinter. I have had some luck modifying the the code in an answer here to draw on to a canvas. Of course there is a lot missing as there are no lines being drawn from the origin. I don't know how to do this. One thought is that I could possibly overlay n polygon, each though rotated some 2 * pi/n degrees. This still leaves the problem of getting the line from the origin to the initial and final points for each polygon. I don't think this would quite solve everything but it is a great start.
Or maybe it is simpler to somehow to get the polygon's to rotate around the center?
from tkinter import *
import math
canvas_width = 400
canvas_height =400
python_green = "#476042"
def polygon(canvas,sides=10, radius=100, rotation=0, translation=None, outline=python_green, fill='White', width = 1):
one_segment = math.pi * 2 / sides
points = [
(math.sin(one_segment * i + rotation) * radius + canvas_width/2,
math.cos(one_segment * i + rotation) * radius + canvas_height/2)
for i in range(sides)]
if translation:
points = [[sum(pair) for pair in zip(point, translation)]
for point in points]
canvas.create_polygon(points, outline=outline, fill='', width=width)
master = Tk()
w = Canvas(master, width=canvas_width, height=canvas_height)
w.pack()
polygon(w,outline='green', width=2)
mainloop()