Skip to main content
QUICK REVIEW

[Paper Review] Query2CAD: Generating CAD models using natural language queries

Akshay Badagabettu, Sai Sravan Yarlagadda|arXiv (Cornell University)|May 31, 2024
Manufacturing Process and OptimizationEngineering7 citations
TL;DR

Query2CAD uses large language models to generate executable FreeCAD macros from natural language prompts, with self-refinement loops guided by VQA feedback and optional human input; first-pass success with GPT-4 Turbo is 53.6%, improving by 23.1% after refinements.

ABSTRACT

Computer Aided Design (CAD) engineers typically do not achieve their best prototypes in a single attempt. Instead, they iterate and refine their designs to achieve an optimal solution through multiple revisions. This traditional approach, though effective, is time-consuming and relies heavily on the expertise of skilled engineers. To address these challenges, we introduce Query2CAD, a novel framework to generate CAD designs. The framework uses a large language model to generate executable CAD macros. Additionally, Query2CAD refines the generation of the CAD model with the help of its self-refinement loops. Query2CAD operates without supervised data or additional training, using the LLM as both a generator and a refiner. The refiner leverages feedback generated by the BLIP2 model, and to address false negatives, we have incorporated human-in-the-loop feedback into our system. Additionally, we have developed a dataset that encompasses most operations used in CAD model designing and have evaluated our framework using this dataset. Our findings reveal that when we used GPT-4 Turbo as our language model, the architecture achieved a success rate of 53.6\% on the first attempt. With subsequent refinements, the success rate increased by 23.1\%. In particular, the most significant improvement in the success rate was observed with the first iteration of the refinement. With subsequent refinements, the accuracy of the correct designs did not improve significantly. We have open-sourced our data, model, and code (github.com/akshay140601/Query2CAD).

Motivation & Objective

  • Motivate reducing CAD prototyping time by enabling non-experts to generate CAD designs from natural language prompts.
  • Develop a workflow that converts prompts into executable CAD macros for FreeCAD.
  • Incorporate self-refinement loops using visual feedback to improve CAD outputs.
  • Enable human-in-the-loop feedback to address false negatives and improve robustness.
  • Provide an open dataset, model, and code to reproduce and extend the approach.

Proposed method

  • LLM generates Python macros (FreeCAD) from user prompts to create 3D CAD models.
  • Error refinement loop uses error messages to iteratively fix executable code up to a specified iterations.
  • Model refinement loop uses VQAscore from Clip-FlanT5-XL to compare isometric views with the prompt and triggers caption-based feedback.
  • BLIP2 generates captions to describe designs, complemented by human feedback to guide refinements.
  • PyAutoGUI automates the FreeCAD macro execution workflow.
  • Few-shot prompting is used for all LLM invocations; the process allows up to three refinement iterations.

Experimental results

Research questions

  • RQ1Can an LLM generate executable CAD macros from natural language prompts that produce correct FreeCAD models?
  • RQ2Do iterative refinement loops (error-driven and model-driven) improve CAD design accuracy compared to direct generation?
  • RQ3How does VQA-based scoring correlate with design accuracy and determine stopping criteria?
  • RQ4What is the impact of model choice (GPT-3.5 Turbo vs GPT-4 Turbo) on initial success and refinement gains?
  • RQ5What are the limitations and failure modes in fully autonomous CAD generation from language?

Key findings

  • First-pass success rates depend on the LLM; GPT-4 Turbo achieves 53.6% on easy questions with direct generation.
  • Refinements raise accuracy by 23.1% on average across the dataset, with the first refinement contributing most of the gain.
  • Easy questions achieve up to 95.23% accuracy with GPT-4 Turbo, while medium and hard questions reach 70% and 41.7% respectively.
  • GPT-3.5 Turbo attains 85.71% easy, 35% medium, and 37.5% hard accuracy, with refinements improving results similarly.
  • Weaker models (e.g., Codellama-70B) perform poorly, showing hallucinations and inconsistent reasoning.
  • BLIP2 captions alone are less effective for refinement compared to when combined with human feedback.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.