           (f[((k + 1) * ny + (j + 1)) * nx + (i + 0)] < threshold ? (1 << 6) : 0) |
           (f[((k + 1) * ny + (j + 1)) * nx + (i + 1)] < threshold ? (1 << 7) : 0);
 
-        const unsigned N = counts[mccase];
+        const unsigned N = mc_index_count[mccase];
         for (unsigned l = 0; l <N; l++) {
-          const auto r = mctable[16*mccase + l];
-
-          vertices.push_back((2 * i + ((r >> 3) & 1) + ((r >> 0) & 1)) / (2.f * nx));
-          vertices.push_back((2 * j + ((r >> 4) & 1) + ((r >> 1) & 1)) / (2.f * ny));
-          vertices.push_back((2 * k + ((r >> 5) & 1) + ((r >> 2) & 1)) / (2.f * nz));
+          const auto r = mc_triangles[16*mccase + l];
+
+          vertices.push_back((2 * i + 2*((r >> 3) & 1) + ((r >> 0) & 1)) / (2.f * nx));
+          vertices.push_back((2 * j + 2*((r >> 4) & 1) + ((r >> 1) & 1)) / (2.f * ny));
+          vertices.push_back((2 * k + 2*((r >> 5) & 1) + ((r >> 2) & 1)) / (2.f * nz));
         }
 #else
         unsigned mccase =

        {3,2}, // 2
        {3,0}, // 3
        {4,5}, // 4
        {5,6}, // 5
        {6,7}, // 6
        {7,4}, // 7
        {0,4}, // 8
        {1,5}, // 9
        {2,6}, // 10
        {3,7}  // 11
      };
      mctable[16 * n + i] = (vv[e[t][0]] << 3) | vv[e[t][1]];
      if (i % 3 == 2) {
        std::swap(mctable[16 * n + i - 1], mctable[16 * n + i]);
      }
    }
    counts[n] = i;
  }

  // reference code
  fprintf(stderr, "%d %zu\n", nx * ny * nz * 2, scalarField_host.size());

using namespace ComputeStuff::MC;

namespace {

  // Marching cubes tables.
  //
  // Original table from 'Marching Cubes Example Program` by Cory Bloyd,
  // released to the Public Domain.
  // http://paulbourke.net/geometry/polygonise/marchingsource.cpp
  //
  // Cell corners reorganized such that
  //
  //       6--------7
  //      /|       /|
  //     / |      / |
  //    4--------5  |
  //    |  2-----|--3     z  y
  //    | /      | /      ^ /
  //    |/       |/       |/
  //    0--------1        --->x
  //
  // Triangle indices are encoded such that bits 3, 4 and 5 tells the shift
  // along X, Y and Z respectively for the first end of the edge, and from
  // that, bits 0, 1, and 2 tells which of the X, Y and Z axes to follow, i.e.,
  // only one of the bits 0, 1, and 2 is set. Another invariant is that a
  // valid edge index is never zero.
  //
  const uint8_t mc_index_count[256] = {
    0, 3, 3, 6, 3, 6, 6, 9, 3, 6, 6, 9, 6, 9, 9, 6,
    3, 6, 6, 9, 6, 9, 9, 12, 6, 9, 9, 12, 9, 12, 12, 9,
    3, 6, 6, 9, 6, 9, 9, 12, 6, 9, 9, 12, 9, 12, 12, 9,
    6, 9, 9, 6, 9, 12, 12, 9, 9, 12, 12, 9, 12, 15, 15, 6,
    3, 6, 6, 9, 6, 9, 9, 12, 6, 9, 9, 12, 9, 12, 12, 9,
    6, 9, 9, 12, 9, 6, 12, 9, 9, 12, 12, 15, 12, 9, 15, 6,
    6, 9, 9, 12, 9, 12, 12, 15, 9, 12, 12, 15, 12, 15, 15, 12,
    9, 12, 12, 9, 12, 9, 15, 6, 12, 15, 15, 12, 15, 12, 6, 3,
    3, 6, 6, 9, 6, 9, 9, 12, 6, 9, 9, 12, 9, 12, 12, 9,
    6, 9, 9, 12, 9, 12, 12, 15, 9, 12, 12, 15, 12, 15, 15, 12,
    6, 9, 9, 12, 9, 12, 12, 15, 9, 12, 6, 9, 12, 15, 9, 6,
    9, 12, 12, 9, 12, 15, 15, 12, 12, 15, 9, 6, 15, 6, 12, 3,
    6, 9, 9, 12, 9, 12, 12, 15, 9, 12, 12, 15, 6, 9, 9, 6,
    9, 12, 12, 15, 12, 9, 15, 12, 12, 15, 15, 6, 9, 6, 12, 3,
    9, 12, 12, 15, 12, 15, 15, 6, 12, 15, 9, 12, 9, 12, 6, 3,
    6, 9, 9, 6, 9, 6, 12, 3, 9, 12, 6, 3, 6, 3, 3, 0
  };

