Press the Green Flag to draw a stitched hexagon. Enjoy.
This project uses a lot of maths: 1- find the vertices of a regular hexagon; 2- calculate points along each of the sides of the hexagon; 3- calculate points along 3 of the radii from the center to the vertices of the hexagon (skipping the ones in between); 4- draw stitched lines between these points. Try to do it by ruler and pencil first, and then you will understand how it works. The key is to find first the coordinates of the vertices, and then the equations for each of the lines along the sides and radii. To avoid complexity, the code is divided into sections. Each section does one part of the job. The calculated points are stored in lists, so they can be retrieved as an array, and reused several times.