Sequence and search enhanced 3d cad automatic modeling method and system

By defining a JSON structure with unified field naming and parameter constraints to represent the modeling sequence, and combining retrieval enhancement technology and large model generation methods, the problems of cross-software inconsistency and unstable results in existing 3D CAD model generation methods are solved, and cross-platform editable and manufacturable parametric part model generation is realized.

CN121480336BActive Publication Date: 2026-05-08ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-01-08
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing 3D CAD model generation methods cannot achieve robust replay across software, lack consistent representation of design intent and feature constraints, struggle to cover high-frequency engineering features and topological constraints, and lack end-to-end syntax, geometry, and topology anomaly fallback mechanisms, resulting in unstable and uneditable generation results.

Method used

A sequence-based and retrieval-enhanced approach is adopted. A JSON structure representing the modeling sequence is defined with unified field naming and parameter constraints. A parts library of standard and non-standard parts is built. Relevant parts are retrieved through vector retrieval index. The modeling sequence represented by the JSON structure is generated by combining the large model. The modeling is then automatically generated through CAD software API to produce parametric part models.

Benefits of technology

It achieves robust replayability and editability across software, improves the accuracy and stability of generated results, reduces the cost of manual modeling, and meets the requirements of engineering manufacturability and reusability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121480336B_ABST
    Figure CN121480336B_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional CAD automatic modeling method and system based on sequence and retrieval enhancement, and belongs to the field of computer-aided design and artificial intelligence generation content. A unified JSON structure is used to carry common operation types and parameter constraints of engineering modeling, a first database for storing standard parts and variants and a second database for storing ordinary parts are constructed, and a vector retrieval index is established for each part. Based on user input prompt words, relevant parts are retrieved and recalled according to the first database priority principle, and a large model prompt word is constructed, and a modeling sequence represented by a JSON structure is generated by a large model. After preprocessing and analysis, a feature history tree is sequentially created through a CAD software API, and a parameterized part model meeting the user's demand is generated. Through standardized intermediate representation and retrieval enhancement, the application effectively improves the accuracy and stability from user input prompt words to an engineering editable model, reduces the cost of manual modeling, and has cross-platform reusability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer-aided design and artificial intelligence-generated content, and in particular to a method and system for automatic 3D CAD modeling based on sequence and retrieval enhancement. Background Technology

[0002] Against the backdrop of the advancement of digitalization and intelligentization in manufacturing, 3D CAD is primarily expressed using B-rep models. B-rep models define 3D shapes by precisely describing the boundaries of objects (including geometric elements such as vertices, edges, and faces, and their topological relationships), accurately representing complex geometric structures. However, with the continuous shortening of product development cycles and the increasing demand for customized designs, the limitations of traditional B-rep models are becoming increasingly apparent. Current B-rep models lack a record of the modeling process, leading to difficulties in model modification; design intent and parametric relationships are easily lost, making it difficult to understand and modify others' designs in team collaborations. Parametric features and modeling history (sketches, extrusions, rotations, fillets, chamfers, etc.) are crucial for ensuring editability and manufacturability. With the development of AIGC and large language models, the industry hopes to automatically obtain "editable parametric parts" from text or images to shorten design cycles and accumulate design knowledge.

[0003] One mainstream 3D CAD model generation approach is text-to-3D generation based on implicit fields or mesh optimization. A typical approach involves using diffusion models or score distillation to constrain text semantics into a 3D representation, followed by volume rendering or mesh extraction to obtain the shape. These methods can quickly generate visually high-quality 3D shapes from natural language, making them suitable for conceptual design and content creation. However, they often produce triangular meshes or implicit volumes, lacking parametric features and modeling history, making it impossible to perform dimensional / geometric constraints, assembly, and tolerance analysis within a CAD environment. Furthermore, geometric noise, topological defects, and scale uncertainties are common, making it difficult to meet engineering manufacturability and reusability requirements.

[0004] Another approach is "procedural generation," which involves learning to generate CAD command sequences from textual or visual cues, and then executing them in open-source CAD library functions to obtain feature-rich results. This direction can recreate the modeling process to some extent, closely resembling engineering application scenarios. However, existing methods often focus on a few operations (mostly limited to sketching / extrusion), lacking sufficient support for high-frequency engineering features such as rotation, fillets, and chamfers; conventions for sketch pose, loop orientation, and closure are inconsistent, and edge / face selection easily relies on fragile indexes; feature semantics and termination conditions differ significantly across different CAD systems, lacking a universally accepted cross-platform consistent representation, resulting in insufficient stability for cross-software replay and Boolean construction.

