You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Vts/MonteCarlo/Tissues, the method GetDistanceToBoundary should determine the distance to the closest tissue region boundary using the photon current position and direction, independent of hitting it (not using photon.S, track length, but possibly using a projection of S).
The projected distance needs to be correct so that MonteCarloSimulation MoveToBoundaryCheck processes correctly.
Problem definitely occurs in MultiConcentricInclusionTissue but plan to check all other tissues.
The text was updated successfully, but these errors were encountered:
While making corrections to MultiConcentricInclusionTissue GetDistanceToBoundary and writing unit tests, I decided to beef up
other unit tests for this class, in particular for GetRefractedDirection. I determined the Direction when refracting between n=1.0 and n=1.4 both ways. I used a flat layer plane to determine refracted Direction from test incident Directions. Then put the photon on top or bottom of cylinder with same incident Directions. Since on top or bottom, the plane determined from the surface normal will be flat like the layer and the direction of the normal will be outward like the layer. I used the validation values
from the layer tests for the cylinder tests.
From these unit tests I found that GetRefractedDirection algorithm was in error. I had previously used the reference: Bram de Greve "Reflections and Refractions in Ray Tracing" dated 11/13/2006. However after much trial and error, determined that the algorithm was missing something. The missing code was found in https://stackoverflow.com/questions/26087106/refraction-in-raytracing
After applying this code my unit tests for the cylinder GetRefractedDirection passed.
If @janakarana feels these modifications solve the handling of air-(tissue cylinder layers of varying n)-air, I will start a PR.
In Vts/MonteCarlo/Tissues, the method GetDistanceToBoundary should determine the distance to the closest tissue region boundary using the photon current position and direction, independent of hitting it (not using photon.S, track length, but possibly using a projection of S).
The projected distance needs to be correct so that MonteCarloSimulation MoveToBoundaryCheck processes correctly.
Problem definitely occurs in MultiConcentricInclusionTissue but plan to check all other tissues.
The text was updated successfully, but these errors were encountered: