This logic should be handled by the paths library currently which follows that vector field method from that paper you sent me ages ago.  This should be pretty solid, at least for an initial implementation.