W3C home > Mailing lists > Public > www-svg@w3.org > June 2013

Method for finding intersection points

From: Nikita Vasilyev <me@elv1s.ru>
Date: Wed, 19 Jun 2013 14:27:36 +0400
Message-Id: <1135AF57-6A37-48AB-8B1A-C5D79400719A@elv1s.ru>
To: www-svg@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:44 UTC