osresearch / plotter-vision

Hidden Wireframe removal demo in p5.js
GNU General Public License v2.0
87 stars 18 forks source link

Provide a view port for exported SVG #19

Closed pilhuhn closed 1 year ago

pilhuhn commented 3 years ago

Currently the exported SVG has a width/weight, that is fixed and much larger than the actual drawn surface. It would be good to have a view-port that shows the part of the canvas that is really used.

For example the bunny in https://twitter.com/pilhuhn/status/1345759428239364098 has <svg width='1480px' height='885px' ...> but the actual path data is:

minX  : 351, maxX = 1051
minY  : 11, maxY = 760

which translates to Height: 700.0, Width : 749.0

osresearch commented 2 years ago

Does #26 satisfy this? It now clips the segments to the viewport.

osresearch commented 1 year ago

Hopefully this is working for you. It seems to fine for me.