DennisD
Mechanical
- Jan 3, 2000
- 42
Greetings fellow SWX heavies! I need some help. I'm trying to expedite a ray tracing for a crude optical analysis. I've already searched these forums for previous threads and FAQs but have come up blank. I've also looked at the SWX Partners and the subscriber's knowledge base and model library hoping to find a free or 30-day version of some ray tracing routine, a macro, a techinique, anything, but to no avail.
In a SWX sketch I have a profile of a transparent part. I want to draw a ray from my source to the first surface of the transparency. I want to draw the appropriate trace of this (these) ray(s) all the way through the transparency and out the other side. I figure some kind of macro or API may be in order but I'm not skilled in either so I need your help.
The governing equation is Snell's Law: n1*sin(theta_1) = n2*sin(theta_2) where theta is the angle of incidence (which is measured from the surface normal at the point of intersection with the ray). The indexes of refraction of the two materials are n1 and n2. I am using air and acrylic so n1=1.0003 and n2=1.491. (It would be nice if n1 and n2 were user-inputs so this could easily handle other material combinations.)
If I were intersecting a flat this would be no big deal, but I am intersecting surfaces with differing shapes. A good chunk (technical term) of the difficulty will come from determining the normal. Probably this routine would draw a construction line for the normal and reference that for the incoming theta_1 and outgoing theta_2.
Who is up to the challenge? I'd love the help.
Thanks in advance,
- - -DennisD
In a SWX sketch I have a profile of a transparent part. I want to draw a ray from my source to the first surface of the transparency. I want to draw the appropriate trace of this (these) ray(s) all the way through the transparency and out the other side. I figure some kind of macro or API may be in order but I'm not skilled in either so I need your help.
The governing equation is Snell's Law: n1*sin(theta_1) = n2*sin(theta_2) where theta is the angle of incidence (which is measured from the surface normal at the point of intersection with the ray). The indexes of refraction of the two materials are n1 and n2. I am using air and acrylic so n1=1.0003 and n2=1.491. (It would be nice if n1 and n2 were user-inputs so this could easily handle other material combinations.)
If I were intersecting a flat this would be no big deal, but I am intersecting surfaces with differing shapes. A good chunk (technical term) of the difficulty will come from determining the normal. Probably this routine would draw a construction line for the normal and reference that for the incoming theta_1 and outgoing theta_2.
Who is up to the challenge? I'd love the help.
Thanks in advance,
- - -DennisD