Textile materials are characterized by a distinct structural hierarchy, whi
ch should be represented by a model of textile geometry and its mechanical
behavior. Despite extensive investigations of textile materials and a numbe
r of theoretical models existing in the textile literature for different st
ructures, a general model is not available. Hence, the challenge addressed
in this work is to take full advantage of the hierarchical principle of tex
tile modeling to create a truly integrated modeling and design tool. The al
gorithm for extensive simulations of complex yarn interactions uses the min
imum energy principle, allowing complex textile structure computations in c
omputer time to be counted in minutes instead of hours or days for FEM impl
ementation of the same nonlinear, nonconservative behavior of yarns under c
ompression and bending. The architecture of the code corresponds to the hie
rarchical structure of the textile material. General ideas of the hierarchi
cal approach are illustrated by models of the internal geometry of multilay
ered woven fabrics and weft-knitted fabric topology.