You can start out with rayCasts in forward and down/up in the direction of the part and if none of those hit you check the corners of the part you are looking for and which is closer to your part and that should work
If i got you right, how about make another point lower than raypoint instead of surface position? Like, instead of getting baseplate’s position, just make lower point of ray point (for example, raypoint - Vector3.new(0, 1000, 0)) or something, and then do raycast thingy to find surface
Edit: also i know i “KINDA” late (2 years lol), just thought maybe i still can help you or help other people
to get the closest point on the edge of the target part(or within the part if the ray’s origin is inside) you should clamp the ray’s origin to within the object. this is pretty simple to do for non-rotated objects, but incorporating rotation is more difficult.