How to know if a point of a face is in shadow?

I would use just boxes as shadow generators (but I don’t know how to associate a physics shape to a box)