chbergmann / OpticsWorkbench

GNU Lesser General Public License v3.0
80 stars 22 forks source link

change the RayHit data when there are multiple absorbers #48

Open amihashemi opened 3 months ago

amihashemi commented 3 months ago

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...

chbergmann commented 3 months ago

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.

amihashemi commented 3 months ago

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

chbergmann commented 3 months ago

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

amihashemi commented 3 months ago

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.

chbergmann commented 3 months ago

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

luzpaz commented 2 months ago

@amihashemi can you elaborate further on your usecase ?

amihashemi commented 2 months ago

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...

chbergmann commented 2 months ago

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.