We present a novel trajectory computation algorithm to smooth piecewise linear collision-free trajectories computed by samplebased motion planners. Our approach uses cubic B-splines to generate trajectories which are C 2 almost everywhere, except on a few isolated points. The algorithm performs local spline refinement to compute smooth, collision-free trajectories and it works well even in environments with narrow passages. We also present a fast and reliable algorithm for collision checking between robot and the environment along the B-spline trajectories. We highlight the performance of our algorithm on complex benchmarks, including path computation for rigid and articulated models in cluttered environments.