Computer-aided design intersection analysis method based on transformer and feature column
By combining Transformer and feature columns, parametric curves and surfaces are transformed into implicit equations, solving the problem of high computational complexity in existing technologies, achieving efficient CAD geometric intersection analysis, and improving automation and computational efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING INST OF GREEN & INTELLIGENT TECH CHINESE ACAD OF SCI
- Filing Date
- 2026-04-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies have high computational complexity when converting curves and surfaces in parametric equation form into implicit equations, making it difficult to meet the needs of large-scale or real-time CAD applications. Furthermore, large language models based on Transformer have shortcomings in accurate algebraic calculations.
A method based on Transformer and feature columns is adopted. By randomly generating a system of polynomial equations, a symbolic solver is used to calculate the feature columns and pseudo-datasets to train the Transformer model, thereby transforming parametric curves and surfaces into implicit equations and performing intersection analysis.
It improves the automation level and computational efficiency of CAD geometric intersection tasks, significantly reduces computational complexity, and is suitable for large-scale and real-time applications.
Smart Images

Figure CN122113189A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a computer-aided design intersection analysis method based on Transformer and feature columns, belonging to the interdisciplinary field of computer-aided design and artificial intelligence, and is particularly applicable to computer-aided design intersection analysis based on the Transformer model. Background Technology
[0002] In computer-aided design (CAD), curves and surfaces are typically represented using parametric equations. Parametric equations offer excellent geometric intuition and modeling flexibility, easily representing complex shapes and are the mainstream geometric representation method in current CAD systems. However, when dealing with intersection analysis tasks involving geometric objects, such as finding the intersection of curves, surfaces, or other geometric objects, parametric equations are not convenient for direct algebraic solutions. In contrast, implicit equations are more conducive to constructing systems of equations, eliminating variables, and performing intersection calculations, transforming geometric intersection problems into algebraic constraint-based problems.
[0003] Therefore, in practical CAD intersection analysis, it is usually necessary to transform curves or surfaces in parametric equation form into implicit equations. Existing transformation methods mainly rely on symbolic computation techniques, such as resultant elimination, Gröbner basis, or characteristic column methods. While these methods are theoretically rigorous, their computational complexity increases dramatically when dealing with high-order, multivariable, or complex parametric forms, making them unsuitable for large-scale or real-time CAD applications.
[0004] In recent years, large language models based on Transformer have shown some potential in mathematical reasoning and symbolic computation tasks, but they still have shortcomings in accurate algebraic computation [1-2], often requiring the use of external solvers, which limits overall efficiency. Therefore, how to efficiently transform parametric curves and surfaces into implicit equations, and on this basis realize automatic intersection analysis between curves and surfaces, is a key technical problem to improve the efficiency and automation level of CAD geometric intersection calculation.
[0005] [1] Wu Y, Huang Y, Shi J. Teaching arithmetic to small Transformers[C] / / Proceedings of the 12th International Conference on LearningRepresentations. New York: Curran Associates, Inc., 2024: 25684-25737.
[0006] [2] Lee N, Cai Z, Schwarzschild A, et al. Self-improving Transformersovercome easy-to-hard and length generalization challenges [C] / / ICML'25: Proceedings of the 42nd International Conference on Machine Learning: volume267. PMLR, 2025: 32930-32964. Summary of the Invention
[0007] In view of this, the present invention proposes a computer-aided design intersection analysis method based on Transformer and feature columns. Using parametric equations commonly used in CAD systems as the main input form, the method efficiently transforms parametric curves and parametric surfaces into implicit equations through feature column calculations, thereby completing the intersection analysis between curves, surfaces, and curves and surfaces, and improving the efficiency and automation level of CAD geometric intersection tasks.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] A computer-aided design intersection analysis method based on Transformer and feature columns is characterized by comprising the following steps:
[0010] S1: Randomly generate a system of polynomial equations for parametric curves or parametric surfaces with different degrees, number of terms, and coefficients;
[0011] S2: Set the parameter variable order of the polynomial equation system in step S1 to the highest order, use the symbolic solver to calculate the Wu feature column corresponding to the polynomial equation system, and construct the Wu feature column dataset.
[0012] S3: Increase the upper limit of the number of steps in step S1, regenerate the polynomial equation system of parametric curves or parametric surfaces, use the symbolic solver to calculate the polynomial pseudo-division, and obtain the pseudo-division dataset.
[0013] S4: Based on the pseudo-division training dataset from step S3, train the Transformer model to obtain the pseudo-division model;
[0014] S5: Using the Wu feature column dataset constructed in step S2, perform full parameter fine-tuning on the pseudo-division model obtained in step S4 to obtain the Wu feature column model.
[0015] S6: Input the parametric curves or parametric surfaces of the two CAD geometric objects to be analyzed, transform them into a system of polynomial equations by multiplying them by the denominator polynomial, and determine whether the degree, number of terms, and coefficients are within the range of the Wu feature column dataset. If they are, continue to step S7; otherwise, output the conclusion that cannot be determined.
[0016] S7: Set the parameter variable order in the polynomial equation system of step S6 to the highest order, input the Wu feature column model, and obtain the correct Wu feature column of the geometric object after symbol verification. Extract the polynomials that do not contain parameter variables in the output Wu feature column to obtain the corresponding implicit equation.
[0017] S8: Based on the types of the two geometric objects to be analyzed, select the corresponding intersection judgment criteria, process the implicit equations to obtain coordinates, intersection line expressions or judgment conclusions, and output a compliance report according to the design rules;
[0018] S9: Return the intersection points, intersection lines, or judgment results obtained in step S8 to the user in the form of visualized or structured data to support subsequent design modifications, assembly verification, or interference detection.
[0019] Furthermore, the number of times and the number of terms mentioned in step S1 have artificially set upper limits; the coefficients have a range of values, and the smaller the range, the better. Typically, in CAD modeling, the maximum number of times is 10, and for B-spline curves it is 3, so the upper limit of the number of times is generally no more than 3.
[0020] Furthermore, the Wu feature column dataset mentioned in step S2 includes: v, t, e, and C respectively specify the number of variables, number of terms, maximum degree, and number of digits of coefficients for each polynomial in the input polynomial system; L and S respectively limit the number of digits of coefficients and degree for each polynomial in the output feature column; and F is the order of the finite field in the finite field coefficient polynomial.
[0021] Furthermore, in the process of constructing the pseudo-division dataset described in step S3, the number of iterations is amplified to the maximum integer with the same upper limit number of digits. .
[0022] Furthermore, the intersection judgment criterion described in step S8 is specifically as follows:
[0023] (1) Type of intersection between curves: Convert one of the parametric curves into an implicit equation, substitute the parametric equation of the other curve into the implicit equation, solve for the common point, and determine whether there is a real intersection point.
[0024] (2) Type of intersection between surfaces: Transform one of the parametric surfaces into an implicit equation, substitute the parametric equation of the other surface into the implicit equation, and obtain the implicit equation of the intersection line on the projection plane. The intersection line can be further parameterized or discretized.
[0025] (3) Type of intersection between curve and surface: transform the parametric surface into an implicit equation, substitute the parametric equation of the curve into the implicit equation, substitute the implicit equation of the parametric surface into the implicit equation, obtain the single variable equation about the curve parameter, solve to obtain the intersection point parameter, and then obtain the intersection point coordinates.
[0026] Furthermore, step S2 specifically includes:
[0027] S201: Input a system of polynomial equations f and g are the polynomials corresponding to two geometric objects, respectively. The Wu characteristic sequence is obtained by using a symbolic solver. ,in, It is the polynomial with the highest principal variable order in Wu's sequence;
[0028] S202: Use word segmentation to transform the polynomial equation system sys into an input sequence and the Wu feature column cs into an output sequence, and use these two sequences to construct a training dataset for the polynomial system feature column.
[0029] Furthermore, the word segmentation method in step S202 is as follows: fill in the omitted unit exponents, unit coefficients, and positive signs before the first positive coefficient in each polynomial expression in the polynomial list; segment the numbers digit by digit; and separate the expressions with special characters.
[0030] Furthermore, step S3 specifically includes:
[0031] S301: For a given input polynomial equation system The pseudo-component r is calculated using a symbolic solver;
[0032] S302: Use word segmentation to transform the polynomial equation system into an input sequence and the pseudo-coefficient into an output sequence, and use these two sequences to construct a pseudo-division dataset;
[0033] S303: Calculate the polynomial pseudo-division using a symbolic solver and record intermediate results of the iterative calculation: , ,in, , , To treat polynomial g as the first term coefficient when the principal variable is the only variable, For the number of iterations, For polynomial pseudo-dividing multipliers;
[0034] S304: Use word segmentation to transform the polynomial equation system into an input sequence, and the intermediate results are sorted according to the sequence [m, , , , , , , The sequence , …] is transformed into an output sequence, and these two sequences are used to construct a pseudo-intermediate dataset.
[0035] Furthermore, step S4 specifically includes:
[0036] S401: Train the Transformer model based on the pseudo-division dataset to obtain the pseudo-division model;
[0037] S402: If the pseudo-division model obtained in step S401 has a low prediction accuracy on the validation set, regenerate a polynomial multiplication dataset with the same number of variables v, number of terms t, number of exponents E, and number of coefficients C.
[0038] S403: Based on the multiplication dataset, train the Transformer model to obtain the multiplication model, and then use the pseudo-division dataset to fine-tune the full parameters of the multiplication model and update the pseudo-division model.
[0039] S404: If the pseudo-division model obtained in S403 has a low prediction accuracy on the validation set, train the Transformer model based on the pseudo-division intermediate dataset and further update the pseudo-division model.
[0040] Furthermore, the process of constructing the multiplication dataset is as follows: first, a system of polynomial equations is randomly generated. The product p is calculated using a symbolic solver, and then the polynomial equation system is segmented using a word segmentation method. The input sequence and product p are transformed into an output sequence to obtain the multiplication dataset.
[0041] The beneficial effects of this invention are as follows: This invention proposes a computer-aided design intersection analysis method based on Transformer and feature columns, which combines symbolic computation with deep learning. Through feature column computation, it efficiently transforms parametric curves and parametric surfaces into implicit equations, thereby completing the intersection analysis between curves, surfaces, and curves and surfaces, improving the automation level and computational efficiency of CAD geometric intersection tasks. Attached Figure Description
[0042] To illustrate the purpose and technical solution of this invention, the following figures are provided for illustrative purposes:
[0043] Figure 1 This is a flowchart of the method of the present invention;
[0044] Figure 2 This is a schematic diagram of the Wu feature column model training in this invention;
[0045] Figure 3 This is a graph showing the performance comparison experiment results on the feature column validation set in Embodiment 4 of the present invention;
[0046] Figure 4 This is the accuracy result of the feature column model in Embodiment 4 of the present invention;
[0047] Figure 5 This represents the model accuracy result on the polynomial pseudo-division validation set in Embodiment 4 of the present invention. Detailed Implementation
[0048] The present invention will be further described below with reference to specific embodiments. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0049] Example 1: In CAD drawing software, it is necessary to judge and analyze the intersection problems of curves and surfaces. For the compliance check of point-line membership in the parametric equation of a circle, this invention provides a "computer-aided design intersection analysis method based on Transformer and feature columns".
[0050] Assume the circles and points of a CAD object are described as follows:
[0051] Let the center of a circle on a plane be... With a radius of 2, its rational parametric equation is:
[0052] ;
[0053] Where t is a parameter. To facilitate the processing of polynomial systems, translation variables are introduced:
[0054] ;
[0055] Further rewritten as parametric equations:
[0056] ;
[0057] There are two checkpoints, namely , .
[0058] Combination Figure 1 The method of the present invention is characterized by comprising the following steps:
[0059] S1: The range of values for the number of times is Variables The number of items does not exceed 3, and the coefficient range is [missing information]. Within, a system of polynomial equations with randomly generated parametric curves of different degrees, numbers of terms, and coefficients.
[0060] S2: Adjust the parameter variables of the polynomial equation system in step S1 Set to the highest order, use the wsolve symbolic solver implemented in Maple software (http: / / www.mmrc.iss.ac.cn / ~dwang / wsolve.html) to calculate the Wu characteristic columns corresponding to the polynomial equation system, and construct the Wu characteristic column dataset. .
[0061] Furthermore, the Wu feature column dataset includes: v, t, e, and C, which respectively specify the number of variables, the number of terms, the maximum degree, and the number of digits of coefficients for each polynomial in the input polynomial system; L and S, which respectively limit the number of digits of coefficients and the number of digits of degree for each polynomial in the output feature column; and F, which is the order of the finite field in the finite field coefficient polynomial.
[0062] Step S2 is as follows:
[0063] S201: Input a system of polynomial equations f and g are the polynomials corresponding to two geometric objects, respectively. The Wu characteristic sequence is obtained by using a symbolic solver. ,in, This is the polynomial with the highest principal order in Wu's sequence;
[0064] S202: Use word segmentation to transform the polynomial equation system sys into an input sequence and the Wu feature column cs into an output sequence, and use these two sequences to construct a training dataset for the polynomial system feature column.
[0065] S3: The maximum value of the number of steps in step S1 is 9. The polynomial equation system of the parametric curve or parametric surface is randomly generated again. The pseudo-division of the polynomial is calculated using the prem function built into the Maple software to obtain the pseudo-division dataset.
[0066] Step S3 is as follows:
[0067] S301: For a given input polynomial equation system The pseudo-component r is calculated using a symbolic solver;
[0068] S302: Use word segmentation to transform the polynomial equation system into an input sequence and the pseudo-coefficient into an output sequence, and use these two sequences to construct a pseudo-division dataset.
[0069] Due to memory limitations, this embodiment does not perform the construction of a pseudo-intermediate dataset.
[0070] S4: Based on the pseudo-division training dataset from step S3, train the Transformer model to obtain the pseudo-division model.
[0071] Step S4 is as follows:
[0072] S401: Train the Transformer model based on the pseudo-division dataset to obtain the pseudo-division model;
[0073] S402: If the pseudo-division model obtained in step S401 has a low prediction accuracy on the validation set, regenerate a polynomial multiplication dataset with the same number of variables v, number of terms t, number of exponents E, and number of coefficients C.
[0074] S403: Based on the multiplication dataset, train the Transformer model to obtain the multiplication model, and then use the pseudo-division dataset to fine-tune the full parameters of the multiplication model and update the pseudo-division model.
[0075] The process of constructing the multiplication dataset is as follows: First, a system of polynomial equations is randomly generated. The product p is calculated using a symbolic solver, and then the polynomial equation system is segmented using a word segmentation method. The input sequence and product p are transformed into an output sequence to obtain the multiplication dataset.
[0076] S5: As Figure 2 As shown, using the Wu feature column dataset constructed in step S2, the pseudo-division model obtained in step S4 is fine-tuned with all parameters to obtain the Wu feature column model.
[0077] S6: For the parametric curve equation to be analyzed, it is transformed into a system of polynomial equations by multiplying it by a denominator polynomial.
[0078]
[0079] After unfolding and organizing
[0080]
[0081] Determine its position in the Wu feature column dataset. Within the specified range, continue with step S7;
[0082] S7: Denote parameter variables , , Variable order is set as The above system can then be reorganized as follows:
[0083] ;
[0084] Positional word segmentation yields the word representation of the input sequence: [ <s>, +, 1, *, x1, ^, 2, *, x2, ^, 1,+, 2, *, x1, ^, 2, +, 1, *, x2, ^, 1, −, 2, <op> , +, 1, *, x1, ^, 2, *, x3, ^,1, −, 4, *, x1, ^, 1, +, 1, *, x3, ^, 1,< / op> < / s> ]; "*" represents the multiplication symbol, and "^" represents the exponentiation symbol. <s>”、" <op> ”、"< / op> < / s> The symbols "" represent special characters, indicating the start of a sequence, the input polynomial separator, and the end of a sequence.
[0085] After feature column model inference, the final predicted word sequence is obtained: [ <s> , +, 1, *, x1, ^, 1, *,x2, ^, 1, +, 2, *, x1, ^, 1, −, 1, *, x3, ^, 1, >, +, 1, *, x2, ^, 2, *, x3,^, 1, +, 1, *, x3, ^, 3, −, 4, *, x3, ^, 1,< / s> The ">" symbol is a special character that separates polynomials in the output sequence. That is, the feature columns predicted by the feature column model are: .
[0086] Symbolic verification confirmed that the prediction result is indeed a characteristic sequence of the input multinomial system. (Second term) The parameter is not included. The polynomial constraints are obtained by reduction. Calculate the primitive polynomial of this polynomial (treating it as a single-variable polynomial in X, divided by the greatest common factor of all coefficients), and you will obtain the implicit equation. .
[0087] Furthermore, by reducing the equations, the implicit equations of the corresponding parameter curves can be obtained: .
[0088] S8: For the point to be checked Substituting into the implicit equation, we get The decision point P1 lies on the circle and satisfies the point-line membership constraint; for the point to be checked... After substituting, we get The equation is not satisfied, therefore point P2 is determined not to be on the circle and does not meet the corresponding design rules. Thus, this invention can first convert the parametric curves in the CAD object into implicit equations, and then perform point-line membership compliance checks based on the point coordinates.
[0089] Example 2: In CAD drawing software, for the compliance check of point and surface membership in surface parametric equations, this example provides a "computer-aided design intersection analysis method based on Transformer and feature columns".
[0090] Combination Figure 1 The method includes the following steps:
[0091] S1: A system of polynomial equations for parametric surfaces of different degrees, numbers of terms, and coefficients;
[0092] S2: Set the parameter variable order of the polynomial equation system in step S1 to the highest order, use the symbolic solver to calculate the Wu feature column corresponding to the polynomial equation system, and construct the Wu feature column dataset.
[0093] S3: Increase the upper limit of the number of steps in step S1, regenerate the polynomial equation system of the parametric surface, use the symbolic solver to calculate the polynomial pseudo-division, and obtain the pseudo-division dataset.
[0094] S4: Based on the pseudo-division training dataset from step S3, train the Transformer model to obtain the pseudo-division model;
[0095] S5: Using the Wu feature column dataset constructed in step S2, perform full parameter fine-tuning on the pseudo-division model obtained in step S4 to obtain the Wu feature column model.
[0096] S6: Input the parametric surface equations of the two CAD geometric objects to be analyzed, transform them into a system of polynomial equations by multiplying them by the denominator polynomial, and determine whether the degree, number of terms, and coefficients are within the range of the Wu feature column dataset. If they are, continue to execute step S7; otherwise, output the conclusion that cannot be determined.
[0097] S7: Set the parameter variable order in the polynomial equation system of step S6 to the highest order, input the Wu feature column model, and obtain the correct Wu feature column of the geometric object after symbol verification. Extract the polynomials that do not contain parameter variables in the output Wu feature column to obtain the corresponding implicit equation.
[0098] S8: Based on the types of the two geometric objects to be analyzed, select the corresponding intersection judgment criteria, process the implicit equations to obtain coordinates, intersection line expressions or judgment conclusions, and output a compliance report according to the design rules;
[0099] S9: Return the intersection points, intersection lines, or judgment results obtained in step S8 to the user in the form of visualized or structured data to support subsequent design modifications, assembly verification, or interference detection.
[0100] Example 3: To better demonstrate the process of constructing the polynomial pseudo-division dataset and pseudo-division intermediate dataset using the method of the present invention, this example uses a power range of [value missing]. Variables The number of terms does not exceed 2, and the coefficient range is [missing information]. Within, the implicit equations of randomly generated curves are used to construct a polynomial pseudo-division dataset. and pseudo-intermediate dataset This invention provides a "pseudo-divide dataset construction method applicable to computer-aided design intersection analysis methods based on Transformer and feature columns".
[0101] Specifically, the method includes the following steps:
[0102] S301: Polynomial Pseudo-Division Dataset The input polynomial equation system with principal component x1 is as follows:
[0103]
[0104] The pseudo-component was calculated using the prem function in Maple software. ;
[0105] S302: Word segmentation yields the word representation of the input sequence: [<s>, −, 3, *, x1, ^, 8, *, x2, ^,8, +, 3, *, x1, ^, 1, *, x2, ^ 6, <op> , −, 6, *, x1, ^, 3, *, x2, ^, 7, +, 3,*, x1, ^, 5,< / op> < / s> The word representation of the output sequence is: [ <s> , −, 9, 7, 2, *, x1, ^, 4, x2, ^, 2,2, +, 2, 4, 3, *, x1, ^, 1, x2, ^, 6,< / s> ], and use these two sequences to construct a pseudo-divide dataset;
[0106] S303: Calculate the pseudo-division of the polynomial using Maple software to obtain the pseudo-division multipliers. ; and the results of the intermediate iteration process: pseudo-complement , business type The product of quotient and divisor , pseudo-remainder , business type The product of quotient and divisor , pseudo-remainder ;in, This indicates the search for the highest degree of the principal component of a polynomial.
[0107] S304: Word segmentation yields the word representation of the input sequence: [ <s>, −, 3, *, x1, ^, 8, *, x2, ^,8, +, 3, *, x1, ^, 1, *, x2, ^ 6, <op> , −, 6, *, x1, ^, 3, *, x2, ^, 7, +, 3,*, x1, ^, 5,< / op> < / s> The word representation of the output sequence is: [m, , , , , , , ] = [ <s> ,+, 8, 1, >, −, 2, 4, 3, *, x1, ^, 8, *, x2, ^, 8, +, 2, 4, 3, *, x1, ^, 1, *,x2, ^, 6, >, −, 8, 1, *, x1, ^, 3, *, x2, ^, 8, >, +, 4, 8, 6, *, x1, ^, 6, *,x2, ^, 1, 5, −, 2, 4, 3, *, x1, ^, 8, *, x2, ^, 8, >, +, 4, 8, 6, *, x1, ^, 6,*, x2, ^, 1, 5, −, 2, 4, 3, *, x1, ^, 1, *, x2, ^, 6, >, −, 1, 6, 2, *, x1, ^,1, *, x2, ^, 1, 5, >, +, 9, 7, 2, *, x1, ^, 4, x2, ^, 2, 2, −, 4, 8, 6, *, x1,^, 6, *, x2, ^, 1, 5, >, −, 9, 7, 2, *, x1, ^, 4, x2, ^, 2, 2, +, 2, 4, 3, *,x1, ^, 1, x2, ^, 6,< / s> ], and use these two sequences to construct a pseudo-intermediate dataset.
[0108] Example 4: To better demonstrate the effect of the method of the present invention, in this example, a polynomial equation system of parametric curves with different degrees, number of terms, and coefficients is first randomly generated, and coordinate points are randomly generated. Then, a performance comparison experiment of intersection analysis of CAD software is carried out using the method of the present invention and the existing wsolve symbolic solver.
[0109] The hardware and software configuration of the experimental platform is as follows: CPU uses Intel. ® Core™ Ultra 7 265K (20 cores, 32GB RAM); GPU is NVIDIA GeForce RTX. ® 5080 (10,752 CUDA cores, 16GB GDDR7 memory); Maple version 2024.2; CUDA version 13.0; PyTorch version 2.9.0; OS is Ubuntu 24.04.3 LTS.
[0110] Specifically, the wsolve symbolic solver directly calculates the characteristic columns of the polynomial equation system of the parametric curve; the method of this invention directly uses the offline-trained Wu characteristic column model to calculate the characteristic columns; then, both methods and criteria are used for intersection analysis. The experiment mainly compares the performance of the two methods in the characteristic column calculation process, and the specific experimental results are shown in Table 1.
[0111] Table 1 Performance Comparison Experiment Results
[0112]
[0113] Combining Table 1 and Figure 3 The proposed feature column model demonstrates significantly higher computational efficiency than the traditional symbolic solver wsolve in feature column computation. On four datasets of different sizes, the total computation time (including model loading, inference, and result transformation) is significantly shorter than the pure symbolic computation time of wsolve, with a speedup of up to 7.15 times. In terms of time composition, the total computation time is primarily comprised of inference time, while the overhead of model loading and result post-processing is minimal. This reflects the core advantage of the Transformer model, which completes computation in a single forward propagation, making it particularly suitable for batch processing.
[0114] Furthermore, this embodiment also compares the accuracy of the feature column model and the model accuracy on the polynomial pseudo-division validation set on some datasets. The experimental results are as follows: Figure 4 and Figure 5 As shown, the model proposed by the method of this invention also has high accuracy.
[0115] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made to it in form and detail without departing from the scope defined by the claims of the present invention.
Claims
1. A computer-aided design intersection analysis method based on Transformer and feature columns, characterized in that, Includes the following steps: S1: Randomly generate a system of polynomial equations for parametric curves or parametric surfaces with different degrees, number of terms, and coefficients; S2: Set the parameter variable order of the polynomial equation system in step S1 to the highest order, use the symbolic solver to calculate the Wu feature column corresponding to the polynomial equation system, and construct the Wu feature column dataset. S3: Increase the upper limit of the number of steps in step S1, regenerate the polynomial equation system of parametric curves or parametric surfaces, use the symbolic solver to calculate the polynomial pseudo-division, and obtain the pseudo-division dataset. S4: Based on the pseudo-division training dataset from step S3, train the Transformer model to obtain the pseudo-division model; S5: Using the Wu feature column dataset constructed in step S2, perform full parameter fine-tuning on the pseudo-division model obtained in step S4 to obtain the Wu feature column model. S6: Input the parametric curves or parametric surfaces of the two CAD geometric objects to be analyzed, transform them into a system of polynomial equations by multiplying them by the denominator polynomial, and determine whether the degree, number of terms, and coefficients are within the range of the Wu feature column dataset. If they are, continue to step S7; otherwise, output the conclusion that cannot be determined. S7: Set the parameter variable order in the polynomial equation system of step S6 to the highest order, input the Wu feature column model, and obtain the correct Wu feature column of the geometric object after symbol verification. Extract the polynomials that do not contain parameter variables in the output Wu feature column to obtain the corresponding implicit equation. S8: Based on the types of the two geometric objects to be analyzed, select the corresponding intersection judgment criteria, process the implicit equations to obtain coordinates, intersection line expressions or judgment conclusions, and output a compliance report according to the design rules; S9: Return the intersection points, intersection lines, or determination results obtained in step S8 to the user in the form of visual or structured data.
2. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 1, characterized in that, The Wu feature column dataset mentioned in step S2 includes: v, t, e, and C respectively specify the number of variables, number of terms, maximum degree, and number of digits of coefficients for each polynomial in the input polynomial system; L and S respectively limit the number of digits of coefficients and degree for each polynomial in the output feature column; and F is the order of the finite field in the finite field coefficient polynomial.
3. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 1, characterized in that, The intersection judgment criterion mentioned in step S8 is as follows: (1) Type of intersection between curves: Convert one of the parametric curves into an implicit equation, substitute the parametric equation of the other curve into the implicit equation, solve for the common point, and determine whether there is a real intersection point. (2) Type of intersection between surfaces: Transform one of the parametric surfaces into an implicit equation, substitute the parametric equation of the other surface into the implicit equation, and obtain the implicit equation of the intersection line on the projection plane. The intersection line can be further parameterized or discretized. (3) Type of intersection between curve and surface: transform the parametric surface into an implicit equation, substitute the parametric equation of the curve into the implicit equation, substitute the implicit equation of the parametric surface into the implicit equation, obtain the single variable equation about the curve parameter, solve to obtain the intersection point parameter, and then obtain the intersection point coordinates.
4. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 1, characterized in that, Step S2 specifically involves: S201: Input a system of polynomial equations f and g are the polynomials corresponding to two geometric objects, respectively. The Wu characteristic sequence is obtained by using a symbolic solver. ,in, It is the polynomial with the highest principal variable order in Wu's sequence; S202: Use word segmentation to transform the polynomial equation system sys into an input sequence and the Wu feature column cs into an output sequence, and use these two sequences to construct a training dataset for the polynomial system feature column.
5. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 1, characterized in that, Step S3 specifically involves: S301: For a given input polynomial equation system The pseudo-component r is calculated using a symbolic solver; S302: Use word segmentation to transform the polynomial equation system into an input sequence and the pseudo-coefficient into an output sequence, and use these two sequences to construct a pseudo-division dataset; S303: Calculate the polynomial pseudo-division using a symbolic solver and record intermediate results of the iterative calculation: , ,in, , , To treat polynomial g as the first term coefficient when the principal variable is the only variable, For the number of iterations, For polynomial pseudo-dividing multipliers; S304: Use word segmentation to transform the polynomial equation system into an input sequence, and the intermediate results are sorted according to the sequence [m, , , , , , , The sequence , …] is transformed into an output sequence, and these two sequences are used to construct a pseudo-intermediate dataset.
6. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 1, characterized in that, Step S4 specifically involves: S401: Train the Transformer model based on the pseudo-division dataset to obtain the pseudo-division model; S402: If the pseudo-division model obtained in step S401 has a low prediction accuracy on the validation set, regenerate a polynomial multiplication dataset with the same number of variables v, number of terms t, number of exponents E, and number of coefficients C. S403: Based on the multiplication dataset, train the Transformer model to obtain the multiplication model, and then use the pseudo-division dataset to fine-tune the full parameters of the multiplication model and update the pseudo-division model. S404: If the pseudo-division model obtained in S403 has a low prediction accuracy on the validation set, train the Transformer model based on the pseudo-division intermediate dataset and further update the pseudo-division model.
7. The computer-aided design intersection analysis method based on Transformer and feature columns according to claim 6, characterized in that, The process of constructing the multiplication dataset is as follows: First, a system of polynomial equations is randomly generated. The product p is calculated using a symbolic solver, and then the polynomial equation system is segmented using a word segmentation method. The input sequence and product p are transformed into an output sequence to obtain the multiplication dataset.
8. The computer-aided design intersection analysis method based on Transformer and feature columns according to claims 4-5, characterized in that, The word segmentation method in steps S202 and S302 is as follows: fill in the omitted unit exponent, unit coefficient, and positive sign before the first positive coefficient in each polynomial expression in the polynomial list; segment the numbers by position; and separate the expressions with special characters.