topology.js
function dual(cells, vertex_count) {
  if(!vertex_count) {
    return incidence(unique(skeleton(cells, 0)), cells, 0)
  }
  var res = new Array(vertex_count)
  for(var i=0; i<vertex_count; ++i) {
    res[i] = []
  }
  for(var i=0, len=cells.length; i<len; ++i) {
    var c = cells[i]
    for(var j=0, cl=c.length; j<cl; ++j) {
      res[c[j]].push(i)
    }
  }
  return res
}
function dual(cells, vertex_count) {
  if(!vertex_count) {
    return incidence(unique(skeleton(cells, 0)), cells, 0)
  }
  var res = new Array(vertex_count)
  for(var i=0; i<vertex_count; ++i) {
    res[i] = []
  }
  for(var i=0, len=cells.length; i<len; ++i) {
    var c = cells[i]
    for(var j=0, cl=c.length; j<cl; ++j) {
      res[c[j]].push(i)
    }
  }
  return res
}
function dual ( cells , vertex_count ) { if ( ! vertex_count ) { return incidence ( unique ( skeleton ( cells , 0 ) ) , cells , 0 ) } var res = new Array ( vertex_count ) for ( var i = 0 ; i < vertex_count ; ++ i ) { res [ i ] = [ ] } for ( var i = 0 , len = cells . length ; i < len ; ++ i ) { var c = cells [ i ] for ( var j = 0 , cl = c . length ; j < cl ; ++ j ) { res [ c [ j ] ] . push ( i ) } } return res }
Computes the dual of the mesh.  This is basically an optimized version of buildIndex for the situation where from_cells is just the list of vertices
Computes the dual of the mesh . This is basically an optimized version of buildIndex for the situation where from_cells is just the list of vertices