This is an openscad module (also provided as an stl in case it is useful to someone) for a Canon EF bayonet lens mount. I built this as a part of a project to make a microscope adapter for my camera (which will be published soon). I hope this can be useful to others for developing pinhole cameras, macro adapters, microscope adapters, telescope adapters, replacement body covers, and other useful things.
This has been printed and tested and it works very well. Because of the overhangs of the threads on the bayonet, your print settings will have to be pretty good. You may get away with mediocre settings if you do a little clean-up work.
In this version, I forgot to include the hole that the lock pin on the camera sinks into, which means that this won't lock in place on the camera, but it should nonetheless be light tight and it does seat very snugly and securely.
Include as a module in an openscad project. The output of this file, when rendered, includes a through hole as a use demonstration. The module itself does not, and if printed would yield a solid body cap.