All work

CAD / Robotics · 2024

Constraint-aware CAD editing with a multi-agent LLM

A system that lets engineers edit CAD drawings in natural language while preserving geometric constraints — driven by a multi-agent LLM and a 17-detector constraint engine, with a live force-graph view of the sketch's relationships.

Editing an engineering drawing is rarely about moving a line. Change one dimension and a web of relationships — symmetry, alignment, hole spacing, cross-view consistency — has to hold. We built a system that lets an engineer describe a change in plain language ("make the width 150mm, keep the holes centered") and have the geometry update while those relationships are preserved.

A multi-agent pipeline

Rather than ask a single model to do everything, we decomposed the problem into cooperating agents, each with a narrow job:

  • Intent parser — turns the natural-language request into a structured edit.
  • Constraint analyzer — identifies which geometric relationships are in play.
  • Operation planner — sequences the concrete geometry operations.
  • Validation — checks the result against the original constraints before it is committed.

The models run locally via Ollama, keeping proprietary CAD data on-prem — an important property for engineering teams.

A real constraint engine

Language alone isn't enough; the system needs to understand the geometry. We built 17 constraint detectors covering symmetry, alignment, collinearity, parallelism and perpendicularity, concentricity, dimensional ratios, and cross-view synchronization. Detected relationships are expressed in the SketchGraphs format (29 constraint types spanning geometric, dimensional, and pattern constraints), giving the system a rigorous, ML-compatible representation of the sketch.

Why it's hard

Constraint preservation is a genuinely difficult geometry problem. Naively resizing a part breaks symmetry and misaligns features; the value is in re-solving the whole relationship graph so the edit stays valid.

Seeing the relationships

The interface is dual-pane: a live SVG editor with immediate preview beside a D3.js force-directed graph of the sketch's constraint network. Engineers can watch how a single change ripples through the relationship graph — making an otherwise invisible structure tangible and debuggable.

The result

The system turns constraint-aware editing — normally the domain of expert CAD users — into a conversational workflow, while keeping the underlying geometry rigorous and the data local. It's a clear example of pairing LLM reasoning with a real domain solver rather than asking the model to guess.

Build something like this

Tell us about the problem you're solving and we'll show you what's possible.

Start a conversation