POV-Ray : Newsgroups : povray.binaries.images : Path with sphere attached. . . Server Time
17 Aug 2024 10:18:09 EDT (-0400)
  Path with sphere attached. . . (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Arie L  Stavchansky
Subject: Path with sphere attached. . .
Date: 21 Oct 2001 09:58:42
Message: <3bd2d492@news.povray.org>
Okay, this note may get a little complicated so forgive me if I confuse you.

I have written a macro that makes stacks of rings of spheres as seen in the
attached image.  The macro adjusts the radius of the spheres in a ring
dependant on the radius of the ring because I wanted to make sure that all
spheres are tangential (touching each other at a tangent).

Now, what I would like to do is at the top of the "cylinder of spheres" is
start to make the rings, but so that every stack of it fits the profile i
have drawn in.  Figuring out what the radius of the ring should be and the y
value of the ring is very difficult for me--especially since the sphere's
radius changes as the ring's radius gets smaller.  I have attempted to
figure this out and in the second attached image you can see my initial
approach.

Initially I have thought to define a "path" for the profile by a polynomial
equation.  I would then input an x-coordinate value into the function with
the equation and I would get a y-coordinate as an output.  The problem is
that when you actually go and make this a macro, how can I determine the
change in the x value so it will give me the correct y value and STILL have
the sphere be tangential?   In other words how do I determine the
x-coordinate to input into the function that gives me the appropriate y
value?  Well I imagined that the change in x could be (as shown in the
diagram):

radius1*(sin theta1) + radius2(sin theta2)

I have figured out how to determine the radius for each sphere of any ring
size, but I simply can not figure out how to determine the "thetas" of which
to use for my equation.  Am I way off?  Is there an easier way to do this?

F. Audet has put up his Apple code which does something similar, and I have
looked at it, but I am trying to understand how I can figure the math so
that I can become more adept at making what I want.  Thanks for your time
and help I appreciate it a great deal since it has helped me realize the
images I see in my head :)

Arie


Post a reply to this message


Attachments:
Download 'pathSpheres.jpg' (43 KB) Download 'cylinderSpheres.jpg' (63 KB)

Preview of image 'pathSpheres.jpg'
pathSpheres.jpg

Preview of image 'cylinderSpheres.jpg'
cylinderSpheres.jpg


 

From: Arie L  Stavchansky
Subject: Re: Path with sphere attached. . . [MORE PROGRESS]
Date: 21 Oct 2001 13:51:47
Message: <3bd30b33@news.povray.org>
While muddling around, I have come up with this.  You can start see the
effect I am after, but this is truly a linear inclination.  I am looking to
acheive a curved inclination all the while my spheres remain tangential.  I
just can't get enough of this stuff.

Arie


"Arie L. Stavchansky" <ari### [at] bellatlanticnet> wrote in message
news:3bd2d492@news.povray.org...
> Okay, this note may get a little complicated so forgive me if I confuse
you.
>
> I have written a macro that makes stacks of rings of spheres as seen in
the
> attached image.  The macro adjusts the radius of the spheres in a ring
> dependant on the radius of the ring because I wanted to make sure that all
> spheres are tangential (touching each other at a tangent).
>
> Now, what I would like to do is at the top of the "cylinder of spheres" is
> start to make the rings, but so that every stack of it fits the profile i
> have drawn in.  Figuring out what the radius of the ring should be and the
y
> value of the ring is very difficult for me--especially since the sphere's
> radius changes as the ring's radius gets smaller.  I have attempted to
> figure this out and in the second attached image you can see my initial
> approach.
>
> Initially I have thought to define a "path" for the profile by a
polynomial
> equation.  I would then input an x-coordinate value into the function with
> the equation and I would get a y-coordinate as an output.  The problem is
> that when you actually go and make this a macro, how can I determine the
> change in the x value so it will give me the correct y value and STILL
have
> the sphere be tangential?   In other words how do I determine the
> x-coordinate to input into the function that gives me the appropriate y
> value?  Well I imagined that the change in x could be (as shown in the
> diagram):
>
> radius1*(sin theta1) + radius2(sin theta2)
>
> I have figured out how to determine the radius for each sphere of any ring
> size, but I simply can not figure out how to determine the "thetas" of
which
> to use for my equation.  Am I way off?  Is there an easier way to do this?
>
> F. Audet has put up his Apple code which does something similar, and I
have
> looked at it, but I am trying to understand how I can figure the math so
> that I can become more adept at making what I want.  Thanks for your time
> and help I appreciate it a great deal since it has helped me realize the
> images I see in my head :)
>
> Arie
>
>
>


