topology.js
function normalize(cells, attr) {
  if(attr) {
    var len = cells.length
    var zipped = new Array(len)
    for(var i=0; i<len; ++i) {
      zipped[i] = [cells[i], attr[i]]
    }
    zipped.sort(compareZipped)
    for(var i=0; i<len; ++i) {
      cells[i] = zipped[i][0]
      attr[i] = zipped[i][1]
    }
    return cells
  } else {
    cells.sort(compareCells)
    return cells
  }
}
function normalize(cells, attr) {
  if(attr) {
    var len = cells.length
    var zipped = new Array(len)
    for(var i=0; i<len; ++i) {
      zipped[i] = [cells[i], attr[i]]
    }
    zipped.sort(compareZipped)
    for(var i=0; i<len; ++i) {
      cells[i] = zipped[i][0]
      attr[i] = zipped[i][1]
    }
    return cells
  } else {
    cells.sort(compareCells)
    return cells
  }
}
function normalize ( cells , attr ) { if ( attr ) { var len = cells . length var zipped = new Array ( len ) for ( var i = 0 ; i < len ; ++ i ) { zipped [ i ] = [ cells [ i ] , attr [ i ] ] } zipped . sort ( compareZipped ) for ( var i = 0 ; i < len ; ++ i ) { cells [ i ] = zipped [ i ] [ 0 ] attr [ i ] = zipped [ i ] [ 1 ] } return cells } else { cells . sort ( compareCells ) return cells } }
Puts a cell complex into normal order for the purposes of findCell queries
Puts a cell complex into normal order for the purposes of findCell queries