I am looking for a solution to automate texture mapping on a mesh. In the scenario depicted in the image, I have applied a single texture (1024 X 1024 pixels) to two cubes, each with different surface areas. The texture appears resized for both cubes due to scaling based on the UV coordinates. I am curious if there is a method to calculate the ideal image scale for each surface. Is there a mathematical equation that relates surface bounds, UV coordinates, and image size?
https://i.sstatic.net/4gi3e.jpg