Theory of rolling curves