  The motion of flexible fibers through structured fluidic environments is
ubiquitous in nature and industrial applications. Most often, their dynamics
results from the complex interplay between internal elastic stresses, contact
forces and hydrodynamic interactions with the walls and obstacles. By means of
numerical simulations, experiments and analytical predictions, we investigate
the dynamics of flexible fibers settling in a viscous fluid embedded with
obstacles of arbitrary shapes. We identify and characterize two types of
events: trapping and gliding, for which we detail the mechanisms at play. We
observe nontrivial trapping conformations on sharp obstacles that result from a
subtle balance between elasticity, gravity and friction. In the gliding case, a
flexible fiber reorients and drifts sideways after sliding along the obstacle.
The subsequent lateral displacement is large compared to the fiber length and
strongly depends on its mechanical and geometrical properties. We show how
these effects can be leveraged to propose a new strategy to sort particles
based on their size and/or elasticity. This approach has the major advantage of
being simple to implement and fully passive, since no energy is needed.
