The camera distance is set to 10 to improve the 3D visualization of the object. This change is purely cosmetic and does not affect the functionality of the code.