A man has been found guilty of various terrorism and firearms offences after he was caught attempting to use a 3D-printer to make a sub-machine gun.