Parameter-driven CAD automatic modeling method and system
By using a parameter-driven CAD automatic modeling method, the problems of low efficiency and poor reliability in existing CAD modeling technologies are solved, enabling efficient and accurate CAD model generation and supporting the rapid advancement of complex engineering projects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-04-10
AI Technical Summary
Existing CAD automatic modeling methods are inefficient and unreliable, making it difficult to meet the needs of parametric research and optimization design for complex engineering projects.
A parameter-driven CAD automatic modeling method is adopted, which obtains model parameter information and performs parameter parsing, geometry construction, topology parsing, feature extraction and model optimization to generate efficient and accurate CAD models.
It enables efficient and reliable CAD model generation, improves the accuracy and speed of engineering simulation and data simulation, and supports the rapid advancement of complex engineering projects.
Smart Images

Figure CN121479858B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of digital signal processing, and particularly relates to a CAD automatic modeling method and system based on parameter driving. BACKGROUND
[0002] With the development of economy and technology and the increasing requirement of people for safety, engineering simulation and data simulation process in the engineering field are of great significance. In the current engineering simulation and numerical simulation field, large-scale geometric modeling has become mainstream. Therefore, it is of great significance to study the process of geometric modeling.
[0003] At present, the CAD modeling scheme in the engineering simulation and data simulation process is generally manual modeling by researchers according to corresponding data. Although this manual modeling method can cope with simple CAD engineering modeling, in the face of complex engineering projects, the manual scheme often needs to consume a large amount of manpower and time cost. Especially in the scene of parameterized research, optimization design and batch simulation analysis, the existing manual modeling mode seriously hinders the deep application of numerical simulation technology and the rapid progress of engineering projects, and has poor reliability, poor accuracy and low efficiency. SUMMARY
[0004] One of the purposes of the application is to provide a CAD automatic modeling method based on parameter driving, which has high reliability, good accuracy and high efficiency.
[0005] The second purpose of the application is to provide a system for implementing the CAD automatic modeling method based on parameter driving.
[0006] The CAD automatic modeling method based on parameter driving provided by the application comprises the following steps:
[0007] S1. Obtain model parameter information to be modeled;
[0008] S2. According to the data information obtained in step S1, generate a CAD model based on parameter analysis, geometric construction and surface recognition scheme;
[0009] S3. According to the data information obtained in step S1, perform reverse reconstruction of a three-dimensional CAD model based on topology analysis, geometric feature extraction, pattern recognition and parameter relationship inference;
[0010] S4. According to the data information obtained in step S1, perform modeling, optimization and feedback evolution based on model analysis and feature learning and generation of parameterized modeling rules;
[0011] S5. Complete CAD automatic modeling based on parameter driving according to the data information obtained in steps S2-S4.
[0012] The step S2 comprises the following steps:
[0013] Based on the progressive search strategy, the installation position of the CAD kernel is determined, and the initialization of the CAD kernel is performed;
[0014] Based on the parametric geometry construction scheme, the construction of the basic geometric body and the feature geometric body is performed;
[0015] Geometric topology analysis is performed, all faces of the three-dimensional entity are traversed, geometric feature extraction is performed on each face, and face recognition and naming are performed according to the extracted data;
[0016] All three-dimensional entity feature objects and all named face feature objects are exported to realize the export and persistence of the model;
[0017] Parameter table data is read from an external data source, and modeling is performed to complete the generation of the corresponding CAD model.
[0018] The step S2 comprises the following steps:
[0019] CAD kernel determination and initialization:
[0020] An incremental strategy is used to determine the installation path of the CAD kernel: first, a Windows registry query method is used to search for installation records containing the "CAD" keyword in the Uninstall key of HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER; if the registry query fails, search is performed in the standard program directory, which includes the Program Files, Program Files (x86) and LocalAppData folders; if the standard program directory query still fails, full symbol traversal search is performed to locate the CAD kernel;
[0021] After locating the CAD kernel, the path validity is verified to ensure that the bin subdirectory exists and contains the necessary CAD kernel modules, and then the verified path is added to the search path;
[0022] The CAD geometry kernel module is imported, and a non-interface document object is created to complete the initialization process;
[0023] Construction of basic geometric body and feature geometric body:
[0024] Define the basic geometric body size, including length, width and height;
[0025] Define the feature geometric body parameters, including the circular radius, position coordinates and stretching height;
[0026] Base geometry construction: According to the input base geometry size, calculate the key control point coordinates; adopt homogeneous coordinate system to represent the spatial position to ensure the consistency of transformation operation; create geometric topology according to the hierarchical logic of "point-line-surface-solid": create a control vertex set, generate an edge set connecting the vertices, combine the edges into a closed wire frame to form a surface boundary, and generate a geometric surface from the surface boundary; define the stretching transformation matrix, expand the two-dimensional surface into a three-dimensional solid through the vector stretching operation, and the stretching direction is determined by the unit normal vector and the stretching distance; encapsulate the generated geometric solid as a CAD feature object, and establish the association between parameters and geometry;
[0027] Feature geometry construction: extract the key parameters of the feature geometry, including center point coordinates, radius, normal vector, position constraint, direction constraint, size constraint, connection relationship and dependency relationship; establish a parameter constraint equation set, and solve the parameter solution that satisfies all constraint conditions by using numerical iteration method to ensure the reasonableness and consistency of the geometry; create a base geometry curve according to the solved parameters, form a closed contour by splicing the base geometry curve, apply surface generation algorithm to construct a geometric surface, and execute solidification operation to generate a three-dimensional feature geometry; adopt object-oriented encapsulation strategy to encapsulate each geometric feature as an independent parameterized object, and establish the dependency graph between features;
[0028] Recognition and naming of surface:
[0029] Traverse all the surfaces of the three-dimensional solid, and perform geometric feature extraction on each surface: calculate the parameter range of the surface, calculate the normal vector at the parametric center point of the surface, and obtain the centroid coordinates of the surface; identify the geometric type of the surface, including plane, cylindrical surface and spherical surface;
[0030] Calculate the geometric properties of each surface, including the geometric type, geometric parameters and topological relationship of the surface; establish a multi-dimensional judgment rule for surface classification, adopt a hierarchical decision tree structure: the first layer is based on geometric type for coarse classification, the second layer is based on spatial position for fine classification, and the third layer is based on functional semantics for final classification; for position classification, calculate the relative position of the surface centroid in the coordinate system, and determine the spatial orientation of the surface through coordinate comparison; for direction classification, calculate the angle between the surface normal vector and the coordinate axis, and determine the orientation feature of the surface through angle threshold value judgment; for functional classification, identify the functional attributes of the surface in combination with geometric context and engineering semantics; ensure the correctness of the classification result through topological consistency check and geometric reasonableness verification;
[0031] Create an independent feature object for each identified face; identify the functional attributes of the face using semantic names and add the named face feature object to the export object list; establish a multi-level geometric feature description system to extract the complete geometric information of the face; use an adaptive numerical error handling mechanism to set a combination of relative error threshold and absolute error threshold to handle rounding errors in floating point operations and improve the robustness of geometric determination; implement a hierarchical face organization strategy to analyze and aggregate the connectivity of the faces through graph theory algorithms; define classification rules in XML or JSON format;
[0032] Export and persist the model:
[0033] Execute the recompute() method of the document to update the dependency relationships and geometric state of all feature objects, ensuring the consistency of the model data; build an export object list containing all three-dimensional entity feature objects and all named face feature objects; create a standardized directory structure using an operating system-independent path handling method, check for directory existence and automatically create it if it does not exist; use a standardized CAD exchange format to export all objects using the Part.export() method to generate a model file containing semantic information;
[0034] Generation of CAD models:
[0035] Read the parameter table from an external data source, with table structure including model ID, length, width, height, cylinder radius, cylinder position X, cylinder position Y, and cylinder height; use a loop structure to iterate through each row of the table and extract parameters; use a loop iteration mechanism to process each row of parameters in the table in turn, with each iteration including parameter extraction, geometry creation, face naming, and model export; use an independent document object to manage each model to avoid interference between different models; after iteration, clean up document resources to release memory and ensure the stability of batch processing;
[0036] Before generating the CAD model, perform legality verification on the parameters, including numerical range checking, geometric constraint checking, and unit consistency checking; invalid parameter processing strategies include recording detailed error logs, skipping the model or using default values to replace according to configuration, and providing warning level settings to distinguish between fatal errors and tolerable deviations;
[0037] Finally, complete the generation of the CAD model.
[0038] The step S3 comprises the following steps:
[0039] According to the determined installation location of the CAD kernel, initialize the CAD kernel;
[0040] Import the model data and perform topology hierarchy analysis to achieve topology analysis;
[0041] According to the result of topological analysis, the geometric information of vertices, edges and faces is extracted, and the analysis of geometric constraint relationship is performed to realize feature extraction;
[0042] A data model is designed, and the data is structured and stored persistently;
[0043] Through the analysis of the extracted geometric parameters, the construction process of the original model is inferred, and the geometric shape mode is recognized by using the rule base matching method;
[0044] According to the obtained data information, the parameter relationship is inferred to realize the reverse reconstruction of the three-dimensional CAD model.
[0045] The step S3 specifically includes the following steps:
[0046] Initialization of the CAD kernel:
[0047] According to the determined installation position of the CAD kernel, the necessary geometric modeling module and topological analysis module are imported, and the unbounded document object is initialized to prepare the environment for subsequent reconstruction operation;
[0048] Topological analysis:
[0049] The model data is loaded into the memory by using the file reading interface of the CAD kernel, the file integrity and format correctness are verified, the topological hierarchy of the model is analyzed, starting from the top composite or assembly, and then layer by layer decomposed to the independent three-dimensional entity of the entity layer, the closed or open shell of the shell layer, the shell constituting face of the face layer, the boundary line of the face of the edge layer, and the end point of the edge of the vertex layer; the number of entities contained in the model is identified, and the multi-entity model is separated;
[0050] Feature extraction:
[0051] All vertices of each entity are traversed, the three-dimensional space coordinates of each vertex are extracted, and the coordinate de-duplication processing is performed; the KD tree data structure is used to judge the vertex coincidence by setting a threshold, the vertex coordinates are sorted, and the number of vertices is counted as a preliminary index of geometric complexity;
[0052] Extraction of geometric information of edges: all edges of the entity are traversed, the geometric type identification and parameter extraction are performed on each edge; for a straight line edge, the identification condition is that the curve type of the edge is a straight line, and the extracted parameters include the start point coordinates, the end point coordinates, the direction vector and the length; for a circular arc edge, the identification condition is that the curve type of the edge is a circle but the parameter range does not include a complete , and the extracted parameters include the center coordinates, the radius, the normal vector, the start angle, the end angle and the arc length; for a complete circular edge, the identification condition is that the curve type of the edge is a circle and the parameter range is a complete For a circle, the extraction parameters include the center coordinates, radius, normal vector, and circumference length; for an ellipse, the extraction parameters include the center coordinates, major axis, minor axis, and normal vector; for a spline curve, the extraction parameters include the control point coordinates, node vector, and order; for a Bezier curve, the extraction parameters include the control point sequence coordinates;
[0053] Extraction of geometric information of faces: traverse all the faces of the entity, and perform geometric type identification and parameter extraction for each face; for a plane, the identification condition is that the surface type of the face is a plane, and the extraction parameters include the reference point, normal vector, area, and boundary contour; for a cylindrical surface, the identification condition is that the surface type of the face is a cylinder, and the extraction parameters include the axis position, axis direction, radius, height, and area; for a conical surface, the identification condition is that the surface type of the face is a cone, and the extraction parameters include the apex, axis direction, half-apex angle, and base radius; for a spherical surface, the identification condition is that the surface type of the face is a sphere, and the extraction parameters include the sphere center coordinates, radius, and coverage angle; for a torus, the identification condition is that the surface type of the face is a torus, and the extraction parameters include the center coordinates, major radius, minor radius, and normal vector; for a NURBS surface, the extraction parameters include the control point grid coordinates, node vector, and order; for a Bezier surface, the extraction parameters include the control point array coordinates;
[0054] Analysis of spatial relationships between geometric elements, including parallel relationship identification, perpendicular relationship identification, concentric relationship identification, symmetry relationship identification, and tangent relationship identification; extraction of dimensional constraints, including geometric dimension parameters and relative position relationships between geometric elements; during the analysis process: call the corresponding parameter extraction function according to the type identifier of the geometric object to perform data extraction and analysis; use principal component analysis to calculate the principal axis direction of the geometric object, and identify the symmetry through eigenvalue decomposition; use Fourier transform to detect periodic characteristics, and identify array patterns and repeated structures through frequency domain analysis; use tree structure to represent the inclusion relationship of geometric features, use adjacency table to record the topological connection relationship, and establish spatial index; use Kahan summation algorithm to handle cumulative errors;
[0055] Structured and persistent storage of data:
[0056] Use a hierarchical data organization structure as the data model, starting from the top-level model data, which contains file meta information, entity quantity, and entity list; each entity contains entity ID, vertex data, edge data, and face data; convert the extracted geometric data into JSON format for easy storage and exchange; the design principles of the JSON structure include using nested objects to represent hierarchical relationships, using arrays to represent collections of similar elements, and using key-value pairs to store geometric parameters;
[0057] Add check information and metadata to each geometric element; check information includes element count, topological consistency verification and geometric validity verification; metadata includes extraction timestamp, CAD kernel version information and data format version number; create a standardized output directory structure, the file naming specification generates JSON file name based on the original model file name, and adds timestamp or version number; generate corresponding JSON files for each input model, and establish index file to record all generated data files;
[0058] Inference of the original model construction process and geometric shape pattern recognition:
[0059] Infer the construction process of the original model by analyzing the extracted geometric parameters; recognize the set geometric shape pattern by rule base matching:
[0060] The cuboid recognition rule includes: the number of vertices is equal to 8, the number of edges is equal to 12 and all edges are straight lines, the number of faces is equal to 6 and all faces are planes, the number of circular edges is equal to 0; geometric verification includes: there are three groups of parallel pairs and three groups of parallel plane pairs, the normal vectors of all faces are mutually orthogonal or parallel, and the intersection lines of adjacent faces are mutually perpendicular; parameter derivation: extract the minimum and maximum values of X, Y and Z coordinates from the vertex coordinates to calculate the length, width and height and determine the reference point; construction method deduction includes: create a rectangular bottom surface at the reference point, stretch the height value along the Z axis positive direction or directly use the makeBox function to pass in the length, width, height and reference point parameters;
[0061] The cylinder recognition rule includes: there is at least one cylindrical surface, there are two or more circular edges, the radii of the circular edges are equal and the normal vectors are parallel; geometric verification includes: the center line of the two circular edges is parallel to the normal vector, the axis of the cylindrical surface is consistent with the normal vector of the circular edge, and the radius of the cylindrical surface is consistent with the radius of the circular edge; parameter derivation: extract the radius from the circular edge, extract the center coordinates of the two circles, calculate the center distance as the cylinder height, and determine the axis direction and reference point; construction method deduction includes: create a circular bottom surface at the reference point, stretch the height value along the axis direction or directly use the makeCylinder function to pass in the radius, height, reference point and direction parameters;
[0062] The cone recognition rule includes: there is one conical surface, there is one circular edge and one vertex; geometric verification includes: the vertex of the conical surface coincides with the independent vertex, the axis of the conical surface passes through the center of the circular edge, and the half vertex angle of the conical surface is consistent with the geometric dimension; parameter derivation: extract the radius and center of the bottom circle, extract the vertex coordinates, and calculate the height and axis direction; construction method deduction includes: create a circle at the bottom center, perform conical stretching to the vertex direction or use the makeCone function;
[0063] Sphere recognition rule includes: all faces are spherical or there is one complete spherical face, all spherical faces share the same sphere center; parameter derivation: extract sphere center coordinates and radius; construction method deduction: use makeSphere function to pass in sphere center and radius;
[0064] Torus recognition rule includes: there is a torus; parameter derivation: extract torus center coordinates, major radius and minor radius, direction vector; construction method deduction: use makeTorus function;
[0065] Composite geometry recognition: based on topological separation analysis, calculate the minimum distance between each entity; when the minimum distance is greater than a set value, it is determined as an independent entity; use connected component analysis algorithm to identify geometric bodies without intersection; establish entity adjacency matrix A, the value of the element in the ith row and the jth column of A is: if entity i and entity j intersect, if entity i and entity j do not intersect, ; identify independent geometric groups through connected component algorithm of graph theory;
[0066] Use normal vector direction analysis to identify concave features: for cylindrical surfaces, calculate the radial vector as , is a point on the surface, is the center; when , it indicates that the normal vector points to the inside, is the plane normal vector; for planes, calculate the sign of the distance from a point to the plane and determine the inside and outside; the depth of the recess is , which is , where is the recess boundary point, is the plane normal vector, is the plane constant; hole recognition uses topological loop detection, and the topological genus of the geometric body is calculated by Euler number; based on curvature continuity analysis, use discrete curvature calculation to detect curvature discontinuity points; face continuity determination is achieved through hierarchical inspection of G0 continuity, G1 continuity and G2 continuity; record the geometric feature mode of the set typical Boolean operation combination, and use pattern matching algorithm to automatically identify the construction history of composite geometric body;
[0067] Round corner recognition rule includes: round corner recognition feature is that there is a partial cylindrical surface or a torus connecting two planes or curved surfaces, and the round corner surface is tangent to the adjacent surface; parameter derivation: extract round corner radius to identify the edge where the round corner is located; construction method deduction: apply round corner operation on specific edges of the base geometric body;
[0068] Chamfer recognition rules include: chamfer appears at the original sharp edge location, chamfer and adjacent face form a fixed angle; Parameter derivation includes: extract chamfer distance or angle, identify the edge where the chamfer is located; Construction method deduction: apply chamfer operation on a specific edge of the base geometry;
[0069] Draft recognition rules include: face exists taper and is not completely parallel; Parameter derivation includes: extract draft angle; Construction method deduction: apply draft operation on the face;
[0070] Deduce the construction sequence to determine the creation order of geometric features: base geometry priority principle: identify and reconstruct the base geometry first, analyze the dependency relationship between features, topologically sort the construction steps according to the dependency relationship, and select the most concise construction path; Typical construction sequence includes: creating base geometry, creating additional geometry, performing Boolean operation, applying feature operation, and applying transformation operation; The entire process uses a rule library architecture, each geometric shape corresponds to a set of recognition rules and reconstruction methods, rule matching uses a priority mechanism, and geometric errors in actual models are handled using fuzzy matching and tolerance settings; Establish a confidence score mechanism to evaluate the reliability of the recognition results;
[0071] Inference of parameter relationships and reverse reconstruction of models:
[0072] Create a new CAD document object to accommodate the reconstructed geometry; Initialize the geometry constructor and feature manager, and load the saved JSON geometry data file; According to the recognized shape type and deduced construction method, perform geometric reconstruction operations;
[0073] Cuboid reconstruction process: read cuboid parameters from JSON data, call the makeBox function of the CAD kernel or perform the following operations: create four vertices of a rectangular base, connect the vertices to form four edges, combine the edges into a closed wireframe, generate a plane from the wireframe, define a stretch vector, and perform a stretch operation to generate a cuboid solid; Apply position transformation: move the reconstructed geometry to the correct position, create a feature object and add it to the document; Cylinder reconstruction process: read cylinder parameters from JSON data, call the makeCylinder function or perform the following operations: create a circle at the reference point, define a stretch vector, and perform a stretch operation to generate a cylinder solid, if the axis direction is not the Z axis, calculate and apply a rotation transformation, including calculating the rotation matrix of the Z axis to the target axis and applying the rotation transformation to the geometry, create a feature object and add it to the document; Other geometric body reconstruction includes: cone uses the makeCone function to pass in the base radius, top radius, and height; sphere uses the makeSphere function to pass in the sphere center and radius; torus uses the makeTorus function to pass in the major and minor radii;
[0074] Complex geometry reconstruction: for geometries combined through Boolean operations, perform Boolean union, reconstruct each individual geometry, and use the fuse function to perform the union operation; Boolean difference reconstruction: reconstruct the main body geometry and the subtracted geometry, use the cut function to perform the difference operation; Boolean intersection reconstruction: reconstruct two intersecting geometries, use the common function to perform the intersection operation; feature operation reconstruction includes: fillet feature reconstruction, read the fillet parameters from the JSON data, identify the corresponding edges on the reconstructed base geometry, including feature matching according to the position and direction of the edge and using spatial coordinate tolerance matching, call the makeFillet function to pass in the edge list and the fillet radius, and replace the original geometry with the filleted geometry; chamfer feature reconstruction, read the chamfer parameters, identify the target edge, call the makeChamfer function;
[0075] Reconstruction accuracy control and verification: including geometric accuracy verification, comparing the size of the reconstructed model and the original model, calculating the relative error and the absolute error, setting the acceptable error threshold; topological consistency verification: verifying whether the number of vertices, edges and faces is consistent with the original model, verifying the Euler formula, checking the closure of the geometry; visual comparison verification: generating three-dimensional views of the original model and the reconstructed model, using different colors to superimpose the two models, and calculating the Hausdorff distance between the models; using parameterized reconstruction, maintaining the editability and accuracy of the model, maintaining the geometric constraint relationship during reconstruction, using numerical optimization methods to adjust parameters, and minimizing reconstruction error; for complex surfaces, choose NURBS reconstruction or approximate fitting, and record the reconstruction process log when reconstruction fails;
[0076] System recalculates the document, updates the state of all geometries, and constructs an export object list; the export object list includes all reconstructed entities; export as STEP standard format and save to the specified directory; quality report generation: generate a reconstruction quality report containing original model information, identification results, reconstruction parameters, accuracy evaluation, reconstruction time consumption statistics, success rate and failure items, save the report in a structured format, and generate visual comparison charts; batch reconstruction management: including traversing the model folder, executing scanning and reconstruction for each model, automatically matching scanning data and reconstruction tasks, processing several reconstruction tasks in parallel to improve efficiency, establishing a reconstruction task queue and progress tracking, and generating a summary report of the reconstruction.
[0077] The step S4 comprises the following steps:
[0078] Based on the multi-level analysis deduction model, the relationship between parameters is identified, and the rule knowledge is extracted from the identified parameter relationship, so as to extract the modeling knowledge that can be reused;
[0079] The obtained result is converted into a formal modeling rule to complete the generation of the parameterized modeling rule.
[0080] Based on the similarity calculation scheme, intelligent rule recommendation analysis is performed, and corresponding modeling rules are obtained;
[0081] A hierarchical and progressive decomposition strategy is adopted to perform result backstepping and optimization of complex models;
[0082] Modeling quality is evaluated to realize knowledge feedback and evolution.
[0083] The step S4 specifically comprises the following steps:
[0084] Identification of the relationship between parameters and extraction of reusable modeling knowledge:
[0085] The reference model is analyzed to extract the complete topological structure, including entities, faces, edges and vertices; the types and parameters of all geometric elements are identified, the geometric constraint relationship is analyzed, and the feature operation trace is detected; the correlation atlas of geometric elements is established, wherein the nodes are each geometric element, the edges are the topological relationship between elements, and the attributes include geometric parameters, constraint relationships and feature types;
[0086] A multi-level analysis and deduction model is constructed to identify the relationship between parameters: the first layer of the model adopts a multi-dimensional feature matching algorithm to establish a geometric feature vector For , is the number of vertices, is the number of edges, is the number of faces, is the Euler number, is the area, is the surface area; a support vector machine classifier is used for geometric body type identification, a radial basis function is used as the kernel function, and a softmax function is used for confidence evaluation; the second layer of the model adopts a deep learning convolutional neural network for feature pattern recognition, and the network structure includes a 3D convolutional layer, a pooling layer and a fully connected layer; additive feature recognition is performed through volume increment increase, and subtractive feature recognition and concave feature recognition are performed through volume reduction detection; feature dependency relationship is modeled by a graph neural network, wherein the nodes represent geometric features and the edges represent dependency relationships; the third layer of the model adopts a topological sorting algorithm to determine the construction sequence; a deep first search algorithm is used for circular dependency detection, and a constraint relaxation strategy is used when a loop is found; the fourth layer of the model adopts regression analysis to identify the relationship between parameters, linear relationships are fitted by least squares method, and nonlinear relationships are fitted by polynomial regression or neural network; a Lagrange multiplier method or an interior point method optimization algorithm is used to solve the constraint equation set;
[0087] Extract reusable modeling knowledge from the derivation results: use clustering algorithms to identify similar geometric structures, use K-means clustering to group geometric feature vectors to achieve geometric template extraction; use principal component analysis for dimensionality reduction, retain the principal components of the set variance as a variable parameter, use parameterized graph grammar for template representation; use association rule mining algorithm to learn design rules, identify strong association design patterns based on support and confidence, use decision tree algorithm to learn design rules; use regression analysis to establish parameter relationship model, significance test uses t test; use reinforcement learning framework, model the modeling process as a Markov decision process, state space S represents the current geometric state, action space A represents the executable modeling operation, use reward function R to evaluate the operation quality, use Q-learning algorithm to learn the optimal strategy; use RDF triple <subject, predicate, object> to represent knowledge relationship to build knowledge graph, use graph database to store and query knowledge;
[0088] Generation of parameterized modeling rules:
[0089] Convert the derived construction logic into formal modeling rules; modeling rules use structured representation, including rule ID, rule name, applicable conditions, geometric operation sequence, constraint equations, and verification rules; in the geometric operation sequence, each operation defines type, parameter expression, and dependency relationship;
[0090] Parameter expressions use variable names instead of specific numerical values, and define the calculation relationship between parameters, while supporting conditional expressions; dependency relationship uses graph structure, where nodes are geometric operations or features, directed edges represent dependency relationship, and weights represent dependency strength or priority;
[0091] Rule library management uses a classification storage method, which is divided into cuboid class, cylinder class and composite class according to geometric type, divided into building, machinery and electronics according to industry field, and divided into simple, medium and complex according to complexity; Establish key feature index and parameter range index to realize retrieval and matching; version management records the creation time and source of the rule, traces the modification history of the rule, and supports A / B testing and optimization iteration of the rule;
[0092] Rule verification and optimization, including correctness verification, robustness test and rule simplification and generalization; correctness verification uses the original model as a test case, applies the extracted rules to reconstruct the model, compares the consistency of the reconstructed result with the original model, and evaluates the accuracy of the rules; robustness test uses different parameter values to test the rules, verifies the boundary conditions, detects parameter combinations that may cause geometric failure, and establishes the parameter effective domain; rule simplification and generalization identify redundant operations and constraints, merge similar rules, and adjust parameter ranges to expand applicability;
[0093] The technical points include formalized representation, so that the modeling knowledge changes from implicit to explicit, in order to store, transfer and reuse; parameterized expression supports mathematical relations and logical judgments; rule base management realizes systematic organization and utilization of modeling knowledge; verification and optimization mechanism ensures the reliability and applicability of rules;
[0094] The modeling rules are obtained:
[0095] The parameter mapping mechanism establishes a parameter name mapping table, handles synonyms and abbreviations, performs unit conversion and data type conversion, and uses default values or recommends default values based on historical data for missing parameters;
[0096] The characteristics of the input parameters are analyzed, and the matching modeling rules are retrieved from the rule base: the cosine similarity is used to calculate the similarity of the feature vector, the interval overlap algorithm is used to judge and calculate the inclusion degree of the parameter range, the collaborative filtering algorithm is used to calculate the prediction score and recommend the historical successful cases, and finally the weighted sum method is used to calculate the comprehensive matching degree, and the K candidate rule list with the highest matching degree is returned; for complex models, multi-rule collaboration is used, including serial combination, parallel combination and nested combination, parameter conflicts are coordinated through constraint solvers, and geometric conflicts are handled through Boolean operations or priority;
[0097] Parameterized model construction includes parameter calculation and propagation: directed acyclic graph is used to represent the dependency relationship between parameters, nodes represent parameters, and edges represent dependency relationships; parameter calculation uses topological sorting to ensure the calculation order; parameter propagation uses incremental update strategy: when parameter pi changes, only the affected successor parameter set is recalculated; constraint equation system solving: for linear constraints, use LU decomposition or QR decomposition to solve, for nonlinear constraints, use Newton-Raphson iteration method to solve; branch and bound algorithm is used to divide the solution space into sub-regions, and solve in each sub-region; no solution case processing uses constraint relaxation technology to convert hard constraints into soft constraints; numerical stability guarantee uses condition number test, when the condition number is greater than the set value, uses regularization technology or singular value decomposition to solve;
[0098] Geometric bodies are constructed according to the operation sequence defined by the rules, including basic geometry creation, Boolean operation, feature operation and geometric transformation; monitor the execution status of each operation, capture geometric failure and automatically repair, record error information and roll back when unable to repair;
[0099] After the model is built, identify and name the key surfaces; position-based naming: determine the top and bottom surfaces according to the Z coordinate, determine the side surface according to the normal vector direction, and define front, back, left and right according to the coordinate system; function-based naming: name the inlet and outlet according to the fluid direction or design intent, name the working surface according to the process requirements, and name the mounting surface and mating surface according to the assembly relationship; naming based on geometric features: including naming the inward cylindrical surface as a hole surface, naming the partial cylindrical surface or ring surface as a fillet surface, and numbering the planes and curved surfaces according to their types; naming rules inheritance: if the modeling rules come from the reference model learned, the corresponding naming scheme is inherited, and the naming is inferred according to the semantic information of the parameter table;
[0100] Result backstepping and optimization of complex model:
[0101] For models with complexity exceeding a certain threshold, a hierarchical and progressive decomposition strategy is adopted: primary and secondary structure separation adopts a volume contribution-based analysis method to calculate the volume contribution rate of each feature For , the volume of feature i, the total volume; the main structure is defined as the feature set with a volume greater than the set threshold, and the accessory feature is defined as the feature set with a volume not greater than the set threshold; the minimum spanning tree algorithm is used to establish the master-slave relationship tree, and the edge weight is defined as the spatial distance between features; the spectral clustering algorithm is used to construct the feature adjacency matrix and calculate the Laplacian matrix; the eigenvalue decomposition of the Laplacian matrix is performed, and the first k smallest eigenvalues are selected to correspond to the feature vectors for K-means clustering; ontology-based semantic reasoning is used for semantic division, and a feature semantic network is established , C is a concept set, R is a relationship set, and I is an instance set; a recursive divide-and-conquer strategy is used for hierarchical deduction: the first layer of main structure analysis uses a shape matching algorithm to calculate shape descriptors; the second layer of module analysis uses a feature recognition algorithm based on geometric invariants for classification; the third layer of combination relationship analysis uses a Boolean operation history reconstruction algorithm to analyze geometric combinations through R-function theory; the fourth layer of detail feature analysis uses local geometric analysis to calculate curvature and torsion; a dynamic programming algorithm is used to optimize the construction sequence and perform hierarchical merging, with the target function being the minimization of the weighted sum of construction step number and computational complexity;
[0102] Machine learning techniques are introduced to assist in the identification; feature engineering extracts feature vectors from geometric data, first topological features extract Euler number, genus, shape complexity and surface density; geometric feature extraction uses principal component analysis to calculate principal axis direction, symmetry measure uses symmetry transformation residual; distribution feature extraction uses histogram to count curvature distribution, calculate statistical moments; thickness distribution uses distance transform to calculate the shortest distance from internal points to the surface; data augmentation techniques are used to prepare training data; labeling uses active learning strategies, selecting the most uncertain samples for manual labeling; classification model training uses deep neural networks, network structure includes convolutional layers, LSTM layers and fully connected layers; loss function uses cross-entropy; optimization algorithm uses Adam optimization algorithm; model evaluation uses k-fold cross-validation, performance indicators include accuracy, precision, recall and F1-score; inference assistance application uses ensemble learning methods, combining the prediction results of multiple classifiers; confidence fusion uses uncertainty quantification, when the uncertainty exceeds the threshold, manual review is applied; continuous learning uses online learning algorithms to update model parameters through gradient accumulation;
[0103] On the basis of the reconstructed model, the influence of parameters on geometry is analyzed and optimized design is carried out: parameter sensitivity analysis uses finite difference method to calculate partial derivative, sensitivity coefficient is , the set target function, is the design parameter; Sobol sequence is used for global sensitivity analysis, to calculate the first order sensitivity index and total sensitivity index : , , the first order partial variance of parameter , is the conditional expectation of output Y when the parameter is fixed, Y is the model output response, is all design parameters except , is the total variance of model output; Morris screening method is used for parameter importance ranking;
[0104] Parameter optimization uses a multi-objective optimization framework, constraint conditions include equality constraints and inequality constraints; non-dominated sorting genetic algorithm NSGA-II is used, fitness function is based on Pareto dominance relationship and crowding distance; gradient optimization uses quasi-Newton method;
[0105] Optimization iteration process uses adaptive termination criteria, sets relative improvement threshold condition , gradient modulus threshold condition and maximum iteration number limit, wherein Objective function value for the kth iteration, Objective function gradient norm for the kth iteration, Improvement threshold set, Gradient norm threshold set; surrogate model acceleration technique employs Kriging model or radial basis function RBF; optimization result verification employs Monte Carlo simulation to evaluate the impact of parameter uncertainty on optimization results, calculates confidence interval and reliability index;
[0106] Design variant generation using derived parametric knowledge: parameter space sampling employs hybrid sampling methods, including uniform sampling, Latin hypercube sampling, Halton sequence sampling, and intelligent sampling based on Bayesian optimization; batch model generation employs parallel computing framework, task allocation employs load balancing algorithm, node selection is based on performance and load state; geometric validity verification includes topology check, geometry check and physical constraint check; verification algorithm employs fast collision detection and Boolean operation validity judgment; variant evaluation employs multi-criteria decision analysis, weight allocation employs analytic hierarchy process AHP calculation; Pareto frontier identification employs non-dominated sorting algorithm; visualization employs parallel coordinate chart, scatter matrix chart and interactive 3D chart; variant library construction employs multi-dimensional index structure, including B+ tree index and LSH index; similarity measurement employs weighted Euclidean distance;
[0107] Knowledge feedback and evolution:
[0108] Ensure the reliability of the output through modeling result quality evaluation: geometric validity check employs multi-level verification algorithm, including degenerate face detection; self-intersection detection using space hash grid accelerated line intersection algorithm; closedness check through edge usage count verification; topological consistency detection through Euler formula verification; connectivity detection by traversing face adjacency graph using depth-first search algorithm to calculate the number of connected components; manifold detection by verifying that each edge is shared by at most two faces and the neighborhood of each vertex is homeomorphic to a disc; parameter compliance detection using numerical comparison algorithm; principal axis direction determination using principal component analysis, combined with minimum bounding box algorithm for size measurement; wall thickness analysis by calculating the shortest distance from internal points to the surface using distance transform to obtain the minimum wall thickness; draft angle detection by calculating the angle between the face normal vector and the draft direction; feature size check using morphological operations;
[0109] Failure case diagnosis and learning: construct classification feature vector according to error type, parameter range and geometric feature, use multi-layer decision tree algorithm for failure cause classification; use isolated forest algorithm for anomaly detection; use support vector machine method to find decision boundary in parameter space, identify failure area to realize parameter boundary analysis; diagnostic analysis uses causal reasoning framework, builds causal graph to represent the causal relationship between parameters, operations and results; use dynamic programming algorithm for backtracking analysis, use state transition equation to identify key decision points that lead to failure; calculate the influence of parameter perturbation on failure probability for sensitivity analysis; use reinforcement learning algorithm to generate improvement measures, action space includes rule correction, parameter adjustment and constraint optimization; rule optimization uses genetic algorithm, individual encoding as rule parameter, fitness function based on rule accuracy and coverage; knowledge base update uses incremental learning algorithm, conflict detection between new knowledge and existing knowledge uses consistency test; knowledge graph update uses graph neural network, node represents concept, edge represents relationship, updates node representation through message passing mechanism; version control uses Git-like differential storage mechanism, supports knowledge version rollback and branch merging;
[0110] Successful case knowledge extraction: pattern mining uses deep clustering algorithm, combined with autoencoder and K-means clustering scheme to realize implicit knowledge mining; frequent pattern mining uses FP-Growth algorithm, builds FP-tree compression data structure to mine frequent itemsets; association rule mining based on confidence and lift; sequence pattern mining uses PrefixSpan algorithm to identify and build operation timing patterns; rule generalization uses inductive logic programming framework to learn general rules from specific instances; background knowledge is represented as first-order logic predicates, and the learning goal is set to minimize description length; rule simplification uses pruning algorithm to remove redundant conditions and rules with confidence lower than the set value; cross-validation evaluates rule generalization performance to prevent overfitting; best practice identification uses a multi-criteria evaluation system, evaluation indicators include construction efficiency, geometric quality and resource consumption; comprehensive score uses TOPSIS method; practice pattern extraction uses process mining technology to build Petri net model to represent the construction process; knowledge automatic reasoning uses description logic reasoning machine to support concept inclusion, instance checking and consistency checking; ontology evolution management uses version management and change propagation mechanism to ensure the consistency and integrity of the knowledge base;
[0111] A / B testing framework uses online controlled experiment design, random shuffling algorithm ensures statistical independence of user grouping; effect evaluation uses hypothesis testing, confidence interval calculation evaluates effect significance; multi-armed bandit algorithm is used for dynamic adjustment of traffic allocation, balancing exploration and utilization;
[0112] Version iteration management adopts semantic version control; performance benchmarking adopts standard test sets, including geometric precision, computational efficiency, and memory occupation; regression testing ensures new version compatibility; gray release strategy controls the impact range of new versions, and automatically rolls back when monitoring key indicators are abnormal; user feedback analysis uses natural language processing technology, sentiment analysis to identify user satisfaction; topic modeling uses LDA algorithm to extract feedback topics; feedback priority scoring uses the analytic hierarchy process, and weight distribution is based on impact and urgency; crowd-sourced quality control uses a mechanism combining majority voting and expert review; performance monitoring uses a distributed monitoring architecture, and index collection uses a time series database for storage; anomaly detection uses LSTM neural networks to predict normal patterns, and triggers an alarm when the deviation exceeds the threshold; root cause analysis uses causal reasoning and correlation analysis; adaptive optimization uses online gradient descent to update system parameters; learning rate uses an adaptive adjustment strategy.
[0113] The step S5 specifically comprises the following steps:
[0114] Intelligent parameter configuration and fusion:
[0115] Based on the model parameters obtained in step S1 and the modeling rules generated in step S4, a parameter fusion engine is constructed;
[0116] Parameter mapping and completion: based on semantic similarity calculation, automatic mapping of input parameters and rule parameters is performed; the calculation formula of semantic similarity is wherein is the semantic similarity score between parameters and parameters , is the input parameter feature vector, is the rule library parameter feature vector; for missing parameters, based on the knowledge graph constructed in step S4, the highest correlation default value is queried using a graph reasoning algorithm for completion, or a set historical experience value is used for completion;
[0117] Conflict detection and resolution: a parameter constraint network is established, and a constraint propagation algorithm is used to detect logical conflicts between input parameters; when a conflict is found, the parameter sensitivity index determined in step S4 is used to prioritize parameters with higher parameter sensitivity index and adjust parameters with lower parameter sensitivity index to meet the constraint conditions;
[0118] Adaptive modeling execution engine:
[0119] Dependency graph construction: Convert the modeling task into a directed acyclic graph, where nodes represent geometric operations and edges represent dependency relationships between operations; use topological sorting algorithm to determine the optimal linear execution sequence, ensure that parent features precede child features in construction; transactional modeling operations: introduce database transaction mechanism to manage the modeling process, treat each independent geometric feature construction as an atomic operation; create a snapshot of the current document state before executing Part.make or Boolean operations; if the operation fails, perform rollback operation to the nearest stable state, and trigger adaptive repair strategy; dynamic feature injection: after the base geometry is constructed, dynamically load the corresponding feature construction script according to the identified geometric shape pattern;
[0120] Geometry optimization and performance tuning:
[0121] Shape optimization: after the initial model is generated, call the NSGA-II multi-objective optimization algorithm; take minimizing volume and maximizing structural strength as objective functions, use geometric dimensions as design variables, and iterate; grid and precision control: adjust the model discretization precision according to the extracted curvature information; increase the grid in areas with sudden changes in curvature and decrease the grid in flat areas; set linear deflection and angular deflection parameters to ensure that the generated geometry meets the specified precision requirements; lightweight processing: use feature suppression technology to remove small features in non-critical areas to generate model variants suitable for different LOD levels;
[0122] Comprehensive model verification and quality assurance:
[0123] Geometric interference check: use the hierarchical bounding box scheme to construct the OBB tree, quickly detect self-intersection inside the entity and interference between assembly components; physical property verification: calculate the volume, centroid, and moment of inertia matrix of the model; verify whether the centroid position is within the preset allowable range; manufacturability analysis: based on the identified face features, perform machining process checking; check whether the minimum wall thickness meets the injection molding or casting requirements, check whether the depth-to-diameter ratio meets the drilling process restrictions, and check whether there are reverse clamping areas affecting demolding;
[0124] Complete CAD automatic modeling.
[0125] The application further provides a system for realizing the parameter-driven CAD automatic modeling method, comprising a data acquisition module, a model generation module, a reverse reconstruction module, a rule generation module and an automatic modeling module; the data acquisition module, the model generation module, the reverse reconstruction module, the rule generation module and the automatic modeling module are sequentially connected; the data acquisition module is used for acquiring model parameter information to be modeled and uploading data information to the model generation module; the model generation module is used for generating a CAD model based on parameter analysis, geometric construction and surface recognition scheme according to the received data information and the acquired data information, and uploading data information to the reverse reconstruction module; the reverse reconstruction module is used for performing reverse reconstruction of a three-dimensional CAD model based on topology analysis, geometric feature extraction, pattern recognition and parameter relationship inference according to the received data information and the acquired data information, and uploading data information to the rule generation module; the rule generation module is used for performing modeling, optimization and feedback evolution based on model analysis and feature learning and generation of parameterized modeling rules according to the received data information and the acquired data information, and uploading data information to the automatic modeling module; and the automatic modeling module is used for completing parameter-driven CAD automatic modeling according to the received data information and the acquired data information.
[0126] The parameter-driven CAD automatic modeling method and system provided by the application realize parameter-driven CAD automatic modeling, have higher reliability, better accuracy and higher efficiency through CAD model generation, reverse reconstruction of a three-dimensional CAD model, modeling, optimization and feedback evolution. BRIEF DESCRIPTION OF DRAWINGS
[0127] Figure 1 The figure is a method flowchart of the method of the application.
[0128] Figure 2 The figure is a function module schematic diagram of the system of the application. DETAILED DESCRIPTION
[0129] As shown in the figure, the method flowchart of the method of the application is as follows: the parameter-driven CAD automatic modeling method disclosed by the application comprises the following steps: Figure 1
[0130] S1. acquiring model parameter information to be modeled;
[0131] S2. generating a CAD model based on parameter analysis, geometric construction and surface recognition scheme according to the data information acquired in step S1; comprising the following steps:
[0132] determining the installation position of a CAD kernel based on a progressive search strategy and initializing the CAD kernel;
[0133] Based on the parameterized geometry construction scheme, the construction of the basic geometry and the feature geometry is performed;
[0134] Geometric topology analysis is performed, all faces of the three-dimensional entity are traversed, geometric feature extraction is performed on each face, and face recognition and naming are performed according to the extracted data;
[0135] All three-dimensional entity feature objects and all named face feature objects are exported to realize the export and persistence of the model;
[0136] The parameter table data is read from the external data source, and modeling is performed to complete the generation of the corresponding CAD model.
[0137] In specific implementation, the following steps can be adopted:
[0138] CAD kernel determination and initialization:
[0139] An incremental strategy is adopted to determine the installation path of the CAD kernel: first, the Windows registry query method is adopted to search the installation records containing the "CAD" keyword in the Uninstall keys of HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER; if the registry query fails, the search is performed in the standard program directory, which includes the Program Files, Program Files (x86) and LocalAppData folders; if the standard program directory query still fails, the full symbol traversal search is adopted to locate the CAD kernel;
[0140] After locating the CAD kernel, the path validity is verified to ensure that the bin subdirectory exists and contains the necessary CAD kernel modules, and then the verified path is added to the search path;
[0141] The CAD geometry kernel module is imported, and the non-interface document object is created to complete the initialization process;
[0142] Construction of the basic geometry and the feature geometry:
[0143] The basic geometry size is defined, including length, width and height;
[0144] The feature geometry parameters are defined, including the circular radius, position coordinates and stretching height;
[0145] Base geometry construction: calculate key control point coordinates according to input base geometry dimensions; use homogeneous coordinate system to represent spatial positions to ensure consistency of transformation operations; create geometric topology according to "point-line-surface-solid" hierarchical logic: create a control vertex set, generate an edge set connecting vertices, combine edges into a closed wire frame to form a surface boundary, and generate a geometric surface from the surface boundary; define a stretch transformation matrix to expand a two-dimensional surface into a three-dimensional solid through vector stretching operations, with the stretching direction determined by a unit normal vector and a stretching distance; encapsulate the generated geometric solid as a CAD feature object and establish a parameter-geometry association;
[0146] Feature geometry construction: extract key parameters of feature geometry, including center point coordinates, radius, normal vector, position constraint, direction constraint, size constraint, connection relationship, and dependency relationship; establish a parameter constraint equation system and solve for parameter solutions that satisfy all constraint conditions using a numerical iteration method to ensure the reasonableness and consistency of the geometry; create a base geometry curve based on the solved parameters, form a closed contour by splicing the base geometry curve, construct a geometric surface using a surface generation algorithm, and perform a solidification operation to generate a three-dimensional feature geometry; use an object-oriented encapsulation strategy to encapsulate each geometric feature as an independent parameterized object and establish a dependency graph between features;
[0147] Face recognition and naming:
[0148] Iterate through all the faces of the three-dimensional solid and perform geometric feature extraction on each face: calculate the parameter range of the face, calculate the normal vector at the parameterized center point of the face, and obtain the centroid coordinates of the face; identify the geometric type of the face, including planar, cylindrical, and spherical surfaces;
[0149] Calculate the geometric properties of each face, including the geometric type, geometric parameters, and topological relationships; establish a multi-dimensional decision rule for face classification using a hierarchical decision tree structure: the first layer performs coarse classification based on geometric type, the second layer performs fine classification based on spatial position, and the third layer performs final classification based on functional semantics; for position classification, calculate the relative position of the face centroid in the coordinate system and determine the spatial orientation of the face through coordinate comparison; for direction classification, calculate the angle between the face normal vector and the coordinate axis and determine the directional characteristics of the face through an angle threshold; for functional classification, identify the functional attributes of the face in combination with geometric context and engineering semantics; ensure the correctness of the classification results through topological consistency checks and geometric reasonableness verification;
[0150] Create an independent feature object for each identified face; identify the functional attributes of the face using semantic names and add the named face feature object to the export object list; establish a multi-level geometric feature description system to extract the complete geometric information of the face; use an adaptive numerical error handling mechanism to set a combination of relative error threshold and absolute error threshold to handle rounding errors in floating point operations and improve the robustness of geometric determination; implement a hierarchical face organization strategy to analyze and aggregate the connectivity of the faces through graph theory algorithms; define classification rules in XML or JSON format;
[0151] Export and persist the model:
[0152] Execute the recompute() method of the document to update the dependencies and geometric state of all feature objects, ensuring the consistency of the model data; build an export object list containing all three-dimensional entity feature objects and all named face feature objects; create a standardized directory structure using an operating system-independent path handling method, check for directory existence and automatically create it if it does not exist; use a standardized CAD exchange format to export all objects using the Part.export() method to generate a model file containing semantic information;
[0153] Generation of CAD models:
[0154] Read the parameter table from an external data source, the table structure includes model ID, length, width, height, cylinder radius, cylinder position X, cylinder position Y, and cylinder height; use a loop structure to iterate through each row of the table and extract the parameters; use a loop traversal mechanism to process each row of parameters in the table in turn, each iteration including parameter extraction, geometry creation, face naming, and model export; use an independent document object to manage each model to avoid interference between different models; after iteration, clean up document resources to release memory and ensure the stability of batch processing;
[0155] Before generating the CAD model, perform legality verification on the parameters, including value range check, geometric constraint check, and unit consistency check; invalid parameter processing strategy, including recording detailed error logs, skipping the model or using default values according to configuration selection, providing warning level settings to distinguish between fatal errors and tolerable deviations;
[0156] Finally, complete the generation of the CAD model.
[0157] S3. Based on the data information obtained in step S1, based on topological analysis, geometric feature extraction, pattern recognition and parameter relationship inference, perform reverse reconstruction of three-dimensional CAD models; including the following steps:
[0158] According to the determined installation location of the CAD kernel, initialize the CAD kernel;
[0159] Importing model data, and performing topology hierarchy analysis to realize topology analysis;
[0160] According to the results of topology analysis, extracting vertex, edge and face geometric information, and performing geometric constraint relationship analysis to realize feature extraction;
[0161] Designing data model, and performing data structuring and persistent storage;
[0162] Through analysis of the extracted geometric parameters, inferring the construction process of the original model, and using rule base matching to identify geometric shape patterns;
[0163] According to the obtained data information, inferring parameter relationships to realize reverse reconstruction of the three-dimensional CAD model.
[0164] In specific implementation, the following steps can be used:
[0165] Initialization of the CAD kernel:
[0166] According to the determined installation location of the CAD kernel, importing necessary geometric modeling modules and topology analysis modules, and initializing the interfaceless document object to prepare an environment for subsequent reconstruction operations;
[0167] Topology analysis:
[0168] Using the file reading interface of the CAD kernel to load model data into memory, verifying file integrity and format correctness; analyzing the topology hierarchy of the model, starting from the topmost composite or assembly, and decomposing layer by layer to the independent three-dimensional entity of the entity layer, the closed or open shell of the shell layer, the shell-forming faces of the face layer, the edge boundary lines of the face layer, and the endpoints of the edges of the vertex layer; identifying the number of entities contained in the model, and separating multi-entity models;
[0169] Feature extraction:
[0170] Traversing all vertices of each entity, extracting the three-dimensional spatial coordinates of each vertex, and performing coordinate deduplication processing; using the KD tree data structure to set a threshold to judge vertex coincidence, sorting vertex coordinates, and counting the number of vertices as a preliminary indicator of geometric complexity;
[0171] Extracting geometric information of edges: traversing all edges of the entity, identifying and extracting parameters of each edge; for straight edges, the identification condition is that the curve type of the edge is a straight line, and the extracted parameters include the start point coordinates, the end point coordinates, the direction vector and the length; for circular edges, the identification condition is that the curve type of the edge is a circle but the parameter range does not include a complete , the extraction parameters include the center coordinates, the radius, the normal vector, the start angle, the end angle, and the arc length; for a complete circular edge, the identification condition is that the curve type of the edge is a circle and the parameter range is complete , the extraction parameters include the center coordinates, the radius, the normal vector, and the circumference length; for an ellipse, the center coordinates, the major axis, the minor axis, and the normal vector are extracted; for a spline curve, the control point coordinates, the node vector, and the order are extracted; for a Bezier curve, the control point sequence coordinates are extracted;
[0172] The geometric information of the face is extracted: all faces of the entity are traversed, and the geometric type identification and parameter extraction are performed for each face; for a plane, the identification condition is that the curve type of the face is a plane, and the extraction parameters include the reference point, the normal vector, the area, and the boundary contour; for a cylindrical surface, the identification condition is that the curve type of the face is a cylinder, and the extraction parameters include the axis position, the axis direction, the radius, the height, and the area; for a conical surface, the identification condition is that the curve type of the face is a cone, and the extraction parameters include the vertex, the axis direction, the half-apex angle, and the base radius; for a spherical surface, the identification condition is that the curve type of the face is a sphere, and the extraction parameters include the center coordinates, the radius, and the coverage angle; for a torus, the identification condition is that the curve type of the face is a torus, and the extraction parameters include the center coordinates, the major radius, the minor radius, and the normal vector; for a NURBS surface, the control point grid coordinates, the node vector, and the order are extracted; for a Bezier surface, the control point array coordinates are extracted;
[0173] The spatial relationships between geometric elements are analyzed, including parallel relationship identification, vertical relationship identification, concentric relationship identification, symmetry relationship identification, and tangent relationship identification; the size constraints are extracted, including geometric size parameters and relative position relationships between geometric elements; in the analysis process: according to the type identifier of the geometric object, the corresponding parameter extraction function is called for data extraction and analysis; the principal axis direction of the geometric object is calculated using principal component analysis, and the symmetry is identified through eigenvalue decomposition; the periodic characteristics are detected using Fourier transform, and the array pattern and repeated structure are identified through frequency domain analysis; the containing relationship of geometric features is represented using a tree structure, the topological connection relationship is recorded using an adjacency list, and a spatial index is established; the cumulative error is processed using the Kahan summation algorithm;
[0174] Structured and persistent storage of data:
[0175] A hierarchical data organization structure is used as the data model, starting from the top model data, which contains file meta information, entity quantity, and entity list; each entity contains entity ID, vertex data, edge data, and face data; the extracted geometric data is converted into JSON format for storage and exchange; the design principles of the JSON structure include using nested objects to represent hierarchical relationships, using arrays to represent collections of similar elements, and using key-value pairs to store geometric parameters;
[0176] Add check information and metadata to each geometric element; check information includes element count, topological consistency verification and geometric validity verification; metadata includes extraction timestamp, CAD kernel version information and data format version number; create a standardized output directory structure, the file naming specification generates JSON file name based on the original model file name, and adds timestamp or version number; generate corresponding JSON files for each input model, and establish index file to record all generated data files;
[0177] Inference of the original model construction process and geometric shape pattern recognition:
[0178] Infer the construction process of the original model by analyzing the extracted geometric parameters; recognize the set geometric shape pattern by rule base matching:
[0179] The cuboid recognition rule includes: the number of vertices is equal to 8, the number of edges is equal to 12 and all edges are straight lines, the number of faces is equal to 6 and all faces are planes, the number of circular edges is equal to 0; geometric verification includes: there are three groups of parallel pairs and three groups of parallel plane pairs, the normal vectors of all faces are mutually orthogonal or parallel, and the intersection lines of adjacent faces are mutually perpendicular; parameter derivation: extract the minimum and maximum values of X, Y and Z coordinates from the vertex coordinates to calculate the length, width and height and determine the reference point; construction method deduction includes: creating a rectangular bottom surface at the reference point, stretching the height value along the Z axis positive direction or directly using the makeBox function to pass in the length, width, height and reference point parameters;
[0180] The cylinder recognition rule includes: there is at least one cylindrical surface, there are two or more circular edges, the radii of the circular edges are equal and the normal vectors are parallel; geometric verification includes: the center line of the two circular edges is parallel to the normal vector, the axis of the cylindrical surface is consistent with the normal vector of the circular edge, and the radius of the cylindrical surface is consistent with the radius of the circular edge; parameter derivation: extract the radius from the circular edge, extract the center coordinates of the two circles, calculate the center distance as the cylinder height, and determine the axis direction and reference point; construction method deduction includes: creating a circular bottom surface at the reference point, stretching the height value along the axis direction or directly using the makeCylinder function to pass in the radius, height, reference point and direction parameters;
[0181] The cone recognition rule includes: there is one conical surface, there is one circular edge and one vertex; geometric verification includes: the vertex of the conical surface coincides with the independent vertex, the axis of the conical surface passes through the center of the circular edge, and the half vertex angle of the conical surface is consistent with the geometric dimension; parameter derivation: extract the radius and center of the bottom circle, extract the vertex coordinates, and calculate the height and axis direction; construction method deduction includes: creating a circle at the bottom center, performing conical stretching to the vertex direction or using the makeCone function;
[0182] Sphere recognition rule includes: all faces are spherical or there is one complete spherical face, all spherical faces share the same sphere center; parameter derivation: extract sphere center coordinates and radius; construction method deduction: use makeSphere function to pass in sphere center and radius;
[0183] Torus recognition rule includes: there is a torus; parameter derivation: extract torus center coordinates, major radius and minor radius, direction vector; construction method deduction: use makeTorus function;
[0184] Composite geometry recognition: based on topological separation analysis, calculate the minimum distance between each entity; when the minimum distance is greater than a set value, it is determined as an independent entity; use connected component analysis algorithm to identify geometric bodies without intersection; establish entity adjacency matrix A, the value of the element in the ith row and the jth column of A is: when entity i and entity j intersect, when entity i and entity j do not intersect, ; identify independent geometric groups through connected component algorithm of graph theory;
[0185] Use normal vector direction analysis to identify concave features: for cylindrical surfaces, calculate the radial vector as , is a point on the surface, is the center; when , it indicates that the normal vector points to the inside, is the plane normal vector; for planes, calculate the sign of the distance from a point to the plane, and determine the inside and outside; the depth of the recess is expressed as , where is the recess boundary point, is the plane normal vector, is the plane constant; hole recognition uses topological loop detection, and the topological genus of the geometric body is calculated by Euler number; based on curvature continuity analysis, use discrete curvature calculation to detect curvature discontinuity points; face continuity determination is achieved through hierarchical inspection of G0 continuity, G1 continuity and G2 continuity; record the geometric feature mode of the set typical Boolean operation combination, and use pattern matching algorithm to automatically identify the construction history of composite geometric body;
[0186] Round corner recognition rule includes: the round corner recognition feature is that there is a partial cylindrical surface or a torus connecting two planes or curved surfaces, and the round corner surface is tangent to the adjacent surface; parameter derivation: extract the round corner radius to identify the edge where the round corner is located; construction method deduction: apply the round corner operation on the specific edge of the basic geometric body;
[0187] Chamfer recognition rules include: chamfer appears at the original sharp edge location, chamfer and adjacent face form a fixed angle; Parameter derivation includes: extract chamfer distance or angle, identify the edge where the chamfer is located; Construction method deduction: apply chamfer operation on a specific edge of the base geometry;
[0188] Draft recognition rules include: face exists taper and is not completely parallel; Parameter derivation includes: extract draft angle; Construction method deduction: apply draft operation on the face;
[0189] Deduce the construction sequence to determine the creation order of geometric features: base geometry priority principle: identify and reconstruct the base geometry first, analyze the dependency relationship between features, topologically sort the construction steps according to the dependency relationship, and select the most concise construction path; Typical construction sequence includes: creating base geometry, creating additional geometry, performing Boolean operation, applying feature operation, and applying transformation operation; The entire process uses a rule library architecture, each geometric shape corresponds to a set of recognition rules and reconstruction methods, rule matching uses a priority mechanism, and geometric errors in actual models are handled using fuzzy matching and tolerance settings; Establish a confidence score mechanism to evaluate the reliability of the recognition results;
[0190] Inference of parameter relationships and reverse reconstruction of models:
[0191] Create a new CAD document object to accommodate the reconstructed geometry; Initialize the geometry constructor and feature manager, and load the saved JSON geometry data file; According to the recognized shape type and deduced construction method, perform geometric reconstruction operations;
[0192] Cuboid reconstruction process: read cuboid parameters from JSON data, call the makeBox function of the CAD kernel or perform the following operations: create four vertices of a rectangular base, connect the vertices to form four edges, combine the edges into a closed wireframe, generate a plane from the wireframe, define a stretch vector, and perform a stretch operation to generate a cuboid solid; Apply position transformation: move the reconstructed geometry to the correct position, create a feature object and add it to the document; Cylinder reconstruction process: read cylinder parameters from JSON data, call the makeCylinder function or perform the following operations: create a circle at the reference point, define a stretch vector, and perform a stretch operation to generate a cylinder solid, if the axis direction is not the Z axis, calculate and apply a rotation transformation, including calculating the rotation matrix of the Z axis to the target axis and applying the rotation transformation to the geometry, create a feature object and add it to the document; Other geometric body reconstruction includes: cone uses the makeCone function to pass in the base radius, top radius, and height; sphere uses the makeSphere function to pass in the sphere center and radius; torus uses the makeTorus function to pass in the major and minor radii;
[0193] Composite geometry reconstruction: for geometries combined through Boolean operations, perform Boolean union, reconstruct each individual geometry, and use the fuse function to perform the union operation; Boolean difference reconstruction: reconstruct the main body geometry and the subtracted geometry, use the cut function to perform the difference operation; Boolean intersection reconstruction: reconstruct two intersecting geometries, use the common function to perform the intersection operation; feature operation reconstruction includes: fillet feature reconstruction, read the fillet parameters from the JSON data, identify the corresponding edges on the reconstructed base geometry, including feature matching according to the position and direction of the edges and using spatial coordinate tolerance matching, call the makeFillet function to pass in the edge list and the fillet radius, and replace the original geometry with the fillet geometry; chamfer feature reconstruction, read the chamfer parameters, identify the target edges, call the makeChamfer function;
[0194] Reconstruction accuracy control and verification: including geometric accuracy verification, comparing the size of the reconstructed model and the original model, calculating the relative error and the absolute error, setting the acceptable error threshold; topological consistency verification: verifying whether the number of vertices, edges and faces is consistent with the original model, verifying the Euler formula, checking the closure of the geometry; visual comparison verification: generating three-dimensional views of the original model and the reconstructed model, using different colors to superimpose the two models, and calculating the Hausdorff distance between the models; using parameterized reconstruction, maintaining the editability and accuracy of the model, maintaining the geometric constraint relationship during reconstruction, using numerical optimization methods to adjust parameters, and minimizing reconstruction error; for complex curved surfaces, choose NURBS reconstruction or approximate fitting, and record the reconstruction process log when reconstruction fails;
[0195] System recalculates the document, updates the state of all geometries, and constructs an export object list; the export object list includes all reconstructed entities; export as STEP standard format and save to the specified directory; quality report generation: generate a reconstruction quality report containing original model information, identification results, reconstruction parameters, accuracy evaluation, reconstruction time consumption statistics, success rate and failure items, save the report in a structured format, and generate visual comparison charts; batch reconstruction management: including traversing the model folder, executing scanning and reconstruction for each model, automatically matching scanning data and reconstruction tasks, processing several reconstruction tasks in parallel to improve efficiency, establishing a reconstruction task queue and progress tracking, and generating a summary report of the reconstruction.
[0196] S4. Based on the data information obtained in step S1, model analysis and feature learning, and generation of parameterized modeling rules, modeling, optimization and feedback evolution are performed; including the following steps:
[0197] Based on the multi-level analysis and deduction model, the relationship between parameters is identified, and the rule knowledge is extracted from the identified parameter relationship to extract reusable modeling knowledge;
[0198] The obtained results are converted into formalized modeling rules to complete the generation of parameterized modeling rules;
[0199] Based on the similarity calculation scheme, intelligent rule recommendation analysis is performed to obtain corresponding modeling rules;
[0200] A hierarchical progressive decomposition strategy is adopted to perform result backstepping and optimization of complex models;
[0201] Modeling quality is evaluated to realize knowledge feedback and evolution.
[0202] In specific implementation, the following steps can be adopted:
[0203] Identification of relationships between parameters and extraction of reusable modeling knowledge:
[0204] The reference model is analyzed to extract the complete topological structure, including entities, faces, edges, and vertices; the types and parameters of all geometric elements are identified, geometric constraint relationships are analyzed, and feature operation traces are detected; a correlation atlas of geometric elements is established, in which nodes are various geometric elements, edges are topological relationships between elements, and attributes include geometric parameters, constraint relationships, and feature types;
[0205] A multi-level analysis and deduction model is constructed to identify relationships between parameters: the first layer of the model adopts a multi-dimensional feature matching algorithm to establish a geometric feature vector For , the number of vertices, the number of edges, the number of faces, Euler number, area, surface area; a support vector machine classifier is used for geometric body type identification, a radial basis function is used as the kernel function, and a softmax function is used for confidence evaluation; the second layer of the model adopts a deep learning convolutional neural network for feature pattern recognition, the network structure includes 3D convolutional layers, pooling layers, and fully connected layers; additive feature recognition is performed through volume increment increase, and subtraction feature recognition and concave feature recognition are performed through detection of volume reduction; feature dependency relationships are modeled using a graph neural network, in which nodes represent geometric features and edges represent dependency relationships; the third layer of the model adopts a topological sorting algorithm to determine the construction sequence; a deep-first search algorithm is used for circular dependency detection, and a constraint relaxation strategy is used when a loop is found; the fourth layer of the model adopts regression analysis to identify relationships between parameters, linear relationships are fitted using the least squares method, and nonlinear relationships are fitted using polynomial regression or neural networks; a Lagrange multiplier method or an interior point method optimization algorithm is used to solve the constraint equation set;
[0206] Extract reusable modeling knowledge from the deduction results: use clustering algorithms to identify similar geometric structures, use K-means clustering to group geometric feature vectors to extract geometric templates; use principal component analysis for dimensionality reduction, retain the principal components of the set variance as a variable parameter, use parameterized graph grammar for template representation; use association rule mining algorithm to learn design rules, identify strong association design patterns based on support and confidence, use decision tree algorithm to learn design rules; use regression analysis to establish parameter relationship model, significance test uses t test; use reinforcement learning framework, model the modeling process as a Markov decision process, state space S represents the current geometric state, action space A represents the executable modeling operation, use reward function R to evaluate the operation quality, use Q-learning algorithm to learn the optimal strategy; use RDF triple <subject, predicate, object> to represent knowledge relationship to build knowledge graph, use graph database to store and query knowledge;
[0207] Generation of parameterized modeling rules:
[0208] Convert the deduction construction logic into formal modeling rules; modeling rules use structured representation, including rule ID, rule name, applicable conditions, geometric operation sequence, constraint equations, and verification rules; in the geometric operation sequence, each operation defines type, parameter expression, and dependency relationship;
[0209] Parameter expressions use variable names instead of specific numerical values, and define the calculation relationship between parameters, while supporting conditional expressions; dependency relationship uses graph structure, where nodes are geometric operations or features, directed edges represent dependency relationship, and weights represent dependency strength or priority;
[0210] Rule library management uses a classification storage method, which is divided into cuboid class, cylinder class and composite class according to geometric type, divided into building, machinery and electronics according to industry field, and divided into simple, medium and complex according to complexity; Establish key feature index and parameter range index to realize retrieval and matching; version management records the creation time and source of the rule, traces the modification history of the rule, and supports A / B testing and optimization iteration of the rule;
[0211] Rule verification and optimization, including correctness verification, robustness test and rule simplification and generalization; correctness verification uses the original model as a test case, applies the extracted rules to reconstruct the model, compares the consistency of the reconstructed result with the original model, and evaluates the accuracy of the rules; Robustness testing uses different parameter values to test the rule, verifies the boundary conditions, detects parameter combinations that may cause geometric failure, and establishes the parameter effective domain; rule simplification and generalization identify redundant operations and constraints, merge similar rules, and adjust parameter ranges to expand applicability;
[0212] The technical points include formalized representation, so that the modeling knowledge changes from implicit to explicit, in order to store, transfer and reuse; parameterized expression supports mathematical relations and logical judgments; rule base management realizes systematic organization and utilization of modeling knowledge; verification and optimization mechanism ensures the reliability and applicability of rules;
[0213] The modeling rules are obtained:
[0214] The parameter mapping mechanism establishes a parameter name mapping table, handles synonyms and abbreviations, performs unit conversion and data type conversion, and uses default values or recommends default values based on historical data for missing parameters;
[0215] The characteristics of the input parameters are analyzed, and the matching modeling rules are retrieved from the rule base: the cosine similarity is used to calculate the similarity of the feature vector, the interval overlap algorithm is used to judge and calculate the inclusion degree of the parameter range, the collaborative filtering algorithm is used to calculate the predicted score and recommend the historical successful cases, and finally the weighted sum method is used to calculate the comprehensive matching degree, and the K candidate rule list with the highest matching degree is returned; for complex models, multi-rule collaboration is used, including serial combination, parallel combination and nested combination, parameter conflicts are coordinated through constraint solvers, and geometric conflicts are handled through Boolean operations or priority;
[0216] Parameterized model construction includes parameter calculation and propagation: directed acyclic graph is used to represent the dependency relationship between parameters, nodes represent parameters, and edges represent dependency relationships; parameter calculation uses topological sorting to ensure the calculation order; parameter propagation uses incremental update strategy: when parameter pi changes, only the affected successor parameter set is recalculated; constraint equation system solving: for linear constraints, use LU decomposition or QR decomposition to solve, for nonlinear constraints, use Newton-Raphson iteration method to solve; branch and bound algorithm is used to divide the solution space into sub-regions, and solve in each sub-region; no solution case processing uses constraint relaxation technology to convert hard constraints into soft constraints; numerical stability guarantee uses condition number test, when the condition number is greater than the set value, uses regularization technology or singular value decomposition to solve;
[0217] According to the operation sequence defined by the rules, the geometric body is constructed, including basic geometry creation, Boolean operation, feature operation and geometric transformation; monitor the execution state of each operation, capture geometric failure and automatically repair, record error information and roll back when it cannot be repaired;
[0218] After the model is built, identify and name the key surfaces; position-based naming: determine the top and bottom surfaces according to the Z coordinate, determine the side surface according to the normal vector direction, and define front, back, left and right according to the coordinate system; function-based naming: name the inlet and outlet according to the fluid direction or design intent, name the working surface according to the process requirements, and name the mounting surface and mating surface according to the assembly relationship; naming based on geometric features: including naming the inward cylindrical surface as a hole surface, naming the partial cylindrical surface or ring surface as a fillet surface, and numbering the planes and curved surfaces according to the type; naming rule inheritance: if the modeling rule comes from the reference model learned, the corresponding naming scheme is inherited, and the naming is inferred according to the semantic information of the parameter table;
[0219] Result backstepping and optimization of complex model:
[0220] For models with complexity exceeding the set threshold, a hierarchical and progressive decomposition strategy is adopted: primary and secondary structure separation adopts an analysis method based on volume contribution rate to calculate the volume contribution rate of each feature For , the volume of feature i, the total volume; the main structure is defined as the feature set with a volume greater than the set threshold, and the accessory feature is defined as the feature set with a volume less than or equal to the set threshold; the minimum spanning tree algorithm is used to establish the master-slave relationship tree, and the edge weight is defined as the spatial distance between features; the spectral clustering algorithm is used to construct the feature adjacency matrix and calculate the Laplacian matrix, and the eigenvalue decomposition of the Laplacian matrix is performed, and the feature vectors corresponding to the first k smallest eigenvalues are selected for K-means clustering; ontology-based semantic reasoning is used for semantic division, and a feature semantic network is established , C is a concept set, R is a relationship set, and I is an instance set; a recursive divide-and-conquer strategy is used for hierarchical deduction, the first layer of main structure analysis uses a shape matching algorithm to calculate shape descriptors; the second layer of module analysis uses a feature recognition algorithm based on geometric invariants for classification; the third layer of combination relationship analysis uses a Boolean operation history reconstruction algorithm to analyze geometric combinations through R-function theory; the fourth layer of detail feature analysis uses local geometric analysis to calculate curvature and torsion; a dynamic programming algorithm is used to optimize the construction sequence and perform hierarchical merging, and the objective function is set as the minimization of the weighted sum of the number of construction steps and the computational complexity;
[0221] Machine learning techniques are introduced to assist in recognition; feature engineering extracts feature vectors from geometric data. First, topological feature extraction calculates Euler number, genus, shape complexity, and areal density; geometric feature extraction uses principal component analysis to calculate principal axis directions, and symmetry measurement uses symmetry transformation residuals; distribution feature extraction uses histogram statistics of curvature distribution and calculates statistical moments; thickness distribution uses distance transformation to calculate the shortest distance from internal points to the surface; data augmentation techniques are used to prepare training data; annotation adopts an active learning strategy, selecting samples with the highest uncertainty for manual annotation; classification model training uses a deep neural network, with a network structure including convolutional layers, LSTM layers, and fully connected layers; the loss function is cross-entropy; the optimization algorithm is the Adam optimization algorithm; model evaluation uses k-fold cross-validation, and performance metrics include accuracy, precision, recall, and F1-score; inference-assisted application uses an ensemble learning method, combining the prediction results of multiple classifiers; confidence fusion uses uncertainty quantification, and manual review is requested when uncertainty exceeds a threshold; continuous learning uses an online learning algorithm, updating model parameters through gradient accumulation.
[0222] Based on the reconstructed model, the influence of parameters on geometry is analyzed, and optimization design is performed: parameter sensitivity analysis uses the finite difference method to calculate partial derivatives and sensitivity coefficients. for , For the set objective function, Design parameters; global sensitivity analysis was performed using Sobol sequences to calculate the first-order sensitivity index. and total sensitivity index : , , For parameters The first-order partial variance, For fixed parameters The conditional expectation of output Y is given by the time interval, where Y is the model output response. To remove All external design parameters, The total variance of the model output is used; the Morris screening method is used to rank the parameters by importance.
[0223] Parameter optimization employs a multi-objective optimization framework, with constraints including equality and inequality constraints; the non-dominated sorting genetic algorithm NSGA-II is used, with the fitness function based on Pareto dominance and crowding distance; gradient optimization employs a quasi-Newton method.
[0224] The optimization iterative process employs an adaptive termination criterion and sets a relatively improved threshold condition. Gradient modulus threshold condition And the maximum number of iterations limit, its Objective function value for the kth iteration, Objective function gradient norm for the kth iteration, Improvement threshold set, Gradient norm threshold set; surrogate model acceleration technique adopts Kriging model or radial basis function RBF; optimization result verification, Monte Carlo simulation is used to evaluate the influence of parameter uncertainty on the optimization result, calculate the confidence interval and reliability index;
[0225] Design variant generation using derived parameterized knowledge: parameter space sampling uses a hybrid sampling method, including uniform sampling, Latin hypercube sampling, Halton sequence sampling and intelligent sampling based on Bayesian optimization; batch model generation uses a parallel computing framework, task allocation uses a load balancing algorithm, and node selection is based on performance and load state; geometric validity verification includes topology checking, geometry checking and physical constraint checking; verification algorithm uses fast collision detection and Boolean operation validity judgment; variant evaluation uses multi-criteria decision analysis, weight allocation uses analytic hierarchy process AHP calculation; Pareto frontier identification uses non-dominated sorting algorithm; visualization uses parallel coordinate chart, scatter matrix chart and interactive 3D chart; variant library construction uses multi-dimensional index structure, including B+ tree index and LSH index; similarity measurement uses weighted Euclidean distance;
[0226] Knowledge feedback and evolution:
[0227] Ensure the reliability of the output through modeling result quality evaluation: geometric validity checking uses a multi-level verification algorithm, including degenerate face detection; self-intersection detection using space hash grid accelerated line intersection algorithm; closedness checking through edge usage count verification; topological consistency detection by Euler formula verification; connectivity detection by using depth-first search algorithm to traverse the face adjacency graph and calculate the number of connected components; manifold detection by verifying that each edge is shared by at most two faces and the neighborhood of each vertex is homeomorphic to a disc; parameter compliance detection using numerical comparison algorithm; principal axis direction determination using principal component analysis, combined with minimum bounding box algorithm for size measurement; wall thickness analysis by calculating the shortest distance from internal points to the surface using distance transform to get the minimum wall thickness; draft angle detection by calculating the angle between the face normal vector and the draft direction; feature size checking using morphological operations;
[0228] Failure case diagnosis and learning: construct classification feature vector according to error type, parameter range and geometric feature, use multi-layer decision tree algorithm for failure reason classification; use isolated forest algorithm for anomaly detection; use support vector machine method to find decision boundary in parameter space, identify failure area to realize parameter boundary analysis; diagnostic analysis uses causal reasoning framework, builds causal graph to represent the causal relationship between parameters, operations and results; use dynamic programming algorithm for backtracking analysis, use state transition equation to identify key decision points that lead to failure; calculate the influence of parameter perturbation on failure probability for sensitivity analysis; use reinforcement learning algorithm to generate improvement measures, action space includes rule correction, parameter adjustment and constraint optimization; rule optimization uses genetic algorithm, individual encoding as rule parameter, fitness function based on rule accuracy and coverage; knowledge base update uses incremental learning algorithm, conflict detection between new knowledge and existing knowledge uses consistency test; knowledge graph update uses graph neural network, node represents concept, edge represents relationship, update node representation through message passing mechanism; version control uses Git-like differential storage mechanism, supports knowledge version rollback and branch merging;
[0229] Successful case knowledge extraction: pattern mining uses deep clustering algorithm, combined with autoencoder and K-means clustering scheme to realize implicit knowledge mining; frequent pattern mining uses FP-Growth algorithm, builds FP-tree compression data structure to mine frequent itemsets; association rule mining based on confidence and lift; sequence pattern mining uses PrefixSpan algorithm to identify and build operation timing patterns; rule generalization uses inductive logic programming framework to learn general rules from specific instances; background knowledge is represented as first-order logic predicates, and the learning goal is set to minimize description length; rule simplification uses pruning algorithm to remove redundant conditions and rules with confidence lower than the set value; cross-validation evaluates rule generalization performance to prevent overfitting; best practice identification uses a multi-criteria evaluation system, evaluation indicators include construction efficiency, geometric quality and resource consumption; comprehensive score uses TOPSIS method; practice pattern extraction uses process mining technology to build Petri net model to represent the construction process; knowledge automatic reasoning uses description logic reasoning machine to support concept inclusion, instance checking and consistency checking; ontology evolution management uses version management and change propagation mechanism to ensure the consistency and integrity of the knowledge base;
[0230] A / B testing framework uses online controlled experiment design, random shuffling algorithm ensures statistical independence of user grouping; effect evaluation uses hypothesis testing, confidence interval calculation evaluates effect significance; multi-armed bandit algorithm is used for dynamic adjustment of traffic allocation, balancing exploration and utilization;
[0231] Version iteration management employs semantic version control; performance benchmarking uses a standard test set, including geometric accuracy, computational efficiency, and memory usage; regression testing ensures new version compatibility; a canary release strategy controls the impact of new versions, automatically rolling back when key metrics show anomalies; user feedback analysis uses natural language processing technology, with sentiment analysis identifying user satisfaction; topic modeling uses the LDA algorithm to extract feedback topics; feedback priority scoring uses the analytic hierarchy process, with weight allocation based on impact and urgency; crowdsourcing quality control uses a combination of majority voting and expert review; performance monitoring uses a distributed monitoring architecture, with metrics collected and stored in a time-series database; anomaly detection uses an LSTM neural network to predict normal patterns, triggering alarms when deviations exceed thresholds; root cause analysis uses causal reasoning and correlation analysis; adaptive optimization uses online gradient descent to update system parameters; and the learning rate uses an adaptive adjustment strategy.
[0232] S5. Based on the data obtained in steps S2 to S4, complete the parameter-driven CAD automatic modeling; specifically including the following steps:
[0233] Intelligent parameter configuration and fusion:
[0234] Based on the model parameters obtained in step S1 and the modeling rules generated in step S4, a parameter fusion engine is constructed.
[0235] Parameter mapping and completion: Based on semantic similarity calculation, automatic mapping is performed between input parameters and rule parameters; the formula for calculating semantic similarity is... ,in For parameters With parameters Semantic similarity score between them The input parameter is the feature vector. The feature vector is the parameter of the rule base; for missing parameters, based on the knowledge graph constructed in step S4, the graph reasoning algorithm is used to query the default value with the highest relevance to complete the missing parameters, or the set historical experience value is used to complete the missing parameters.
[0236] Conflict Detection and Resolution: A parameter constraint network is established, and a constraint propagation algorithm is used to detect logical conflicts between input parameters; when a conflict is detected, the parameter sensitivity index determined in step S4 is applied. Parameters with higher sensitivity indices are retained first, while parameters with lower sensitivity indices are adjusted to meet the constraints.
[0237] Adaptive modeling execution engine:
[0238] Dependency graph construction: Convert the modeling task into a directed acyclic graph, where nodes represent geometric operations and edges represent dependency relationships between operations; use topological sorting algorithm to determine the optimal linear execution sequence, ensure that parent features precede child features in construction; transactional modeling operations: introduce database transaction mechanism to manage the modeling process, treat each independent geometric feature construction as an atomic operation; create a snapshot of the current document state before executing Part.make or Boolean operations; if the operation fails, perform rollback operation to the nearest stable state, and trigger adaptive repair strategy; dynamic feature injection: after the base geometry is constructed, dynamically load the corresponding feature construction script according to the identified geometric shape pattern;
[0239] Geometry optimization and performance tuning:
[0240] Shape optimization: after the initial model is generated, call the NSGA-II multi-objective optimization algorithm; take minimizing volume and maximizing structural strength as objective functions, use geometric dimensions as design variables, and iterate; grid and precision control: adjust the model discretization precision according to the extracted curvature information; increase the grid in areas with sudden changes in curvature and decrease the grid in flat areas; set linear deflection and angular deflection parameters to ensure that the generated geometry meets the specified precision requirements; lightweight processing: use feature suppression technology to remove small features in non-critical areas to generate model variants suitable for different LOD levels;
[0241] Comprehensive model verification and quality assurance:
[0242] Geometric interference check: use hierarchical bounding box scheme to construct OBB tree, quickly detect self-intersection inside the entity and interference between assembly components; physical property verification: calculate the volume, centroid, and moment of inertia matrix of the model; verify whether the centroid position is within the preset allowable range; manufacturability analysis: based on the identified face features, perform machining process checking; check whether the minimum wall thickness meets the injection molding or casting requirements, check whether the depth-to-diameter ratio meets the drilling process restrictions, and check whether there are reverse clamping areas affecting demolding;
[0243] Complete CAD automatic modeling.
[0244] The following describes the method of the present application in combination with an embodiment:
[0245] (1) Based on parameter analysis, geometric construction and face recognition scheme, generate CAD model:
[0246] This embodiment aims to automatically generate a simplified model containing a cuboid (representing the roadway) and a cylinder (representing the ventilation duct) for CFD simulation analysis of roadway ventilation design. The specific parameters are set as follows: the roadway body is 60000mm long, 4000mm wide, and 3000mm high; the ventilation duct has a radius of 600mm, with its center located at (2000, 2000, 0) and a length of 50000mm. The key requirement is to semantically name different surfaces of the model for the simulation software to set boundary conditions.
[0247] The implementation process of this method begins with the automatic positioning of the CAD kernel. After the system starts, the environment detection module uses a multi-level search strategy to locate the installation path of the kernel such as FreeCAD. This strategy first attempts to quickly locate by querying the software uninstallation information in the Windows registry; if it fails, it searches the standard program installation directories such as Program Files and LocalAppData; finally, as a supplement, the system will traverse all disk drives to find portable installations. After the path is found, the system verifies its validity, ensuring that it contains the necessary module files, then adds it to the Python module search path, and initializes a CAD document object without an interface.
[0248] Next is the parameter-driven geometry construction phase. For the cuboid roadway body, the system calculates the coordinates of the four vertices of the rectangular base surface, such as (0, 0, 0) and (4000, 3000, 0), then creates straight lines, combines them into a closed wireframe, generates a plane, and finally stretches it along the positive Z-axis for 60000mm to generate a three-dimensional entity, which is named "Box_3x4x30m". Similarly, for the cylindrical ventilation duct, the system defines a circle based on the center position, radius, and normal direction, generates a circular plane, and then stretches it along the positive Z-axis for 50000mm to create a cylindrical entity and name it "Cylinder_R0.3_H20m".
[0249] Subsequently, the system enters the intelligent face recognition and semantic naming phase. The system traverses all the surfaces of the cuboid and cylindrical entities, automatically classifies them by analyzing their geometric characteristics (normal vector, centroid coordinates, and geometric type, etc.). For example, the Z-coordinate minimum plane of the cuboid is identified as the bottom surface (outlet), the Z-coordinate maximum plane is identified as the top surface (workingface), and the four faces with Z-component of the normal vector close to zero are identified as the side surfaces (wall). For the cylinder, its side surface is identified as the duct due to its cylindrical surface geometry, and the top surface with a higher Z-coordinate is identified as the inlet (inlet). All identified surfaces are created as independent feature objects and given corresponding semantic names.
[0250] Finally, the model exporting stage. The system will perform a global recalculation to ensure all geometry states and dependencies are synchronized, then export the cuboid, cylinder, and all named surface feature objects (outlet, workingface, wall, duct, inlet) together as a STEP format file (scene_with_names.stp). The process will automatically create an output directory named "models" and ensure that the exported STEP file retains all geometry, topology, and semantic naming information.
[0251] The implementation effect is good, and the entire modeling process is completed automatically, and the time consumption is shortened from minutes to seconds. The generated STEP file of about 50KB size can be directly imported into CFD software such as ANSYS Fluent or OpenFOAM, and the software can automatically identify the named surface, greatly simplifying the setting process of boundary conditions.
[0252] To meet the needs of parametric research, the embodiment constructs a batch modeling system that can generate 100 different size roadway models for CFD simulation analysis according to a CSV parameter table. The CSV table defines the number of each model, the length, width, and height of the roadway body, as well as the radius, center position, and height of the ventilation pipe.
[0253] The implementation process of batch modeling starts with the analysis and verification of the parameter table. The system reads the CSV file, identifies the header and loads the data. Then, each parameter record is strictly checked for legality, including verifying that all sizes are positive numbers, the pipe position is within the range of the roadway floor, the pipe height and radius are reasonable, and other geometric constraints. At the same time, the system also checks the consistency of units and performs automatic conversion, and verifies that the length-width ratio and other logical relationships are within the normal range. For abnormalities found in the verification, the system will take different strategies according to their severity: fatal errors (such as negative size) will cause the model to be skipped and an error log will be recorded; while warning-level problems (such as slight proportion abnormalities) will only record a warning and continue processing.
[0254] After verification, the system enters the loop batch execution stage. It will iterate through each row of the parameter table and create a separate CAD document for each model. In each loop, the system calls the corresponding geometry construction function according to the parameters of the current row, and performs the complete construction process from point, line, surface to body. After the model is built, the intelligent face recognition and naming module automatically classifies the surfaces and assigns semantic names such as outlet, inlet, etc. Finally, the model is exported in STEP format (such as M001.stp) to the specified directory, and the document resources are cleaned up after completion to release memory, ensuring the stability of long-time batch processing.
[0255] To ensure the robustness of the batch processing, the system integrates comprehensive monitoring and fault-tolerant mechanisms. Through exception capture, the failure of a single model construction (due to geometric degeneration caused by parameter problems or write failure caused by insufficient disk space) will not interrupt the entire batch processing flow. The system also supports breakpoint resuming, which records the completed model number in real time, allowing the task to resume from the breakpoint after an unexpected interruption. After the batch processing is completed, the system generates a detailed statistical report, including processing time, the number of successful and failed models, failure cause analysis, and average processing speed, providing comprehensive data support for the entire process.
[0256] The implementation of the system is effective, and the total time for batch generation of 100 models is about 5 minutes, which is a significant improvement in efficiency compared to manual modeling. All models are parameter accurate, free of human errors, and follow uniform modeling and naming standards. The generated STEP files can be directly used in the automated analysis process of CFD software.
[0257] In practical engineering applications, models often need to add complex features such as chamfers, fillets, and holes on the basis of the basic geometry. This implementation demonstrates how to extend the original method to support adding a 50mm radius fillet to the top edge of a cuboid.
[0258] The implementation of this method first follows the standard process to create the basic cuboid and cylinder. Then, it enters the newly added fillet feature addition step. The system identifies the target through a set of fine edge selection logic. It iterates through all the edges of the cuboid and accurately selects the four edges on the top of the cuboid along the horizontal direction by analyzing the centroid Z coordinate and direction vector of each edge.
[0259] After selecting the target edge, the system performs the fillet operation. It creates a fillet feature object that specifies the target edge list and a 50mm radius, and executes the operation. This replaces the original sharp edge with a smooth cylindrical surface, and the adjacent planes are also trimmed accordingly, finally generating a new entity with a fillet, which replaces the original cuboid.
[0260] Since the fillet operation changes the topological structure of the model, such as the top surface and side surface being divided by the newly generated fillet surface, the face recognition rules also need to be adjusted adaptively. The adjusted strategy can correctly handle these changes: for the top surface, the system selects all the plane patches with the largest centroid Z coordinate and merges them into a composite object called "workingface"; for the side surface, the system merges all the planes with Z component of the normal vector close to zero and excludes the fillet surface to form "wall"; at the same time, the system can also add recognition of the fillet surface itself, which can be selectively named by judging the geometric type of its partial cylindrical surface.
[0261] To support batch application, a column of "fillet radius" can be added in the parameter table. In the batch process, the system reads this parameter, and performs the fillet operation when its value is greater than zero, or skips it if the value is zero, thus flexibly supporting the generation of models with or without fillet using the same code.
[0262] This solution has good technical scalability and can also be applied to the addition of chamfer, hole (Boolean subtraction), boss (Boolean addition), array, draft angle, and other features. The implementation of each feature follows the standardized process of "parameter definition → target identification → feature operation → topology update → face identification rule adjustment". The implementation results show that the system successfully adds a smooth and defect-free 50mm fillet to the cuboid, the face identification algorithm correctly adapts to the new topology structure, all named faces remain correct, and the time consumption of each model is only increased by about 0.5 seconds when generating in batch.
[0263] (2) Based on topology analysis, geometric feature extraction, pattern recognition, and parameter relationship inference, reverse reconstruction of three-dimensional CAD models is performed:
[0264] This embodiment aims to handle a typical reverse engineering scenario: a building ventilation model STEP file (scene.stp) composed of a cuboid body and a cylindrical component, which has no parameter information and needs to be reconstructed into an editable parametric model.
[0265] The method implementation process starts with model loading and topology analysis. After the scanner is started, the scene.stp file is loaded using the Part.read() function after initializing the environment and locating the CAD kernel. The system parses the file to obtain a Shape object containing complete geometric and topological information, and further calls its Solids attribute to successfully decompose two independent entities (Solid), which are assigned identifiers of Entity 0 and Entity 1.
[0266] In the second step, the system performs detailed geometric feature extraction on each entity. For Entity 1 (cuboid), the system traverses all its vertices, edges, and faces. By extracting and de-duplicating (tolerance set to mm), 8 unique vertices are determined, and their coordinate ranges clearly reveal the dimensions of the model. By analyzing the geometric types of the edges, 12 edges of all straight types are confirmed, and their lengths and directions are calculated. Similarly, by analyzing the types of the faces, 6 faces of all planar types are confirmed, and the centroid, normal vector, and area of each face are extracted. These data collectively constitute the complete geometric description of Entity 1.
[0267] For entity 2 (cylinder), the focus of feature extraction is on the circular edges and the cylindrical surface. The system successfully detects two complete circular edges with a radius of 300mm at the bottom and the top, and extracts their center coordinates and normal vectors. Meanwhile, the system identifies a cylindrical side surface with a radius of 300mm and a height of 20000mm, as well as the upper and lower circular planes. These accurate geometric parameters lay the foundation for subsequent shape recognition.
[0268] All extracted geometric data is structured and serialized into JSON format. The JSON file is organized in a hierarchical structure, containing file meta information, the number of entities, and detailed geometric data for each entity, such as vertex coordinate arrays, circular edge parameters (radius, center, normal), etc. This highly readable format facilitates subsequent analysis and verification.
[0269] In the geometric pattern recognition phase, the system reads the JSON data and applies the rule base. For entity 0, its vertex count (8), edge count (12), and face count (6) completely match the cuboid recognition rule, so the system successfully identifies it and deduces its length, width, and height as 3000mm, 4000mm, and 30000mm, respectively, with the reference point at (0, 0, 0). For entity 1, the system verifies that it has two circular edges with equal radii and that the center line is parallel to the normal vector, successfully triggering the cylinder recognition rule. Further, the system deduces its radius as 300mm and its height (center distance) as 20000mm, with the reference point at (2000, 2000, 0).
[0270] Based on the deduced construction logic, the system enters the parametric model reconstruction phase. In a new CAD document, the system calls the makeBox(3000, 4000, 30000) function to reconstruct the cuboid and calls the makeCylinder(300,20000) function to move it to the correct position, thereby reconstructing the cylinder.
[0271] Finally, the system performs strict reconstruction accuracy verification. By comparing the key dimensions, volume, and topological structure (vertex, edge, and face counts, and Euler's formula V-E+F=2) of the reconstructed model and the original model, it confirms that the error is within the numerical precision range (<0.01%). Visually, the two models overlap completely, with a Hausdorff distance of less than mm. After verification, the reconstructed model is exported as a reconstructed_scene.stp file, and a detailed quality report is generated, recording the entire process from recognition results to accuracy evaluation.
[0272] The implementation results show that this method successfully extracts the geometric information from the STEP file without parameters, accurately identifies and reconstructs the parameterized cuboid and cylinder, and the whole process takes a short time, and the reconstructed model is completely consistent with the original model in geometry and topology.
[0273] To cope with a more complex reverse engineering challenge: analyze a STEP model of a mechanical part containing multiple features (complex_part.stp) and reconstruct its editable parameterized version. The part is based on a 100x80x50 mm cuboid with a 20 mm diameter through-hole in the center and a 5 mm radius fillet on the top four edges.
[0274] In the geometric feature extraction phase, the complexity of the model brings new challenges. Due to the presence of fillets, the original sharp vertices are replaced by curve endpoints, resulting in an increase in the number of vertices; the original straight edges are replaced by arc edges and transition curves. In face extraction, the system not only needs to handle the planes divided by fillets, but also needs to distinguish between two different causes of cylindrical surfaces: inward cylindrical surfaces representing holes and fillet part cylindrical surfaces representing features.
[0275] The system addresses these challenges through precise identification logic. For hole identification, the system detects complete cylindrical surfaces with normal vectors pointing inside the solid to confirm that it is a "negative feature". By analyzing the position and connection of the end face (circular edge), it determines that it is a through-hole and accurately deduces the diameter (20mm), height (50mm) and center position of the hole. This enables the system to deduce the "cuboid minus cylinder" Boolean difference operation.
[0276] For the identification of the fillet feature, the system focuses on detecting partial cylindrical surfaces with a parameter range of less than 360 degrees. By analyzing the tangential relationship between these fillet surfaces and adjacent planes, the system can locate the original edge where the fillet is located (i.e. the four edges on the top of the cuboid), and extract the fillet radius of 5mm from the surface geometry. This enables the system to deduce the "apply fillet on specific edge" feature operation.
[0277] By analyzing the geometric dependency of these features, the system successfully deduces the correct construction sequence: first create the base cuboid, then perform the Boolean difference operation to subtract the cylinder to form the hole, and finally apply the fillet operation on the top edge of the result.
[0278] In the step-by-step reconstruction process, the system strictly follows this sequence: use makeBox and makeCylinder to create the base geometry, perform the Boolean difference through the.cut() method, then filter the target edge through geometric conditions, and finally call the.makeFillet() method to apply the fillet, finally generating a final_shape that is highly consistent with the original model.
[0279] The reconstruction accuracy verification shows that the errors of base size, hole diameter, and fillet radius are all less than 0.1%, and the relative volume error is less than 0.5%, proving the accuracy of the method. However, the process also reveals some challenges, such as the identification of variable-radius fillets, the certainty problem of multiple possible construction sequences, and the handling of accumulated floating-point operation errors, which require more advanced algorithms and tolerance control to solve.
[0280] In summary, this implementation successfully reverse-engineers a complex model containing Boolean operations and fillet features, accurately identifies its constituent features, parameters, and construction sequence, and reconstructs its parametric model with high precision. This proves that the method is suitable for parts composed of standard geometric bodies and common feature operations, laying the foundation for more extensive reverse engineering applications.
[0281] Solve the management and utilization problem of large-scale CAD model assets: There are 1000 historical CAD model files, and it is necessary to establish a geometric parameter database through batch scanning to support fast retrieval, statistical analysis and parametric reconstruction.
[0282] To efficiently process a large number of files, the system designs a robust batch scanning architecture. This architecture first organizes the input (models_library / ) and output (json_database / , scan_logs / etc.) directories, then obtains the list of all.stp and.step files, and performs a standardized scanning process for each file, including file validity check, geometric topology scanning, data extraction and JSON generation, while capturing errors and updating progress throughout the process.
[0283] To significantly improve processing speed, the system uses multi-process-based parallel processing optimization. By dividing the file list into task subsets equal to the number of CPU cores and starting multiple independent scanning processes, processing efficiency is greatly improved. For example, on an 8-core CPU, the original serial processing time of about 16.7 minutes is shortened to about 2.1 minutes. At the same time, by limiting process memory, setting processing timeouts and using process pool management, the stability and resource utilization of the entire batch scanning process are ensured.
[0284] After scanning is complete, the system extracts key features for each model to establish database indexes. These index information is stored in a master index file (master_index.json), and each entry contains the model ID, geometric type label, size range, topology complexity (number of solids, vertices, edges, and faces), and a path to the detailed JSON data file. This design allows subsequent query operations to be quickly completed at the index level without loading complete geometric data.
[0285] Based on the established database, the system provides powerful statistical analysis and retrieval functions. For example, the distribution of various geometric shapes in the model library can be quickly calculated, or the distribution of specific sizes can be analyzed to find commonly used standard sizes. In terms of retrieval, users can quickly query based on size range and geometric type. More advanced functions include similar model retrieval based on feature vectors, which finds the most similar design in geometry by calculating the Euclidean distance or cosine similarity of geometric features.
[0286] The implementation effect shows that in an 8-core parallel environment, the system successfully scanned 98% (980) of the models in only 2.5 minutes, with the remaining 20 failures mainly due to file corruption or unsupported formats. The total size of the generated JSON database is about 150MB, while the index file is only 5MB. Based on this database, the retrieval speed reaches millisecond-level response, and statistical analysis reports can be quickly generated. This not only greatly improves the management efficiency of model assets, supports design reuse and standardization, but also provides a solid data foundation for subsequent parameterized reconstruction and intelligent design recommendation systems.
[0287] (3) Based on model analysis and feature learning, and the generation of parameterized modeling rules, modeling, optimization, and feedback evolution are carried out:
[0288] The system's core capabilities are demonstrated: learning the design intent and construction logic from a parameter-free reference CAD model, and using the learned knowledge to generate a series of size variants based on new parameter tables. The scenario is set to quickly produce 50 different specifications of variants based on the provided L-shaped bracket reference model (reference_bracket.stp).
[0289] The process begins with a deep analysis of the reference model. After loading the STEP file, the system performs a comprehensive geometric topology scan and identifies that the model is composed of an L-shaped body, four mounting holes, and edge chamfers. Through multi-level recognition logic, the system not only extracts basic geometric dimensions but also deduces deeper design rules. For example, it identifies that the four mounting holes are distributed in a four-corner symmetry, and their positions can be described by the parameterized expression "distance from edge", rather than fixed coordinates. Similarly, it also identifies that all exposed edges apply a uniform 2mm chamfer. Based on these analyses, the system deduces the optimal construction method, such as creating two cuboids first and then performing Boolean operations to form the L-shaped body.
[0290] In the parameterized relationship inference stage, the system converts the extracted geometric information into a set of interrelated parameter variables, such as L_base (bottom plate length), D_hole (hole diameter), M_edge (hole distance from edge), etc., and clearly defines their mathematical relationships.
[0291] These derived knowledge is finally solidified as a formalized modeling rule. This rule defines all the variable parameters and their reasonable ranges, a detailed sequence of geometric operations (create base plate → create vertical plate → Boolean union → create hole → apply chamfer), and constraints to ensure the validity of the model in a structured way. This piece of knowledge named "L-shaped bracket modeling rule" is saved in the rule base and indexed with tags such as "L-shaped structure", "with hole" for future retrieval.
[0292] Entering the batch modeling phase, the system reads the 50-row parameter table provided by the customer and maps its columns to the parameters defined in the rule (L_base). Before execution, the system performs a rigorous constraint verification on each set of parameters, automatically identifying and rejecting invalid data that may cause geometric failure.
[0293] For the 49 sets of parameters that pass the verification, the system starts a parallel modeling process and completes the generation of all variants in just 15 seconds (8-core CPU). During the construction of each model, the system strictly follows the operation sequence defined by the rule and automatically names the key surfaces intelligently. Finally, 49 STEP files with semantic information are successfully exported.
[0294] The quality verification stage confirms that all generated models meet high standards in geometric validity, dimensional compliance, and topological consistency through automated checks and manual sampling. The final delivery not only includes model files, but also parameter comparison tables, quality reports, and reusable modeling rule documents.
[0295] Reverse engineering challenges of highly complex assemblies. The scenario is to analyze a CAD model of a pump body (competitor_pump.stp) containing 12 independent entities, free-form surfaces, and array features, with the goal of understanding its design intent and generating a simplified and optimized parametric version.
[0296] The analysis process adopts a multi-level decomposition strategy. At the first level, the system groups the 12 entities by volume comparison, successfully identifying the largest main shell, the medium-sized mounting seat and flange, and the small-sized reinforcing rib. At the second level, the system focuses on the main shell and identifies its approximate cylindrical shape, complex internal cavity flow passage, and top inlet and side outlet through geometric scanning. At the third level, the system successfully identifies the 8 bolt holes on the flange surface as a circumferential array feature and detects multiple decorative fillets with a radius of 3-8 mm. At the fourth level, the system performs parameter relationship inference and discovers deep-level design constraints such as "outlet diameter = inlet diameter x 0.75" and "bolt hole distribution circle diameter = main body diameter - 20 mm".
[0297] Based on the comprehensive analysis, the system enters the strategy simplification and rule generation phase. To reduce manufacturing cost and optimize design, the system decides to retain core functional features while simplifying or removing internal complex flow channels and non-essential decorative features. These decisions are integrated to generate a parameterized rule named "Pump Body Simplified Model". This rule defines the main parameters such as body diameter, inlet diameter, number of bolt holes, and their derived relationships, and plans a clear construction sequence: create body -> open holes -> add flanges -> array bolt holes -> apply fillets.
[0298] Next, the system enters the parameter optimization and variant generation phase. The goal is to reduce weight by 10% while keeping strength and interface size unchanged. Through parameter sensitivity analysis, the system finds that the body wall thickness has the greatest impact on weight, followed by the flange thickness, and the fillet radius has the least impact. Based on this, the system proposes an optimization scheme: reduce the body wall thickness from 10mm to 8.5mm, reduce the flange thickness from 20mm to 18mm, and reduce some fillet radii. Through integration with finite element analysis software, the system verifies the strength of the optimized design, and the results show that the maximum stress is still within the allowable range, meeting the performance requirements.
[0299] Finally, based on the optimized parameterized model, the system can quickly generate a product family, including small, standard, and large-sized pump bodies, with a shorter total time. Comparative analysis shows that the optimized model reduces weight from 5.2kg to 4.4kg, reducing estimated manufacturing cost, while retaining all core functions and improving machinability.
[0300] This implementation successfully transforms a complex, static assembly model into a lightweight, manufacturable, and fully parameterized design template through multi-level decomposition, intelligent deduction, and strategy simplification, fully demonstrating the system's reverse engineering and innovative design capabilities in the high-end manufacturing field.
[0301] Convert a large number of historical CAD models into reusable knowledge assets. The scenario is to establish an intelligent recommendation system that can automatically recommend similar designs and provide modeling rules from 5000 historical models when the designer inputs the initial parameters of a new product.
[0302] The first step of system construction is the batch scanning and knowledge extraction of the model library. With the parallel processing capability of a 16-core server, the system completes the comprehensive analysis of all 5000 models in about 15 minutes. For each model, the system not only performs geometric topology scanning, but also basic geometry recognition, feature operation recognition, and parameter relationship inference, finally generating a 100-dimensional geometric feature vector for each model. This vector contains rich information such as size ratio, geometric type distribution, feature number, topology complexity, and symmetry. At the same time, the system also labels the model with industry, product type, and other semantic tags, and attempts to generate its parameterized construction rules, finally successfully extracting about 3000 rules.
[0303] These extracted knowledge is efficiently organized in the knowledge base. An index database stores the mapping relationship of model ID to its feature vector, semantic label, and rule, while a vector retrieval index based on FAISS or Annoy library is specially used to support millisecond-level fast approximate nearest neighbor search of high-dimensional feature vectors.
[0304] Based on this knowledge base, the system has built a powerful intelligent recommendation engine. This engine uses a hybrid recommendation algorithm. When the user inputs the preliminary parameters of the new product (size, hole number, keywords, etc.), the system will simultaneously perform two recommendation strategies. The first is similarity-based recommendation, which converts the user input into a query feature vector and quickly retrieves the most similar Top-K historical models in the vector database. The second is rule-based recommendation, which directly retrieves matching modeling rules in the rule base according to the user's design constraints. The results of the two strategies are comprehensively sorted, and designs that are geometrically similar, semantically matched, and have complete parameterized rules are preferentially recommended.
[0305] In a practical application case, when the designer inputs the requirement of "base plate about 250 180mm, 6 holes, L-shaped support", the system returns 5 recommendations within 1 second. The first ranked is an L-shaped support in a historical project, whose size (240 170mm, 6 holes) is highly matched with the requirement and is accompanied by complete parameterized rules. The designer adopts this recommendation and only needs to fine-tune a few parameters to quickly generate a new model that meets the requirements, greatly shortening the design time.
[0306] More importantly, the system has the ability of continuous learning. The "excellent designs" adopted and generated by the user are fed back to the model library, enriching its data and knowledge. The frequency of rule usage and user feedback dynamically adjusts its weight in future recommendations. Through regular scanning and retraining of new models, the system can continuously evolve and improve the accuracy of recommendations.
[0307] This embodiment successfully activates a static and huge historical model library as a dynamic and intelligent design knowledge engine, greatly improving the design reuse rate, efficiency and quality.
[0308] The method of the application realizes integrated processing of parameterized forward modeling, geometric reverse reconstruction and intelligent learning optimization; the three technical fields of parameterized modeling, reverse engineering and machine learning are organically integrated to form a complete intelligent modeling technology system, solving the problem of fragmented functions and low intelligence of traditional CAD systems. The method of the application designs a hybrid intelligent recognition mechanism combining rule base matching and machine learning recognition, and develops a deduction architecture: basic geometry recognition→ feature operation recognition→ construction sequence deduction→ parameter relationship inference, automatically extracts deep modeling rules from multiple reference models through weight distribution, confidence evaluation and conflict resolution, breaks through the limitations of single recognition method and the constraints of experience-based modeling, and realizes automatic extraction and abstraction of modeling knowledge. The method of the application designs a parameterized reverse reconstruction algorithm based on topological analysis and construction sequence deduction, combines multi-level constraint solving strategies such as hierarchical solving, iterative optimization and conflict detection, realizes intelligent conversion of static geometric models to dynamic parameterized models and efficient processing of complex constraint systems, and solves the technical bottleneck of traditional reverse engineering that can only generate static models and low constraint solving efficiency.
[0309] As Figure 2 The system for implementing the parameter-driven CAD automatic modeling method comprises a data acquisition module, a model generation module, a reverse reconstruction module, a rule generation module and an automatic modeling module; the data acquisition module, the model generation module, the reverse reconstruction module, the rule generation module and the automatic modeling module are sequentially connected; the data acquisition module is used for acquiring model parameter information to be modeled and uploading data information to the model generation module; the model generation module is used for generating a CAD model based on parameter analysis, geometric construction and surface recognition scheme according to the received data information and the acquired data information, and uploading data information to the reverse reconstruction module; the reverse reconstruction module is used for performing reverse reconstruction of a three-dimensional CAD model based on topological analysis, geometric feature extraction, pattern recognition and parameter relationship inference according to the received data information and the acquired data information, and uploading data information to the rule generation module; the rule generation module is used for performing modeling, optimization and feedback evolution based on model analysis, feature learning and parameterized modeling rule generation according to the received data information and the acquired data information, and uploading data information to the automatic modeling module; and the automatic modeling module is used for completing parameter-driven CAD automatic modeling according to the received data information and the acquired data information.
Claims
1. A parameter-driven CAD automatic modeling method, characterized in that Comprise the following steps: S1. Obtain the model parameter information that needs to be modeled; S2. According to the data information obtained in step S1, based on parameter analysis, geometric construction and face recognition scheme, CAD model generation is carried out; S3. According to the data information obtained in step S1, based on topological analysis, geometric feature extraction, pattern recognition and parameter relationship inference, three-dimensional CAD model reverse reconstruction is carried out; S4. According to the data information obtained in step S1, based on model analysis and feature learning and parameterized modeling rule generation, modeling, optimization and feedback evolution are carried out; S5. According to the data information obtained in steps S2-S4, the parameter-driven CAD automatic modeling is completed; Specifically, it includes the following steps: Intelligent parameter configuration and fusion: Based on the model parameters obtained in step S1 and the modeling rules generated in step S4, a parameter fusion engine is constructed; Parameter mapping and completion: based on semantic similarity calculation, automatic mapping of input parameters and rule parameters is carried out; The formula for calculating semantic similarity is wherein is a parameter and the semantic similarity score between parameters , is an input parameter feature vector, is a rule base parameter feature vector; For missing parameters, based on the knowledge graph constructed in step S4, the highest correlation default value is queried by using graph reasoning algorithm for completion, or the set historical experience value is used for completion; Conflict Detection and Resolution: A parameter constraint network is established, and a constraint propagation algorithm is used to detect logical conflicts between input parameters; when a conflict is detected, the parameter sensitivity index determined in step S4 is applied. Parameters with higher sensitivity indices are retained first, while parameters with lower sensitivity indices are adjusted to meet the constraints. Adaptive modeling execution engine: Construct dependency graph: convert the modeling task into a directed acyclic graph, where the node represents the geometric operation, and the edge represents the dependency relationship between the operations; Adopt topological sorting algorithm to determine the optimal linear execution sequence, ensure that the parent feature is constructed before the child feature; Transactional modeling operation: introduce database transaction mechanism to manage the modeling process, and regard each independent geometric feature construction as an atomic operation; Before executing Part.make or Boolean operation, create a snapshot of the current document state; If the operation fails, execute rollback operation to the nearest stable state, and trigger adaptive repair strategy; Dynamic feature injection: after the basic geometric body is constructed, the corresponding feature construction script is dynamically loaded according to the identified geometric shape mode; Geometric optimization and performance tuning: Shape optimization: after the initial model is generated, the NSGA-II multi-objective optimization algorithm is called; the objective function is to minimize the volume and maximize the structural strength , with geometric dimensions as design variables, and iteration is performed; mesh and precision control: according to the extracted curvature information, the model discretization precision is adjusted; the grid is densified in the curvature mutation area and is sparsified in the flat area; Set linear deflection and angular deflection parameters to ensure that the generated geometric body meets the set accuracy requirements; Lightweight processing: use feature suppression technology to remove small features in non-critical areas to generate model variants suitable for different LOD levels; All-round model verification and quality assurance: Geometric interference check: adopt hierarchical bounding box scheme to construct OBB tree, quickly detect self-intersection in entity and interference between assembly components; Physical property verification: calculate the volume, centroid and moment of inertia matrix of the model; Verify whether the centroid position is within the preset allowable range; Manufacturability analysis: based on the identified face features, carry out machining process checking; Check whether the minimum wall thickness meets the injection molding or casting requirements, check whether the depth-diameter ratio meets the drilling process limit, and check whether there is a reverse clamping area affecting demolding; Complete CAD automatic modeling.
2. The parameter-driven CAD automatic modeling method according to claim 1, wherein The step S2 comprises the following steps: Based on the progressive search strategy, determine the installation position of the CAD kernel, and initialize the CAD kernel; Based on the parameterized geometric construction scheme, the construction of basic geometric body and feature geometric body is carried out; Geometric topology analysis is performed, all faces of the three-dimensional entity are traversed, geometric feature extraction is performed on each face, and face recognition and naming are performed according to the extracted data; All three-dimensional entity feature objects and all named face feature objects are exported to realize model export and persistence; Parameter table data is read from an external data source, and modeling is performed to complete the generation of the corresponding CAD model.
3. The parameter-driven CAD automatic modeling method according to claim 2, wherein The step S2 specifically comprises the following steps: CAD kernel determination and initialization: An incremental strategy is adopted to determine the installation path of the CAD kernel: firstly, a Windows registry query method is adopted to search for installation records containing the "CAD" keyword in the Uninstall keys of HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER; if the registry query fails, a search is performed in the set standard program directory, and the standard program directory includes the Program Files, Program Files (x86) and LocalAppData folders; if the standard program directory query still fails, a full symbol traversal search is performed to locate the CAD kernel; After locating the CAD kernel, the path validity is verified to ensure that the bin subdirectory exists and contains the necessary CAD kernel modules, and then the verified path is added to the search path; The CAD geometric kernel module is imported, and a non-interface document object is created to complete the initialization process; Construction of basic geometric bodies and feature geometric bodies: Define the basic geometric body size, including length, width and height; Define the feature geometric body parameters, including the circular radius, position coordinates and stretching height; Basic geometric body construction: according to the input basic geometric body size, the key control point coordinates are calculated; the space position is represented by a homogeneous coordinate system to ensure the consistency of the transformation operation; the hierarchical logic of "point-line-face-body" is followed to create a geometric topology: a control vertex set is created, an edge set connecting the vertices is generated, the edge set is combined into a closed wire frame to form a face boundary, and a geometric face is generated from the face boundary; define the stretching transformation matrix, and expand the two-dimensional face to a three-dimensional entity through the vector stretching operation, and the stretching direction is determined by the unit normal vector and the stretching distance; the generated geometric entity is encapsulated as a CAD feature object, and the parameter and geometric association relationship is established; Feature geometric body construction: extract the key parameters of the feature geometric body, including the center point coordinates, radius, normal vector, position constraint, direction constraint, size constraint, connection relationship and dependency relationship; establish a parameter constraint equation set, and solve the parameter solution that satisfies all constraint conditions by using a numerical iteration method to ensure the reasonableness and consistency of the geometry; create a basic geometric curve according to the solved parameters, form a closed contour through basic geometric curve splicing, apply a surface generation algorithm to construct a geometric surface, and perform an entity operation to generate a three-dimensional feature geometry; adopt an object-oriented encapsulation strategy to encapsulate each geometric feature into an independent parameterized object, and establish a dependency relationship diagram among the features; Face recognition and naming: Traverse all faces of the three-dimensional entity, and perform geometric feature extraction on each face: calculate the parameter range of the face, calculate the normal vector at the parameterization center point of the face, and obtain the centroid coordinates of the face; identify the geometric type of the face, including plane, cylindrical surface and spherical surface; Calculate the geometric properties of each face, including the geometric type, geometric parameters and topological relationship; establish a multi-dimensional decision rule for face classification, using a hierarchical decision tree structure: the first layer is based on geometric type for rough classification, the second layer is based on spatial position for fine classification, and the third layer is based on functional semantics for final classification; For Position classification, calculate the relative position of the face centroid in the coordinate system, and determine the spatial orientation of the face by comparing the coordinates; for direction classification, calculate the angle between the face normal vector and the coordinate axis, and determine the directional feature of the face by angle threshold; for functional classification, identify the functional attributes of the face by combining geometric context and engineering semantics; ensure the correctness of the classification results through topological consistency check and geometric rationality verification; Create an independent feature object for each identified face; use semantic naming to identify the functional attributes of the face, and add the named face feature object to the export object list; establish a multi-level geometric feature description system to extract the complete geometric information of the face; use an adaptive numerical error processing mechanism to set the relative error threshold and the absolute error threshold in combination to handle the rounding error in floating point operation and improve the robustness of geometric judgment; implement a hierarchical face organization strategy to analyze and aggregate the connectivity of the faces through graph theory algorithms; use XML or JSON format to define the classification rules; Model export and persistence: Execute the recompute() method of the document to update the dependency relationships and geometric states of all feature objects, ensuring the consistency of the model data; build an export object list containing all three-dimensional entity feature objects and all named face feature objects; create a standardized directory structure using an operating system-independent path processing method, check the existence of the directory and automatically create it if it does not exist; use a standardized CAD exchange format to export all objects using the Part.export() method to generate a model file containing semantic information; CAD model generation: Read the parameter table from an external data source, and the table structure includes model ID, length, width, height, cylindrical radius, cylindrical position X, cylindrical position Y, and cylindrical height; use a loop structure to traverse each row of the table and extract the parameters; use a loop traversal mechanism to process each row of parameters in the table in turn, each iteration including parameter extraction, geometry creation, face naming, and model export; use an independent document object to manage each model to avoid interference between different models; after iteration, clean up the document resources to release memory and ensure the stability of batch processing; Before generating the CAD model, perform legality verification on the parameters, including numerical range check, geometric constraint check and unit consistency check; invalid parameter processing strategy, including recording detailed error logs, skipping the model or using default values according to configuration selection, providing warning level setting to distinguish between fatal errors and tolerable deviations; Finally, the CAD model is completed.
4. The parameter-driven CAD automatic modeling method according to claim 3, wherein The step S3 comprises the following steps. According to the determined installation position of the CAD kernel, the CAD kernel is initialized; Model data is imported, and topological hierarchy is parsed to realize topological parsing; According to the result of topological parsing, the geometric information of vertices, edges and faces is extracted, and the analysis of geometric constraint relationship is carried out to realize feature extraction; The data model is designed, and the data is structured and stored persistently; Through the analysis of the extracted geometric parameters, the construction process of the original model is inferred, and the geometric shape mode is recognized by using the rule base matching mode; According to the obtained data information, the parameter relationship is inferred to realize the reverse reconstruction of the three-dimensional CAD model.
5. The parameter-driven CAD automatic modeling method according to claim 4, wherein The step S3 comprises the following steps. Initialization of the CAD kernel: According to the determined installation position of the CAD kernel, the necessary geometric modeling module and topological analysis module are imported, and the unbounded document object is initialized to prepare the environment for subsequent reconstruction operation; Topological parsing: The model data is loaded into the memory by using the file reading interface of the CAD kernel, the file integrity and format correctness are verified, the topological hierarchy of the model is parsed, starting from the topmost composite or assembly, and then layer by layer decomposed to the independent three-dimensional entity of the entity layer, the closed or open shell of the shell layer, the shell surface of the surface layer, the boundary line of the surface of the edge layer and the end point of the edge of the vertex layer, the number of entities contained in the model is identified, and the multi-entity model is separated; Feature extraction: All vertices of each entity are traversed, and the three-dimensional space coordinates of each vertex are extracted, and the coordinate de-duplication processing is performed; The KD tree data structure is used to judge the vertex coincidence by setting the threshold, the vertex coordinates are sorted, and the number of vertices is counted as the preliminary index of geometric complexity; Extracting geometric information of edges: traversing all edges of the entity, identifying geometric type and extracting parameters for each edge; for straight edges, the identification condition is that the curve type of the edge is straight, and the extracted parameters include the start point coordinates, the end point coordinates, the direction vector and the length; for circular arc edges, the identification condition is that the curve type of the edge is a circle but the parameter range does not include a complete , and the extracted parameters include the center coordinates, the radius, the normal vector, the start angle, the end angle and the arc length; for complete circular edges, the identification condition is that the curve type of the edge is a circle and the parameter range is complete , and the extracted parameters include the center coordinates, the radius, the normal vector and the circumference length; for ellipses, the center coordinates, the major axis, the minor axis and the normal vector are extracted; for spline curves, the control point coordinates, the node vector and the order are extracted; for Bezier curves, the control point sequence coordinates are extracted; The geometric information of the face is extracted: all faces of the entity are traversed, the geometric type of each face is identified, and the parameter is extracted; for a plane, the identification condition is that the surface type of the face is a plane, and the extracted parameters include the reference point, the normal vector, the area and the boundary contour; for a cylindrical surface, the identification condition is that the surface type of the face is a cylinder, and the extracted parameters include the axis position, the axis direction, the radius, the height and the area; for a conical surface, the identification condition is that the surface type of the face is a cone, and the extracted parameters include the vertex, the axis direction, the half vertex angle and the base radius; for a spherical surface, the identification condition is that the surface type of the face is a sphere, and the extracted parameters include the spherical center coordinates, the radius and the coverage angle; for a torus, the identification condition is that the surface type of the face is a torus, and the extracted parameters include the center coordinates, the major radius, the minor radius and the normal vector; for a NURBS surface, the control point grid coordinates, the node vector and the order are extracted; for a Bezier surface, the control point array coordinates are extracted; Analysis of spatial relationships between geometric elements, including parallel relationship identification, vertical relationship identification, concentric relationship identification, symmetry relationship identification and tangent relationship identification; extraction of dimensional constraints, including geometric dimension parameters and relative position relationships between geometric elements; During the analysis: according to the type identifier of the geometric object, call the corresponding parameter extraction function to extract and analyze the data; Use principal component analysis to calculate the principal axis direction of the geometric object, and identify the symmetry through eigenvalue decomposition; Use Fourier transform to detect periodic features, and identify array patterns and repeated structures through frequency domain analysis; Use tree structure to represent the inclusion relationship of geometric features, use adjacency list to record the topological connection relationship, and establish spatial index; Use Kahan summation algorithm to handle cumulative error; Structured and persistent storage of data: Use hierarchical data organization structure as data model, starting from the top model data, containing file meta information, entity number and entity list; Each entity contains entity ID, vertex data, edge data and face data; Convert the extracted geometric data into JSON format for storage and exchange; The design principles of JSON structure include using nested objects to represent hierarchical relationships, using arrays to represent collections of similar elements, and using key-value pairs to store geometric parameters; Add verification information and metadata to each geometric element; Verification information includes element count, topological consistency verification and geometric validity verification; Metadata includes extraction timestamp, CAD kernel version information and data format version number; Create a standardized output directory structure, with file naming specifications based on the original model file name to generate JSON file names and add timestamps or version numbers; Generate corresponding JSON files for each input model and establish index files to record all generated data files; Inference of the original model construction process and geometric shape pattern recognition: Infer the construction process of the original model by analyzing the extracted geometric parameters; Use rule base matching to identify the set geometric shape patterns: Cuboid recognition rules include: vertex count equal to 8, edge count equal to 12 and all edges are straight lines, face count equal to 6 and all faces are planes, circular edge count equal to 0; Geometric verification includes: there are three sets of parallel pairs and three sets of parallel plane pairs, all face normal vectors are mutually orthogonal or parallel, and adjacent face intersection lines are mutually perpendicular; Parameter derivation: extract the minimum and maximum values of X, Y and Z coordinates from the vertex coordinates to calculate length, width and height and determine the reference point; Construction method deduction includes: create a rectangular base at the reference point, stretch the height value along the Z axis positive direction or directly use the makeBox function to pass in length, width, height and reference point parameters; Cylinder recognition rules include: at least one cylindrical surface exists, two or more circular edges exist, the radii of the circular edges are equal and the normal vectors are parallel; geometric verification includes: the line connecting the centers of the two circular edges is parallel to the normal vector, the axis of the cylindrical surface is consistent with the normal vector of the circular edge, the radius of the cylindrical surface is consistent with the radius of the circular edge; parameter derivation: extract the radius from the circular edge, extract the coordinates of the centers of the two circles, calculate the distance between the centers as the height of the cylinder, determine the direction of the axis and the reference point; construction method deduction includes: create a circular base at the reference point, stretch the height value along the axis direction or directly use the makeCylinder function to pass in the radius, height, reference point and direction parameters; Cone recognition rules include: one conical surface exists, one circular edge and one vertex exist; geometric verification includes: the vertex of the conical surface coincides with the independent vertex, the axis of the conical surface passes through the center of the circular edge, the half-apex angle of the conical surface is consistent with the geometric dimension; parameter derivation: extract the radius and center of the base circle, extract the vertex coordinates, calculate the height and axis direction; construction method deduction includes: create a circle at the center of the base, perform conical stretching towards the vertex direction or use the makeCone function; Sphere recognition rules include: all faces are spherical or there is one complete spherical surface, all spherical surfaces share the same sphere center; parameter derivation: extract the sphere center coordinates and radius; construction method deduction: use the makeSphere function to pass in the sphere center and radius; Torus recognition rules include: torus surface exists; parameter derivation: extract the torus center coordinates, major radius and minor radius, direction vector; construction method deduction: use the makeTorus function; Composite geometry identification: Based on topological separation analysis, the minimum distance between entities is calculated; entities with a minimum distance greater than a set value are identified as independent entities; a connected component analysis algorithm is used to identify non-intersecting geometries; an entity adjacency matrix A is established, where the element in the i-th row and j-th column of A... The rule for determining the value is: if entity i and entity j intersect, then... If entity i and entity j do not intersect, then Identify independent geometric groups using graph theory-based connected component algorithms; Identify concave features using normal vector direction analysis: for cylindrical surfaces, calculate radial vectors For , is a point on the surface, is the center of the circle; when indicates that the normal vector points to the inside, is the plane normal vector; for a plane, calculate the sign of the point-to-plane distance and determine the inside and outside; the depth of the concave is represented as , where is the concave boundary point, is the plane normal vector, is the plane constant; hole recognition uses topological loop detection, and the topological genus of the geometric body is calculated by the Euler number; based on curvature continuity analysis, discrete curvature calculation is used to detect curvature abruptness points; surface continuity determination is achieved through hierarchical inspection of G0 continuity, G1 continuity and G2 continuity; record the geometric feature mode of the set typical Boolean operation combination, and use pattern matching algorithm to automatically identify the construction history of the composite geometric body; Round corner recognition rules include: the round corner recognition feature is that there is a partial cylindrical surface or a torus connecting two planes or curved surfaces, the round corner surface is tangent to the adjacent surface; parameter derivation: extract the round corner radius to identify the edge where the round corner is located; construction method deduction: apply the round corner operation on the specific edge of the base geometric body; Chamfer recognition rules include: an inclined surface appears at the original sharp edge position, the inclined surface forms a fixed angle with the adjacent surface; parameter derivation includes: extract the chamfer distance or angle, identify the edge where the chamfer is located; construction method deduction: apply the chamfer operation on the specific edge of the base geometric body; Draft recognition rules include: the surface has a taper that is not completely parallel; parameter derivation includes: extract the draft angle; construction method deduction: apply the draft operation on the surface; Construction sequence deduction determines the creation order of geometric features: base geometry priority principle: identify and reconstruct the base geometric body first, identify the dependency relationship between features based on dependency analysis, topologically sort the construction steps according to the dependency relationship, and select the most concise construction path; typical construction sequence includes: creating a base geometric body, creating an additional geometric body, performing Boolean operations, applying feature operations, and applying transformation operations; the entire process uses a rule library architecture, each geometric shape corresponds to a set of recognition rules and reconstruction methods, rule matching uses a priority mechanism, and geometric errors in actual models are handled using fuzzy matching and tolerance settings; a confidence score mechanism is established to evaluate the reliability of the recognition results; Parameter relationship inference and model reverse reconstruction: Create a new CAD document object to hold the reconstructed geometry; initialize the geometry builder and feature manager, load the saved JSON geometry data file; perform geometry reconstruction operations based on the identified shape types and deduced construction methods; Cube reconstruction flow: read cube parameters from JSON data, call CAD kernel makeBox function or perform creating four vertices of a rectangular base, connecting vertices to form four edges, combining edges into a closed wireframe, generating a plane from the wireframe, defining a stretch vector, performing stretch operation to generate a cube solid; apply position transformation: move the reconstructed geometry to the correct position, create a feature object and add it to the document; cylinder reconstruction flow: read cylinder parameters from JSON data, call makeCylinder function or perform creating a circle at the reference point, defining a stretch vector, performing stretch operation to generate a cylinder solid, if the axis direction is not Z-axis, calculate and apply a rotation transformation, including calculating the rotation matrix of Z-axis to the target axis and applying the rotation transformation to the geometry, create a feature object and add it to the document; other geometry reconstruction includes: cone using makeCone function passing in the base radius, top radius, height; sphere using makeSphere function passing in the sphere center and radius; torus using makeTorus function passing in the major and minor radii; Composite geometry reconstruction: for geometries combined through Boolean operations, use Boolean AND operation, reconstruct each independent geometry, use fuse function to perform AND operation; Boolean difference operation reconstruction: reconstruct the main geometry and the subtracted geometry, use cut function to perform difference operation; Boolean intersection operation reconstruction: reconstruct two intersecting geometries, use common function to perform intersection operation; feature operation reconstruction includes: fillet feature reconstruction, read fillet parameters from JSON data, identify corresponding edges on the reconstructed base geometry, including feature matching based on edge position and direction and using spatial coordinate tolerance matching, call makeFillet function passing in edge list and fillet radius, replace the original geometry with the filleted geometry; chamfer feature reconstruction, read chamfer parameters, identify target edges, call makeChamfer function; Reconstruction accuracy control and verification: includes geometry accuracy verification, compare the dimensions of the reconstructed model and the original model, calculate the relative error and absolute error, set the acceptable error threshold; topological consistency verification: verify the number of vertices, edges, and faces consistent with the original model, verify Euler's formula, check the closure of the geometry; visual comparison verification: generate three-dimensional views of the original model and the reconstructed model, use different colors to superimpose display of the two models, calculate the Hausdorff distance between the models; use parameterized reconstruction to maintain the editability and accuracy of the model, maintain geometric constraint relationships during reconstruction, use numerical optimization methods to adjust parameters to minimize reconstruction error; for complex surfaces, choose NURBS reconstruction or approximate fitting, record the reconstruction process log when reconstruction fails; The system recalculates the document, updates the state of all geometric bodies, and constructs an export object list; the export object list includes all reconstructed entities; the export is in the STEP standard format and is saved to a specified directory; a quality report is generated: a reconstruction quality report is generated, including original model information, identification results, reconstruction parameters, precision evaluation, reconstruction time consumption statistics, success rate, and failure items, the report is saved in a structured format, and a visual comparison chart is generated; batch reconstruction management: including traversing the model folder, performing scanning and reconstruction on each model, automatically matching scanning data and reconstruction tasks, processing several reconstruction tasks in parallel to improve efficiency, establishing a reconstruction task queue and progress tracking, and generating a summary report of the reconstruction.
6. The parameter-driven CAD automatic modeling method according to claim 5, wherein The step S4 comprises the following steps: Based on the multi-level analysis deduction model, the relationship between parameters is identified, and the reusable modeling knowledge is extracted from the identified parameter relationship, so as to extract the reusable modeling knowledge; The obtained result is converted into a formal modeling rule, so as to complete the generation of the parameterized modeling rule; Based on the similarity calculation scheme, intelligent rule recommendation analysis is carried out, and corresponding modeling rules are obtained; A hierarchical progressive decomposition strategy is adopted to carry out result backstepping and optimization of the complex model; The modeling quality is evaluated to realize knowledge feedback and evolution.
7. The parameter-driven CAD automatic modeling method according to claim 6, wherein The step S4 comprises the following steps: Identification of the relationship between parameters and extraction of reusable modeling knowledge: The reference model is analyzed, and the complete topological structure including entities, faces, edges and vertices is extracted; the types and parameters of all geometric elements are identified, the geometric constraint relationship is analyzed, and the feature operation trace is detected; A correlation atlas of geometric elements is established, wherein the nodes are various geometric elements, the edges are the topological relationship between elements, and the attributes include geometric parameters, constraint relationship and feature type; A multi-level analysis and deduction model is constructed to identify the relationship between parameters: the first layer of the model adopts a multi-dimensional feature matching algorithm to establish a geometric feature vector For , is the number of vertices, is the number of edges, is the number of faces, is the Euler number, is the area, is the surface area; a support vector machine classifier is used for geometric body type identification, a radial basis function is used as the kernel function, and a softmax function is used for confidence evaluation; the second layer of the model adopts a convolutional neural network of deep learning for feature pattern recognition, the network structure includes a 3D convolutional layer, a pooling layer and a fully connected layer; an additive feature is identified by volume increment, a subtractive feature and a concave feature are identified by detecting volume reduction; a graph neural network is used to model the feature dependency relationship, in which the nodes represent geometric features and the edges represent dependency relationships; the third layer of the model adopts a topological sorting algorithm to determine the construction sequence; a deep-first search algorithm is used for circular dependency detection, and a constraint relaxation strategy is used when a loop is found; The fourth layer of the model adopts regression analysis to identify the relationship between parameters, the least square method is used to fit the linear relationship, and the polynomial regression or neural network is used to fit the nonlinear relationship; the constraint equation set is solved by using the Lagrange multiplier method or the interior point method optimization algorithm; Reusable modeling knowledge is extracted from the deduction result: a clustering algorithm is used to identify similar geometric structures, a K-means clustering algorithm is used to group geometric feature vectors, so as to realize the extraction of geometric templates; Principal component analysis is used for dimension reduction, and the principal components with a set variance are reserved as variable parameters; a parameterized graph syntax is used for template representation; A correlation rule mining algorithm is used to learn the design rule, a strong correlation design pattern is identified based on support and confidence, a decision tree algorithm is used to learn the design rule; a regression analysis is used to establish a parameter relationship model, and a significance test is performed by using t-test; A reinforcement learning framework is used to model the modeling process as a Markov decision process, the state space S represents the current geometric state, the action space A represents the executable modeling operation, the reward function R is used to evaluate the operation quality, and the Q-learning algorithm is used to learn the optimal strategy; a knowledge graph is constructed by using RDF triplets <subject, predicate, object> to represent knowledge relationships, and a graph database is used to store and query knowledge; Generation of parameterized modeling rules: The derived construction logic is converted into formalized modeling rules. The modeling rules use a structured representation, including rule ID, rule name, applicable conditions, geometric operation sequence, constraint equations, and verification rules. In the geometric operation sequence, each operation defines the type, parameter expression, and dependency relationship. The parameter expression uses variable names instead of specific numerical values and defines the calculation relationship between parameters, while supporting conditional expressions. The dependency relationship is represented using a graph structure, where nodes represent geometric operations or features, directed edges represent dependency relationships, and weights represent dependency strength or priority. The rule library management uses a classified storage method, which is divided into cuboid, cylinder, and composite classes according to geometric types, and is divided into architecture, machinery, and electronics according to industry fields, and is divided into simple, medium, and complex according to complexity. Key feature indexing and parameter range indexing are established to achieve retrieval and matching. Version management records the creation time and source of the rules, tracks the modification history of the rules, and supports A / B testing and optimization iteration of the rules. Rule verification and optimization include correctness verification, robustness testing, and rule simplification and generalization. Correctness verification uses the original model as a test case, applies the extracted rules to reconstruct the model, compares the reconstructed results with the original model, and evaluates the accuracy of the rules. Robustness testing uses different parameter values to test the rules, verifies the boundary conditions, detects parameter combinations that may cause geometric failure, and establishes the parameter effective domain. Rule simplification and generalization identify redundant operations and constraints, merge similar rules, and adjust parameter ranges to expand applicability. The technical points include formalized representation, which makes modeling knowledge explicit for storage, transmission, and reuse. Parameterized expression supports mathematical relationships and logical judgments. Rule library management enables systematic organization and utilization of modeling knowledge. Verification and optimization mechanisms ensure the reliability and applicability of the rules. The modeling rules are obtained: The parameter mapping mechanism establishes a parameter name mapping table, handles synonyms and abbreviations, performs unit conversion and data type conversion, and uses default values or recommended default values based on historical data for missing parameters. The characteristics of the input parameters are analyzed, and the matching modeling rules are retrieved from the rule library: the cosine similarity is used to calculate the similarity of the feature vectors, the interval overlap algorithm is used to judge and calculate the inclusion degree of the parameter range, the collaborative filtering algorithm is used to calculate the predicted score and recommend historical successful cases, and finally the weighted sum method is used to calculate the comprehensive matching degree, and the K candidate rule list with the highest matching degree is returned. For complex models, multiple rules are used in collaboration, including serial combination, parallel combination, and nested combination. The constraint solver is used to coordinate parameter conflicts, and Boolean operations or priority handling are used to handle geometric conflicts. Parameterized model construction includes parameter calculation and propagation: the directed acyclic graph is used to represent the dependency relationship between parameters, and the nodes represent parameters and edges represent dependency relationships. Parameter calculation uses topological sorting to ensure the calculation order. Parameter propagation adopts incremental update strategy: when parameter pi changes, only recompute the affected successor parameter set; constraint equation system solving: for linear constraints, use LU decomposition or QR decomposition to solve, for nonlinear constraints, use Newton-Raphson iteration method to solve; adopt branch and bound algorithm, divide the solution space into sub-regions, solve in each sub-region; no solution case processing adopts constraint relaxation technology, converts hard constraints into soft constraints; numerical stability guarantee adopts condition number test, when the condition number is greater than the set value, adopts regularization technology or singular value decomposition to solve; According to the rule defined operation sequence to construct geometric body, including basic geometry creation, Boolean operation, feature operation and geometric transformation; monitor the execution state of each operation, capture geometric failure and automatically repair, record error information and roll back when unable to repair; After the model is built, identify and name the key surfaces; position-based naming: determine the top surface, bottom surface according to the Z coordinate, determine the side surface according to the normal vector direction, define front, back, left and right according to the coordinate system; function-based naming: name the inlet, outlet according to the fluid direction or design intent, name the working surface according to the process requirement, name the mounting surface, mating surface according to the assembly relationship; geometric feature-based naming: including naming the inward cylindrical surface as hole surface, naming the partial cylindrical surface or annular surface as fillet surface, numbering the plane and curved surface according to type; naming rule inheritance: if the modeling rule comes from the learned reference model, inherit the corresponding naming scheme, infer the naming according to the semantic information of the parameter table; Result backstepping and optimization of complex model: For models whose complexity exceeds a set threshold, a hierarchical decomposition strategy is adopted: the separation of primary and secondary structures uses a volume contribution-based analysis method to calculate the volume contribution rate of each feature. for , Let i be the volume of feature i. The total volume; the main structure is defined as follows: The feature set that exceeds a set threshold, the auxiliary feature is defined as follows: The feature set is not greater than a set threshold; a master-slave relationship tree is established using the minimum spanning tree algorithm, with edge weights defined as the spatial distance between features; a spectral clustering algorithm is used to construct a feature adjacency matrix, and the Laplacian matrix is calculated. Eigenvalue decomposition is performed on the Laplacian matrix, and the eigenvectors corresponding to the k smallest eigenvalues are selected for K-means clustering; semantic segmentation is performed using ontology-based semantic reasoning to establish a feature semantic network. Let C be the set of concepts, R be the set of relations, and I be the set of instances. A recursive divide-and-conquer strategy is used for hierarchical deduction. The first layer, main structure analysis, uses a shape matching algorithm to calculate shape descriptors. The second layer, module analysis, uses a feature recognition algorithm for classification based on geometric invariants. The third layer, combination relationship analysis, uses a Boolean operation history reconstruction algorithm to analyze geometric combinations through R-function theory. The fourth layer, detailed feature analysis, uses local geometric analysis to calculate curvature and torsion. A dynamic programming algorithm is used to optimize the construction sequence and perform hierarchical merging, with the objective function being the minimization of the weighted sum of the number of construction steps and computational complexity. Introduce machine learning technology to assist identification; feature engineering extracts feature vectors from geometric data, first topological feature extraction calculates Euler number, genus, shape complexity and surface density; geometric feature extraction uses principal component analysis to calculate principal axis direction, symmetry measurement uses symmetric transformation residual; distribution feature extraction uses histogram to calculate curvature distribution, calculates statistical moments; thickness distribution uses distance transformation to calculate the shortest distance from internal points to surface; use data enhancement technology to prepare training data; labeling uses active learning strategy, selects the sample with the highest uncertainty for manual labeling; classification model training uses deep neural network, network structure includes convolution layer, LSTM layer and fully connected layer; loss function uses cross entropy; optimization algorithm uses Adam optimization algorithm; model evaluation uses k-fold cross-validation, performance indicators include accuracy, precision, recall and F1-score; deduction auxiliary application uses ensemble learning method, combines the prediction results of multiple classifiers; confidence fusion uses uncertainty quantification, when the uncertainty exceeds the threshold, applies manual audit; Continuous learning uses online learning algorithm to update model parameters through gradient accumulation; On the basis of the reconstructed model, the influence of parameters on geometry was analyzed and the design was optimized: the finite difference method was used to calculate the partial derivative for parameter sensitivity analysis, and the sensitivity coefficient is , the set objective function, is the design parameter; Sobol sequence was used for global sensitivity analysis, and the first-order sensitivity index and the total sensitivity index : , , is the first-order partial variance of the parameter , is the conditional expectation of the output Y when the parameter is fixed , Y is the output response of the model, is all design parameters except , is the total variance of the model output; the importance of the parameters was sorted by the Morris screening method; Parameter optimization uses a multi-objective optimization framework, including equality constraints and inequality constraints; uses non-dominated sorting genetic algorithm NSGA-II, fitness function is based on Pareto dominance relationship and crowding distance; gradient optimization uses quasi-Newton method; The optimization iteration process adopts adaptive termination criteria, sets relative improvement threshold conditions , gradient module threshold conditions , and maximum iteration number limit, wherein is the objective function value of the kth iteration, is the objective function gradient module of the kth iteration, is the set improvement threshold, is the set gradient module threshold; the surrogate model acceleration technology adopts Kriging model or radial basis function RBF; the optimization result verification adopts Monte Carlo simulation to evaluate the influence of parameter uncertainty on the optimization result, calculates the confidence interval and reliability index; Generating design variants with inferred parametric knowledge: parameter space sampling adopts hybrid sampling methods, including uniform sampling, Latin hypercube sampling, Halton sequence sampling, and intelligent sampling based on Bayesian optimization; Batch model generation adopts parallel computing framework, task allocation adopts load balancing algorithm, node selection is based on performance and load state; geometric validity verification includes topology check, geometry check and physical constraint check; verification algorithm adopts fast collision detection and Boolean operation validity judgment; Variant evaluation adopts multi-criteria decision analysis, weight allocation adopts analytic hierarchy process AHP calculation; Pareto frontier identification adopts non-dominated sorting algorithm; visualization adopts parallel coordinate chart, scatter matrix chart and interactive 3D chart; variant library construction adopts multi-dimensional index structure, including B+ tree index and LSH index; similarity measurement adopts weighted Euclidean distance; Knowledge feedback and evolution: Ensure the reliability of the output through modeling result quality evaluation: geometric validity check adopts multi-level verification algorithm, including degenerate face detection; self-intersection detection using space hash grid accelerated line intersection algorithm; closedness check through edge usage count verification; Topology consistency detection is realized by Euler formula verification; connectivity detection is realized by traversing the face adjacency graph using depth-first search algorithm to calculate the number of connected components; manifold detection is realized by verifying that each edge is shared by at most two faces and the neighborhood of each vertex is homeomorphic to a disc; parameter compliance detection is realized by numerical comparison algorithm; principal axis direction is determined by principal component analysis, and size measurement is realized by combining with the minimum bounding box algorithm; the minimum wall thickness is obtained by calculating the shortest distance from internal points to the surface using distance transform, and wall thickness analysis is performed; draft angle detection is realized by calculating the angle between the face normal vector and the draft direction; feature size check is realized by morphological operation; Failure case diagnosis and learning: construct classification feature vector according to error type, parameter range and geometric feature, and use multi-layer decision tree algorithm for failure reason classification; use isolated forest algorithm for anomaly detection; use support vector machine method to find decision boundary in parameter space and identify failure region to realize parameter boundary analysis; diagnostic analysis adopts causal reasoning framework, builds causal graph to represent the causal relationship between parameters, operations and results; uses dynamic programming algorithm for backtracking analysis, and uses state transition equation to identify the key decision points that lead to failure; Sensitivity analysis is performed by calculating the influence of parameter perturbation on failure probability; improved measures are generated by reinforcement learning algorithm, and action space includes rule correction, parameter adjustment and constraint optimization; Rule optimization adopts genetic algorithm, individual encoding is rule parameter, fitness function is based on accuracy and coverage of rule; knowledge base update adopts incremental learning algorithm, conflict detection between new knowledge and existing knowledge adopts consistency check; knowledge graph update adopts graph neural network, node represents concept, edge represents relationship, and node representation is updated through message passing mechanism; version control adopts Git-like differential storage mechanism, supports knowledge version rollback and branch merging; Successful case knowledge extraction: pattern mining uses a deep clustering algorithm combined with an autoencoder and K-means clustering scheme to mine implicit knowledge; frequent pattern mining uses the FP-Growth algorithm to build an FP-tree compressed data structure and mine frequent item sets; association rule mining is based on confidence and lift; sequence pattern mining uses the PrefixSpan algorithm to identify and build timing patterns of operations; rule generalization uses an inductive logic programming framework to learn general rules from specific instances; background knowledge is represented as a first-order logic predicate, and the learning goal is set to minimize the description length; rule simplification uses a pruning algorithm to remove redundant conditions and rules with confidence below a certain value; cross-validation evaluates rule generalization performance to prevent overfitting; best practice identification uses a multi-criteria evaluation system, with evaluation indicators including construction efficiency, geometric quality, and resource consumption; Comprehensive scoring uses the TOPSIS method; practice pattern extraction uses process mining technology to build a Petri net model to represent the construction process; automatic knowledge reasoning uses a description logic inference machine to support concept inclusion, instance checking, and consistency checking; ontology evolution management uses version management and change propagation mechanisms to ensure the consistency and integrity of the knowledge base; The A / B testing framework uses online controlled experiment design, and the random shunting algorithm ensures the statistical independence of user grouping; effect evaluation uses hypothesis testing, and confidence interval calculation evaluates the significance of the effect; the multi-arm tiger machine algorithm is used for dynamic adjustment of traffic allocation, balancing exploration and utilization; Version iteration management uses semantic version control; performance benchmarking uses standard test sets, including geometric precision, computational efficiency, and memory usage; Regression testing ensures compatibility of new versions; Gray release strategy controls the impact of new versions, and automatically rolls back when key indicators are abnormal; user feedback analysis uses natural language processing technology, sentiment analysis to identify user satisfaction; topic modeling uses the LDA algorithm to extract feedback topics; feedback priority scoring uses the analytic hierarchy process, with weight allocation based on impact and urgency; crowdsourcing quality control uses a mechanism combining majority voting and expert review; performance monitoring uses a distributed monitoring architecture, with index collection using a time series database for storage; anomaly detection uses an LSTM neural network to predict normal patterns, and triggers an alarm when the deviation exceeds a threshold; root cause analysis uses causal reasoning and correlation analysis; adaptive optimization uses online gradient descent to update system parameters; learning rate uses an adaptive adjustment strategy.
8. A system for implementing the parameter-driven CAD automatic modeling method according to any one of claims 1 to 7, characterized in that It includes a data acquisition module, a model generation module, a reverse reconstruction module, a rule generation module, and an automatic modeling module; the data acquisition module, the model generation module, the reverse reconstruction module, the rule generation module, and the automatic modeling module are sequentially connected; the data acquisition module is used to acquire model parameter information that needs to be modeled, and upload the data information to the model generation module; The model generation module is used to generate a CAD model based on parameter analysis, geometric construction, and face recognition schemes according to the received data information, and upload the data information to the reverse reconstruction module; The reverse reconstruction module is used for reverse reconstruction of a three-dimensional CAD model according to the received data information, according to the obtained data information, based on topology analysis, geometric feature extraction, pattern recognition and parameter relationship inference, and uploading the data information to the rule generation module; The rule generation module is used for modeling, optimization and feedback evolution according to the received data information, according to the obtained data information, based on model analysis and feature learning and parameterized modeling rule generation, and uploading the data information to the automatic modeling module; The automatic modeling module is used for completing parameter-driven CAD automatic modeling according to the received data information and the obtained data information.
Citation Information
Patent Citations
CAD (Computer Aided Design) modeling method for reverse engineering of complex parts based on semantic information
CN102622478A
Virtual fitting method based on color three-dimensional model
CN120689560A