|
 |
Kevin Wampler <wam### [at] u washington edu> wrote:
> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
> for i in xrange(usteps):
> for j in xrange(vsteps):
> for k in xrange(rsteps):
> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
> x = (major+r*minor*cos(v))*cos(u)
> y = (major+r*minor*cos(v))*sin(u)
> z = r*minor*sin(v)
> m = r*sqrt(x*x+y*y)
> yield x, y, z, m
The density will not be equal because the points will be distributed more
densely deeper inside the torus than closer to the surface, without the
correspondent scaling of the mass.
As for taking into account the distance from the center on the mass, are
you sure that it's proportional to 'r' and not 'r*r'?
--
- Warp
Post a reply to this message
|
 |