[0005] In summary, the key to generating parametric CAD models for engineering lies in four aspects: 1) Achieving a consistent representation and semantic bridge that can be robustly replayed across software while carrying design intent and feature constraints. 2) Covering high-frequency engineering features and topological constraints, ensuring geometric / topological constructibility and Boolean stability. 3) Fully aligning natural language and images to parameters and features, and incorporating standard part knowledge and industry semantics. 4) The end-to-end execution chain requires rigorous syntax, geometry, topology, and exception fallback mechanisms to ensure stability and maintainability. Summary of the Invention

[0006] This invention addresses the shortcomings of existing technologies by proposing a sequence-based and retrieval-enhanced automatic 3D CAD modeling method and system. While ensuring that the model is editable, manufacturable, and reusable, it significantly improves the accuracy and stability of the process from user input prompts to engineering model modeling, and reduces the cost of manual modeling.

[0007] The technical solution adopted in this invention is as follows:

[0008] In a first aspect, the present invention discloses a three-dimensional CAD automatic modeling method based on sequence and retrieval enhancement, comprising the following steps:

[0009] (1) Define a JSON structure to represent the modeling sequence with a unified field naming, parameter field and default value strategy. The JSON structure includes the operation type of engineering modeling and its parameter constraints.

[0010] (2) Construct a parts library containing part names, part images and their modeling sequences, divide the parts library into a first database for storing standard parts and their one-step parametric variants and a second database for storing the remaining parts, and attach appearance descriptions of each part to the second database; establish a vector retrieval index for each part;

[0011] (3) Based on the user input prompt words, the parts library is retrieved according to the first database priority principle, and the top-k related parts are recalled; the prompt words of the large model are constructed by combining the search results, Few-shot samples, field definitions, value ranges and operation examples of JSON structure, and the modeling sequence represented by JSON structure is generated by the large model;

[0012] (4) The generated modeling sequence is preprocessed and parsed. After parsing, the feature history tree is created sequentially through the CAD software API to generate a parametric part model that meets the user's requirements.

[0013] Furthermore, the operation types include sketching, stretching and stretch cut, revolving and revolving cut, filleting and chamfering.

[0014] Furthermore, the parameter constraints for each operation type include:

[0015] The parametric constraints of the sketch include the profile and planar pose. The profile is composed of several closed curve loops, which contain curve elements and Boolean values ​​indicating the inner and outer loops.

[0016] The parameter constraints for extrusion and extrusion cut include Boolean mode, sketch profile, and extrusion parameters;

[0017] The parameter constraints for rotation and rotation cut include the rotation axis, rotation angle, and sketch profile;

[0018] The parameter constraints for rounded corners include the coordinates of the sampling points of the curve elements and the distance parameter;

[0019] The chamfer parameters include the coordinates of the curve element sampling points, the fillet type, and the distance parameter.

[0020] Furthermore, the parameter constraints for sketch operations adopt the following specifications:

[0021] The outline is composed of several non-intersecting closed curve loops, and each closed curve loop organizes curve elements in a counterclockwise direction;

[0022] Curve elements are defined in three types: straight line segments, perfect circles, and circular arcs.

[0023] Planar pose is uniquely determined in three-dimensional space by rotation matrix and translation vector;

[0024] The sketch sequence starts from the bottom left point.

[0025] Furthermore, a one-step parametric variant of a standard part refers to a part obtained by adding a step of extrusion, rotation, filleting, or chamfering operations on the basis of the modeling sequence corresponding to the standard part. Each standard part corresponds to at least one parametric variant.

[0026] Further, step (2) includes:

[0027] Collect 3D part source files containing various engineering modeling operations, export multi-view model images and modeling history text, filter standard parts and their one-step parametric variants to form the first part set, and the remaining parts to form the second part set;

[0028] Parse the modeling history text and convert it into a predefined JSON structure to represent the modeling sequence, forming basic data containing part name, modeling sequence, and model image; for parts in the second part set, call the multimodal large model to read the modeling sequence and model image, generate appearance description, and insert basic data;

[0029] A vector retrieval index is generated based on the part set type. If the part belongs to the first part set, the part name is directly generated into a part vector representation using a text embedding model as the index, resulting in the first database. If the part belongs to the second part set, the part name and appearance description are semantically segmented, and the vector representation of each semantic segment is generated using a text embedding model and concatenated into a complete part vector representation as the index, resulting in the second database.

[0030] Furthermore, the first database priority principle is specifically as follows:

[0031] The user input prompt words are converted into prompt word vectors. First, the similarity between the prompt word vectors and the vector retrieval indexes of each part in the first database is calculated. If the highest similarity is greater than the threshold, the part corresponding to the highest similarity is selected as the Top-1 relevant part to be recalled.

