Parametric Primitive Analysis of CAD Sketches with Vision Transformer
Xiaogang Wang, Liang Wang, Hongyu Wu, Guoqiang Xiao, Kai Xu
TL;DR
This work tackles automatic parsing of hand-drawn CAD sketches into parameterized primitives and their constraint relations. It introduces a two-stage framework that recasts sketch analysis as set prediction, producing a primitive set $P$ and a constraint set $C$ via separate primitive and constraint networks, augmented by a pointer module to bind constraint parameters to primitive indices. A key contribution is decoupling primitive types from their parameters and applying Hungarian matching to align GT and predicted sets, avoiding the error accumulation seen in autoregressive methods. On two public CAD sketch datasets, the method achieves higher primitive-type/flag/parameter accuracies and constraint-type/parameter accuracies than state-of-the-art baselines, with robust performance under noise and potential extension to free-form curves.
Abstract
The design and analysis of Computer-Aided Design (CAD) sketches play a crucial role in industrial product design, primarily involving CAD primitives and their inter-primitive constraints. To address challenges related to error accumulation in autoregressive models and the complexities associated with self-supervised model design for this task, we propose a two-stage network framework. This framework consists of a primitive network and a constraint network, transforming the sketch analysis task into a set prediction problem to enhance the effective handling of primitives and constraints. By decoupling target types from parameters, the model gains increased flexibility and optimization while reducing complexity. Additionally, the constraint network incorporates a pointer module to explicitly indicate the relationship between constraint parameters and primitive indices, enhancing interpretability and performance. Qualitative and quantitative analyses on two publicly available datasets demonstrate the superiority of this method.
