At this point, I have decides that it would be a perfect start for new improvements of the project’s application. Piece rendering was the last thing that has been done. To build on that, I have implemented the line function and Bezier curve to fill in the inner design of the Stained – Glass.
For the beginning, I have decided to implement a very simple method for both line and bezier curve. What I have thought of doing is to have an array of calculated spawn points of the whole piece and choose randomly 2 of those marking starting and ending points for the curves.
The first step that had to be done before start and end points could be chosen was getting the list of all spawn points available to be selected.

When this part was done, I have created a method that would choose start and end points for the line function from the list of all spawn points. It has to be noted that starting and ending points has to be chosen so that the line could split the shape into two separate shapes. Thus, I am measuring angles of spawn points and spawn points + 1 and spawn points – 1 to check whether angles are the same which would mean that the shape cannot be split into two.
Here is the result of line function implementation with 1 line and 45deg angled piece.


And some pretty interesting combinations could be achieved already with 10 lines although it is not correct as the lines are overlapping each other:

