[whatwg] Questions regarding Path object
Jürg Lehni
lists at scratchdisk.com
Sat Mar 23 16:38:03 PDT 2013
Hello all,
I am now to this list, so before formulating my questions I'd like to introduce myself:
I am one of the creators of Paper.js <http://paperjs.org/>, a JavaScript framework focusing on vector graphics in the canvas element. The library is built on about a decade of work on <http://scriptographer.org/>, a JavaScript plugin for Adobe Illustrator.
Paper.js differs from other Canvas wrappers in its focus on offering simple tools to describe, craft and manipulate vector outlines. It currently offers path intersection, many handy tools to iterate over paths, find positions, precise hit-testing, interaction, creation of tools, etc. Soon we are adding stroke expansion and boolean operations. The code is based on efficient implementations of curve time parametrisation, curve length calculation through numerical integration, etc.
I have recently discovered this list and the discussion about the extension of the canvas element, and feel foolish for not joining earlier.
So here my questions:
- Paper.js has its own share of classes, and one of them is called Path. We normally run scoped but allow people to inject into the global scope. This would override the new Path constructor. I was wondering if this constructor should not have a less generic name, since I doubt we are the only library that this will collide with? For example CanvasPath?
- I see there are many ways to construct paths from different type of data, and perform manipulations on them. addPathByStrokingPath() and addPathByStrokingText() are both very welcome, for example. Will there be a way to access the resulting path description again, for example as SVG-style pathData? I have not seen a description of any such property on the object, but would strongly suggest that one is added, since having access to the result of such path manipulations would hugely increase the usefulness of the Path object.
That's it for now, I am sure more ideas will come to mind.
Jürg
More information about the whatwg
mailing list