POV-Ray : Newsgroups : povray.text.scene-files : Tangents between circles : Re: Tangents between circles Server Time
20 Sep 2021 13:29:57 EDT (-0400)
  Re: Tangents between circles  
From: Bald Eagle
Date: 20 Nov 2019 17:40:01
Message: <web.5dd5bfbf1b345bf54eec112d0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> one question is: in the #for() loop near bottom, you test for IFlag and OFlag.
> naively, given two circles A + B which do not touch/overlap, you always get 4
> tangents, no?  by mandating "sane" scenarios you might be able to get rid of
> some conditional code.

Right, but computing the arcs and tangent lines wasn't meant to solely address
the "belt/pulley problem" - the point was to get tangent lines to circles to
design a prism.  I don't much care about the conditional code, and it all seems
fast enough, especially since it won't be in a loop that gets executed 1000

It would also be nice to have a block of code that doesn't crap out if the
"wrong" data gets entered into the circle array.

> the comments in the code suggest that you can "classify" the tangents (order +
> direction) and used colour to see that info; is that code available too?

Right.  If you look at the original thread, ALL the tangents and arcs get shown.
Then you can eliminate the tangents that don't apply, and then with only two
endpoints on a circle, you can then highlight two discrete arcs to choose from.
Then you can select/correct the direction so that the ordering of the points to
generate the prism is correct.

Let me see where I'm at with that scene file - just put it back on my radar if I
don't get back to you on it in the next week or so.

> > Certainly I'd love to work out the logic of animating it, and doing something
> > like a toothed belt or chain to run along gears or sprockets.
> given knowledge of radius of A, and the number of degrees it revolves from one
> frame to the next, it would just require to map that length of arc to B to get
> the corresponding angle (not that I could actually do it).

That's great for - one arc.  Now picture 5 pulleys and you want to highlight one
link in the chain and follow that around the whole system.

It's sounds - excessive to do, but from an animator's standpoint - to give the
viewer that visual cue with which to infer motion and direction... it makes a
BIG difference.

> I hope I can make some headway understanding the code, and hopefully learn how
> to "assemble" the correct tangents into a belt or cable.  I probably won't be
> able to avoid stumbling into problems.  :-)

Well in that end section, there's the parts that control the outer tangents, and
the inner tangents.  Just change "pigment {LinePigment}" into something
different for all 4 lines, and you'll see exactly which one is which.

Post a reply to this message

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