Sorting and Comparing 3D Shapes