Method for finding intersection points

I propose to implement a method for finding intersection points for basic shapes and paths.

svgElements.getIntersectionPoints( svgElement )
-> Array of points, e.g. [{x: 1, y: 120}, …]

There are JavaScript libraries for this
http://www.kevlindev.com/geometry/2D/intersections/
http://raphaeljs.com/reference.html#Raphael.pathIntersection

There is a getIntersectionList method which calculates intersection using bounding boxes of the elements (http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#__svg__SVGSVGElement__getIntersectionList)
It does NOT return intersection points.

Motivation
Finding intersection is commonly used for drawing and prototyping applications such as Adobe Illustrator to "snap" objects.

Received on Wednesday, 19 June 2013 10:24:45 UTC