How to detect object's collision shape boundaries?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Robotex

I need to make few raycasts to obstacle boundaries to detect which zones can be observed by player and which not. It is easy to do with CircleShape2D - just take a radius. But what is about the other shapes? I can get extents of RectangleShape2D for i.e. but how to define left and right boundaries of zone that it hides. I suggest, I need to apply some rotations but what to do next? What is about other shapes?