Textile mathematics