Text this: Optimization method for determining vertices in lattice radiotherapy