  const uint8_t mc_triangles[256 * 16] = {
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 004, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 001, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 004, 002, 012, 014, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 002, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 001, 004, 024, 021, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 012, 014, 002, 024, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 012, 014, 021, 014, 024, 024, 014, 004, 0, 0, 0, 0, 0, 0, 0,
    034, 012, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    012, 021, 034, 001, 004, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    034, 014, 001, 021, 034, 001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 021, 034, 002, 034, 004, 004, 034, 014, 0, 0, 0, 0, 0, 0, 0,
    024, 034, 012, 002, 024, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    012, 001, 004, 012, 004, 034, 034, 004, 024, 0, 0, 0, 0, 0, 0, 0,
    001, 002, 024, 001, 024, 014, 014, 024, 034, 0, 0, 0, 0, 0, 0, 0,
    014, 004, 034, 034, 004, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 042, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 041, 042, 002, 001, 042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 001, 012, 041, 042, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 041, 042, 014, 042, 012, 012, 042, 002, 0, 0, 0, 0, 0, 0, 0,
    042, 004, 041, 024, 021, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 024, 021, 042, 021, 041, 041, 021, 001, 0, 0, 0, 0, 0, 0, 0,
    041, 042, 004, 001, 012, 014, 024, 021, 002, 0, 0, 0, 0, 0, 0, 0,
    042, 024, 021, 041, 042, 021, 041, 021, 012, 041, 012, 014, 0, 0, 0, 0,
    041, 042, 004, 012, 021, 034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 041, 042, 001, 042, 002, 021, 034, 012, 0, 0, 0, 0, 0, 0, 0,
    001, 021, 034, 001, 034, 014, 041, 042, 004, 0, 0, 0, 0, 0, 0, 0,
    041, 042, 002, 041, 002, 034, 041, 034, 014, 021, 034, 002, 0, 0, 0, 0,
    024, 034, 012, 024, 012, 002, 004, 041, 042, 0, 0, 0, 0, 0, 0, 0,
    012, 001, 041, 012, 041, 024, 012, 024, 034, 024, 041, 042, 0, 0, 0, 0,
    041, 042, 004, 001, 002, 014, 014, 002, 024, 014, 024, 034, 0, 0, 0, 0,
    042, 014, 041, 042, 024, 014, 024, 034, 014, 0, 0, 0, 0, 0, 0, 0,
    014, 052, 041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 014, 052, 004, 002, 001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 001, 012, 052, 041, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 004, 002, 041, 002, 052, 052, 002, 012, 0, 0, 0, 0, 0, 0, 0,
    014, 052, 041, 002, 024, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    004, 024, 021, 004, 021, 001, 014, 052, 041, 0, 0, 0, 0, 0, 0, 0,
    012, 052, 041, 012, 041, 001, 002, 024, 021, 0, 0, 0, 0, 0, 0, 0,
    041, 004, 024, 041, 024, 012, 041, 012, 052, 012, 024, 021, 0, 0, 0, 0,
    014, 052, 041, 012, 021, 034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 041, 014, 012, 021, 034, 004, 002, 001, 0, 0, 0, 0, 0, 0, 0,
    034, 052, 041, 034, 041, 021, 021, 041, 001, 0, 0, 0, 0, 0, 0, 0,
    034, 002, 021, 052, 002, 034, 052, 004, 002, 052, 041, 004, 0, 0, 0, 0,
    012, 002, 024, 012, 024, 034, 052, 041, 014, 0, 0, 0, 0, 0, 0, 0,
    041, 014, 052, 004, 034, 001, 004, 024, 034, 034, 012, 001, 0, 0, 0, 0,
    052, 024, 034, 052, 001, 024, 052, 041, 001, 002, 024, 001, 0, 0, 0, 0,
    041, 034, 052, 041, 004, 034, 004, 024, 034, 0, 0, 0, 0, 0, 0, 0,
    052, 042, 004, 014, 052, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 014, 052, 001, 052, 002, 002, 052, 042, 0, 0, 0, 0, 0, 0, 0,
    004, 001, 012, 004, 012, 042, 042, 012, 052, 0, 0, 0, 0, 0, 0, 0,
    052, 042, 012, 042, 002, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    004, 014, 052, 004, 052, 042, 024, 021, 002, 0, 0, 0, 0, 0, 0, 0,
    014, 021, 001, 014, 042, 021, 014, 052, 042, 024, 021, 042, 0, 0, 0, 0,
    024, 021, 002, 004, 001, 042, 042, 001, 012, 042, 012, 052, 0, 0, 0, 0,
    021, 042, 024, 021, 012, 042, 012, 052, 042, 0, 0, 0, 0, 0, 0, 0,
    052, 042, 004, 052, 004, 014, 012, 021, 034, 0, 0, 0, 0, 0, 0, 0,
    034, 012, 021, 052, 002, 014, 052, 042, 002, 002, 001, 014, 0, 0, 0, 0,
    004, 052, 042, 004, 021, 052, 004, 001, 021, 021, 034, 052, 0, 0, 0, 0,
    034, 002, 021, 034, 052, 002, 052, 042, 002, 0, 0, 0, 0, 0, 0, 0,
    034, 012, 002, 034, 002, 024, 014, 052, 004, 004, 052, 042, 0, 0, 0, 0,
    034, 001, 024, 034, 012, 001, 024, 001, 042, 014, 052, 001, 042, 001, 052, 0,
    042, 001, 052, 042, 004, 001, 052, 001, 034, 002, 024, 001, 034, 001, 024, 0,
    042, 034, 052, 024, 034, 042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 061, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    004, 002, 001, 042, 061, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 001, 012, 061, 024, 042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 012, 014, 002, 014, 004, 042, 061, 024, 0, 0, 0, 0, 0, 0, 0,
    002, 042, 061, 021, 002, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    004, 042, 061, 004, 061, 001, 001, 061, 021, 0, 0, 0, 0, 0, 0, 0,
    002, 042, 061, 002, 061, 021, 012, 014, 001, 0, 0, 0, 0, 0, 0, 0,
    012, 014, 004, 012, 004, 061, 012, 061, 021, 042, 061, 004, 0, 0, 0, 0,
    061, 024, 042, 034, 012, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 004, 002, 021, 034, 012, 042, 061, 024, 0, 0, 0, 0, 0, 0, 0,
    034, 014, 001, 034, 001, 021, 024, 042, 061, 0, 0, 0, 0, 0, 0, 0,
    061, 024, 042, 034, 004, 021, 034, 014, 004, 004, 002, 021, 0, 0, 0, 0,
    061, 034, 012, 061, 012, 042, 042, 012, 002, 0, 0, 0, 0, 0, 0, 0,
    004, 042, 061, 001, 004, 061, 001, 061, 034, 001, 034, 012, 0, 0, 0, 0,
    061, 034, 014, 061, 014, 002, 061, 002, 042, 002, 014, 001, 0, 0, 0, 0,
    061, 004, 042, 061, 034, 004, 034, 014, 004, 0, 0, 0, 0, 0, 0, 0,
    041, 061, 024, 004, 041, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    024, 002, 001, 024, 001, 061, 061, 001, 041, 0, 0, 0, 0, 0, 0, 0,
    041, 061, 024, 041, 024, 004, 001, 012, 014, 0, 0, 0, 0, 0, 0, 0,
    014, 002, 012, 014, 061, 002, 014, 041, 061, 061, 024, 002, 0, 0, 0, 0,
    002, 004, 041, 002, 041, 021, 021, 041, 061, 0, 0, 0, 0, 0, 0, 0,
    041, 061, 001, 001, 061, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 001, 012, 041, 021, 004, 041, 061, 021, 021, 002, 004, 0, 0, 0, 0,
    014, 021, 012, 014, 041, 021, 041, 061, 021, 0, 0, 0, 0, 0, 0, 0,
    024, 004, 041, 024, 041, 061, 034, 012, 021, 0, 0, 0, 0, 0, 0, 0,
    012, 021, 034, 001, 061, 002, 001, 041, 061, 061, 024, 002, 0, 0, 0, 0,
    041, 061, 004, 061, 024, 004, 001, 034, 014, 001, 021, 034, 0, 0, 0, 0,
    061, 002, 041, 061, 024, 002, 041, 002, 014, 021, 034, 002, 014, 002, 034, 0,
    004, 041, 061, 004, 061, 012, 004, 012, 002, 034, 012, 061, 0, 0, 0, 0,
    012, 061, 034, 012, 001, 061, 001, 041, 061, 0, 0, 0, 0, 0, 0, 0,
    014, 002, 034, 014, 001, 002, 034, 002, 061, 004, 041, 002, 061, 002, 041, 0,
    014, 061, 034, 041, 061, 014, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 041, 014, 061, 024, 042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 052, 041, 004, 002, 001, 061, 024, 042, 0, 0, 0, 0, 0, 0, 0,
    041, 001, 012, 041, 012, 052, 061, 024, 042, 0, 0, 0, 0, 0, 0, 0,
    061, 024, 042, 041, 004, 052, 052, 004, 002, 052, 002, 012, 0, 0, 0, 0,
    061, 021, 002, 061, 002, 042, 041, 014, 052, 0, 0, 0, 0, 0, 0, 0,
    052, 041, 014, 061, 001, 042, 061, 021, 001, 001, 004, 042, 0, 0, 0, 0,
    042, 061, 021, 042, 021, 002, 052, 041, 012, 012, 041, 001, 0, 0, 0, 0,
    052, 004, 012, 052, 041, 004, 012, 004, 021, 042, 061, 004, 021, 004, 061, 0,
    041, 014, 052, 061, 024, 042, 012, 021, 034, 0, 0, 0, 0, 0, 0, 0,
    014, 052, 041, 034, 012, 021, 004, 002, 001, 061, 024, 042, 0, 0, 0, 0,
    042, 061, 024, 041, 021, 052, 041, 001, 021, 021, 034, 052, 0, 0, 0, 0,
    052, 041, 004, 052, 004, 002, 052, 002, 034, 021, 034, 002, 061, 024, 042, 0,
    014, 052, 041, 012, 042, 034, 012, 002, 042, 042, 061, 034, 0, 0, 0, 0,
    001, 004, 042, 001, 042, 061, 001, 061, 012, 034, 012, 061, 014, 052, 041, 0,
    042, 034, 002, 042, 061, 034, 002, 034, 001, 052, 041, 034, 001, 034, 041, 0,
    061, 004, 042, 061, 034, 004, 041, 004, 052, 052, 004, 034, 0, 0, 0, 0,
    052, 061, 024, 052, 024, 014, 014, 024, 004, 0, 0, 0, 0, 0, 0, 0,
    001, 024, 002, 014, 024, 001, 014, 061, 024, 014, 052, 061, 0, 0, 0, 0,
    061, 012, 052, 061, 004, 012, 061, 024, 004, 001, 012, 004, 0, 0, 0, 0,
    024, 052, 061, 024, 002, 052, 002, 012, 052, 0, 0, 0, 0, 0, 0, 0,
    052, 061, 021, 052, 021, 004, 052, 004, 014, 004, 021, 002, 0, 0, 0, 0,
    052, 001, 014, 052, 061, 001, 061, 021, 001, 0, 0, 0, 0, 0, 0, 0,
    021, 004, 061, 021, 002, 004, 061, 004, 052, 001, 012, 004, 052, 004, 012, 0,
    052, 021, 012, 061, 021, 052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    012, 021, 034, 052, 061, 014, 014, 061, 024, 014, 024, 004, 0, 0, 0, 0,
    014, 052, 061, 014, 061, 024, 014, 024, 001, 002, 001, 024, 012, 021, 034, 0,
    021, 052, 001, 021, 034, 052, 001, 052, 004, 061, 024, 052, 004, 052, 024, 0,
    024, 052, 061, 024, 002, 052, 034, 052, 021, 021, 052, 002, 0, 0, 0, 0,
    014, 061, 004, 014, 052, 061, 004, 061, 002, 034, 012, 061, 002, 061, 012, 0,
    012, 061, 034, 012, 001, 061, 052, 061, 014, 014, 061, 001, 0, 0, 0, 0,
    052, 061, 034, 004, 001, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 061, 034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 061, 004, 002, 001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 061, 014, 001, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 004, 002, 014, 002, 012, 034, 061, 052, 0, 0, 0, 0, 0, 0, 0,
    034, 061, 052, 021, 002, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 001, 004, 021, 004, 024, 061, 052, 034, 0, 0, 0, 0, 0, 0, 0,
    014, 001, 012, 034, 061, 052, 002, 024, 021, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 061, 014, 024, 012, 014, 004, 024, 024, 021, 012, 0, 0, 0, 0,
    052, 012, 021, 061, 052, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 061, 052, 021, 052, 012, 001, 004, 002, 0, 0, 0, 0, 0, 0, 0,
    052, 014, 001, 052, 001, 061, 061, 001, 021, 0, 0, 0, 0, 0, 0, 0,
    052, 021, 061, 052, 004, 021, 052, 014, 004, 004, 002, 021, 0, 0, 0, 0,
    024, 061, 052, 024, 052, 002, 002, 052, 012, 0, 0, 0, 0, 0, 0, 0,
    061, 052, 012, 061, 012, 004, 061, 004, 024, 001, 004, 012, 0, 0, 0, 0,
    001, 002, 024, 014, 001, 024, 014, 024, 061, 014, 061, 052, 0, 0, 0, 0,
    052, 024, 061, 052, 014, 024, 014, 004, 024, 0, 0, 0, 0, 0, 0, 0,
    041, 042, 004, 052, 034, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 002, 001, 042, 001, 041, 052, 034, 061, 0, 0, 0, 0, 0, 0, 0,
    001, 012, 014, 041, 042, 004, 034, 061, 052, 0, 0, 0, 0, 0, 0, 0,
    034, 061, 052, 014, 041, 012, 012, 041, 042, 012, 042, 002, 0, 0, 0, 0,
    052, 034, 061, 042, 004, 041, 021, 002, 024, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 061, 042, 024, 041, 041, 024, 021, 041, 021, 001, 0, 0, 0, 0,
    024, 021, 002, 041, 042, 004, 014, 001, 012, 034, 061, 052, 0, 0, 0, 0,
    041, 042, 024, 041, 024, 021, 041, 021, 014, 012, 014, 021, 052, 034, 061, 0,
    052, 012, 021, 052, 021, 061, 042, 004, 041, 0, 0, 0, 0, 0, 0, 0,
    052, 012, 061, 012, 021, 061, 042, 001, 041, 042, 002, 001, 0, 0, 0, 0,
    042, 004, 041, 052, 014, 061, 061, 014, 001, 061, 001, 021, 0, 0, 0, 0,
    061, 014, 021, 061, 052, 014, 021, 014, 002, 041, 042, 014, 002, 014, 042, 0,
    041, 042, 004, 052, 002, 061, 052, 012, 002, 002, 024, 061, 0, 0, 0, 0,
    041, 024, 001, 041, 042, 024, 001, 024, 012, 061, 052, 024, 012, 024, 052, 0,
    014, 001, 002, 014, 002, 024, 014, 024, 052, 061, 052, 024, 041, 042, 004, 0,
    042, 014, 041, 042, 024, 014, 052, 014, 061, 061, 014, 024, 0, 0, 0, 0,
    014, 034, 061, 041, 014, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 034, 061, 014, 061, 041, 004, 002, 001, 0, 0, 0, 0, 0, 0, 0,
    012, 034, 061, 012, 061, 001, 001, 061, 041, 0, 0, 0, 0, 0, 0, 0,
    004, 061, 041, 004, 012, 061, 004, 002, 012, 034, 061, 012, 0, 0, 0, 0,
    061, 041, 014, 061, 014, 034, 021, 002, 024, 0, 0, 0, 0, 0, 0, 0,
    001, 004, 024, 001, 024, 021, 041, 014, 061, 061, 014, 034, 0, 0, 0, 0,
    002, 024, 021, 012, 034, 001, 001, 034, 061, 001, 061, 041, 0, 0, 0, 0,
    024, 012, 004, 024, 021, 012, 004, 012, 041, 034, 061, 012, 041, 012, 061, 0,
    014, 012, 021, 014, 021, 041, 041, 021, 061, 0, 0, 0, 0, 0, 0, 0,
    004, 002, 001, 014, 012, 041, 041, 012, 021, 041, 021, 061, 0, 0, 0, 0,
    041, 001, 061, 001, 021, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 041, 004, 002, 021, 041, 021, 061, 041, 0, 0, 0, 0, 0, 0, 0,
    014, 012, 002, 014, 002, 061, 014, 061, 041, 061, 002, 024, 0, 0, 0, 0,
    041, 012, 061, 041, 014, 012, 061, 012, 024, 001, 004, 012, 024, 012, 004, 0,
    024, 001, 002, 024, 061, 001, 061, 041, 001, 0, 0, 0, 0, 0, 0, 0,
    041, 024, 061, 004, 024, 041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    061, 042, 004, 061, 004, 034, 034, 004, 014, 0, 0, 0, 0, 0, 0, 0,
    061, 014, 034, 061, 002, 014, 061, 042, 002, 002, 001, 014, 0, 0, 0, 0,
    004, 061, 042, 001, 061, 004, 001, 034, 061, 001, 012, 034, 0, 0, 0, 0,
    061, 012, 034, 061, 042, 012, 042, 002, 012, 0, 0, 0, 0, 0, 0, 0,
    021, 002, 024, 061, 042, 034, 034, 042, 004, 034, 004, 014, 0, 0, 0, 0,
    034, 042, 014, 034, 061, 042, 014, 042, 001, 024, 021, 042, 001, 042, 021, 0,
    001, 012, 034, 001, 034, 061, 001, 061, 004, 042, 004, 061, 002, 024, 021, 0,
    021, 042, 024, 021, 012, 042, 061, 042, 034, 034, 042, 012, 0, 0, 0, 0,
    012, 004, 014, 012, 061, 004, 012, 021, 061, 042, 004, 061, 0, 0, 0, 0,
    002, 014, 042, 002, 001, 014, 042, 014, 061, 012, 021, 014, 061, 014, 021, 0,
    004, 061, 042, 004, 001, 061, 001, 021, 061, 0, 0, 0, 0, 0, 0, 0,
    002, 061, 042, 021, 061, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 061, 012, 002, 024, 061, 012, 061, 014, 042, 004, 061, 014, 061, 004, 0,
    014, 012, 001, 061, 042, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    024, 001, 002, 024, 061, 001, 004, 001, 042, 042, 001, 061, 0, 0, 0, 0,
    042, 024, 061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 052, 034, 024, 042, 034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 052, 034, 042, 034, 024, 002, 001, 004, 0, 0, 0, 0, 0, 0, 0,
    034, 024, 042, 034, 042, 052, 014, 001, 012, 0, 0, 0, 0, 0, 0, 0,
    014, 004, 012, 004, 002, 012, 034, 042, 052, 034, 024, 042, 0, 0, 0, 0,
    034, 021, 002, 034, 002, 052, 052, 002, 042, 0, 0, 0, 0, 0, 0, 0,
    004, 042, 052, 004, 052, 021, 004, 021, 001, 021, 052, 034, 0, 0, 0, 0,
    014, 001, 012, 034, 021, 052, 052, 021, 002, 052, 002, 042, 0, 0, 0, 0,
    052, 021, 042, 052, 034, 021, 042, 021, 004, 012, 014, 021, 004, 021, 014, 0,
    021, 024, 042, 021, 042, 012, 012, 042, 052, 0, 0, 0, 0, 0, 0, 0,
    004, 002, 001, 042, 012, 024, 042, 052, 012, 012, 021, 024, 0, 0, 0, 0,
    014, 001, 021, 014, 021, 042, 014, 042, 052, 024, 042, 021, 0, 0, 0, 0,
    004, 021, 014, 004, 002, 021, 014, 021, 052, 024, 042, 021, 052, 021, 042, 0,
    052, 012, 042, 042, 012, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    004, 012, 001, 004, 042, 012, 042, 052, 012, 0, 0, 0, 0, 0, 0, 0,
    001, 052, 014, 001, 002, 052, 002, 042, 052, 0, 0, 0, 0, 0, 0, 0,
    052, 004, 042, 014, 004, 052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 052, 034, 041, 034, 004, 004, 034, 024, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 024, 052, 024, 001, 052, 001, 041, 002, 001, 024, 0, 0, 0, 0,
    001, 012, 014, 041, 052, 004, 004, 052, 034, 004, 034, 024, 0, 0, 0, 0,
    012, 041, 002, 012, 014, 041, 002, 041, 024, 052, 034, 041, 024, 041, 034, 0,
    034, 021, 002, 052, 034, 002, 052, 002, 004, 052, 004, 041, 0, 0, 0, 0,
    034, 041, 052, 034, 021, 041, 021, 001, 041, 0, 0, 0, 0, 0, 0, 0,
    052, 034, 021, 052, 021, 002, 052, 002, 041, 004, 041, 002, 014, 001, 012, 0,
    034, 041, 052, 034, 021, 041, 014, 041, 012, 012, 041, 021, 0, 0, 0, 0,
    041, 024, 004, 041, 012, 024, 041, 052, 012, 012, 021, 024, 0, 0, 0, 0,
    012, 024, 052, 012, 021, 024, 052, 024, 041, 002, 001, 024, 041, 024, 001, 0,
    004, 052, 024, 004, 041, 052, 024, 052, 021, 014, 001, 052, 021, 052, 001, 0,
    014, 041, 052, 002, 021, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 002, 004, 041, 052, 002, 052, 012, 002, 0, 0, 0, 0, 0, 0, 0,
    041, 012, 001, 052, 012, 041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 052, 014, 001, 002, 052, 041, 052, 004, 004, 052, 002, 0, 0, 0, 0,
    014, 041, 052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 041, 014, 042, 014, 024, 024, 014, 034, 0, 0, 0, 0, 0, 0, 0,
    001, 004, 002, 014, 024, 041, 014, 034, 024, 024, 042, 041, 0, 0, 0, 0,
    012, 041, 001, 012, 024, 041, 012, 034, 024, 024, 042, 041, 0, 0, 0, 0,
    024, 041, 034, 024, 042, 041, 034, 041, 012, 004, 002, 041, 012, 041, 002, 0,
    041, 002, 042, 041, 034, 002, 041, 014, 034, 021, 002, 034, 0, 0, 0, 0,
    001, 042, 021, 001, 004, 042, 021, 042, 034, 041, 014, 042, 034, 042, 014, 0,
    001, 034, 041, 001, 012, 034, 041, 034, 042, 021, 002, 034, 042, 034, 002, 0,
    041, 004, 042, 012, 034, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    042, 021, 024, 041, 021, 042, 041, 012, 021, 041, 014, 012, 0, 0, 0, 0,
    041, 014, 012, 041, 012, 021, 041, 021, 042, 024, 042, 021, 004, 002, 001, 0,
    042, 021, 024, 042, 041, 021, 041, 001, 021, 0, 0, 0, 0, 0, 0, 0,
    002, 041, 004, 002, 021, 041, 042, 041, 024, 024, 041, 021, 0, 0, 0, 0,
    014, 042, 041, 014, 012, 042, 012, 002, 042, 0, 0, 0, 0, 0, 0, 0,
    004, 012, 001, 004, 042, 012, 014, 012, 041, 041, 012, 042, 0, 0, 0, 0,
    001, 042, 041, 002, 042, 001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    041, 004, 042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 034, 004, 034, 024, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 024, 002, 001, 014, 024, 014, 034, 024, 0, 0, 0, 0, 0, 0, 0,
    012, 004, 001, 012, 034, 004, 034, 024, 004, 0, 0, 0, 0, 0, 0, 0,
    024, 012, 034, 002, 012, 024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 034, 021, 002, 004, 034, 004, 014, 034, 0, 0, 0, 0, 0, 0, 0,
    034, 001, 014, 021, 001, 034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    002, 034, 021, 002, 004, 034, 012, 034, 001, 001, 034, 004, 0, 0, 0, 0,
    034, 021, 012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 014, 012, 021, 024, 014, 024, 004, 014, 0, 0, 0, 0, 0, 0, 0,
    021, 014, 012, 021, 024, 014, 001, 014, 002, 002, 014, 024, 0, 0, 0, 0,
    021, 004, 001, 024, 004, 021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    021, 024, 002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 002, 004, 012, 002, 014, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    014, 012, 001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    001, 002, 004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  };


  // Table from 'Marching Cubes Example Program` by Cory Bloyd, released to the Public Domain.
  // http://paulbourke.net/geometry/polygonise/marchingsource.cpp
