Is there a way to get the points on the intersecting area of a part on the y position?

I was having a lot of trouble figuring out where the positions on a part are on the intersecting 2d grid on a specific worldspace y position and was wondering if someone knows any code or guides out there which allows me to do this correctly without too many issues.

It doesn’t need to be perfect, aslong as its somewhat accurate for big parts

it needs to function like this


but due to the method im using, it requires rotating the part its size and cframe upwards and messes up quite a lot.