03 March 2013  #1 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

evenly distributed Points on Sphere
Im trying to evenly distribute some points on a sphere. I gather there are several methods including relaxation but I stumbled upon this page that was discussing a couple methods.
http://www.softimageblog.com/archives/115 Part way down is a python implimentation which I gather if you do it right you should end up with a spiral pattern that evenly places N# points across the surface. as you see here. http://www.flickr.com/photos/279743...in/photostream/ Im naturally not quite getting that yet. Any body want to see what I might be doing wrong? Thanks! Michael
Last edited by spaw : 03 March 2013 at 08:51 AM. 
03 March 2013  #2 
MAX Doctor
portfolio
Denis Trofimov
CA,
USA
Join Date: Jul 2009
Posts: 10,067

Originally Posted by spaw:
Im trying to evenly distribute some points on a sphere. I gather there are several methods including relaxation but I stumbled upon this page that was discussing a couple methods.
http://www.softimageblog.com/archives/115 Part way down is a python implimentation which I gather if you do it right you should end up with a spiral pattern that evenly places N# points across the surface. as you see here. http://www.flickr.com/photos/279743...in/photostream/ Im naturally not quite getting that yet. Any body want to see what I might be doing wrong? Thanks! Michael delete $_pts_*  Here is an implementation of the Saff and Kuijlaars algorithm for evenly distributed Points on Sphere  Golden Section spiral n= 50 num points on the sphere s = pi / sqrt(n) phi = 0 pts = #([0, 1,0] ) for k = 1 to n1 do ( y = 1.0 + ( 2.0 * k / ( n  1)) r = 1.0  (y * y) phi = phi + s / r append pts [(cos phi)*r, y, (sin phi)*r] ) append pts [0,1, 0] for i in pts do ( point pos:(i*100) centermarker:true cross:false name:("_pts_" + (i as string)) ) forceCompleteRedraw() if we got evenly distribution on a sphere, what is next? 
03 March 2013  #3 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

evenly distributed Points on a sphere
Sometimes it just takes starting from scratch... and someone that knows more than I do. As to whats next, I want to build a delaunay triangulation for the surface and eventually build a voronoi surface.
Michael
Last edited by spaw : 03 March 2013 at 08:51 AM. 
03 March 2013  #4 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

evenly distributed Points on a sphere
Here is a purely brute force way to approach it, slow and clunky but im sure someone here could make it better
https://vimeo.com/60932036 Michael

03 March 2013  #5 
isKindOf Artist
portfolio
Vojtech Cada
3D generalist
Czech Republic

Okay, next one in the row, been there, done that, once again long long time ago (not interactive, not polished, just a piece of code lost in my scripts folder; based on Saff and Kuiljaars' paper as well), sure enough the next thread you post will be something about Voronoi partitioning

03 March 2013  #6 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

evenly distributed Points on Sphere
Oh I think I like yours better Its nice to see this is well traveled ground. Thanks for sharing.
As far as voronoi partitioning do share as I haven't gone there yet. I do however want to get to the point where i can build a voronoi based mesh on arbitrary sets of 3d points. not trivial from the looks of it. Anything else you want to share would be great. Michael 
03 March 2013  #7 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

evenly distributed Points on a sphere
Denis would you be willing to take a stab at doing a pure rejection based version of this. I'm sure it would be faster than just relaxing the points but I'm not sure what it would look like. My guess is you need the area of the sphere divided by the number of points to establish a rejection radius then add a new point when it doesn't overlap any existing points. But I may be missing something. I still have to think its going to get slower prograssivle as more points are added but perhaps it would still cost less than moving all the points to a minimum energy state. god I wish I had taken math seriously as a kid
Thanks Michael 
03 March 2013  #8 
Veteran
TD/Visual Effects
Join Date: Dec 2004
Posts: 68

even distribution of points on a sphere
Here is a version that uses pure dart throwing, slower than molasses in the dead of winter for large point counts but it works. The distance between the points is calculated based on the area of the underlying sphere and the number of points you want. As you can imagine, the closer you get to that optimum distance the slower it will be to converge cause it takes a ton of attempts to find just the right spots to place a point.
I bet Denis could put this in a grid based acceleration structure and it would be a ton faster. I just need to find a bigger brain. Michael

03 March 2013  #9 
Expert
Join Date: Sep 2003
Posts: 1,066,473

Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. 
Thread Closed share thread 
«
Previous Thread

Next Thread
»