[0032] Otherwise, the similarity between the prompt word vector and the vector retrieval index of each part in the second database is calculated. The results of all calculations in the first and second databases are combined, and the k parts with the highest similarity are selected as the Top-k related parts for recall, where k ranges from 2 to 5.

[0033] Furthermore, the operational examples used to construct prompt words refer to the parsing of operations for each operation type;

[0034] The Few-shot sample used to construct the prompt words refers to a complete user input and its corresponding standard modeling sequence. The prompt word template is called from a pre-established sample library and inserted. The calling rule is: based on the operation type of the retrieved parts, select the sample of the associated operation type to insert the prompt words.

[0035] Further, step (4) includes:

[0036] Based on the type of the target 3D CAD software, the generated modeling sequence is subjected to parameter inverse normalization and pose recovery. The parameter inverse normalization includes mapping the normalized length and angle parameters in the modeling sequence to the actual dimensions of the target 3D CAD software. The pose recovery includes transforming the planar pose of the sketch in the modeling sequence according to the specifications of the target 3D CAD software.

[0037] The modeling sequence is analyzed to identify the operation types and their dependencies, forming a topological sort of the operation execution plan and dependency order;

[0038] The application programming interface of the target 3D CAD software is invoked to create a feature history tree in topological sorting order, generate a parametric part model, and export it as a STEP neutral format file.

[0039] Secondly, this invention proposes a sequence-based and retrieval-enhanced 3D CAD automatic modeling system to implement the aforementioned sequence-based and retrieval-enhanced 3D CAD automatic modeling method.

[0040] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0041] First, this invention defines a standardized JSON structure to represent modeling sequences, covering common engineering modeling operation types and parameter constraints. This effectively eliminates the differences between different CAD software platforms. This structured representation not only ensures the replayability and portability of the modeling history but also provides a reliable foundation for subsequent automated execution, solving the cross-platform inconsistencies and geometric topology errors caused by inconsistent formats in traditional methods. Simultaneously, by combining retrieval-enhanced generation technology to intelligently recall relevant part sequences and injecting large model prompts, the accuracy and stability of the generated results are significantly improved, reducing the cost of manual modeling.

[0042] Secondly, the hierarchical parts library design and priority retrieval mechanism further enhance engineering practicality. By dividing the parts library into a first database for storing standard parts and their in-one-step parametric variants and a second database for storing the remaining parts, the generation of standard parts and their in-one-step parametric variants is prioritized, improving the conversion efficiency from natural language to engineering models and realizing end-to-end automated generation from input prompts to editable parametric models. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the framework of the automatic 3D CAD modeling method based on sequence and retrieval enhancement of the present invention;

[0044] Figure 2 This is a flowchart illustrating the automatic 3D CAD modeling method based on sequence and retrieval enhancement of the present invention.

[0045] Figure 3 A simplified diagram of the JSON structure;

[0046] Figure 4 This is a schematic diagram of the cross-modal RAG process of the present invention;

[0047] Figure 5 This is a schematic diagram of the structure of the 3D CAD automatic modeling system based on sequence and retrieval enhancement of the present invention. Detailed Implementation

[0048] The present invention will be further described and illustrated below with reference to specific embodiments. The embodiments described are merely examples of the content of this disclosure and do not limit the scope of the invention. The technical features of each embodiment in the present invention can be combined accordingly, provided that there is no mutual conflict.

[0049] The accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0050] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0051] like Figure 1 As shown, this invention proposes a sequence-based and retrieval-enhanced 3D CAD automatic modeling method, which enables end-to-end automated generation from user-input prompts to editable parametric models. The entire process begins with user input. First, a gating retrieval mechanism following a first database priority principle accesses the parts library. If a direct match is found in the first database storing standard parts and their one-step parametric variants, the retrieval result is directly retrieved; otherwise, it is merged with a second database storing the remaining parts. The retrieval results are combined with samples from a Few-shot sample library to construct a complete set of prompts to drive the large model. Finally, a standardized modeling sequence is generated from the large model, driving the CAD software API to automatically model and generate parametric part models that meet the user's requirements.

[0052] like Figure 2 As shown, the specific steps are as follows:

[0053] S1, Definition and standardization of intermediate formats for modeling sequences.

[0054] This step is used to define a JSON structure representing the modeling sequence that uses a uniform field naming, parameter field, and default value strategy. Figure 3 This is a simplified diagram of a JSON structure, which includes the operation types for engineering modeling and their parameter constraints. To cover common engineering modeling, the operation types include Sketch, Extrusion / Cut, Revolution / RevCut, Fillet, and Chamfer.

[0055] The sketch's parameter constraints include a profile and a planar pose; the profile is composed of a series of closed curve loops, each containing curve elements.

