Let's say you can only afford a single-nozzle FDM 3D printer, but you want to print a multimaterial part. You can stop at each material transition point in the process and swap out the spools, but this pause-and-resume approach comes with challenges; most notably you may need to purge the tip to flush out the first color before adding the second, for instance if the color switch is extreme.
A research collaboration between students from Meiji University, Osaka University and Texas A&M University has come up with a new trick called Programmable Filament. With this method, their software analyzes the design of your part and determines exactly how much filament is required between switches. It then generates a print file where you basically use multiple filaments to print a single new filament.
In other words, you feed a red filament into the printer and it starts printing out what is essentially a new spool. The researcher's G-code has programmed in pauses signified by beeps; this lets the operator know to purge the tip, switch to the next spool, then hit the resume button. The printer then stitches the transition in--seamlessly, according to the paper--and continues printing the spool, in the shape of a large spiral.
At the end of this process, you've got a new custom spool that changes material at various points based on your exact object to be printed. Here's a demonstration:
Enter a caption (optional)
You're probably wondering "Isn't this just a more time-consuming version of pause-and-resume?" Not if you've got a lot of color switches throughout your design. Remember that the new "spool" is actually printed out as a large spiral, so does not need to be produced in a continuous fashion. In other words:
"The boat [above left] is printed using five different materials, requires only four exchanges (equal to the number of materials minus 1); however, if printed using a regular approach by manually exchanging the material every time a layer meets the new color segment, 211 exchanges are required, which is the number of extruder exchanges appear in G-code—not ideal in practice."
Another question I had was "Is this truly multi-material, or just multi-color of the same material?" The researchers say they've combined PLA, ABS, TPU, nylon and PVA and that their joinery method "sufficiently compensates [for the inherent] fragility" of joints between the materials. If you want to read the technical details of how they've managed this, you can dive into the full research paper here.