Three-dimensional treatment planning