<back to posts
|6 min read|problem

Semantic References: How AI Can Finally Understand "The Top Face"

Traditional CAD tracks geometry with fragile internal indices. Semantic references in code-based CAD preserve design intent, making AI-generated models robust across changes.

When you tell a CAD engineer to "put a hole in the top face," they know exactly what you mean. When you tell an AI the same thing, you've just exposed a 30-year-old problem that the entire CAD industry has been dancing around.

Last week we wrote about the topological naming problem and why it makes parametric CAD models fragile. The short version: CAD systems track faces and edges using internal indices like "Face #4" instead of meaningful names. Change your model, and those indices shift. Your carefully placed features break.

But here's what that post didn't fully address: if we can't even solve this problem for human users, how are we supposed to solve it for AI?

The Human Workaround

Experienced CAD users have developed workarounds over decades. They learn which faces are "stable" and which are prone to renumbering. They use construction geometry as anchors. They build models in specific sequences to minimize topology changes. They've essentially trained themselves to think in terms of internal indices, even if they don't realize it.

When something breaks, a human can look at the model, understand what went wrong, and click on the correct face. Problem solved, or at least patched.

AI doesn't have this option. It can't look at a model and intuitively know that "the top face" has become "Face #7." It can't make educated guesses based on spatial intuition. It's working with symbols, not geometry.

Why Natural Language Matters

Here's the thing: natural language is inherently semantic. When someone says "the top face," they're making a reference that's stable across model changes. The top face is the top face, regardless of how the internal kernel decides to number things.

This is why humans rarely get confused when describing CAD operations to each other. "Put a hole in the center of the top face" is unambiguous to another person, even if they've never seen your model. The reference is self-describing.

But traditional CAD systems force you to translate that natural reference into an index. You click on something in the viewport, and the system records "Face #4." The semantic meaning is gone, replaced by an arbitrary number.

This translation loss is where everything breaks down.

The Academic Solutions

Researchers have been working on persistent naming for decades. The landmark papers on this (Wang and Nnaji's work on geometry-based semantic IDs, for example) proposed ways to generate stable identifiers based on how faces were created rather than their position in an index.

The idea is compelling: instead of "Face #4," you get something like "the face created by extruding the top edge of the base sketch in the positive Z direction." That's more stable because it describes the face's origin, not just its current position in a list.

Commercial CAD systems have implemented variations of this. SolidWorks, Fusion 360, and Onshape all use some form of persistent naming algorithm. When indices shift, the system tries to figure out which new face corresponds to your old reference.

But these solutions are heuristics. They guess based on geometric similarity, position, area, normal direction. Usually they're right. Sometimes they're not. And when they're wrong, you're back to clicking through error dialogs.

More importantly, these systems still use natural language as input (your click) and immediately discard the semantic meaning in favor of internal representations. They're solving the wrong end of the problem.

Semantic References by Design

What if instead of trying to reconstruct semantic meaning from internal indices, you never lost it in the first place?

This is the approach that code-based CAD tools like Build123d and CadQuery enable. When you write code to describe geometry, you can use selectors that preserve semantic intent:

from build123d import *

Create a base box

base = Box(100, 60, 20)

Select the top face semantically, not by index

top_face = base.faces().sort_by(Axis.Z)[-1]

Place a hole using the semantic reference

with Locations(top_face.center()): hole = Cylinder(10, 20)

result = base - hole

That sort_by(Axis.Z)[-1] line is doing something important: it's selecting "the face with the highest Z position," which is what we mean by "top face." Change the base dimensions, add fillets, modify earlier features, and that selector still returns the top face.

No index. No guessing. The semantic intent survives model changes.

Why This Matters for AI

LLMs are good at generating code. They understand functions, parameters, logical relationships. When you ask an AI to "put a hole in the top face," it can generate that semantic selector directly.

The AI doesn't need to know internal face numbering. It doesn't need to track topology changes. It just needs to express the natural language reference in a form that survives regeneration.

This is fundamentally different from trying to make AI work with traditional parametric CAD. In that world, the AI has to:

  • Figure out which face is "top"

  • Convert that to an internal index

  • Hope the index doesn't change when the model regenerates

  • Deal with cascading errors when it inevitably does
  • With semantic selectors:

  • Express "top face" as code

  • Done
  • The geometry can change. The topology can shift. The selector still works.

    The Limits of This Approach

    I don't want to oversell it. Semantic selection solves a class of problems, not all problems.

    Complex assemblies still need ways to reference geometry across parts. Interactive editing (dragging a face, sketching constraints) benefits from the immediate feedback that GUI-based systems provide. And there are legitimate cases where you want to reference a specific face that doesn't have an easy semantic description.

    But for the core use case of AI-generated CAD, where natural language goes in and manufacturing-ready geometry comes out, semantic references are a better foundation than persistent naming heuristics.

    What We're Building

    At Henqo, we generate Build123d Python code from natural language, then execute it to produce BREP geometry. The semantic selectors are built into how we think about geometry references.

    When you say "add a chamfer to all the vertical edges," our system generates code that selects edges by orientation, not index. When you say "hollow out the part with a 2mm wall thickness except for the bottom," we generate a shell operation that semantically identifies which face to keep.

    The AI never sees internal indices. It works entirely in the language of design intent.

    We're not claiming to have solved the topological naming problem in some universal sense. That's a 30-year challenge that's still being researched. What we're doing is building AI-native CAD where the problem simply doesn't arise in the same way, because semantic references are the foundation, not an afterthought.

    ---

    What do you think is the hardest reference to describe semantically? Some faces and edges have obvious descriptions. Others are genuinely ambiguous. We'd love to hear about the edge cases (pun intended) that would challenge this approach.
    >CTA.RENDER

    Build with Henqo

    Turn your engineering specs into manufacturing-ready STEP files in minutes.

    Try Henqo Free>
    // Published February 9, 2026