diode direction
The diode is reverse biased when the switch is closed and so with an ideal diode you get the full 10 V on the output. (If the diode were not ideal, you would get the 10 V minus the diode leakage current drawn through the resistor.) If the diode was the other direction, the output would be the diode forrward drop plus the voltage on the capacitor. The voltage would rise to 10 V with a time constant of RC and you would end up with all 10 V on the capacitor because the diode forward drop at low currents approaching zero is itself nearly zero.