POV-Ray : Newsgroups : povray.binaries.images : Tangents with analytical geomtery : Re: Tangents with analytical geomtery Server Time
27 Apr 2024 04:42:24 EDT (-0400)
  Re: Tangents with analytical geomtery  
From: Leroy
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


 

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