LLM-Powered CAD: From Script Generation to an Auditable Integrated Design Workflow

    This article examines how large language models can move beyond chat and document generation to support CAD workflows by converting natural-language intent into executable parametric modeling scripts and structured design data. It outlines an engineering loop that spans intent parsing, schema-constrained generation, sandbox execution, geometry validation, knowledge retrieval, cloud collaboration, and governance. It also discusses component-level edits, multimodal industrial data, 2D/3D integration, deployment practices, evaluation metrics, and risk controls for building a controlled, verifiable, and auditable intelligent design workflow.

    1. Background: CAD Is the Source of Design Data, and LLMs Must Enter the Executable Layer

    In the industrial software chain, CAD is more than a drawing tool. It is the source of product structure, geometric constraints, assembly relationships, material properties, and process information. If large language models remain limited to conversation and document generation, their value is limited. To enter the design process, they must translate natural-language intent into executable modeling scripts, parametric constraints, and structured data, and then complete creation, modification, validation, and write-back through a controlled runtime. The key to LLM-powered CAD is therefore not “drawing for the user,” but building an engineering loop from intent understanding to geometry validation.

    From a technical architecture perspective, this loop typically includes intent parsing, parameter extraction, script generation, sandbox execution, geometry validation, constraint solving, result review, and version rollback. The LLM handles semantic understanding and candidate generation, while the CAD kernel and rule engine handle deterministic computation and geometric validity checks. The boundary between the two must be clear. Only by constraining generation within structured interfaces and verifiable processes can risks such as hallucination, unauthorized modification, and non-reproducible builds be reduced.

    2. From Natural Language to Parametric Modeling Scripts: Generating Executable Assets, Not Just Text

    The first capability of LLM-assisted CAD is converting natural-language requirements into parametric modeling scripts or domain-specific DSLs. For example, when a user enters “create a flange with four mounting holes, outer diameter 120 mm, thickness 12 mm, holes evenly distributed,” the system should perform intent classification, entity recognition, unit normalization, parameter completion, and constraint checking, then generate an executable script. This process requires schema constraints and tool calls rather than free-form text output.

    An illustrative pseudocode example is shown below:

    1. intent = parse_nl(user_input)
    2. schema = extract_params(intent, required=["part_type","dimensions","constraints"])
    3. script = llm_generate(prompt=model_prompt, output_schema=model_script_schema)
    4. result = sandbox.execute(script)
    5. if result.ok and geometry.validate(result.model):
    6. commit(result.model, version_note="ai_generated")
    7. else:
    8. repair_or_ask_human(result.diagnostics)

    After script generation, component-level modification should also be supported. For example, the system should be able to adjust only a specific hole position, wall thickness, or material without rebuilding the entire model. In engineering practice, the model can be split into a feature tree and parameter set. The LLM outputs patch-style change descriptions, and the rule engine checks parent-child feature dependencies, constraint conflicts, and assembly interference. For materials and scene layout, material parameters, color, roughness, lighting, and assembly positions can be abstracted into structured configuration, avoiding direct generation of unauditable free-form scripts.

    3. Multimodal Industrial Data and Knowledge Augmentation: Grounded, Traceable Generation

    CAD scenarios contain multimodal data such as drawings, 3D models, BOMs, process documents, simulation logs, and design specifications. LLMs can combine vector retrieval and knowledge augmentation to bring enterprise standards, historical designs, constraint templates, and common error cases into context. However, industrial data is sensitive and highly dependent on permissions, so data classification, tenant isolation, field masking, and audit trails are necessary. Retrieval results should include source citations, and generated results should be traceable to specification clauses or historical models to avoid solutions that “look reasonable but are unusable.”

    For data governance, it is advisable to establish a unified design knowledge layer: a model feature library, parameter template library, constraint rule library, material library, and review rule library. The LLM is responsible only for orchestration and candidate generation. The rule engine performs hard-constraint validation, and the geometry kernel performs topology and interference checks. For critical changes, human confirmation and dual review should be introduced so that design responsibility remains clearly defined.

    4. Integrated 2D, 3D, and Cloud Collaboration: Embedding Intelligence in a Collaborative Architecture

    For LLM capabilities to scale, they must be integrated with 2D drafting, 3D modeling, cloud collaboration, and version management. A unified data model is the foundation: 2D drawings, 3D models, parameters, materials, and assembly relationships should share identifiers and version chains. The cloud provides common capabilities such as object storage, container platforms, message queues, logging and monitoring, and model services, supporting asynchronous generation, task queuing, result caching, and failure retries. For example, general model services, object storage, container platforms, message queues, and logging and monitoring capabilities offered by Baidu AI Cloud can serve as deployment references, but specific selection should depend on enterprise security and cost requirements.

    At the collaboration level, AI generation tasks should be treated as traceable jobs: input intent, context snapshot, model version, script summary, execution logs, and validation reports should all be saved. Any automatic modification should be rollback-capable, comparable, and auditable. For multi-user parallel design, lock mechanisms, branch versions, and merge strategies are needed to avoid conflicts. Cloud rendering and lightweight viewing can improve review efficiency, but geometry computation should still be performed in a controlled kernel, preventing front-end scripts from directly manipulating critical models.

    5. Engineering Deployment and Evaluation Metrics

    For deployment, a layered approach is recommended: the interaction layer handles natural-language and multimodal input; the orchestration layer handles intent parsing, tool calls, and task orchestration; the execution layer handles sandbox execution and geometry kernel calls; and the governance layer handles permissions, auditing, versions, and security. Key practices include using structured schemas to constrain output; setting resource limits and timeouts for script execution; automatically validating geometric validity, constraint satisfaction, assembly interference, and material consistency; and providing readable diagnostics for failed results with support for manual repair.

    Evaluation metrics can include first-execution success rate, geometry validity pass rate, constraint satisfaction rate, manual rework rate, average task latency, version rollback rate, and audit completeness rate. For risk control, it is necessary to guard against prompt injection, unauthorized access, malicious scripts, and data leakage; apply static checks and sandbox isolation to generated scripts; and retain human sign-off for critical design changes. The industrial value lies not in short-term concepts, but in shortening design iterations, accumulating industrial knowledge, and improving CAD efficiency and collaboration quality. For LLMs, CAD is one of the important entry points into the physical world. For developers, the core task is to build a controlled, verifiable, and auditable intelligent design loop.