[0056] The parameter constraints for stretching and stretch cut include: Boolean mode, sketch profile, and forward / reverse stretching parameters (Blind, ThroughAll, ThroughNext, etc.); the Boolean mode includes six modes such as given depth and complete penetration. Here, the Boolean value IsReversed is defined to indicate whether the stretching direction is reversed.

[0057] The parameter constraints for rotation and rotation cut include: rotation axis ([p1], [p2]), rotation angle, and the profile in the sketch;

[0058] The parameter constraints for fillet include: the coordinates of the sampling points on the curve element, and the symmetry / asymmetry parameter. Here, the sampling points on the curve element are used to locate the target edge that needs to be rounded. Asymmetric fillets require both distances to be given, while symmetric fillets require a single distance, i.e., the fillet radius, to achieve the positioning.

[0059] The parameters constrained for chamfering include: the coordinates of the sampling points on the curve element, different fillet types, and dual distance parameters, where dual distance parameters refer to the parameters used to define the chamfer.

[0060] All the above operation types adopt a unified field naming, parameter field, and default value strategy. The range of parameters such as length, angle, and Boolean values ​​are explicitly constrained in the field definition to ensure cross-platform consistency. The selection method based on edge / face features is uniformly bound using "edge / face point coordinates" to improve robustness. Those skilled in the art can also add other frequently used operation types in engineering.

[0061] In one specific embodiment of the present invention, to ensure that the sketch can be uniquely replayed, its parameter constraints are described using the following specifications:

[0062] Contour: Composed of several non-intersecting closed regions. Each contour consists of several closed curve loops. The closed curve loop contains the Boolean value is_outer, indicating whether it belongs to the inner loop or the outer loop.

[0063] Curve elements: There are three types: Line3D([x1,y1,z1],[x2,y2,z2]), Circle3D([cx,cy,cz],r), and Arc3D([a],[b],[c],r,dir). Line3D defines a straight line segment in 3D space. [x1,y1,z1] represents the 3D coordinates of the line's starting point, the initial position of the line in 3D space; [x2,y2,z2] represents the 3D coordinates of the line's ending point, the final position of the line in 3D space. Circle3D defines a perfect circle in 3D space. [cx,cy,cz] represents the 3D coordinates of the circle's center, the circle's position in space; r represents the circle's radius, which must be positive, defining the size of the circle. Arc3D is used to define a circular arc in three-dimensional space. Its geometry is determined by three reference points [a][b][c] and radius r. [a] is the coordinate of the starting point of the arc, [b] is the coordinate of the midpoint of the arc, which is used to help determine the curvature of the arc, [c] is the coordinate of the ending point of the arc, and dir is the direction parameter, which defines the clockwise or counterclockwise direction of the arc.

[0064] For example, the description of a closed curve loop: "Closed Curve Loop": [{"Outer Loop": "True", "Curve": [{"Type": "Circle3D", "Radius": 0.1, "Center Point": {"Type": "Point3D", "x": 0.0, "y": 0.0, "z": 0.0}}]}] defines a circular outer loop with a radius of 0.1 located at the origin in 3D space. Here, "Outer Loop": "True" indicates that the loop is an outer loop; "Curve" describes the curve segment that makes up the loop, containing only one curve; "Type": "Circle3D" indicates that the curve is a circle in 3D space; "Radius": 0.1 specifies the radius of the circle as 0.1 units; "Center Point": {"Type": "Point3D", "x": 0.0, "y": 0.0, "z": 0.0}}]}] defines a circular outer loop located at the origin in 3D space with a radius of 0.1. 0.0}}]}] indicates that the center of the circle is located at the origin of the three-dimensional coordinate system.

[0065] Planar pose: The unique position of the sketch in 3D is determined by the rotation matrix ([x1,y1,z1],[x2,y2,z2],[x3,y3,z3]) and the translation vector ([x,y,z]);

[0066] Organization and orientation conventions: The sketch sequence starts from the bottom left point and organizes elements in a counterclockwise direction; multiple closed curve loops can form a contour; all coordinates use the same dimension.

[0067] For example, the JSON structure for creating a circular sketch is shown in Table 1 below.

[0068] Table 1

[0069]

[0070] Table 1 defines the term "grass" Figure 1 The sketch contains a circular profile with a radius of 0.1 located at the origin, and a planar pose (no rotation, origin position). The above "1466cdf1-d012-4424-8cea-a4b771488685" represents a sketch ID, and "67cf3c47-c7a8-4b6a-b4d3-c9d59e1a077e" represents a profile ID.

[0071] Based on the content of Table 1, a complete modeling step involves first creating a circular sketch, then extruding the sketch to generate a 3D solid. An example of the corresponding complete JSON structure is shown in Table 2 below.

[0072] Table 2

[0073]

[0074] Table 2 defines how to generate a cylinder by extending a circular profile forward by 0.15 units from the sketch plane (XY plane) and not extruding in the reverse direction. The above "381cd959-5042-4657-9ab0-0ec8db587eb0" represents an extrusion ID, "ProfilePlaneStartDefinition" indicates extrusion starting from the sketch plane, "OneSideFeatureExtentType" indicates unilateral extrusion, and "IsReversed": false indicates that the extrusion direction is not reversed, i.e., following the default direction of forward extrusion and not extruding in the reverse direction. The modeling sequence defined in Table 2 ultimately yields a 3D cylinder.

[0075] S2, build the parts library and embedded index.

[0076] This step is used to construct a parts library including part names, part images and their modeling sequences, divide the parts library into a first database for storing standard parts and their one-step parametric variants and a second database for storing the remaining parts, and the second database also includes the appearance description of each part; and establish a vector retrieval index for each part.

[0077] S21, Data Acquisition and Cleaning

[0078] Source files for 3D parts containing various engineering modeling operations were collected. In this embodiment, approximately 30,000 SolidWorks parts with modeling history were collected from the internet and a self-built library. About 5,000 .sldprt files containing common operations such as sketching, extrusion, and revolving were selected, including over 300 standard parts such as screws, nuts, and washers, as well as in-one-step parametric variants. Multi-view model images and modeling history text were automatically exported using VBA. Based on the part structure, parts belonging to standard parts and their in-one-step parametric variants were selected to form the first part set, and the remaining parts formed the second part set.

[0079] It should be noted that a one-step parametric variant of a standard part refers to a part obtained by adding one more operation to the modeling sequence corresponding to the standard part. Each standard part corresponds to at least one parametric variant. In automated modeling, standard parts are frequently used components. By predefining variants, the computational burden of generating a complete sequence from a large model can be reduced, and existing sequences can be directly reused with slight modifications. Taking a hexagonal screw as an example, by adding a "rounding" operation to the standard hexagonal screw, the edge of the screw head becomes rounded, generating a "hexagonal screw with rounded corners".

[0080] S22, Text parsing generates basic data

[0081] The modeling history text is parsed and converted into a predefined JSON structure representing the modeling sequence, forming basic data containing part name, modeling sequence, and model image. In this embodiment, the above conversion process is implemented using a Python script. Those skilled in the art can implement it using existing technologies, but it requires persistent storage and maintenance of the mapping from part name to modeling sequence.

[0082] S23, Generate appearance description

[0083] In the construction of the parts library, the second set of parts includes non-standard parts, such as custom parts or complex structures. These parts lack standardized names, making it impossible to directly map their geometric features by name. To support cross-modal retrieval, natural language descriptions, or "appearance descriptions," are generated for these parts to bridge visual and semantic information. Appearance descriptions summarize the shape, features, and purpose of the parts, thereby enhancing the relevance of the retrieval.

[0084] Specifically, for parts in the second parts set, the multimodal large model is invoked to read the modeling sequence and model images, generate an appearance description, and insert it into the basic data. For example, the generated appearance description might be "a cuboid base with rounded corners and a through hole in the center." This description is added to the triples in the basic data, forming a complete record of "part name - modeling sequence - model image - appearance description." This ensures efficient matching of text and image prompts during subsequent searches. In this embodiment, the GPT-4o model is used to implement the above process.

[0085] It should be noted that the parts in the first set of parts are standard parts and one-step parameter variations. These parts have industry-recognized names and structures. For example, "hex screw-M10" can be directly mapped to the complete modeling sequence by name without additional description.

[0086] S24, Establish a vector retrieval index for each part.

[0087] Vector retrieval indexes map part information into high-dimensional vectors, enabling the system to quickly calculate similarity and recall relevant modeling sequences. This indexing mechanism is the foundation of the RAG workflow, ensuring the relevance and manufacturability of the generated results.

[0088] By establishing vector retrieval indexes for each part, and based on the set to which the part belongs, a final complete first and second database are formed.

[0089] Specifically, if a part belongs to the first set of parts, only the part name is used to generate a vector representation. For example, the part name can be directly generated into a vector representation using a text embedding model. For example, for the part "GB / T 6170-M10 Nut", the vector index is directly generated based on the name.

[0090] If a part belongs to the second set of parts, the part name and appearance description are semantically segmented. A text embedding model is used to generate vector representations of each semantic segment, which are then concatenated into a complete vector representation of the part. For example, the part name "cuboid base with rounded corners" and the appearance description "through hole in the center, chamfered corners" may be segmented into ["rounded corners", "cuboid base", "through hole in the center", "chamfered corners"]. An independent vector is generated for each segment using a text embedding model, and the segment vectors are concatenated in sequence to form a complete vector representation of the part.

