lib/shape.js
function createPointObjects(array) {
    if (!array) {
        array = [];
    }

    var acc = array.reduce(function(accumulator, current) {
        if (current.x && current.y) { // Point
            accumulator.push(current);
        }
        else if (current.start && current.end && current.height) { // Arc
            // Consider an arc "flat enough" if its height is < the value times its length
            if (!current.interpolatedPoints) {
                current = new Arc(current.start, current.end, current.height);
            }
            var newPoints = current.interpolatedPoints({relative: 0.1});
            accumulator = accumulator.concat(newPoints);
        }
        else if (current[0] && current[1]) { // x, y pair
            var pt = new Point(current[0], current[1]);
            accumulator.push(pt);
        }
        else {
            debug("don't know how to accommodate", current);
        }
        return accumulator;
    }, []);
    return acc;
}
function createPointObjects(array) {
    if (!array) {
        array = [];
    }

    var acc = array.reduce(function(accumulator, current) {
        if (current.x && current.y) { // Point
            accumulator.push(current);
        }
        else if (current.start && current.end && current.height) { // Arc
            // Consider an arc "flat enough" if its height is < the value times its length
            if (!current.interpolatedPoints) {
                current = new Arc(current.start, current.end, current.height);
            }
            var newPoints = current.interpolatedPoints({relative: 0.1});
            accumulator = accumulator.concat(newPoints);
        }
        else if (current[0] && current[1]) { // x, y pair
            var pt = new Point(current[0], current[1]);
            accumulator.push(pt);
        }
        else {
            debug("don't know how to accommodate", current);
        }
        return accumulator;
    }, []);
    return acc;
}
function createPointObjects ( array ) { if ( ! array ) { array = [ ] ; } var acc = array . reduce ( function ( accumulator , current ) { if ( current . x && current . y ) { // Point accumulator . push ( current ) ; } else if ( current . start && current . end && current . height ) { // Arc // Consider an arc "flat enough" if its height is < the value times its length if ( ! current . interpolatedPoints ) { current = new Arc ( current . start , current . end , current . height ) ; } var newPoints = current . interpolatedPoints ( { relative : 0.1 } ) ; accumulator = accumulator . concat ( newPoints ) ; } else if ( current [ 0 ] && current [ 1 ] ) { // x, y pair var pt = new Point ( current [ 0 ] , current [ 1 ] ) ; accumulator . push ( pt ) ; } else { debug ( "don't know how to accommodate" , current ) ; } return accumulator ; } , [ ] ) ; return acc ; }
Ensure that the array is one of Point objects. If they're already `Point`s, simply return a copy; if not, create the `Point`s, interpolate the `Arc`s, etc
Ensure that the array is one of Point objects . If they re already Point s simply return a copy ; if not create the Point s interpolate the Arc s etc