Comments (2)
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.
from vts.
Awesome!
from vts.
Related Issues (20)
- Fix the cognitive complexity issues from the Sonar Cloud analysis HOT 5
- Bug in 2 of the Detectors TransmittedMTOfXAndYAndSubregionHistDetector and ReflectedMTOfXAndYAndSubregionHistDetector HOT 2
- Preparation for the November release
- Vts Code and Scripting changes in preparation for Polyglot notebooks
- Add ability to use layered concentric infinite cylinders with refractive index mismatch HOT 2
- Move the FemModeling and MGRTE into a separate repository HOT 2
- Non-flat layered tissues for MCCL HOT 31
- Add ROfRhoAndTime dMC detectors
- Switch the plot labels for CAW & DAW
- Fixes for Mac Getting Started page HOT 3
- Address deprecation warning when building `vts` under .NET v6 HOT 1
- Allow `vts` build without `matlab` implementation HOT 2
- VTS Build Error
- Bug found in dMCdROfRhodMusDetector HOT 1
- Add Time-Resolved Fiber Detectors
- Updates to PowerShell scripts for building zip files HOT 6
- Preparation for the May release
- Update NUnit to the new version
- Update Plotly to the new version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vts.