OpticsWorkbench icon indicating copy to clipboard operation
OpticsWorkbench copied to clipboard

change the RayHit data when there are multiple absorbers

Open amihashemi opened this issue 1 year ago • 8 comments

How can I change the RayHits output when there are more than one absorber in the simulation? It seems that only one absorber data is written out and that depends on which is hit first...

amihashemi avatar Jun 26 '24 19:06 amihashemi

You cannot change the RayHits output. It is generated automatically for each absorber each time you start the simulation. You can select Ray Hits to Spreadsheet to collect all ray hits from all absorbers.

chbergmann avatar Jun 27 '24 14:06 chbergmann

based on my tries, it doesn't output for all the absorber, it just does it for one when there are multiple ones that one is the first one that absorb. It would be great if the RayHits can do specific absorber output rather than the automatic function

amihashemi avatar Jun 27 '24 14:06 amihashemi

Absorber means that it absorbs a ray. It will not go further to the next absorber. Any other behaviour makes no sense.

chbergmann avatar Jun 27 '24 16:06 chbergmann

sure but that was not my point, If you have a device that includes several absorber, it would have been useful to have a target absorber as RayHits of all absorbers...it is something that can be useful in the problem we face, just wanted to share as suggestion if not included yet.

amihashemi avatar Jun 27 '24 17:06 amihashemi

maybe I could add a SumOfAllRayHitsOfAllAbsorbers property to the spreadsheet that pops up if you click "Ray Hits to Spreadsheet"

chbergmann avatar Jun 28 '24 16:06 chbergmann

@amihashemi can you elaborate further on your usecase ?

luzpaz avatar Jul 31 '24 10:07 luzpaz

the point that I was trying to make is if you do a set of raytracing simulation, one useful implication is to write out the absorbed particles/lights on specific targeted object, not as a bulk data for whatever objects are in the workspace. I think having target object/s that would limit the output of raytracing datafile is useful for users...

amihashemi avatar Jul 31 '24 19:07 amihashemi

you are right. There is too much data. This is why I added a parameter collectStatistics to all absorbers, mirrors, lenses and gratings. Only if collectStatistics is true, ray hits will be counted. The default is false.

chbergmann avatar Aug 03 '24 06:08 chbergmann