public void BuildData(ref Mesh isoMesh) { for (int x = 0; x < data.GetLength(0); x++) { for (int y = 0; y < data.GetLength(1); y++) { for (int z = 0; z < data.GetLength(2); z++) { if (x == 0 || x == size.x - 1) { data[x, y, z] = -1; continue; } if (y == 0 || y == size.y - 1) { data[x, y, z] = -1; continue; } if (z == 0 || z == size.z - 1) { data[x, y, z] = -1; continue; } } } } data.Clamp(-1f, 1f); IsoUtils.BuildMeshFromData(ref isoMesh, data, size, surfaceCrossValue + 0.0001f); }