![](https://www.fabbaloo.com/wp-content/uploads/2024/08/slice-100k-cover.jpg)
Researchers have developed “Slice-100K”, a dataset that could enable much more AI use in 3D printing.
These days we’re seeing AI tools used in many areas, some for good, and some, unfortunately, for evil. Even in the 3D print space there has been some use of AI, typically for generating rough 3D models and automatic detection of print quality issues.
But there’s one area where it really hasn’t been used much: GCODE. GCODE is the low-level machine instructions that cause a 3D printer to print objects. A GCODE file would include, for example, detailed and tedious instructions to move the toolhead, set the hot end temperature, etc.
If you were to look at a GCODE file, you’d see endless and unrecognizable codes, line after line. It’s possible to decrypt them, but very challenging to debug.
The researchers realized that GCODE is simply another language. It’s low level, and not one that you’d converse in, but it’s a formal language. As such it is therefore possible for it to be analyzed by current AI tools.
The latest AI tools are all powered by Large Language Models, (LLMs), which were initially developed for translation purposes. It was later discovered they could do a great deal more, and that’s where we’re at today.
GCODE is a language, and it could be processed with LLMs. However, that happens only if the LLM can be trained on GCODE by exposure to a lot of examples.
The problem is that there is no usable dataset of this type. The researchers have created one, which includes not only GCODE examples, but also the corresponding STL models, layer slices and an object type categorization. The goal was to produce clean data that could be used for LLM training, and subsequent AI applications leveraging GCODE.
They used a combination of existing 3D model collections, along with downloads from Thingiverse, SketchFab and others to create the dataset. They developed a GCODE rendering tool to visualize what a GCODE file is building, and used it to automatically categorize the data. PrusaSlicer was used to create GCODE for the 3D models.
Does this actually work? It turns out it does!
The researchers demonstrated the dataset’s utility by using a trained version of GPT-2 (an earlier version from GPT-3) to translate GCODE flavors. They were able to translate ancient Sailfish-style GCODE into more modern Marlin GCODE automatically, just like translating Japanese into English with an LLM.
They also used the dataset to test the capability of various publicly available LLMs in their ability to generate GCODE from a 3D model. Most of them fail badly at this point, but will likely get better as the future unfolds.
I believe this is a very important step, as it presents a platform on which more advanced LLM applications can be attempted, particularly using GCODE.
One can imagine some possibilities for LLM-GCODE applications:
- Slicing entirely done by AI, not by basic algorithms
- Slicers recognize detailed features automatically and generate optimized GCODE for them
- GCODE made for one machine could be translated into usable code for another
There’s one dimension I believe the researchers missed, and that’s the machine being used. GCODE is a standard and mostly can be used from machine to machine. However, getting optimal results on a specific device may require some tweaks that could be missed if the machine dimension is ignored. I suspect that future datasets might include data for different machines.
This is an important development that I hope will lead to some interesting applications. You can even use the data yourself, if you have AI development skills.
Via ArXiv (PDF)