Shoutout to Michael Fogleman's primitive[1] for likely inspiring this work.
So one way to think about this is it’s a compression algorithm with aesthetic artifacts at high compression rates.
I wonder if you could use a multi-dimensional Hough-like transform on the primitive of choice to avoid the hill climbing step. You can do this easily with lines, but ellipses and triangles will be more difficult I’m sure. Sounds like a fun Christmas break programming project!
Thanks for sharing!