![](https://turtlespaces.org/wp-content/uploads/2021/05/hex1.png)
Simple Hexagon Pattern
Here is a simple Logo project to get started with. It creates a colorful filled hexagon pattern using the polyspot primitive.
![](https://i0.wp.com/turtlespaces.org/wp-content/uploads/2021/05/hex2.png?resize=1348%2C810&ssl=1)
The hexagon pattern zoomed out
TO hex clearscreen penup ;not drawing lines repeat 10 [ ;do all of the following ten times setpos [-149 -270] ;sets the 2D turtle position (on the current Z plane) ;you can use setposition to set all three co-ordinates forward repcount * 34 ;positions the turtle to start the line ;you could use some math with setpos to accomplish this randomfillcolor ;choose a random fill color polyspot 20 6 ;make a filled polygon of size 20, with 6 sides repeat 10 [ ;make ten more polygons slideright 30 forward 17 randfc ;randfc is the short form of randomfillcolor polyspot 20 6] ;return to the start of the loop ] ;finished END
![](https://i0.wp.com/turtlespaces.org/wp-content/uploads/2021/05/hexcode.png?resize=1348%2C810&ssl=1)
A turtleSpaces (app) screenshot of the editor
![](https://i0.wp.com/turtlespaces.org/wp-content/uploads/2021/05/hex3d.png?resize=1348%2C810&ssl=1)
The hexagon pattern viewed from a different 3D angle