[0091] The part vector representation serves as the vector retrieval index for that part. The vector retrieval index has a unique mapping relationship with the modeling sequence, ensuring that subsequent retrieved modeling sequences can be directly injected with large model prompt words.

[0092] This invention separates a first database for storing standard parts and their in-one-step parameterized variants from a second database for storing the remaining parts. A priority retrieval set can be established through the first database to improve engineering manufacturability and specification consistency.

[0093] S3, Search Enhancement Generation Based on Text / Image Hints

[0094] This step is used to retrieve the database based on user-input prompts, following the principle of prioritizing the first database, recalling the top-k relevant parts and constructing large model prompts, which in turn generate a modeling sequence represented in JSON structure from the large model.

[0095] like Figure 4 As shown, user input prompts support both text and image modalities. A multimodal embedding model (including text and image embedding) is used to embed user text or image prompts into a unified vector space to obtain prompt vectors for database retrieval. The retrieval process follows the first database priority principle. First, the cosine similarity between the prompt vector and the vector retrieval index of each part in the first database is calculated. If the highest similarity is greater than a threshold, the part corresponding to the highest similarity is selected as the Top-1 relevant part for recall. This design ensures that when the user queries a standard part that explicitly matches, the standardized result is returned quickly, avoiding redundant calculations. Otherwise, the cosine similarity between the prompt vector and the vector retrieval index of each part in the second database is calculated. Combining all the calculation results from the first and second databases, the k parts corresponding to the highest similarity are selected sequentially as the Top-k relevant parts for recall. In this embodiment, k=3. Further, a large model of prompts is constructed based on the recalled relevant parts.

[0096] In one specific embodiment of the present invention, the large model prompt words are constructed by combining relevant parts, Few-shot samples, field definitions and value ranges of JSON structures, and operation examples corresponding to each operation type.

[0097] Field definition refers to providing the definition logic and requirements for all fields in a predefined JSON structure.

[0098] For example, Circle([x,y,z],radius) draws a circle with a given radius, where each point is represented by its x, y, z coordinates on a three-dimensional plane.

[0099] Value range refers to the definition of the range of values ​​that parameters in a field can take, including the legal range of length, angle, and Boolean values.

[0100] For example, the rotation operation rotates the selected sketch around a 3D straight line as an axis, with the rotation angle ranging from 0 to 6.2831853071796.

[0101] Operation examples refer to actual examples of each field that are attached after the field definition and value range.

[0102] For example, a prompt may contain the segments shown in Table 3.

[0103] Table 3

[0104]

[0105] Few-shot examples refer to providing a simple yet relatively complete part name / description (simulating user input) and modeling sequence (simulating the answer) in the prompt, allowing the model to learn the complete modeling sequence format. A few-shot example library can be pre-built, containing few-shot examples of various operation types. Based on the retrieved relevant parts, the few-shot example associated with the operation type of the relevant part can be called.

[0106] For example, a prompt may contain the segments shown in Table 4.

[0107] Table 4

[0108]

[0109] In this embodiment, by providing a large model prompt word template, the retrieved relevant parts, the Few-shot samples associated with the relevant parts, the field definitions and value ranges of the predefined JSON structure, and the operation examples corresponding to each operation type are filled into the prompt word template to form a complete large model prompt word.

[0110] For example, the large model prompt word template is shown in Table 5.

[0111] Table 5

[0112]

[0113] In this embodiment, the GPT-4o model is used to generate the modeling sequence in JSON structure, and a low-temperature strategy is adopted, with the temperature parameter set to 0.2, to ensure the stability and replayability of the structured output.

[0114] S4, Preprocessing and Automatic Modeling of Modeling Sequences

[0115] This step is used to preprocess the generated modeling sequence based on the type of 3D CAD software, parse the preprocessed modeling sequence, form a topological sort of operation execution plan and dependency order, call API to create feature history tree in sequence, and generate parametric part models that meet user requirements.

[0116] S41, Parameter In-Normalization and Pose Recovery

[0117] The modeling sequence generated from the large model uses standardized parameters, but different CAD software, such as ZW3D and SolidWorks, have different processing of transform matrices and unit systems. Parameter denormalization and pose recovery aim to map the general parameters in the sequence to the specific specifications of the target software, ensuring the unique position and scale consistency of geometric elements in three-dimensional space.

[0118] To ensure that the generated modeling sequence is compatible with the target CAD software, the transform matrix defined in the modeling sequence needs to be transformed according to the transform definition of the target CAD software to achieve normalization and restore the unique position and scale of the sketch in three-dimensional space. In addition, it is also necessary to perform unified normalization on the angle units and directions, and back-map the normalized / discrete parameters to the actual dimensions.

