![]() Turtle. Turtle.goto(-OUTER_RADIUS / 2, -2 * INNER_RADIUS / 2) Turtle.goto(OUTER_RADIUS / 4, -1 * INNER_RADIUS / 2) Keeping our initial code the same: screen = Screen() (Increase the depth argument to fill the window.) The tessellation you really want is four (not thirds) of these patterns overlaid atop each other. Turtle.goto(-OUTER_RADIUS / 2, -INNER_RADIUS) Rt_row_2(x-size/2,y+size*math.sqrt(3)/2,size,800//(size*3))įirst, let's simplify your three turtle, three function hexagonal tessellation to a single turtle, single recursive function solution: from turtle import Screen, Turtle Here is code: def draw_rhombus(x,y,degree,size,tilt,color):įor i in range(800//int(round(size*math.sqrt(3)))): After that it is repetition of the first and second row. The figure contains three different rhombus shapes (they are the same rhombus in different orientation). CP: Christmas Origami Book 2019 /diagrams.php. To be able to fill each rhombus, it needs to be drawn individually. I would draw based the rhombus shape because it will allow you to fill them with different colors. However, when I loop the program, the turtles trace back the same path as before and it takes a while for it to draw the others. So far, I created 3 hexagons in the center with 3 turtles and used for loops to draw the hexagons around the 3 hexagons. ![]() So far, I'm only alternating the angles of the turtles as I run the program and I don't have a definite strategy. I'm not sure how I can create the hexagon pattern recursively. I thought about creating a hexagon pattern first and then dividing the hexagons into thirds. I'm trying to create a rhombus tessellation pattern with the turtle graphics on python that looks like this image:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |