Timothy R. Cook wrote:
>Observe figure 1. Randomly-filled-with-sphere_sweep
>cylinder. Good.
>Observe figure 2. Randomly-filled-along-xy-axes,-
>but-the-z-axis-isn't-random.
>I want figure 2 filled with the randomness of figure
>1.
>How do I do that?
If R_env= envelope you want to keep it in, then
the envelope depends on where Z is so
R_env = f(Z)
It looks like you described it as something like
R_env= (Z+1.2)^2
I would find Z first and then use it to find the envelope and then
find X and Y
Theta=rand(Seed)*360
Z=rand(Seed)
R_env = (Z+1.2)^2
R=R_env*rand(Seed)
X=R*cos(Theta)
Y=R*sin(Theta)
This is independant of your while loop (N variable)
There may be rare occurances where your line points may be within your
boundries, but the path of the line might cross back and forth.
Tony
Post a reply to this message
|