mitxela / plotterfun

MIT License
331 stars 63 forks source link

Halftone creates nonsense vectors #10

Closed zxsq-cc closed 4 years ago

zxsq-cc commented 4 years ago

Certain settings in the halftone tool create arcs of zero radius, leading to parsing errors in other svg tools.

ex. a 0.000 0.000 0 1 0 0.001 0Z

Example generated svg.

mitxela commented 4 years ago

@HomineLudens made that one.

I might as well patch helpers.js so algorithms don't need to worry about it.

The circles are all drawn using arc commands since it lets us use a single path string and makes the svg much smaller. But it is a bit of a hack.

Not sure if a zero radius circle should be no circle at all, or the smallest possible dot. Probably a tiny dot.

mitxela commented 4 years ago

OK, made circles have a minimum radius which should stop the nonsense output, and added a cutoff slider to halftone so you can get rid of the smallest circles entirely if you want.

HomineLudens commented 4 years ago

Seems like I'm late to the party 😁 Thanks for fix it @mitxela