|
 |
On 3/3/2011 11:53 PM, Warp wrote:
>
>> Does just scaling the mass proportionally to a point's distance from the
>> torus' axis not work here?
>
> I explained the details in my original post.
Hopefully this is sufficiently precise:
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
Post a reply to this message
|
 |