This is a small and efficient case for the Adafruit quad rotary encoder circuit board:
https://www.adafruit.com/product/5752
I've provided the open-scad source-code, so it should be customizable with just a bit of editing..
You probably want to print it "upside-down"; i.e. with the face with the knob holes facing the build-plate. This will not only avoid needing supports but gives the best quality for the most visible part.
Note that there are small overhangs for the "feet" but it seems to work well with basically default print settings.
I left the bottom of the box uncovered.. This allows you to put the circuit board in easily. What I ended up doing with mine is using some adhesive non-slip rubber pads (something like this: https://a.co/d/cPNoUGd) to close the bottom and make it non-slippy.
Have fun!
Adafruit_quad_rotary_encoder_part_5752_enclosure.scad | 3.8KB | |
Adafruit_quad_rotary_encoder_part_5752_enclosure.stl | 58.5KB |