How to Use ChatGPT for 3D Printing: From Prompt to G-Code or STL File

ChatGPT has been an online sensation since its launch a few months ago. Chatbots can prepare files for 3D printing as well as help generate answers to simple queries. With ChatGPT you can create print-ready STL files, code 3D models that can be opened using script-based 3D modeling software such as OpensCAD, or create Gcode files without using 3D Slicer. You can
Below we discuss each of these strategies in more detail. Note that ChatGPT only works with the prompts it gives you and you may have to try a few different wordings to get what you want.
How to generate G-code using ChatGPT
to generate G-code Preview in ChatGPT and send to 3D printer. If you’ve never tried a chatbot before, you can access it by registering and logging in. open night. You should see an option to enter the prompt when logging in.
You can think of any design and ask the software to generate a printable file. In my case I want to create a simple 3D model of a cube. When you ask a chatbot to develop a printable 3D model, you’ll see a typical response like the one below.
To get a 3D printable file, you need to ask the software to generate an ASCII STL. The ASCII STL format stores human-readable details of the triangular facets that make up the surface of an object. Each vertex is connected to other vertices in the model to create triangles that define the shape of the 3D model.
Below is a section on the ASCII STL format for designing cups.
The file always starts with individual <名前>, where name is the name of the design. Then the details of the triangle vertices are displayed and the code ends with the name endsolid. <名前>.
Follow the steps below to create a 3D model in ChatGPT.
1. write a prompt Select “Generate cubic 3D model using ASCII STL format” and click Enter. Below is a sample of the generated code.
The full file is available for download on Google Drive.
2. copy the code and paste it You can copy it to a text editor such as Notepad and save it..STL. You can change your code if you understand how it works.
3. Import the file into Cura Or use any other 3D slicing software to slice and generate G-code to send to a 3D printer. It’s also useful for previewing to see what your 3D print will look like. I also realized that the design initially generated by ChatGPT was so small that I needed to scale it with Cura as shown below.
Four. Send the file to a 3D printer. After slicing, you can preview it by moving the sliders on the right and bottom of the interface to see if everything looks good. You can also specify speed, layer height, temperature, and other settings depending on your 3D printer.
Then you can send the file to your machine for 3D printing. His 3D printing of the design took about 6 hours and was completely flawless and I am impressed with the results.
If you look closely, the surface and edges are perfectly 3D printed, making the surface smoother.
In addition to using ChatGPT to generate STL files, you can also modify G-code files and send them directly to a 3D printer without using a 3D slicer.
How to fix G-code files with ChatGPT
To demonstrate this, 3D model of Minecraft Creeper Take it from Thingiverse and slice it using Cura to get the G-code. I then opened this in Notepad and changed the section highlighted below, adding letters instead of numbers on line 5.
When I then saved the file and tried to open it in Cura, I got the following error:
Instead of spending a lot of time identifying errors, ChatGPT can easily detect them. So I copied the file, pasted it into ChatGPT, and asked the bot to identify the mistakes. This was the reply I received.
As you can see, we were able to detect that the values in rows 5, 7, and 10 were not numeric because we added letters.
You can even tell it to go ahead and fix it. In this example, we used the prompt “Please fix the identified errors”. As you can see, the characters have been replaced with random numbers.
In addition to modifying G-code in ChatGPT to generate STL files, it can also be used to generate scripts of 3D models that can be used in 3D modeling software such as OpensCAD. Please follow the instructions.
How to generate scripts for 3D models in ChatGPT
If you want a 3D model that you can interact with, just ask for it. In this case, we will tell it to generate a script for the 3D model of the cup that we can use in OpensCAD. I used prompt.Script the 3D model of the cup to open in OpensCAD.”
Below is the output I got.
After generating the code Downloaded OpensCAD, created a new file and pasted the code into the editor. After saving and rendering the model, I got the design shown below.
It was slightly off, but almost like a cup. However, you can play around with prompts and codes until you have the perfect design for your cup. To save the file as an STL file, STL Options in the upper left section of the toolbar.
Then you can send it to the 3D Slicer for slicing. After slicing, the estimated time to print the model is 57 minutes.
After 3D printing, we were able to get the design as below.
As you can see, like the other one in the cube, the surface is smooth and generally good. You can always experiment with different prompts and create amazing designs.