[0119] S42, Automatic Modeling Based on CAD API

[0120] The preprocessed sequence needs to be automatically generated via the CAD software's API to produce a parametric model with a feature history tree. This step automates the conversion from JSON to an editable model through sequence parsing, topological sorting, and API calls, reducing manual intervention.

[0121] First, the preprocessed modeling sequence is analyzed to identify the operation types and their parameters, and a dependency graph between features is established. For example, the extrusion operation depends on the sketch outline. The dependency graph is then topologically sorted to determine the order of operation execution. For example, all sketches are created first, then extrusion / revolution is performed, and finally fillets / bevels are processed to ensure consistency in replay.

[0122] Secondly, features are automatically created and the modeling history tree is maintained through the API of the target CAD software. ZW3D is preferred as the target software. In implementation, a CVX interface extension is written in C++ and encapsulated as a DLL. ZW3D preloads the DLL and uses the Remote library for external program calls. Sketch, extrusion / revolution, and fillet / bevel features are created in sequence, and Boolean operations and history tree nodes are managed.

[0123] S43, Model Export and Reuse

[0124] Create editable parametric parts in the target CAD software and export neutral format files such as STEP. This format widely supports geometric data exchange between CAD software, preserves feature semantics and parametric structure, and supports cross-platform sharing and secondary editing.

[0125] In addition, B-rep models can be generated in parallel based on actual conditions for rapid quality assessment.

[0126] Based on the same inventive concept, this embodiment also provides a 3D CAD automatic modeling system based on sequence and retrieval enhancement, such as... Figure 5 As shown, the system includes:

[0127] The data definition module is used to define a JSON structure representing the modeling sequence that defines a unified field naming, parameter field, and default value strategy. The JSON structure includes the operation type of the engineering modeling and its parameter constraints.

[0128] The parts library management module is used to build a parts library containing parts names, parts images and their modeling sequences. The parts library is divided into a first database for storing standard parts and their in-one-step parametric variants and a second database for storing the remaining parts. The second database is supplemented with the appearance description of each part. A vector retrieval index is established for each part.

[0129] The retrieval enhancement generation module is used to retrieve parts from the parts library based on user-input prompts, following the principle of prioritizing the first database, and recalling Top-k relevant parts; it constructs large model prompts by combining retrieval results, Few-shot examples, field definitions, value ranges, and operation examples in JSON structure, and generates a modeling sequence represented in JSON structure from the large model;

[0130] The automatic modeling execution module is used to preprocess and parse the generated modeling sequence. After parsing, it sequentially creates a feature history tree through the CAD software API to generate a parametric part model that meets the user's requirements.

[0131] For the system embodiments, since they basically correspond to the method embodiments, relevant details can be found in the descriptions of the method embodiments; the implementation methods of the remaining modules will not be repeated here. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0132] The system embodiments of the present invention can be applied to any device with data processing capabilities, such as a computer or other similar device. The system embodiments can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution.

[0133] The embodiments described above provide a detailed explanation of the technical solutions and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A three-dimensional CAD automatic modeling method based on sequence and retrieval enhancement, characterized in that, Includes the following steps: (1) Define a JSON structure to represent the modeling sequence with a unified field naming, parameter field and default value strategy. The JSON structure includes the operation type of engineering modeling and its parameter constraints. (2) Construct a parts library containing part names, part images and their modeling sequences. Divide the parts library into a first database for storing standard parts and their one-step parametric variants and a second database for storing the remaining parts. The second database is supplemented with the appearance description of each part. Establish a vector retrieval index for each part. The one-step parametric variant of a standard part refers to the part obtained by adding one step of stretching, rotating, filleting or chamfering operation on the basis of the modeling sequence corresponding to the standard part. (3) Based on the user input prompts, the parts database is searched according to the first database priority principle to recall the top-k related parts; Combining search results, Few-shot examples, field definitions, value ranges, and operation examples in a JSON structure, a large model prompt is constructed, and a modeling sequence represented in JSON structure is generated from the large model; the operation examples refer to the operation parsing for each operation type; the operation types include sketch, extrusion and extrusion cut, rotation and rotation cut, fillet and chamfer; (4) The generated modeling sequence is preprocessed and parsed. After parsing, the feature history tree is created sequentially through the CAD software API to generate a parametric part model that meets the user's requirements.

2. The 3D CAD automatic modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, The parameter constraints for each operation type include: The parametric constraints of the sketch include the profile and planar pose. The profile is composed of several closed curve loops, which contain curve elements and Boolean values ​​indicating the inner and outer loops. The parameter constraints for extrusion and extrusion cut include Boolean mode, sketch profile, and extrusion parameters; The parameter constraints for rotation and rotation cut include the rotation axis, rotation angle, and sketch profile; The parameter constraints for rounded corners include the coordinates of the sampling points of the curve elements and the distance parameter; The chamfer parameters include the coordinates of the curve element sampling points, the fillet type, and the distance parameter.

