function getVertexCode(weight, threshold) {
  // threshold must be a single value or a range (array of size 2)

  // Iso-bands
  if (Array.isArray(threshold)) {
    if (weight < threshold[0]) {
      return 0;
    }
    return weight < threshold[1] ? 1 : 2;
  }
  // Iso-lines
  return weight >= threshold ? 1 : 0;
}
function getVertexCode(weight, threshold) {
  // threshold must be a single value or a range (array of size 2)

  // Iso-bands
  if (Array.isArray(threshold)) {
    if (weight < threshold[0]) {
      return 0;
    }
    return weight < threshold[1] ? 1 : 2;
  }
  // Iso-lines
  return weight >= threshold ? 1 : 0;
}
function getVertexCode ( weight , threshold ) { // threshold must be a single value or a range (array of size 2) // Iso-bands if ( Array . isArray ( threshold ) ) { if ( weight < threshold [ 0 ] ) { return 0 ; } return weight < threshold [ 1 ] ? 1 : 2 ; } // Iso-lines return weight >= threshold ? 1 : 0 ; }
Utility methods
Utility methods
Returns the vertex code for a given weight