This is an enclosure for a very common Chinese speed controller you can find everywhere on the internet. There are a few different cheap speed controllers out there, this one comes up under the name "6V-90V 15A PWM DC speed controller" often. I bought the one I'm using about 6 years ago, it had a blue board, current models look to be green more often but it is the exact same layout looking at it.
There's a spot for a SPST on/off switch with small alignment nub, the control potentiometer, and a 40mm 12v fan which fits inside the housing. I connected the on/off switch to the DC input with the fan so it all comes on with the switch. I used a modified computer power supply for my 12v input, but you can use whatever input/output you want. The output is to a salvaged electric scooter motor which I believe took 24V, but it runs fine on 12v. I am using it for a homemade clay throwing wheel so I don't need very much speed. The electric scooter motor seems to have plenty of torque. The controller does not heat up much, but I added the fan so I wouldn't have to worry about leaving it running with high loads overheating it.
The slots for the air outflow are tricky to print. Too lazy to redesign. Should print okay if you're retraction setting aren't too high. Mine are very high and the fan grills ended up a little thin/underextruded.
Important note: Hardware used - I designed this for using eight #6-1/2" sheet metal screws, commonly found in assortment kits such as harbor freight "347 pc Nut and Bolt Assortment". The board is held in with 4 of the bolts, and the other 4 hold the top half onto the bottom half. A standard #2 Phillips screwdriver shaft will fit nicely into the holes that the screws fall into on top. Do not overtighten, PLA has a tendency to let go if given high torque. Snug is fine.
I also used an XT60 60 amp remote control electric motor airplane connector for my motor connection, that way I can connect the motor when I'm assembling my device later without having to take my speed controller apart again to connect the wires to the terminals. It also allows me to move the controller to other gadgets later should I need a motor speed controller for something else.
Here's some examples of this board:
Designed in Solidworks 2018 (Student)