I have a triangular mesh of a surface curved in two directions, e.g. a sphere. It is therefore not possible to roll this surface flat (essentially specifying a mapping to U,V texture coordinates) without distorting some of the triangles. Does anyone know of a C++ library that can take the mesh as input and produce as output suitable U,V texture coordinates for each mesh vertex, such that the resulting implied texture map distorts the triangles as little as possible?
EDIT: An example of this process is described in this paper - "Least Squares Conformal Maps for Automatic Texture Atlas Generation". I'm basically after an implementation of that, or something which does the same thing.