POV-Ray : Newsgroups : povray.general : Help with "programmatically" determining intersection : Re: Help with "programmatically" determining intersection Server Time
3 May 2024 00:22:12 EDT (-0400)
  Re: Help with "programmatically" determining intersection  
From: Bald Eagle
Date: 17 Mar 2016 12:10:01
Message: <web.56ead5c84c69d6165e7df57c0@news.povray.org>
scott <sco### [at] scottcom> wrote:

> I'm surprised this is not documented/solved somewhere else already.
> You're surely not the only one wanting to design gears.

Yes and no.   "documented / solved" - yes, surely.  Freely available on the web
and not buried in a math or engineering textbook - harder to find.

I mean, check this out:
http://mathhelpforum.com/geometry/136011-circle-involute-solving-y-any-given-x.html

"It follows from the given equations for x and y that  x^2+y^2 = a^2(1+t^2)."

Right.   After you do:


Equations for an involute
 x = a(cosq + qsinq)
 y = a(sinq - qcosq)

Equation for a circle
x2 + y2 = r2

When the involute intersects the circle, the evaluated equations are equal

a2(cosq + qsinq)2 +  a2(sinq - qcosq)2 = r2

a2(cos2q + 2qcosqsinq + q2sin2q)  +  a2(sin2q + 2qcosqsinq - q2cos2q)2  = r2

a2(cos2q + 2qcosqsinq + q2sin2q + sin2q - 2qcosqsinq + q2cos2q)2  = r2

a2(cos2q + q2sin2q + sin2q + q2cos2q)2  = r2

a2(cos2q + q2sin2q + sin2q + q2(1 - sin2q))2  = r2

a2(cos2q + q2sin2q + sin2q + q2 - q2sin2q)2  = r2

a2(cos2q + sin2q + q2)2  = r2

a2(1 - sin2q + sin2q + q2)2  = r2

a2(1 + q2)2  = r2      (1 + q2)2  = r2 / a2

a sqrt [(1 + q2)]  = r     1 + q2  = sqrt [ r2 / a2 ]







(The 2's are all superscripted...)



> I don't think that will work because your curves are moving in 2
> dimensions. What you'd need to do is check if the line between the
> current point and the previous point of curve 1 *crosses* the line
> between the current point and the previous point of curve 2.

I read that 5 times and finally got ya.
That _sounds_ good - but:  HOW do we do that "checking"?

Curves moving in 2 dimensions doesn't seem like a big deal - that's 99% of what
most HS math / geometry is anyway, right?  "Find the intersection of 2 lines..."
   These lines just happen to be curves.  So long as theta < 2pi, there ought to
only be one intersection.

I'm leaning towards the mathematical approach, since then I can test for values
of x or z or theta or something else rather than a cluster of error-prone code.




At this point, it looks like the determination of the curves crossing the
Outside Circle doesn't work either.
http://web.mit.edu/harishm/www/papers/involuteEWC.pdf
Page 4, equation 11.

I overlay the involute trace with yellow if theta is _greater_ than that
calculated value, and the beginning of the yellow is OFF.

I'll post an image in binaries, and code in the event that you'd like to play
along on this one  :)


Post a reply to this message

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