I started Polygonjs eight years ago. It was based on three.js, using TypeScript and Vue.js, offering procedural geometry in a browser. It worked very well. It helped ship a number of commercial projects. It’s still on GitHub.

But there were aspects of it that kept bugging me. It all came down to JavaScript.

Inspecting and controlling memory usage

One of the key features of Polygon is that you can generate procedural geometries. This means a typical app may generate a lot of them. Those can take up a lot of memory. In a browser, memory is quite constrained. If you use too much, the tab crashes.

Behind this generation, there was a system that tracked which geometries were in use, and how. Did the renderer use them? Did they serve as a cache between nodes, so that downstream nodes could recompute faster? If the answer to both questions was no, the system deleted the geometry. And deleting a geometry frees the memory it was using.