PIXEL FILE CONVERT
The provided script illustrates how to convert a grayscale pixel file into a 3D surface or mesh.
The main function is the component Image Sampler.
Image Sampler reads the pixel data and maps it to indivicual U,V coordinates.
The Z-axis is then scaled relative to these U,V dimensions based on the file’s native pixel file resolution.
The ScaleNU component is used to scale the mesh or surface to the actual size.
The Image Sampler component has a practical limit of around 1 million pixels. For larger pixel files use the HeightField command directly in Rhino, then reference the resulting mesh back into grasshopper.
From HeightField (Rhino command)
Mesh from pixel file
Surface from pixel file