3D printed magnets for neutron spin manipulation