We propose an algorithm for aperture shape optimization (ASO) for step and shoot delivery of intensity-modulated radiotherapy. The method is an approach to direct aperture optimization (DAO) that exploits gradient information to locally optimize the positions of the leafs of a multileaf collimator. Based on the dose-influence matrix, the dose distribution is locally approximated as a linear function of the leaf positions. Since this approximation is valid only in a small interval around the current leaf positions, we use a trust-region like method to optimize the leaf positions: in one iteration, the leaf motion is confined to the beamlets where the leaf edges are currently positioned. This yields a well-behaved optimization problem for the leaf positions and the aperture weights, which can be solved efficiently. If, in one iteration, a leaf is moved to the edge of a beamlet, the leaf motion can be confined to the neighboring beamlet in the next iteration. This allows for large leaf position changes over the course of the algorithm. In this paper, the ASO algorithm is embedded into a column-generation approach to DAO. After a new aperture is added to the treatment plan, we use the ASO algorithm to simultaneously optimize aperture weights and leaf positions for the new set of apertures. We present results for a paraspinal tumor case, a prostate case and a head and neck case. The computational results indicate that, using this approach, treatment plans close to the ideal fluence map optimization solution can be obtained.