Embodiments generally relate to cancer treatment with radiation sources. The present technology discloses techniques that can enable an automatic generation of radiotherapy trajectories using anatomical data of a patient. It can improve conformal dose distributions and target volume coverage by considering a radiation risk decided by an organs-at-risk (OAR)'s relative location to the target volume and the radiation source.