OrthoLatentCAD: Orthographic Spatial Latents for Hand-Drawn CAD Program Generation

Xiaolei Zhou, Xinjie Zhu, Chuangjie Fang, Chenyu Wang, Jianwei ZhengarXiv 2026

TL;DR

OrthoLatentCAD is an AI framework that takes your hand-drawn "napkin sketches" (front, top, and side views) and automatically generates the actual, editable CAD code needed to build a 3D model. It works by "lifting" 2D drawings into a shared 3D spatial memory and using an efficient scanning technique to ensure that features in one view (like a hole) align perfectly with features in another.

What Problem Does This Paper Address?

In the early stages of engineering, designers often communicate through quick, hand-drawn orthographic views. However, turning these sketches into a functional 3D model in a CAD system is a tedious manual process.

The challenge for AI is twofold. First, hand drawings are "noisy"—lines aren't perfectly straight, and views aren't perfectly aligned. Second, a CAD model isn't just a shape; it’s a program (a construction history of "sketch this circle, then extrude it by 10mm"). To bridge this gap, a model must perform "cross-view reasoning": it has to realize that a circle in the front view and a rectangle in the side view are actually the same cylinder seen from different angles.

Methods

The authors propose a two-stage framework called OrthoLatentCAD.

  1. Stage 1: The CAD Anchor. Instead of training a model to "guess" text, they first train a CAD Sequence Autoencoder. This model learns a compressed "latent space" that represents valid CAD operations. Once trained, they freeze this decoder to act as a stable target for the visual model.
  2. Stage 2: The Visual Bridge. This is where the magic happens. They use three key components to map drawings to the CAD latent space:
  3. Orthographic Spatial Lifting (OSL): This takes the 2D features from your drawings and "pins" them onto their respective 3D canonical planes (xy, yz, and xz).
  4. Orthographic Mamba Propagation (OMP): Using Mamba (a highly efficient state-space model), the system "scans" across these planes. Crucially, it performs Shared-Axis Exchange. Since the front and top views share the same 'x' axis, the model explicitly compares data along those shared lines to ensure geometric consistency.
  5. Program-Latent Alignment (PLA): This module uses a set of "queries" to pull the relevant geometric information out of the spatial memory and slot it into the right place in the CAD program sequence.
Figure 1. Task overview. OrthoLatentCAD converts one or more hand-drawn orthographic views into executable CAD command sequences that compile into editable 3D models.

Datasets

The researchers introduced a new benchmark called Hand2CAD:

  • Synthetic Data: 215,000 pairs of orthographic drawings and their corresponding CAD programs, derived from the massive ABC industrial dataset.
  • Real-World Data: 1,000 sets of three-view drawings created by 20 CAD-trained human participants. This is vital because human sketches contain "stroke noise" and alignment errors that synthetic data often lacks.
Figure 2. Samples from the Hand2CAD benchmark. Ortho- graphic drawing views and their corresponding compiled 3D CAD models.

Key Insights and Ideas

  • Geometry is Math, not just Pixels: Most image-to-3D models treat views as an unordered set of pictures. OrthoLatentCAD treats them as mathematically linked projections. By enforcing "shared-axis" communication, the model "understands" that a line at $x=50$ in the front view must relate to whatever is happening at $x=50$ in the top view.
  • The Power of Freezing: By freezing the CAD decoder in Stage 2, the visual encoder doesn't have to learn "how to write CAD" and "how to see drawings" at the same time. It only has to learn how to map what it sees to a pre-existing, valid language of CAD.
  • Mamba for Sketches: While Transformers are great, Mamba’s ability to scan sequences linearly makes it surprisingly effective at "reading" a 2D plane line-by-line to find distant connections between sketch fragments.
A deep dive into how the model exchanges information between views along shared axes.

Key Results

OrthoLatentCAD significantly outperformed existing baselines (like DeepCAD and Drawing2CAD) across several metrics:

  • Procedural Accuracy: It achieved 89.0% command accuracy, a nearly 6-point jump over the best baseline.
  • Executability: One of the biggest wins was the Invalidity Ratio (IR). Only 26.2% of its generated programs failed to compile in a real CAD engine, compared to over 42% for previous methods.
  • Multi-View Synergy: The model actually gets smarter as you give it more info. Moving from just a front view to all three views (Front+Right+Top) dropped the geometric error (Chamfer Distance) from 0.55 to 0.43.

Limitations and Future Work

Despite the progress, the authors note a few "final frontier" issues:

  • Single-Part Limit: Currently, the model is designed for single mechanical parts, not complex assemblies.
  • The "Loop Closure" Problem: CAD engines are picky. If a predicted sketch line is off by just a fraction of a millimeter and doesn't perfectly close a loop, the "extrude" command will fail.
  • Alignment Sensitivity: The model assumes your three views are roughly aligned. If you draw the top view upside down or at a weird angle, the shared-axis logic breaks.

Future work aims to incorporate "kernel-guided repair," where the AI tries to compile the code, sees where it fails, and automatically tweaks the parameters to fix the geometry.

Summary updated

Abstract

Freehand orthographic drawings capture early design intent, yet recovering executable sketch--extrude CAD programs from raster front, right, and top views remains challenging: noisy, dimension-free 2D layouts must be reconciled into an ordered construction history. We introduce Hand2CAD, a benchmark of 215K ABC-derived synthetic orthographic-drawing--CAD program pairs and 1,000 real three-view sets drawn by CAD-trained participants. Recovering CAD programs from orthographic drawings requires both cross-view geometric reasoning and alignment between visual features and program representations. We propose OrthoLatentCAD to address these two challenges. It fuses local geometry with global context on canonical planes, exchanges evidence between paired plane lines indexed by the same shared-axis coordinate, and maps the spatial representation to ordered program latents through queries inherited from a frozen CAD autoencoder. Across the evaluated one- to three-view configurations, OrthoLatentCAD outperforms protocol-matched baselines in procedural accuracy, compiled geometry, and CAD-kernel validity while benefiting from additional views. Without real-data fine-tuning, it also outperforms the baselines on held-out real drawings. We will release the dataset, code, and evaluation scripts.
BibTeX
@misc{zhou2026ortholatentcad,
  author = {Xiaolei Zhou and Xinjie Zhu and Chuangjie Fang and Chenyu Wang and Jianwei Zheng},
  title = {{OrthoLatentCAD: Orthographic Spatial Latents for Hand-Drawn CAD Program Generation}},
  year = {2026},
  eprint = {2611.28646},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28646},
}
Figure