src/builders/polylines.js
function permuteLine(line, startIndex){
    var newLine = [];
    for (let i = 0; i < line.length; i++){
        var index = (i + startIndex) % line.length;
        // skip the first (repeated) index
        if (index !== 0) {
            newLine.push(line[index]);
        }
    }
    newLine.push(newLine[0]);
    return newLine;
}
function permuteLine(line, startIndex){
    var newLine = [];
    for (let i = 0; i < line.length; i++){
        var index = (i + startIndex) % line.length;
        // skip the first (repeated) index
        if (index !== 0) {
            newLine.push(line[index]);
        }
    }
    newLine.push(newLine[0]);
    return newLine;
}
function permuteLine ( line , startIndex ) { var newLine = [ ] ; for ( let i = 0 ; i < line . length ; i ++ ) { var index = ( i + startIndex ) % line . length ; // skip the first (repeated) index if ( index !== 0 ) { newLine . push ( line [ index ] ) ; } } newLine . push ( newLine [ 0 ] ) ; return newLine ; }
Cyclically permute closed line starting at an index
Cyclically permute closed line starting at an index