I know there are a lot of tutorials out there that tell you how to create a mesh from a height map. E.g. to create some terrain. I wish to know how I can do the reverse. So I have a mesh with a surface going from 0 to 10mm in height for example, and map the 0-10mm range to a grayscale 8bit grayscale bitmap (so 0 to 256). Is this possible with Blender? I do know a way how to convert it to a bitmap by exporting the mesh to *.dae and read the coordinates of the vertices in a script, and create the bitmap myself. But maybe there is an easier way.
The reason I want to do this is the following: A DLP UV light 3D resin printer has an uneven spread of light. There is intensity fall of to the sides. For this one can correct using a mask. But of course, you have to create that mask yourself. So I used a LDR, did some calibration measurements to be able to know what values represents what light intensities.
The box below represents the build area of the printer (X and Y), the Z axis represents relative light intensity (just from 0 to 100%). The plane with the 9 vertices represents the relative light intensity measured. So I have done 9 measurements on the build plate, a the same locations as those of the vertices.
Then the plane was subdivided once (simple) and the additional edges slided to the outer of the plane, so that the catmull clark subdivision leaves the rectangular shape of the plane as is, but does smooth out the rest. This is seen in the image below (slighty different angle than the previous image).
Then the mask for the printer requires it to be inverted. So the least light intensity from the measurement should be 100% white, and the center with the most light should be filtered the most. This is seen in the image below, which is a Z mirror of the subdivided plane.
Now of this smoothed out, inverted plane I wish to make a relative height mask. Where 0 is black (pixel value of 0), and the point touching the wire cube at the top is absolutely white (pixel value of 256). (Pixel values consider 8-bit grayscale image).