LLM-Driven CAD: From Natural Language to Executable Modeling Scripts

    This article explores how Large Language Models (LLMs) can drive CAD systems by converting natural language requirements into executable modeling scripts. It details the end-to-end pipeline from parsing to execution, the role of multimodal data and data engineering, and the engineering challenges of precision and context length. Additionally, it outlines an integrated 2D, 3D, and cloud architecture and assesses the industrial conditions for applying AI to industrial design.

    1. Introduction: Why Natural Language Enters the Modeling Workflow

    Over the past few years, the capabilities of Large Language Models (LLMs) have expanded from text generation and code writing to image understanding and video generation. In the industrial design sector, a specific question arises: Can models directly drive CAD software to perform modeling tasks?

    CAD systems carry drawings, 3D models, and assembly relationships. This data must eventually be transformed into manufacturable and constructible engineering data. Therefore, combining LLMs with CAD serves as an entry point for AI into physical world design processes, though it is just one of many data entry points.

    This article answers three questions: How to implement LLM-generated modeling scripts; how to divide responsibilities among 2D, 3D, and cloud layers; and what risks to watch out for during implementation.

    2. From Natural Language to Executable Modeling Pipelines

    2.1 Minimal Viable Pipeline

    A functional pipeline requires five steps:

    1. Natural Language Parsing: The model converts requirements into a structured JSON feature tree. Fields include feature type, dimensions, units, and positional constraints.
    2. Parameter Validation: The program checks units, value ranges, and required fields, rejecting missing or out-of-bounds requests. Validity is determined by the validation program, not the model.
    3. Script Template Rendering: The system selects pre-audited templates based on feature types, fills in validated parameters, and generates execution scripts. The model does not freely write geometric code.
    4. Kernel Execution: The script runs in a specified version of the CAD kernel or API. For example, using the open-source geometric kernel OpenCASCADE and its Python bindings, the version number should be fixed to avoid inconsistent results due to interface changes.
    5. Read-back Validation and Rollback: After execution, the bounding box, volume, and feature count are read and compared item by item with requirements. If the comparison fails, the system restores the feature tree snapshot saved before execution.

    Taking “add an M8 threaded hole centered at the top of the base plate” as an example, the feature tree output by the model can be written as follows:

    1. {
    2. "part": "bracket",
    3. "base_plate": {"length": 80, "width": 40, "thickness": 5, "unit": "mm"},
    4. "fillet": {"edge": "top_outer", "radius": 3, "unit": "mm"},
    5. "thread_hole": {"spec": "M8", "position": "top_center", "depth": 8, "unit": "mm"}
    6. }

    The template layer only accepts validated parameters. An illustrative base plate template is as follows:

    1. from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
    2. def make_base_plate(p):
    3. # Pre-validated: values are positive, units unified as millimeters
    4. return BRepPrimAPI_MakeBox(p["length"], p["width"], p["thickness"]).Shape()

    Threads are usually approximated by base holes at the geometric level. The common base hole diameter for an M8 thread is about 6.8 mm, though the exact value should follow applicable standards and enterprise specifications.

    The execution environment must clarify three points. First, Python and geometric kernel binding versions must be fixed and recorded. Second, the execution account should only have write access to the sandbox directory and cannot access production data. Third, generated scripts are not allowed network access.

    2.2 Responsibility Boundaries

    The CAD kernel handles geometric construction, boolean operations, and constraint solving. Material properties are managed by PLM or rendering tools, while scene layout is managed by rendering or scene editing tools. LLMs can call these systems via independent tool interfaces, but these calls should be recorded and executed separately from geometric modifications, not mixed within the same modeling script.

    2.3 Division of Labor in Parametric Design

    The core of parametric design is dimension-driven feature trees. The model undertakes three roles:

    • Lowering operational barriers: Engineers can complete most routine modeling through dialogue without memorizing every command.
    • Generating initial drafts: For standard parts and common structures, the model can quickly generate an initial version for engineers to modify.
    • Providing reference suggestions: The model can offer references for material selection or structural layout, but the final decision is made by the engineer, with the rationale recorded.

    3. Multimodal Capabilities and Data

    3.1 Why Multimodal is Needed

    Industrial design inherently involves diverse information: 2D drawings, 3D models, rendered images, technical documents, and process instructions. A single-text model struggles to cover all these, so multimodal models are often used as the foundation, undertaking three main tasks:

    • Drawing Reading: Recognizing view relationships and annotations in 2D engineering drawings to assist in reconstructing 3D models from drawings. Reconstruction results require manual verification.
    • Model Understanding: Parsing the topological structure and semantics of 3D geometry, such as identifying a mounting face or a reinforcing rib.
    • Content Generation: Outputting modeling scripts, design descriptions, and preliminary scene layouts.

    3.2 Data is the Key Barrier

    High-quality data in industrial scenarios is scarce. Models with complete feature histories, annotations, and manufacturing constraints are particularly rare. Thus, accumulating industry data and training vertical models is a major difficulty in the AI transformation of industrial software.

    Three key practices in implementation:

    1. Data Engineering: Cleaning, structuring, and semantically annotating existing design data.
    2. Knowledge Fusion: Injecting industry standards, design specifications, and process knowledge into the model to reduce “geometrically correct but unmanufacturable” solutions.
    3. Human-Machine Loop: Every modification by an engineer serves as a feedback signal for fine-tuning or reinforcement learning.

    Industrial data often involves trade secrets and customer information. Before use, data ownership must be confirmed, and customer names, model numbers, and project numbers in drawings must be desensitized, with data sources and usage scopes recorded.

    3.3 Engineering Challenges in Implementation

    Precision is the first constraint. Industrial modeling typically requires millimeter-level or higher precision, while model output has uncertainty. A common approach is to restrict the model to the script generation layer, with final geometry computed by a deterministic kernel, and verified through automated validation.

    Context length is the second constraint. Complex assemblies may contain thousands of parts, making it difficult for the model to understand the global structure at once. A feasible approach is building a hierarchical scene graph, placing only the substructures relevant to the current modification into the context.

    Explainability is the third constraint. Engineers need to know why the model designed it that way, so every generation should include a design intent explanation for review and traceability.

    Before implementation, you can check against this checklist:

    • Units and Tolerances: All parameters carry units; linear and angular tolerances are uniformly declared in the configuration.
    • Failure Rollback: Save a feature tree snapshot before each execution; automatically restore on failure.
    • Assembly Constraint Consistency: Re-solve constraints after modification to check for over-constraints or under-constraints.
    • Manufacturing Rules: Minimum wall thickness, hole edge distances, draft angles, etc., are enforced at the validation layer, not relying on the model’s voluntary compliance.
    • Permissions and Audit: Accounts calling CAD only have necessary permissions; each modification records request content, parameters, script version, and operator.

    4. Integrated “2D + 3D + Cloud” Architecture

    4.1 Three-Layer Division

    2D Layer: Engineering drawings can derive views from 3D models. AI can assist with annotation and drawing review, but auto-generated annotations require manual confirmation before release.

    3D Layer: Parametric modeling, assembly design, and simulation pre-processing are the most direct domains for the model, and the primary execution location for the pipeline in Section 2.

    Cloud Layer: Responsible for design data storage, version management, and multi-user collaboration, while providing elastic computing power for AI inference and batch processing.

    Cloudification brings three types of risks. Network latency affects the feel of interactive modeling, so geometric operations should be as close to the engineer as possible. After design data moves to the cloud, data security responsibilities change, requiring clear encryption and access control policies. Subscription costs will grow with computing usage, which should be estimated before launch.

    4.2 Task Division After Cloudification

    When moving to the cloud, task division is more important than choosing a service provider:

    • Interactive modeling remains local or near-edge to ensure acceptable operational latency.
    • Batch geometric solving and rendering are placed in cloud queues, executed asynchronously, and users are notified upon completion.
    • AI inference is scheduled elastically based on request volume; non-real-time tasks can queue.
    • Data synchronization uses check-out/check-in or branch merging. When the same part is modified by multiple people simultaneously, locks or merge rules determine which version takes effect, with conflicts handled manually.
    • Every access and export is written to audit logs for post-hoc traceability.

    Synchronization strategies require special attention. If a complete assembly is uploaded for every operation, transmission time and traffic costs may exceed local computing costs, so only changed portions should be synchronized.

    4.3 Synergy of Core Technologies

    3D CAD kernels involve geometric modeling engines, constraint solvers, and rendering engines, presenting a high technical barrier. Some industrial software vendors attempt to integrate proprietary geometric kernels with AI capabilities, delivering complete solutions via the cloud. This is an optional path whose effectiveness depends on kernel maturity, team investment, and customer migration costs. Publicly available successful cases remain limited, so selection should be based on actual test results.

    5. Industrial Perspective: Applicable Conditions

    The value of “AI plus industrial software” depends on whether the following three conditions hold.

    Proportion of Design Cycle: The proportion of the design phase in the R&D cycle varies by industry. Repetitive modeling, such as standard parts and serialized structures, benefits most easily from AI assistance.

    Non-Professional User Participation: Product managers and procurement personnel can preview solutions through dialogue to facilitate communication. Formal drawing releases still require engineer review.

    Foundation for Physical AI: Only when design data can be generated and modified is it possible to connect simulation, manufacturing, and other phases. Currently, most enterprises are still in the early stages of this pipeline.

    For developers, three directions can be prioritized initially: AI transformation of CAD script engines, multimodal industrial data processing pipelines, and cloud-based design collaboration services.