A 30-year-old man has narrowly escaped a stint in jail for owning a 3D printer which he tried to use to illegally print and sell firearms.