Targetsurface returns same sides even if rotated

Hello devs,
I’m trying to make a script that returns same sides of the block even if it has different rotation angles.
Is it even possible to make something like that?