addPoint = function(px, py, pathSegType) {
            // all odd-numbered path types are relative except PATHSEG_CLOSEPATH (1)
            var isRelative = pathSegType % 2 === 1 && pathSegType > 1;

            // when the last point doesn't equal the current point add the current point
            if (!lastPoint || px != lastPoint.x || py != lastPoint.y) {
                if (lastPoint && isRelative) {
                    lx = lastPoint.x;
                    ly = lastPoint.y;
                } else {
                    lx = 0;
                    ly = 0;
                }

                var point = {
                    x: lx + px,
                    y: ly + py
                };

                // set last point
                if (isRelative || !lastPoint) {
                    lastPoint = point;
                }

                points.push(point);

                x = lx + px;
                y = ly + py;
            }
        }
Converts an SVG path into an array of vector points.
If the input path forms a concave shape, you must decompose the result into convex parts before use.
See `Bodies.fromVertices` which provides support for this.
Note that this function is not guaranteed to support complex paths (such as those with holes).
You must load the `pathseg.js` polyfill on newer browsers.
@method pathToVertices
@param {SVGPathElement} path
@param {Number} [sampleLength=15]
@return {Vector[]} points