Debugging plots.
I've been a bit frustrated while generating the geometry, contours and paths for the plots I've created. This is mostly because I've had no real way to analyse the output, other than trying to parse and visualise path coordinates mentally, or to dump PNG after PNG of debug output, which still didn't really help.
For instance, the next problem I want to solve, is why sometimes it generates multiple paths on the inner contours of a torus. A single torus should render with either one, two or three paths at most, whereas I regularly see toruses with over 10 paths.
The top-left torus is side-on and can be rendered with a single path. The top-right and bottom-left toruses both need only two paths, and the bottom-right torus needs three. Why do I sometimes get 10 superfluous paths?
The problem could be in several different places in the generation pipeline. Is the goemetry projected properly? Are the edge contours choosing the correct edges from the model? Is the path generation, where the smaller edge lines are joined together, doing the right thing?
To answer these questions I've made a web GUI to visualise the plots a bit better. Until now I'd just dumped a PNG, or more recently an SVG, and just looked at it. Hrmm. I tried adding colours to different parts, which helps a little, but not enough. A GUI was a better idea.
This is by far the most HTML/Javascript I've written ever, and the most elaborate GUI I've made too. For the many decades that I've been coding, starting with DOS in the 1980s through to Windows in the 1990s, MacOS in the 2000s, Windows again in the 2010s, and FreeBSD/Linux throughout, I've been very comfortable sticking to the command line terminal for all my work. So writing a graphical interface at this stage was interesting.
It's great though, I can now inspect all the paths, highlight them and print where they are in the input. Plus I can just re-render any scene with any random seed at a click of the 'Render' button. Now to actually work out why I'm getting those extra paths... it looks like the contour code is a little too liberal. We'll see.