Knitwear modeling is disclosed. A macrostructure corresponding to a
three-dimensional object is generated, based on a stitch pattern and
optionally a color pattern. Yarn microstructure is generated and applied
to the macrostructure to yield a knitwear model. The stitch positions of
the macrostructure can be perturbed to achieve stitch position
irregularities. The fluffiness of the yarn microstructure can be
controlled. In an alternative embodiment, a two-dimensional knitwear
texture is generated, which can then be mapped to a three-dimensional
object to yield a knitwear model.