vide-coding a 3D part design
Over the Christmas break, I noticed that the Christmas-light-hanging clips that I bought years ago are running out. Staring at the plastic part, I suddenly had the idea of designing a 3D printing part and print it myself. The only problem is that I am not familiar with CAD design software like AutoCAD or Solidworks. A few years ago I played with the open source CAD design programming language called OpenSCAD. What happens if I combine an AI coding agent and OpenSCAD to see if it can help me design the part?
I took a few photos of the existing clip I have from different angles, and did a few measurements to give the agent the idea of the actual size. Then I fired up my go-to coding agent Kiro-cli (you can also use Claude Code or OpenAI Codex). Besides giving the agent a detailed prompt of what I want, I also told it that OpenSCAD can be used in CLI to render code to PNG with a user-specified camera angle.
With all of this information, Kiro-cli went to work. It loaded the photos I took, wrote some OpenSCAD code, used the OpenSCAD CLI tool to render the code to PNG, loaded the rendered PNG files to observe, then further modified the code, rendered and observed, until the agent was satisfied with the result. While the agent was busy, it was very cool for me to load the PNG files and see the progress it was making. At the end, after a few rounds of further prompting, the agent was able to successfully design the part that mostly matching the original part I have. All of this was done without me inspecting/understanding any of the OpenSCAD code it wrote.
