Generating Digital Fabric

Jennifer Weiler

The focus of this research is to programmatically generate woven cloth that could
be used both as static pieces and interactive works. Though the desired end result
of this project was 3D models, there were also several programs to generate
2D designs created along the way.

All of the images and objects generated in this project were created with Processing.

Procedurally Generating 2D and 3D Designs

Before delving into generating braiding and weaving patterns, I first experimented with generating 2D and 3D models of trees. This allowed me to get a handle on how to procedurally generate images and sculptures, and how to translate algorithms for
generating 2D images to different versions that would work for 3D objects.

below: different programmatically-generated 2D model trees

below: programmatically-generated 3D model tree

2D Fabric

In generating 2D fabric, I focused on two different types of traditional fiber techniques: braiding and weaving. In braiding, several threads are repeatedly wrapped around each other in order to bind them together in a repeated pattern. In weaving, a single thread is repeatedly woven back and forth across several other threads (generally using a loom). Depending on the horizontal threads are passed through the other threads, different
patterns and designs can be created.

below: different braiding patterns. The program can create braids with 2-5 strands of thread.

below: different weaving patterns of various complexity

3D Fabric

When switching to 3D fabric, the braiding approach was much more practical
than the weaving approach. In this case, the 3D threads are braided together in a similar way to the 2D model. However, because the 3D models do not have the physical limitations of actual threads, the models can curve back in on themselves in order to make braided cylinders and bowls.

below: 3D generated braided sculptures

Generating and 3D Printing Fabric Models

Because all of these models are being generated programmatically, it is relatively easy to change a few variables and get notable variety in the resulting models. Because the models are watertight, they are also compatible with 3D printers.

However, because this version of the 3D model does not have collision detection between the different threads, there are some points where the threads will overlap with each other. This is most likely to happen if the threads are generated with parameters that cause them
to be either too close to each other or too thick.

below: same fabric vase model generated with different levels of compexity
based on number of threads and thickness of the threads.

below: 3D print of fabric model

Thread Animation and Collision Detection

In order to create an animatable version of the braids that could move and behave
like cloth, there needed to be some sort of collision detection between the different threads so that they could react to each other and move as a single unit. I accomplished this by creating an animatable version of the program where each individual thread was composed of hundreds of orbs, each of which could detect if it was coming into proximity with the orbs that composed the other threads. In this way, the finished tangle of threads could interact as though each actually contained mass.

below: intertwined strands of thread, each of which is composed of a series of orbs
which have collision detection against all orbs in all other strands of thread.

To translate these series of orbs into vertex points for a static OBJ model, each orb was reduced to a ring of points that were most perpendicular to the two orbs next to it in the thread. These points were then outputted to create the finished OBJ. While the OBJ models cannot animate individually, by exporting a series of OBJ models it would be possibly to display the interrelated movements of the threads as a series of images.

below: test to generate ring of points for each segment of the thread
based on the position of the two segments of thread on either side of it.

below: generated 3D model that serves as a snapshot of the animating threads.