This work proposes DAVINCI, a novel transformer-based architecture for simultaneous CAD sketch parameterization and constraint inference from sketch raster images. Departing from existing methods, which address primitive and constraint inference as distinct problems, DAVINCI employs a single-stage architecture. By predicting both primitives and constraints within a unified network, it effectively reduces the error accumulation associated with multi-stage processes, thereby achieving state-ofthe-art performance on the large-scale SketchGraphs dataset.
In order to reduce the reliance of transformer-based architectures (including DAVINCI) on large-scale annotated dataset availability, this work explores data augmentation techniques tailored to CAD sketch applications. While data augmentation is commonplace in vision pipelines, they are less straightforward and often overlooked for CAD-related tasks. The proposed CAD sketch augmentation technique leverages the constraints of input sketches to create new CAD sketches preserving the constraints but with different parameterizations. The resulting CAD sketch augmentations have the advantage of bringing diversity, yet preserving the original distribution of CAD sketch images.
DAVINCI is an encoder/decoder transformer network that jointly learns primitive parameterizations and their constraint relationships (i.e. sketch graph) from a raster CAD sketch image. To that end, it learns two types of token embeddings; [prim]-embeddings and [constr]-embeddings. A [prim]-embedding is learned for each primitive token and can be directly decoded to the token value dedicated MLP heads. A constraint prediction MLP head is used on the pair-wise combinations of these [const]-embeddings to infer the existence of geometric constraints between subreferences of primitives.
Constraint-Preserving Transformations (CPTs) introduce a novel approach for data augmentation in CAD sketches. The core idea is to leverage the existing geometric constraints within sketches to generate plausible variations of the original design. The augmentation process is enabled via integration with FreeCAD software’s API. A random local perturbation, such as the translation of a sketch point, is automatically applied to the CAD sketch. Due to the constraints associated with the manipulated point, this local change cascades across the sketch, modifying the parameterization of all connected primitives. Importantly, these transformations preserve the original geometric and topological relationships set by the constraints.
We evaluate the performance of DAVINCI on the SketchGraphs dataset. Comparison is performed with the state-of-the-art method of Vitruvion on both precise and hand-drawn images. The proposed DAVINCI outperforms Vitruvion at both primitive and constraint levels.
We compare CPTs with two augmentation strategies; synthetic and rotated CAD sketches. Synthetic sketches are built iteratively by appending sampled primitives and constraints from a predefined set of sketch patterns (e.g. adding a new random line that remains parallel to an existing line or a new circle that is concentric to an existing circle). For rotated CAD sketches, we exclude the constraints that become invalid (e.g., horizontal) due to the sketch rotation. While both augmentation baseline methods enhance model performance at primitive and constraint levels, CPT-based augmentations achieve the best results, reaching a comparable performance w.r.t the upper bound..
DAVINCI can also enable constrained CAD sketch inference on 2D cross-sections of 3D scans. Cross-sections are critical components of CAD reverse engineering pipelines and are obtained by designers via intersecting an existing 3D scan with a selected 2D plane. Preliminary qualitative examples show the applicability of DAVINCI within this reverse engineering scenario.
The present work is supported by the National Research Fund (FNR), Luxembourg under the BRIDGES2021/IS/16849599/FREE-3D project and Artec3D.
@inproceedings{Karadeniz2024DAVINCIAS,
title={DAVINCI: A Single-Stage Architecture for Constrained CAD Sketch Inference},
author={Ahmet Serdar Karadeniz and Dimitrios Mallis and Nesryne Mejri and Kseniya Cherenkova and Anis Kacem and Djamila Aouada},
year={2024},
journal={BMVC}
}