A new algorithm to perform coherent mode decomposition of undulator radiation is proposed. It is based on separating the horizontal and vertical directions, reducing the problem by working with one-dimension wavefronts. The validity conditions of this approximation are discussed. Simulations require low computer resources and run interactively on a laptop. The focusing with lenses of the radiation emitted by an undulator in a fourth-generation storage ring (EBS-ESRF) is studied. Results are compared against multiple optics packages implementing a variety of methods for dealing with partial coherence: full two-dimension coherent mode decomposition, Monte Carlo combination of wavefronts from electrons entering the undulator with different initial conditions, and hybrid ray-tracing correcting geometrical optics with wave optics.