topology.js
function skeleton(cells, n) {
  if(n < 0) {
    return []
  }
  var result = []
    , k0     = (1<<(n+1))-1
  for(var i=0; i<cells.length; ++i) {
    var c = cells[i]
    for(var k=k0; k<(1<<c.length); k=bits.nextCombination(k)) {
      var b = new Array(n+1)
        , l = 0
      for(var j=0; j<c.length; ++j) {
        if(k & (1<<j)) {
          b[l++] = c[j]
        }
      }
      result.push(b)
    }
  }
  return normalize(result)
}
function skeleton(cells, n) {
  if(n < 0) {
    return []
  }
  var result = []
    , k0     = (1<<(n+1))-1
  for(var i=0; i<cells.length; ++i) {
    var c = cells[i]
    for(var k=k0; k<(1<<c.length); k=bits.nextCombination(k)) {
      var b = new Array(n+1)
        , l = 0
      for(var j=0; j<c.length; ++j) {
        if(k & (1<<j)) {
          b[l++] = c[j]
        }
      }
      result.push(b)
    }
  }
  return normalize(result)
}
function skeleton ( cells , n ) { if ( n < 0 ) { return [ ] } var result = [ ] , k0 = ( 1 << ( n + 1 ) ) - 1 for ( var i = 0 ; i < cells . length ; ++ i ) { var c = cells [ i ] for ( var k = k0 ; k < ( 1 << c . length ) ; k = bits . nextCombination ( k ) ) { var b = new Array ( n + 1 ) , l = 0 for ( var j = 0 ; j < c . length ; ++ j ) { if ( k & ( 1 << j ) ) { b [ l ++ ] = c [ j ] } } result . push ( b ) } } return normalize ( result ) }
Enumerates all of the n-cells of a cell complex
Enumerates all of the n - cells of a cell complex