I searched for uv coordinate mapping atlas algorithms
What you needed was a Mapping coordinate atlas, and an algorithm to create them. I was curious about that matter, so, i started the search. I found that after some people in gamedev had also a similar question.
In DX9c and further i have seen that they have implemented one algorithm for texture coordinate atlas.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt