This is an OpenSCAD library for generating 3D prints of tightly woven fabrics. I was inspired by the many chainmail patterns I saw on here, and started wondering what it would take to generate a woven fabric pattern. There are three weave patterns I came up with. One is a flat classic fabric weave with sinusoidal waves in the z direction. The second is a crossed pattern of right handed and left-handed helices where each helix always cross the others at a right angle. The third pattern has interlocking helices traveling only in the x direction, resulting in a tightly woven fabric pattern that flexes freely in the y direction without even bending the plastic. (This last pattern might work very well for bracelets, as one example.)
I've enabled the Customizer feature for creating fabric samples right here. But probably for most interesting uses this will be a component of other designs. The useful API functions for use in your own OpenSCAD routines are as follows:
/ Creates a flat fabric weave with overall fabric dimensions of x_len by
// y_len. Each thread has a diameter of diam, and the threads print with a
// minimum distance between each other of approximately clearance.
module MakeFlatFabric(x_len, y_len, diam, clearance)
// Creates a helical/counterhelical fabric weave with overall fabric dimensions
// of x_len by y_len. Each thread has a diameter of diam, and the threads
// print with a minimum distance between each other of approximately clearance.
module MakeHelicalFabric(x_len, y_len, diam, clearance)
// Creates an interlocking x-oriented helical weave with overall fabric
// dimensions of x_len by y_len. Each thread has a diameter of diam, and the
// threads print with a minimum distance between each other of approximately
// clearance. This pattern naturally flexes and stretches well in the y
// direction as generated, while being more rigid in the x direction.
module MakeYFlexFabric(x_len, y_len, diam, clearance)
Initial adhesion is very critical as the print starts as just an array of dots for the lowest layer. I recommend calibrating your initial z offset well, and then applying a fresh layer of adhesive (e.g. glue stick) shortly before the print.
If you have trouble printing a small weave pattern, try calibrating your extrusion rate for line thickness, or adjust the temperature and cooling. You will also need to make sure your retraction settings are adequate as these patterns can retract hundreds of times per print even for a small piece of fabric.
If you have a better printer, try to drive down the resolution to smaller values. I'm curious how small this can get.
I couldn't figure out how to create exactly the shapes I needed using any of the pre-built routines in OpenSCAD, so I had to break out some vector math and generate each thread as a custom polyhedron. The best way I could think of to do this was functionally with tail recursion to generate all the points and faces. This ended up running much faster than I anticipated, and produced a pretty nice result in a relatively short (but dense) stretch of code.