simplify.js
function computeWeight(i) {
    if(dead[i]) {
      return Infinity
    }
    //TODO: Check that the line segment doesn't cross once simplified
    var s = inv[i]
    var t = outv[i]
    if((s<0) || (t<0)) {
      return Infinity
    } else {
      return errorWeight(positions[i], positions[s], positions[t])
    }
  }
function computeWeight(i) {
    if(dead[i]) {
      return Infinity
    }
    //TODO: Check that the line segment doesn't cross once simplified
    var s = inv[i]
    var t = outv[i]
    if((s<0) || (t<0)) {
      return Infinity
    } else {
      return errorWeight(positions[i], positions[s], positions[t])
    }
  }
function computeWeight ( i ) { if ( dead [ i ] ) { return Infinity } //TODO: Check that the line segment doesn't cross once simplified var s = inv [ i ] var t = outv [ i ] if ( ( s < 0 ) || ( t < 0 ) ) { return Infinity } else { return errorWeight ( positions [ i ] , positions [ s ] , positions [ t ] ) } }
Updates the weight for vertex i
Updates the weight for vertex i