This is a threaded plug (cap) for electrical junction boxes. There are both 1/2-inch and 3/4-inch versions as well as versions that include a hex thumb screw for easy tightening/loosening (which I highly recommend--who wants to carry around a huge flat-head screwdriver just for plugs?).
Note: I highly recommend using some dielectric grease on the threads to ensure water can't get into your electrical box.
Remember: In order to comply with the National Electrical Code (NEC) you'll have to print this in a flame-retardant filament and protect it from UV rays somehow (either by using UV-stable filament or painting with a UV-protective coating).
Print flat (no rotation) with 3 perimeters and it should work out fine. The threads are slightly under-sized to make for an easy fit. If you find the plugs are still too tight just adjust the "diameter" value down a bit in the included .scad file (say, -0.005 or -0.01).
I looked at a threaded plug I happened to have lying around and made something similar in OpenSCAD. It actually took me a few prototypes to get it right because mass-manufactured plugs have under-sized threads in order to be easier to fit/tighten. I guess the electrical nerds over at NEC/UL expect everyone to always use dielectric grease on these things!