I imagine this is the kind of thing people refer to by spatial intelligence. But also I can imagine it's easier to do if you've actually done the thing in real life and paid some attention to perspective, shape, shadow and so on. Or if you've tried drawing cubes, etc.