Search

CN-122021317-A - CAD drawing completion method and device and electronic equipment

CN122021317ACN 122021317 ACN122021317 ACN 122021317ACN-122021317-A

Abstract

The application belongs to the technical field of industrial design, and particularly discloses a CAD drawing completion method, a device and electronic equipment, wherein the method comprises the steps of analyzing a CAD drawing to be completed into a geometric constraint diagram; pruning the edge nodes and the edge node associated edges of the geometric constraint graph to obtain a precise sketch, converting the simplified graph into a text sequence, fine tuning a large language model based on the text sequence and a preset instruction prompt to obtain a fine-tuned large language model, and completing the CAD drawing to be completed based on the fine-tuned large language model. The method can effectively solve the problem of insufficient interpretability caused by black box operation in the traditional deep learning method, and improves the completion precision of CAD drawing completion.

Inventors

  • HU TIANYU
  • QIAN YIMING
  • LIANG QICHUAN
  • XIE XIA

Assignees

  • 海南大学

Dates

Publication Date
20260512
Application Date
20260130

Claims (8)

  1. 1. The CAD drawing complement method is characterized by comprising the following steps: Analyzing the CAD drawing to be complemented into a geometric constraint diagram; pruning the edge nodes and the edge node associated edges of the geometric constraint graph to obtain a precise sketch, and converting the simplified graph into a text sequence; performing fine tuning on the large language model based on the text sequence and a preset instruction prompt to obtain a fine-tuned large language model; and complementing the CAD drawing to be complemented based on the trimmed large language model.
  2. 2. The CAD drawing completion method according to claim 1, wherein the completion of the CAD drawing to be completed based on the trimmed large language model comprises: Predicting primitive types of missing parts in the CAD drawing to be complemented based on the fine-tuned first large language model; and generating primitive coordinates based on the trimmed second biggest language model and the primitive type.
  3. 3. The CAD drawing completion method of claim 1, wherein the method further comprises: Training a plurality of antagonistic suffixes aiming at the sketch structure through a greedy coordinate gradient algorithm; Initiating multiple perturbations to the trimmed large language model based on the antagonistic suffix; and calculating the probability of outputting correct results under multiple disturbance of the trimmed large language model respectively, and calculating the standard deviation of the probability of outputting correct results under multiple disturbance respectively.
  4. 4. The CAD drawing completion method according to claim 3, wherein after the completion of the CAD drawing to be completed based on the trimmed large language model, the method further comprises: Based on Logits values, information entropy, confusion degree and standard deviation of probability of outputting correct results under the multiple disturbance in the completion task of the trimmed large language model, constructing a fusion feature vector; inputting the fusion feature vector into a trained logistic regression classifier to obtain the reliability evaluation of the trimmed large language model.
  5. 5. A CAD drawing completion device, comprising: the analysis module is used for analyzing the CAD drawing to be complemented into a geometric constraint diagram; The pruning module is used for pruning the edge nodes and the edge node associated edges of the geometric constraint graph to obtain a precise sketch and converting the simplified graph into a text sequence; The fine tuning module is used for carrying out fine tuning on the large language model based on the text sequence and a preset instruction prompt, and obtaining a fine-tuned large language model; and the completion module is used for completing the CAD drawing to be completed based on the trimmed large language model.
  6. 6. An electronic device, comprising: At least one memory for storing a computer program; at least one processor for executing the program stored in the memory, the processor being configured to perform the CAD drawing completion method of any one of claims 1-4 when the program stored in the memory is executed.
  7. 7. A computer readable storage medium storing a computer program, which when run on a processor causes the processor to perform the CAD drawing completion method of any of claims 1-4.
  8. 8. A computer program product which, when run on a processor, causes the processor to perform the CAD drawing completion method of any of claims 1-4.

Description

CAD drawing completion method and device and electronic equipment Technical Field The application belongs to the technical field of industrial design, and particularly relates to a CAD drawing completion method, a CAD drawing completion device and electronic equipment. Background The existing engineering field has obvious shortboards for drawing and complementing the CAD drawing, namely, although the scheme adopting the visual language model improves the perception capability, the geometric logic reasoning of the visual language model is weak, the complementing precision is low when the drawing with a complex topological structure is processed, and the method generally depends on large-scale and high-quality training data, is difficult to adapt to small sample and long tail distribution scenes common in actual engineering, and limits the practicability and generalization capability. Disclosure of Invention Aiming at the defects of the prior art, the application aims to provide a CAD drawing completion method, which aims to solve the problem of lower completion precision caused by the fact that the existing CAD drawing completion method adopts a visual language model for completion. In order to achieve the above object, in a first aspect, the present application provides a CAD drawing complement method, including: Analyzing the CAD drawing to be complemented into a geometric constraint diagram; pruning the edge nodes and the edge node associated edges of the geometric constraint graph to obtain a precise sketch, and converting the simplified graph into a text sequence; performing fine tuning on the large language model based on the text sequence and a preset instruction prompt to obtain a fine-tuned large language model; and complementing the CAD drawing to be complemented based on the trimmed large language model. According to the method, the CAD drawing to be complemented is analyzed into the geometric constraint graph and pruned, the context content is reduced, the coding length is shortened, the model is forced to directly learn the topological and constraint relations among the primitives, so that the method focuses on advanced geometric semantics, the simplified graph is converted into a text sequence, the standardized and semantic-rich coding mode provides high-quality and high-purity learning materials for a large language model, geometric semantics of the drawing can be accurately mastered when the drawing with a complicated topological structure is faced, a firm understanding basis is provided for a subsequent complementation task, the CAD drawing to be complemented is complemented after the pre-trained large language model is subjected to fine tuning based on the text sequence and a preset instruction prompt, the model drives cross-mode drawing complementation by utilizing the logical reasoning and causal analysis capacity of the pure language model, the reasoning process can be traced back through the natural language prompt, on one hand, the problem of poor interpretability caused by black box operation in the traditional deep learning method and the problem of dependency on a data set are solved, and on the other hand, the complementation accuracy of the CAD drawing is improved. According to the CAD drawing completion method provided by the application, the completion of the CAD drawing to be completed based on the trimmed large language model comprises the following steps: Predicting primitive types of missing parts in the CAD drawing to be complemented based on the fine-tuned first large language model; and generating primitive coordinates based on the trimmed second biggest language model and the primitive type. The application adopts a task decoupling strategy, a first fine-tuned large language model is specially responsible for predicting the primitive type of a missing part in a graph, the learning target of the model is simplified, the predicted type information is used as a known condition and is input into a second fine-tuned large language model, and the model is specially responsible for generating the coordinate parameters of the primitive. According to the CAD drawing completion method provided by the application, the method further comprises the following steps: training a plurality of antagonistic suffixes for the sketch structure by a greedy coordinate gradient (Greedy Coordinate Gradient, GCG) algorithm; Initiating multiple perturbations to the trimmed large language model based on the antagonistic suffix; and calculating the probability of outputting correct results under multiple disturbance of the trimmed large language model respectively, and calculating the standard deviation of the probability of outputting correct results under multiple disturbance respectively. The application uses GCG to generate the countermeasure suffix, perturbs LLM output, calibrates the model confidence coefficient by calculating the consistency measure (standard deviation) of the perturbed output