The above simulation draw all the possible traces.
It seems that you only need a simply version but with a fixed width of incoming ray.

Could you provide a simple drawing for the case you need?  I can try to make a new one when I understand what you really want.