public static void WriteFloatArray(string filepath, VoxelArray array) { FileStream stream = File.Create(filepath); BinaryWriter writer = new BinaryWriter(stream); float[,,] fa = array.toFloatArray(); writer.Write(fa.GetLength(0)); writer.Write(fa.GetLength(1)); writer.Write(fa.GetLength(2)); for (int i = 0; i < fa.GetLength(0); i++) { for (int j = 0; j < fa.GetLength(1); j++) { for (int k = 0; k < fa.GetLength(2); k++) { writer.Write(fa[i, j, k]); } } } writer.Close(); stream.Close(); }
/// <summary> /// Writes the current voxels to a given file path. /// </summary> public static void WriteVoxels(string filename, VoxelArray cloud) { WriteVoxels(filename, cloud.toList()); }