veltman / flubber

Tools for smoother shape animations.
MIT License
6.66k stars 170 forks source link

output precision for path strings need not use 16 digits #110

Open jrus opened 3 years ago

jrus commented 3 years ago

Right now Flubber returns massive path strings with lots of tiny straight-line segments whose vertices are specified to full double-precision floating point, converted to decimal for printing, which results in 16-digit decimals. This is unnecessarily precise, since (a) conforming SVG renderers only need to support single precision (no more than 8 digits) and (b) anything more than a few digits is visually indistinguishable.

I'd recommend using no finer than maybe 2 digits beyond the specified maxSegmentLength.