Post a reply to this message


Attachments:
Download 'capTop.jpg' (81 KB) Download 'capPersp.jpg' (43 KB)

Preview of image 'capTop.jpg'
capTop.jpg

Preview of image 'capPersp.jpg'
capPersp.jpg


 

From: F Audet
Subject: Re: Path with spheres...
Date: 21 Oct 2001 18:45:21
Message: <3BD34F21.8F12DD0@sympatico.ca>


> While muddling around, I have come up with this.  You can start see the
> effect I am after, but this is truly a linear inclination.  I am looking to
> acheive a curved inclination all the while my spheres remain tangential.  I
> just can't get enough of this stuff.
>
> Arie

Hello Arie !  Pretty nicely done job,  even if the goal you want to reach
is a curved profile.  I find it very cool the way each sphere is tangantial
to each others...  My macro don't work that perfectly.
(I posted another one. It is called dancer!)

Alex P

have a look at:  ( some sphere modeling techniques stuff...)

http://astronomy.swin.edu.au/pbourke/modelling/spheremodel/

http://astronomy.swin.edu.au/pbourke/curves/classical/


Post a reply to this message


Attachments:
Download 'us-ascii' (2 KB)

From: Arie L  Stavchansky
Subject: Re: Path with spheres...
Date: 21 Oct 2001 19:07:10
Message: <3bd3551e$1@news.povray.org>
Thanks you Alex!  This is an excellent resource.  I appreciate it :)

Arie
"F.Audet" <flo### [at] sympaticoca> wrote in message
news:3BD### [at] sympaticoca...


While muddling around, I have come up with this.  You can start see the
effect I am after, but this is truly a linear inclination.  I am looking to
acheive a curved inclination all the while my spheres remain tangential.  I
just can't get enough of this stuff.
Arie
Hello Arie !  Pretty nicely done job,  even if the goal you want to reach
is a curved profile.  I find it very cool the way each sphere is tangantial
to each others...  My macro don't work that perfectly.
(I posted another one. It is called dancer!)
Alex P
have a look at:  ( some sphere modeling techniques stuff...)
http://astronomy.swin.edu.au/pbourke/modelling/spheremodel/
http://astronomy.swin.edu.au/pbourke/curves/classical/


Post a reply to this message

From: F Audet
Subject: Re: Path with spheres...
Date: 21 Oct 2001 19:34:22
Message: <3BD35AA2.F96EE2B4@sympatico.ca>


> Thanks you Alex!  This is an excellent resource.  I appreciate it :)
>
> Arie

Oups,  I read the other post before !!
Alex


Post a reply to this message

From: Mike Williams
Subject: Re: Path with sphere attached. . .
Date: 22 Oct 2001 01:26:57
Message: <5ogF3FAU0607EwQ5@econym.demon.co.uk>
Wasn't it Arie L. Stavchansky who wrote:
>Okay, this note may get a little complicated so forgive me if I confuse you.
>
>I have written a macro that makes stacks of rings of spheres as seen in the
>attached image.  The macro adjusts the radius of the spheres in a ring
>dependant on the radius of the ring because I wanted to make sure that all
>spheres are tangential (touching each other at a tangent).
>
>Now, what I would like to do is at the top of the "cylinder of spheres" is
>start to make the rings, but so that every stack of it fits the profile i
>have drawn in.  Figuring out what the radius of the ring should be and the y
>value of the ring is very difficult for me--especially since the sphere's
>radius changes as the ring's radius gets smaller.  I have attempted to
>figure this out and in the second attached image you can see my initial
>approach.
>
>Initially I have thought to define a "path" for the profile by a polynomial
>equation.  I would then input an x-coordinate value into the function with
>the equation and I would get a y-coordinate as an output.  The problem is
>that when you actually go and make this a macro, how can I determine the
>change in the x value so it will give me the correct y value and STILL have
>the sphere be tangential?   In other words how do I determine the
>x-coordinate to input into the function that gives me the appropriate y
>value?  Well I imagined that the change in x could be (as shown in the
>diagram):
>
>radius1*(sin theta1) + radius2(sin theta2)
>
>I have figured out how to determine the radius for each sphere of any ring
>size, but I simply can not figure out how to determine the "thetas" of which
>to use for my equation.  Am I way off?  Is there an easier way to do this?
>
>F. Audet has put up his Apple code which does something similar, and I have
>looked at it, but I am trying to understand how I can figure the math so
>that I can become more adept at making what I want.  Thanks for your time
>and help I appreciate it a great deal since it has helped me realize the
>images I see in my head :)

I think it gets rather messy, but here are a few pointers:-

Firstly, note that the green lines in your diagram are parallel, so
theta1 and theta2 are equal. So

1.      x = (r1 + r2)*sin theta

Now consider the ratio of r2 to r1. Because there are the same number of
spheres in each ring, the size of the spheres decreases by the same
ratio as the radius of the ring. Call the radius of the first ring "R",
then

2.      r2/r1 = (R-x)/R

The polynomial path that you are trying to follow provides the
relationship between y and x

3.      y = p(x)

And we can see that

4.      tan theta = x/y

The values of r1 and R are known, so we now have a system of four
simultaneous equations involving four unknowns (x, y, r2, theta).
Reducing these gives (if my algebra is correct)

5.      x = (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x))

That's a horribly messy equation, but the only unknown in there is x, so
it should be soluble. The method of solution may well depend on the
nature of p(x). Good luck!

Once you've calculated x, obtain y from #3, r2 from #2, and theta (not
that you need it) from #4.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Arie L  Stavchansky
Subject: Re: Path with sphere attached. . .
Date: 22 Oct 2001 10:54:03
Message: <3bd4330b@news.povray.org>
Thank you Mike.  I have been messing around and thinking about you tips.  I
think I'm almost there :)

Take a look

Arie


Post a reply to this message


Attachments:
Download 'sphereBowl.jpg' (24 KB)

Preview of image 'sphereBowl.jpg'
sphereBowl.jpg


 

From: Arie L  Stavchansky
Subject: Re: Path with sphere attached. . .
Date: 22 Oct 2001 16:24:31
Message: <3bd4807f$1@news.povray.org>
Hi Mike,

I have been looking at your equations and am confused on equation number

5.      x = (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x))

How can you define x with x in the right side of the equation?
Thanks,
Arie

"Mike Williams" <mik### [at] nospamplease> wrote in message
news:5og### [at] econymdemoncouk...
> Wasn't it Arie L. Stavchansky who wrote:
> >Okay, this note may get a little complicated so forgive me if I confuse
you.
> >
> >I have written a macro that makes stacks of rings of spheres as seen in
the
> >attached image.  The macro adjusts the radius of the spheres in a ring
> >dependant on the radius of the ring because I wanted to make sure that
all
> >spheres are tangential (touching each other at a tangent).
> >
> >Now, what I would like to do is at the top of the "cylinder of spheres"
is
> >start to make the rings, but so that every stack of it fits the profile i
> >have drawn in.  Figuring out what the radius of the ring should be and
the y
> >value of the ring is very difficult for me--especially since the sphere's
> >radius changes as the ring's radius gets smaller.  I have attempted to
> >figure this out and in the second attached image you can see my initial
> >approach.
> >
> >Initially I have thought to define a "path" for the profile by a
polynomial
> >equation.  I would then input an x-coordinate value into the function
with
> >the equation and I would get a y-coordinate as an output.  The problem is
> >that when you actually go and make this a macro, how can I determine the
> >change in the x value so it will give me the correct y value and STILL
have
> >the sphere be tangential?   In other words how do I determine the
> >x-coordinate to input into the function that gives me the appropriate y
> >value?  Well I imagined that the change in x could be (as shown in the
> >diagram):
> >
> >radius1*(sin theta1) + radius2(sin theta2)
> >
> >I have figured out how to determine the radius for each sphere of any
ring
> >size, but I simply can not figure out how to determine the "thetas" of
which
> >to use for my equation.  Am I way off?  Is there an easier way to do
this?
> >
> >F. Audet has put up his Apple code which does something similar, and I
have
> >looked at it, but I am trying to understand how I can figure the math so
> >that I can become more adept at making what I want.  Thanks for your time
> >and help I appreciate it a great deal since it has helped me realize the
> >images I see in my head :)
>
> I think it gets rather messy, but here are a few pointers:-
>
> Firstly, note that the green lines in your diagram are parallel, so
> theta1 and theta2 are equal. So
>
> 1.      x = (r1 + r2)*sin theta
>
> Now consider the ratio of r2 to r1. Because there are the same number of
> spheres in each ring, the size of the spheres decreases by the same
> ratio as the radius of the ring. Call the radius of the first ring "R",
> then
>
> 2.      r2/r1 = (R-x)/R
>
> The polynomial path that you are trying to follow provides the
> relationship between y and x
>
> 3.      y = p(x)
>
> And we can see that
>
> 4.      tan theta = x/y
>
> The values of r1 and R are known, so we now have a system of four
> simultaneous equations involving four unknowns (x, y, r2, theta).
> Reducing these gives (if my algebra is correct)
>
> 5.      x = (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x))
>
> That's a horribly messy equation, but the only unknown in there is x, so
> it should be soluble. The method of solution may well depend on the
> nature of p(x). Good luck!
>
> Once you've calculated x, obtain y from #3, r2 from #2, and theta (not
> that you need it) from #4.
>
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Path with sphere attached. . .
Date: 22 Oct 2001 21:18:15
Message: <kp1SnAAHoL17EwLs@econym.demon.co.uk>
Wasn't it Arie L. Stavchansky who wrote:
>Hi Mike,
>
>I have been looking at your equations and am confused on equation number
>
>5.      x = (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x))
>
>How can you define x with x in the right side of the equation?

That's the problem. That's what you get if you reduce the simultaneous
equations. I can't do any better it without knowing p(x).

Does it help if I rearrange it like this?

5a.      x - (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x)) = 0

Even if someone tells me what p(x) is, it's still going to be horrible
to solve for x. I'd be inclined to use some sort of numerical method to
obtain an approximation.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Path with sphere attached. . .
Date: 22 Oct 2001 21:23:39
Message: <3BD4C662.3ADE1FF1@hotmail.com>
"Arie L. Stavchansky" wrote:
> 
> Hi Mike,
> 
> I have been looking at your equations and am confused on equation number
> 
> 5.      x = (r1 + (R - x)/(R * r1)) * sin(atan(x/p(x))

Like if you say:

2*x + 1 = x

Now if you rearrange then you'll get:

2*x - x + 1 = 0   =>   x + 1 = 0   =>   x = -1


So he probably meant that you should
solve this equation with respect to x:

(r1 + (R - x)/R/r1)*sin(atan(x/p(x))) - x = 0


Unfortunately; I suspect that it is rather non-
trivial to find analytical solutions for it
(especially with higher degrees of your polynome).


Tor Olav


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.