Having done 3d printing, I can say that unless you have a very expensive 3d printer, your formed threads will not print well enough to be useful. Instead, I make sure the print has an undersized hole (smaller than the root) and there's enough solid material around the hole to use a steel tap to cut the threads after the print is finished.