mmm donuts
As a quick aside in the pursuit of point-clouds,
i generated some point clouds which are points 'near' the surface of a torroid.
The nifty part is that the points are evenly distributed on the donut surface.
That is, if you were standing on the donut, you'd perceive the average point density around you to be pretty much constant no matter where you were standing.
This is actually non-trivial.
Consider the traditional simple mapping of wrapping a rectangle around a donut via theta = x , phi = y. This mapping contracts the map on the inner wall of the donut and expands it on the outter.
Similarly with a sphere, theta = x, phi = y contracts at the poles.
For a sphere this turns out to have a simple analytical solution which i think is just theta = x, phi = sqrt(y). (I explore this mapping here)
However such an analytical mapping of a rectangle onto a donut turns out to be much more complex. Science News had an article in 2003 or 2004 which talked about a recent solution, but i can't find it.
For evenly distributing Random points however,
there's a fairly simple if brutish approach:
Torroid with 100,000 points evenly distributed within 0.01 units of its surface, not projected:


Comparison of filtered and non-filtered projected points:


.. honestly, it barely makes a visual difference, but it's nice to see anyhow.
Actually, after doing some more comparisons with donuts of different shapes,
i've come to the conclusion that the whole threshholding thing is pretty much unnecessary if you project the points onto the donut surface.
Funnily, projecting a point onto the surface of a donut is suprisingly simple and doesn't involve and trig.
Just project the point in question onto the circle which is the core of the donut and then project onto the surface.
i generated some point clouds which are points 'near' the surface of a torroid.
The nifty part is that the points are evenly distributed on the donut surface.
That is, if you were standing on the donut, you'd perceive the average point density around you to be pretty much constant no matter where you were standing.
This is actually non-trivial.
Consider the traditional simple mapping of wrapping a rectangle around a donut via theta = x , phi = y. This mapping contracts the map on the inner wall of the donut and expands it on the outter.
Similarly with a sphere, theta = x, phi = y contracts at the poles.
For a sphere this turns out to have a simple analytical solution which i think is just theta = x, phi = sqrt(y). (I explore this mapping here)
However such an analytical mapping of a rectangle onto a donut turns out to be much more complex. Science News had an article in 2003 or 2004 which talked about a recent solution, but i can't find it.
For evenly distributing Random points however,
there's a fairly simple if brutish approach:
- choose a random point inside the rectilinear volume which contains the torus.
- if the point is within some threshhold of the torus surface keep it.
- optional: project the point onto the torus surface. (this actually introduces a bit of non-even distribution, but it allows you to relax the threshhold quite a bit)
- repeat until you have as many points as you want.
Torroid with 100,000 points evenly distributed within 0.01 units of its surface, not projected:


Comparison of filtered and non-filtered projected points:


.. honestly, it barely makes a visual difference, but it's nice to see anyhow.
Actually, after doing some more comparisons with donuts of different shapes,
i've come to the conclusion that the whole threshholding thing is pretty much unnecessary if you project the points onto the donut surface.
Funnily, projecting a point onto the surface of a donut is suprisingly simple and doesn't involve and trig.
Just project the point in question onto the circle which is the core of the donut and then project onto the surface.

2 Comments:
Actually, projecting onto the core circle then onto the surface would yield all
of the points in the circle centered on and perpendicular to the core circle.
If you choose a randomly dispersed selection
of dots and randomly choose a point on the perpendicular circle you won't notice (much of) a difference, otherwise you will.
The actual projection onto the surface is not difficult, but similarly there is no (or a multi-valed) projection if the initial point lies on the line the passes straight through the center of the torus,
or for any point in the core circle.
Probably the easiest way to do this projection is to convert one dimension to polar form and then do the simple projection onto a circle in the remaining two dimensions.
Hmm.
I'm not sure i follow.
I think my method works.
The goal is to project any point in space onto the surface of a torus, yes ?
- It's more ambiguous than most projections, of course, because for many (most? all?) points in space, there will be more than one surface normal which intersects the point.
But,
i think my method does project to the closest surface point who's normal intersects the point in question.
Rephrasing the method:
* Find the point C on the circular core of the donut which is closest to the target point T.
* Draw a ray from point C to the target point T.
* Where that ray intersects the donut surface, that is our resulting projected point.
who are you, btw ? :)
Post a Comment
<< Home