SMS dit: Theory of textile structure