3. The 3D CAD automatic modeling method based on sequence and retrieval enhancement according to claim 2, characterized in that, The parameter constraints for sketch operations follow these specifications: The outline is composed of several non-intersecting closed curve loops, and each closed curve loop organizes curve elements in a counterclockwise direction; Curve elements are defined in three types: straight line segments, perfect circles, and circular arcs. Planar pose is uniquely determined in three-dimensional space by rotation matrix and translation vector; The sketch sequence starts from the bottom left point.

4. The 3D CAD automatic modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, Each standard part corresponds to at least one parametric variant.

5. The 3D CAD automatic modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, Step (2) includes: Collect 3D part source files containing various engineering modeling operations, export multi-view model images and modeling history text, filter standard parts and their one-step parametric variants to form the first part set, and the remaining parts to form the second part set; Parse the modeling history text and convert it into a predefined JSON structure to represent the modeling sequence, forming basic data containing part name, modeling sequence, and model image; for parts in the second part set, call the multimodal large model to read the modeling sequence and model image, generate appearance description, and insert basic data; A vector retrieval index is generated based on the part set type. If the part belongs to the first part set, the part name is directly generated into a part vector representation using a text embedding model as the index, resulting in the first database. If the part belongs to the second part set, the part name and appearance description are semantically segmented, and the vector representation of each semantic segment is generated using a text embedding model and concatenated into a complete part vector representation as the index, resulting in the second database.

6. The automatic 3D CAD modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, The first database priority principle is as follows: The user input prompt words are converted into prompt word vectors. First, the similarity between the prompt word vectors and the vector retrieval indexes of each part in the first database is calculated. If the highest similarity is greater than the threshold, the part corresponding to the highest similarity is selected as the Top-1 relevant part to be recalled. Otherwise, the similarity between the prompt word vector and the vector retrieval index of each part in the second database is calculated. The results of all calculations in the first and second databases are combined, and the k parts with the highest similarity are selected as the Top-k related parts for recall, where k ranges from 2 to 5.

7. The 3D CAD automatic modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, The Few-shot sample used to construct the prompt words refers to a complete user input and its corresponding standard modeling sequence. The prompt word template is called from a pre-established sample library and inserted. The calling rule is: based on the operation type of the retrieved parts, select the sample of the associated operation type to insert the prompt words.

8. The automatic 3D CAD modeling method based on sequence and retrieval enhancement according to claim 1, characterized in that, Step (4) includes: Based on the type of the target 3D CAD software, the generated modeling sequence is subjected to parameter inverse normalization and pose recovery. The parameter inverse normalization includes mapping the normalized length and angle parameters in the modeling sequence to the actual dimensions of the target 3D CAD software. The pose recovery includes transforming the planar pose of the sketch in the modeling sequence according to the specifications of the target 3D CAD software. The modeling sequence is analyzed to identify the operation types and their dependencies, forming a topological sort of the operation execution plan and dependency order; The application programming interface of the target 3D CAD software is invoked to create a feature history tree in topological sorting order, generate a parametric part model, and export it as a STEP neutral format file.

9. A 3D CAD automatic modeling system based on sequence and retrieval enhancement, used to implement the 3D CAD automatic modeling method based on sequence and retrieval enhancement as described in claim 1, characterized in that the system... include: The data definition module is used to define a JSON structure representing the modeling sequence that defines a unified field naming, parameter field, and default value strategy. The JSON structure includes the operation type of the engineering modeling and its parameter constraints. The parts library management module is used to build a parts library containing parts names, parts images and their modeling sequences. The parts library is divided into a first database for storing standard parts and their in-one-step parametric variants and a second database for storing the remaining parts. The second database is supplemented with the appearance description of each part. A vector retrieval index is established for each part. The retrieval enhancement generation module is used to retrieve parts from the parts library based on user-input prompts, following the principle of prioritizing the first database, and recalling Top-k relevant parts; it constructs large model prompts by combining retrieval results, Few-shot examples, field definitions, value ranges, and operation examples in JSON structure, and generates a modeling sequence represented in JSON structure from the large model; The automatic modeling execution module is used to preprocess and parse the generated modeling sequence. After parsing, it sequentially creates a feature history tree through the CAD software API to generate a parametric part model that meets the user's requirements.

Citation Information

Patent Citations

  • Method and device for generating training sample for modeling three-dimensional entity model of part

    CN118394321A

  • Natural language guided CAD model generation method and system

    CN120611424A