There should be (at least) one additional line of code:
poly:=...
I tryed to find it myself, but I couldn't:)
'poly' should be replaced by 'polygons'
Yes, the definition of 'poly' was missing, corrected now. Thanks to both of you.
-- you have earned Featured Contributor Badge Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
Beautiful problem and solution, thanks for the demo and anniversary reminder! We also have have SpherePoints, that probably uses similar optimization methods (just guessing). And probably things like DelaunayMesh should help to find the polygons.