There are these crazy aluminum “enclosures” of Raspberry PI4 that bolt directly onto the PCB. Here is my way to mount a raspberry pi in a metal case onto a frame of a Prusa MK3 (3030 profiles).
The mounts should be first fitted into the extrusions, and then screwed into the case. You should use longer m2.5 bolts (≈18mm) as you need also extra length that does through the mounts.
I printed the mounts from PC so they don't soften from the heatbed temperature.
The author marked this model as their own original creation.