I am trying to flatten a polysurface to UV space so that surfaces with adjacency lie next to each other. Ive written a script to find shared edges of surfaces and outputs the index of each shared surface. What I am trying to do is then take these indexes and arrange them to fit a grid - so that all shared edges meet up. e.g. Surface 0 shares edges with surfaces 7 and 8, surface 7 shares edges with 19,4, 3, surface 3 shares and edge with 8 etc. What I need to do is graphically represent this in a grid, so that I can map out the uvs and effectively solve the problem of surface seams. Does anyone have a clue how to do this kind of 2d shuffling?
Tags: