Radiation therapy is a technology-driven cancer treatment modality that has experienced significant advances over the last decades, due to multidisciplinary contributions that include engineering and computing. Recent technological developments allow the use of noncoplanar volumetric modulated arc therapy (VMAT), one of the most recent photon treatment techniques, in clinical practice. In this work, an automated noncoplanar arc trajectory optimization framework designed in two modular phases is presented. First, a noncoplanar beam angle optimization algorithm is used to obtain a set of noncoplanar irradiation directions. Then, anchored in these directions, an optimization strategy is proposed to compute an optimal arc trajectory. The computational experiments considered a pool of twelve difficult head-and-neck tumor cases. It was possible to observe that, for some of these cases, the optimized noncoplanar arc trajectories led to significant treatment planning quality improvements, when compared with coplanar VMAT treatment plans. Although these experiments were done in a research environment treatment planning software (matRad), the conclusions can be of interest for a clinical setting: automated procedures can simplify the current treatment workflow, produce high-quality treatment plans, making better use of human resources and allowing for unbiased comparisons between different treatment techniques.