skip to content
JS John Sosoka

AI 3D Printer Object Design Factory

Multi-agent AI system for generating custom 3D-printable objects without CAD experience. Uses Python macros as version-controlled specifications to overcome LLM context limitations.

AI 3D Printer Object Design Factory

A multi-agent AI system for generating custom 3D-printable objects without requiring CAD expertise. This project demonstrates how to overcome LLM context limitations through specialized agent roles and Python code as a 3D design specification language.

The Problem

After acquiring my first 3D printer, I quickly exhausted the pre-made designs available on sites like Printables.com. I needed custom objects—specifically, under-desk mounting hardware for audio equipment—but had zero CAD modeling experience. Traditional CAD learning curves weren’t practical, so I turned to AI agents instead.

The Solution: Multi-Agent Factory

Rather than building a single AI model, I created a team of specialized agents:

Mechanical Designer

CAD Spec Implementer

The Handoff Pattern

Both agents operate in context isolation using an llm_memory directory pattern:

  1. Mechanical Designer writes detailed specs as markdown
  2. CAD Spec Implementer reads specs, writes Python macros
  3. Designer executes macros via FreeCAD MCP to render objects
  4. Designer provides feedback or approves
  5. Both agents maintain focused contexts without cluttering

Python Macros as “3D-Model-as-Code”

The breakthrough insight was using FreeCAD Python macros as specifications. Instead of trying to describe complex 3D geometry through tokens, agents write executable Python code:

# Macro specification: Under-desk mount
base_width = 120
base_depth = 50
mounting_holes = [
{"x": 20, "y": 15, "diameter": 8},
{"x": 100, "y": 15, "diameter": 8},
]

Key Advantages

Version Control for 3D Models

Context Preservation

Reusable Components

Dynamic Generation

The Workflow

User Request (custom 3D part)
Mechanical Designer
- Writes detailed specs and constraints
- Saves to llm_memory/design-spec.md
CAD Spec Implementer
- Reads specification
- Writes Python macro
- Returns macro code
Mechanical Designer
- Executes macro in FreeCAD via MCP
- Reviews rendered object
- Gets visual/textual feedback
Feedback Loop
- Approves → Export to STL
- Requests changes → Back to Implementer

Results in Practice

Using this workflow, I successfully generated:

All within hours, without prior CAD experience.

Why This Approach Works

Overcomes Context Limitations

Initial attempts with FreeCAD MCP alone resulted in context exhaustion after 3-4 turns. The issue: MCP responses describing rendered objects are massive (base64-encoded meshes). By eliminating direct MCP in the generation loop, agents can work much longer without context collapse.

Preserves Specialization

When agents maintain focused contexts, they excel at their domain:

Enables Iteration

Version control on Python specs means:

Technical Architecture

Future Directions

The current workflow is functional but with room for optimization:

Lessons Learned

  1. Code is a better design language than text - For spatial problems, executable specifications beat descriptions
  2. Specialization matters - Agents with focused contexts outperform generalist agents
  3. Handoff patterns scale - Using directories for agent handoffs beats long-context conversations
  4. Version control for hardware - Git workflows apply to 3D models surprisingly well
  5. Manufacturing margins - Always include tolerance specifications in macros

Key Takeaway

This project demonstrates that AI agents don’t need to be monolithic. By decomposing the problem into specialized roles and using code as the medium of exchange between agents, you can build sophisticated systems that overcome individual model limitations.

The result: custom manufacturing without expertise, version-controlled hardware design, and a scalable pattern for AI-driven creation workflows.