I've been working for years on Processing, and I'm now in the process of "migrating" on js/node. Something I've quite worked on in the past is g-code generation. Now, I'm now a bit familiar with the svg implementation on vanilla js and as well on the main library, and something quite crucial for me was getting point on lines (apparently possible just on path, but i can convert everything into paths). Something i was still unable to do, anyway, It is something that was quite easy in Processing, with Geomerative.
I mean converting a shape into a polygon in a more efficient way: as far I've understood it is only possible getting points at a certain length with the js tools I've tried, so you divide the total length for the amount of steps you want and you get an array.
But on a straight line you just need the two ends, and the point distribution need to be higher on curves with a smaller radius. I'm wondering if someone know a way to get points this way, like in Geomerative you can with the Polygonizer adaptative option.
Thanks!