jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.31k stars 455 forks source link

Bezier offseting #148

Open microbians opened 9 years ago

microbians commented 9 years ago

Maybe this could be useful ;)

http://microbians.com/?page=math&id=math-quadraticbezieroffseting

Here is also a demo (but in flash sorry)

http://microbians.com/?page=code&id=code-bezieroffsetingplayground

And here an html5 canvas implementation using my paper: http://brunoimbrizi.com/unbox/2015/03/offset-curve/

jonobr1 commented 9 years ago

Nice paper and really nice examples! I'm trying to think of typical use cases for this. The main thing that comes to mind for me is to create an abstraction to do varying stroke widths across a path: https://dl.dropboxusercontent.com/u/1595444/experiments/Society%206/trails/index.html

What do you use this type of offsetting for?

microbians commented 9 years ago

Yes the process is the same, but is needed to offset for the min and max sizes, and then interpolate the data (the interpolation must be in order of path length as parametrization to be accurate). I have a sketch app (in flash is old) that works with variable offseting

http://microbians.com/?page=code&id=code-theelectronicsketchbook

ceremcem commented 3 years ago

Any progress here?

I don't know if it helps in any way, here is something I think similar: https://github.com/glenzli/paperjs-offset

jonobr1 commented 3 years ago

No code committed yet, but this should be straightforward to add. I think this makes sense living in the /extras directory. Thanks for the reference!