code: function flat (v) {
    // calculate normals for flat shading
    var n = new Float32Array(v.length)
    var i, l, crx, cry, crz, invScalar
    var hasFaultyTrigons = false
    for (i = 0, l = v.length; i < l; i += 9) {
      // cross product (a-b) x (c-b)
      crx = (v[i + 7] - v[i + 4]) * (v[i + 2] - v[i + 5]) - (v[i + 8] - v[i + 5]) * (v[i + 1] - v[i + 4])
      cry = (v[i + 8] - v[i + 5]) * (v[i] - v[i + 3]) - (v[i + 6] - v[i + 3]) * (v[i + 2] - v[i + 5])
      crz = (v[i + 6] - v[i + 3]) * (v[i + 1] - v[i + 4]) - (v[i + 7] - v[i + 4]) * (v[i] - v[i + 3])
      // normalize
      invScalar = 1 / Math.sqrt(crx * crx + cry * cry + crz * crz)
      // Fallback for trigons that don't span an area
      if (invScalar === Infinity) {
        invScalar = 0
        hasFaultyTrigons = true
      }
      // set normals
      n[i] = n[i + 3] = n[i + 6] = crx * invScalar
      n[i + 1] = n[i + 4] = n[i + 7] = cry * invScalar
      n[i + 2] = n[i + 5] = n[i + 8] = crz * invScalar
  
    }
    if (DEBUG && hasFaultyTrigons) console.error('Geometry contains trigons that don\'t span an area.')
    return n
  }
docs: methods