using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static void Main()
new Point() { X = 1, Y = 2, Z = 3 },
new Point() { X = 4, Y = 5, Z = 6 },
var bytes = new byte[points.Length * 3 * sizeof(double)];
var doubles = MemoryMarshal.Cast<byte, double>(bytes);
for (int i = 0; i < points.Length; i++)
doubles[i * 3 + 0] = points[i].X;
doubles[i * 3 + 1] = points[i].Y;
doubles[i * 3 + 2] = points[i].Z;
Console.WriteLine(BitConverter.ToString(bytes));
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }