POV-Ray : Newsgroups : povray.binaries.images : Tangents with analytical geomtery Server Time
25 Apr 2024 17:18:19 EDT (-0400)
  Tangents with analytical geomtery (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Tangents with analytical geomtery
Date: 22 Oct 2019 17:35:00
Message: <web.5daf75ce21826f334eec112d0@news.povray.org>
Update:

OK,  So after fixed the radial pigment pattern, I worked out a bunch of little
bits to pigment the arcs and recolor the chosen arcs.  Then I worked in the
linear bezier code, the segmented bezier arc code, played with the
directionality of the segments, got an array to collect all the data, and
started to tidy up the prism definition.

The path looks mostly ok - except that somehow I'm dropping a circle and its
tangents.   :|   And since something is amiss, the prism isn't closed, and so
there's no prism.

I will have to work that out - hopefully soon. So very very close.

Anyway:
Here's how it works:

First an array of circles is declared -
x,y,z of center, and radius
two more values for when I get around to polygonal pulleys,
and then which tangents and arcs to use, along with a directional adjustment for
each.


 #declare CircleArray = array [11][10]{
  { 0.00, 0,  0.00, 0.10,   0, 0,  _Red, _Fwd, _Blk, _Fwd},
  { 1.75, 0,  2.25, 0.50,   0, 0,  _Grn, _Fwd, _Wht, _Rev},
  { 2.00, 0,  0.50, 0.15,   0, 0,  _Red, _Fwd, _Blk, _Rev},
  { 5.50, 0,  3.00, 0.25,   0, 0,  _Grn, _Fwd, _Wht, _Rev},
  { 2.50, 0, -1.00, 1.00,   0, 0,  _Red, _Fwd, _Blk, _Fwd},
  { 1.00, 0, -2.00, 0.25,   0, 0,  _Grn, _Fwd, _Wht, _Fwd},
  { 0.50, 0, -1.00, 0.25,   0, 0,  _All, _Fwd, _All, _Fwd},
  {-1.00, 0, -1.50, 0.50,   0, 0,  _All, _Fwd, _All, _Fwd},
  {-3.00, 0,  0.00, 0.50,   0, 0,  _All, _Fwd, _All, _Rev},
  {-2.50, 0,  2.00, 0.10,   0, 0,  _All, _Fwd, _All, _Rev},
  {-1.25, 0, -0.25, 0.20,   0, 0,  _All, _Fwd, _All, _Fwd},
  //{-1.00, 0,  3.00, 0.30,   0, 0,  _Blu, _Fwd, _Blk, _Fwd},
  }


The circles and all of the tangents get drawn out, and then you use that first
render to choose the path.  Once a circle has two tangents chosen, there are now
endpoints for 2 arcs, and those arcs get colored.  Pick which arc you want, and
you get a continuous path, colored green-to-red start -to-finish.

Then a loop cranks through the circle array and assigns Bezier spline segments
to everything and writes that into an array.

Then a loop inside a prism declaration unwraps all of those points for the
prism.


In the attached image, circles 0-5 all have the tangent and arc paths selected.
circle 6 has both tangents selected, but the arc path still isn't defined.
7, 8, and 9 are all in the initial stage.

And now to do more debugging.   :(


Post a reply to this message


Attachments:
Download 'serpentinebeltprism.png' (531 KB)

Preview of image 'serpentinebeltprism.png'
serpentinebeltprism.png


 

From: Bald Eagle
Subject: Re: Tangents with analytical geomtery
Date: 22 Oct 2019 21:00:01
Message: <web.5dafa52521826f334eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> And now to do more debugging.   :(

After fixing some bad wrapping code and a few other small things, and adding a
new debugging array to track the joining of the Bezier segments, ....

WHEEEEE!


Post a reply to this message


Attachments:
Download 'serpentinebeltprism.png' (203 KB)

Preview of image 'serpentinebeltprism.png'
serpentinebeltprism.png


 

From: Thomas de Groot
Subject: Re: Tangents with analytical geomtery
Date: 23 Oct 2019 02:25:12
Message: <5daff248@news.povray.org>
Op 23/10/2019 om 02:56 schreef Bald Eagle:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> WHEEEEE!
> 

Nicely done, sir. Now take your dried frog pills (as Stephen would say). :-)

-- 
Thomas


Post a reply to this message

From: Gergely Szaktilla
Subject: Re: Tangents with analytical geomtery
Date: 23 Oct 2019 12:30:06
Message: <5db0800e$1@news.povray.org>
On 23.10.19 02:56, Bald Eagle wrote:
> WHEEEEE!

Yeah!

Reminds me of Helga Philipp



It's nice to see how things evolve :-)

Gregor


Post a reply to this message

From: Bald Eagle
Subject: Re: Tangents with analytical geomtery
Date: 27 Oct 2019 18:55:01
Message: <web.5db61fe221826f334eec112d0@news.povray.org>
So I cleaned up a few things,

made the native prism transparent to allow for further development
moved the small side and rotated view to the side, and widened the view
added a small region of black to each end of the color map to make things
clearer, esp in the case of small wrong-direction arcs
Put the image map at the back, labeled the gridlines...
switched over to orthographic camera

Saving that file as a backup and proceeding to try to model the original part
highlighted the need to consider the cases where adjacent circles are not
exterior to each other, and likely a need to include a proper _point_ where 2
linear segments can meet at a bend.

Also need to work out - or find - some code to keep most of the scene elements a
constant perceived size - like the line width, text size, etc when the camera
zoom is changed to switch between large and small dimension designs.


I made some progress on sorting out 0,1,2,3,4 tangent cases, and filtering the
code to bypass calculations for nonexistent tangent lines.

Hopefully I will have the time, energy, and focus to work through most of that
over the next several days.


Post a reply to this message


Attachments:
Download 'serpentinebeltprism_dev1.png' (640 KB)

Preview of image 'serpentinebeltprism_dev1.png'
serpentinebeltprism_dev1.png


 

From: Leroy
Subject: Re: Tangents with analytical geomtery
Date: 29 Oct 2019 16:40:00
Message: <web.5db8a2f321826f33a83d0ced0@news.povray.org>
Very well done!


Post a reply to this message

From: Leroy
Subject: Re: Tangents with analytical geomtery
Date: 5 Nov 2019 15:10:05
Message: <web.5dc1d6ab21826f33632789d20@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So I tried doing this "the old way" by calculating the angle between the center
> line and the tangent and then rotating and translating - but that got too messy
> too fast for my second test case, and the first one was hairy enough.
>
> So I implemented a fully analytical method to calculate the endpoints of the
> tangent lines "in place" for any arbitrary set of circles.
>
> Input for the macro is just a list of circle centers and radii.
>
> Now to implement some further logic, and then try non-circular "pulleys", and
> linear bends.

Why did you start this? I had to try it for my self. Not the prism part but
getting the belt around a set of pulleys.
 I spent the last week working on it. I started with placing a random number of
pulleys of different sizes around the origin. Then did a simple test to mark
weather the belt was inside or outside a particular pulley.
 That test was:: if the vlength of the midpoint of the two pulleys on each side
of the test pulley was shorter than the vlength of the test then the belt was on
the outside.

 Then I came the deciding which tangent formula to use and calculating the
tangent on two adjacent pulleys. There are basic two formulas one for the cross
over, one for going from Outside to Inside, and the other for Outside to
Outside. Those formula can also be used for the reversed Inside to Outside and
Inside to Inside.

So I had those all 4 tangents that you have shown. But I only needed the one
tangent for two pulleys.

 Then came the curved part of the belt. Each pulley has two tangent points, one
where the belt comes in and one where the belt goes out. Using the
Inside/Outside value and those tangent points I make a prism to cut a torus. Did
I mention the the belt was made of cylinders.

 While testing lots of randomly place Pulleys I came across an error in the
Inside/Outside test and made a second routine that took in account the radius of
the pulleys involved.
 When all is said and done I have 4 arrays::
      Location, Size, Inside/Outside, Tangent points

Now maybe I'll try and animate it;)
Here a look:


Post a reply to this message


Attachments:
Download 'pully1.jpg' (21 KB)

Preview of image 'pully1.jpg'
pully1.jpg


 

From: Bald Eagle
Subject: Re: Tangents with analytical geomtery
Date: 5 Nov 2019 16:55:00
Message: <web.5dc1efa321826f334eec112d0@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:

> Why did you start this?

Because making parts from CSG can be a big pain, and I figured that I could
model a prism which would give me smooth curves and the proper alignment with
the straight sections.  Not so easy without a good modeler or drawing program.

> I had to try it for my self. Not the prism part but
> getting the belt around a set of pulleys.

I did that ages ago.  I used Friedrich Lohmueller's method, with the angles and
all of that, but doing that for multiple pulleys was a bit overwhelming.
So I found a purely analytical method using the radii and the coordinates of the
centers.

>  I spent the last week working on it. I started with placing a random number of
> pulleys of different sizes around the origin. Then did a simple test to mark
> weather the belt was inside or outside a particular pulley.
>  That test was:: if the vlength of the midpoint of the two pulleys on each side
> of the test pulley was shorter than the vlength of the test then the belt was on
> the outside.
>
>  Then I came the deciding which tangent formula to use and calculating the
> tangent on two adjacent pulleys. There are basic two formulas one for the cross
> over, one for going from Outside to Inside, and the other for Outside to
> Outside. Those formula can also be used for the reversed Inside to Outside and
> Inside to Inside.

Nice - when I was analyzing the possible configurations, I realized that it
could get quite complicated, and there was no good way to automate the process -
and different results might be wanted compared to what an algorithm chose.

> So I had those all 4 tangents that you have shown. But I only needed the one
> tangent for two pulleys.

Correct, unless you only have two pulleys.   ;)
I also knew that one might want to model a system with an idler pulley or
tensioner, so i made everything manually selectable.

>  Then came the curved part of the belt. Each pulley has two tangent points, one
> where the belt comes in and one where the belt goes out. Using the
> Inside/Outside value and those tangent points I make a prism to cut a torus. Did
> I mention the the belt was made of cylinders.

Nice.   The animation I did used a belt made out of truncated cones in order to
simulate a V-belt, and to have an odd-colored cone to mark the belt and give a
better visual cue.


> Now maybe I'll try and animate it;)
> Here a look:

You've done a great job as always   :)

Most belt animations are done with only a short, repeating series of frames, but
with multiple radii, or if marking the pulleys or belt to really show the
rotation, then what constitutes a "single" cycle can be much longer and somewhat
challenging to calculate.


Post a reply to this message

From: Leroy
Subject: Re: Tangents with analytical geomtery
Date: 12 Nov 2019 14:00:01
Message: <web.5dcb00ce21826f33fc7719580@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> Most belt animations are done with only a short, repeating series of frames, but
> with multiple radii, or if marking the pulleys or belt to really show the
> rotation, then what constitutes a "single" cycle can be much longer and somewhat
> challenging to calculate.

I hadn't even thought of that!

I was so intent on the math of the problem, that I didn't even think of making a
looped animation. With 10 pulleys that could run awhile!

 I did make a prism belt and 'real' pulleys. I got into a problem with the
texturing of the belt. My idea was to have a texture scaled so that it would be
the length of the belt and translate it to each section of the belt parts.
 Then all you have to do to animate the belt is change the translate value.
I did get a pigment_map to work, using the toroidal Warp for around the pulleys.
 While writing this I had a Idea on how to get texture to work. Got to give it a
try.

 I still don't know why I'm working on this :0
 Well it bets any other thing I need to do :)

 Have Fun!


Post a reply to this message

From: Bald Eagle
Subject: Re: Tangents with analytical geomtery
Date: 12 Nov 2019 17:15:01
Message: <web.5dcb2dcc21826f334eec112d0@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:

> I hadn't even thought of that!

Yeah.   I can't even remember how I did it with just my 2 pulleys - I'll have to
go back and look some time.

> I was so intent on the math of the problem, that I didn't even think of making a
> looped animation. With 10 pulleys that could run awhile!

Yeah - I'll have to see if there's an equation for that.


> I did get a pigment_map to work, using the toroidal Warp for around the pulleys.
>  While writing this I had a Idea on how to get texture to work. Got to give it a
> try.

That's clever.  You should have seen the headache I went through with radial
recently.  :O

>  I still don't know why I'm working on this :0
>  Well it bets any other thing I need to do :)

Ha!   You and me both.
Something always captures my interest and I pursue it --- BECAUSE!

I hope to see some of your work on this soon.  Maybe I can draw you further into
this with --- GEARS!  :D

Glad you're having fun though.


Post a reply to this message

<<< Previous 8 Messages Goto Initial 10 Messages

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