The centroid of each particle was obtained through 3D Gaussian fitting of the confocal microscopy images. To analyze the 3D structure of the optical matter and extract specific structural arrangements, such as the hexagonal close-packed (HCP) lattice, Euclidean distance-based calculations were essential. The process began with the preparation of the particle position data, where the 3D coordinates (x, y, z) of the particles were loaded into a matrix. This data was initially in pixel units, so a conversion factor was applied to transform these values into physical units, such as micrometers. Next, the particles were segmented into distinct layers based on their Z-coordinates (Figure ). This was achieved by defining a specific layer thickness, with particles within a certain grouped into the same layer. A Z-error margin of 20-30% was also considered to account for minor variations in the Z-coordinate, ensuring that particles within a specific range were correctly identified as part of the same layer.