I have been building nest boxes for various birds this spring and thought it would be cool to 3d print one. I found a proven design that was based on 3 inch (75mm) PVC pipe which was intended for chickadees and nuthatches. Here's a link to that design: http://web2.uwindsor.ca/courses/biology/dmennill/nestbox.html
This design is intended to be packed with wood shavings/sawdust up to the hole, the birds will excavate the shavings to create the nest. This arrangement mimics a standing dead birch tree, which is apparently a preferred nest location for these cavity nesting birds.
I took the basic dimensions and made a 3d model with all the rough gripping surfaces, ventilation and drain holes built in. The box is divided into sections which thread together. The main section has a mounting bracket built on which can be screwed onto a tree, or strapped in place. The lower sections can be unthreaded each season to replace the sawdust/wood shavings.
I included a slight taper on the male threads, and the press fit cap so that even if a printer isn't quite calibrated properly it should still screw together.
The best materials for this design would be ones that will last outdoors longest. ASA and PETG have decent longevity in sunlight. painting the outside will protect the plastic from sunlight extend the life further. PLA is probably not a good choice, though it would almost certainly last one or two seasons.