It’s fun.
Closing a line multiple times does not seem to work. For example a figure 8 is detected as a single circle.
At the end I was having to really aggressively optimize the shape checking algo to avoid blocking the game thread/freezing the game. This was one of the side effects of that.