Mesh cylinder parameter inverse calculation method based on end face triangle fan structure

CN122888162APending Publication Date: 2026-10-09BEIJING DATONG HUIDE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611363953.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供基于端面三角扇结构的Mesh圆柱体参数反算方法,用于解决现有技术无法利用端面法线与中心点连线之间的几何约束关系,动态调整圆周点筛选策略,以抑制长圆柱体中轴线方向的系统偏差的问题;

Benefits of technology

[0017]1、通过将端面法线作为独立观测源与中心点连线方向进行加权融合,融合轴线和法线的夹角再去动态调节圆周点筛选阈值,形成闭环迭代修正;有效抑制了长圆柱体中端面中心点径向误差被高度放大所导致的轴线方向系统性漂移,使得轴线估计精度不再过度依赖初始中心点的识别质量;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888162A_ABST
    Figure CN122888162A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of three-dimensional model processing and computer graphics, and is used for solving the problem that the prior art cannot utilize the geometric constraint relationship between the end face normal line and the center point connecting line, dynamically adjust the circumferential point screening strategy, and suppress the system deviation of the axis direction in the long cylinder, and specifically is a Mesh cylinder parameter inverse calculation method based on an end face triangular fan structure, comprising: acquiring a basic parameter set of a Mesh cylinder to be processed, weighting and fusing a center point connecting line direction, a first normal line direction and a second normal line direction based on a weight to obtain a candidate axis direction; repeatedly executing the weighting and fusing, deviation calculation, threshold adjustment and end face parameter updating until a convergence condition is met to obtain a final axis direction; the application forms a closed-loop iterative correction mechanism by weighting and fusing the end face normal line as an independent observation source with the center point connecting line direction and dynamically feeding back and adjusting the circumferential point screening threshold value by using the included angle between the fused axis and the normal line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of 3D model processing and computer graphics technology, specifically a method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure. Background Technology

[0002] In industrial 3D models, Mesh cylinders often have their end faces made into triangular fans: multiple triangles share the same center point. Current technology finds the center by counting the number of references of each vertex of the end face triangle, calculates the radius using the distance from the center to the boundary point, and then uses the line connecting the two end face center points as the axis to calculate the cylinder parameters. This avoids the recalculation of general cylinder fitting and works well when the end face is complete and the height is moderate.

[0003] However, when the cylinder height is much greater than the end face radius, even a small radial error at the end face center point will be amplified by the height, resulting in a significant deviation in the axis direction. Center point identification relies on reference count and distance consistency, leading to a large radial error. The end face normal is averaged from the triangles of the entire end face and is not sensitive to the radial offset of the center point, which could have served as an independent source of observation for the axis direction. Existing methods only use the normal for posterior confidence verification and do not actively use it to correct the axis. The circumferential point selection still uses a fixed distance deviation threshold, which fails to detect differences in the geometric quality of the end face. The fixed distance deviation threshold used for circumferential point selection cannot detect differences in the geometric quality of the end face. When there are local irregularities on one end face, the same selection conditions are still used, resulting in the set of circumferential points participating in the axis calculation containing outliers or missing valid points, further deteriorating the accuracy of axis estimation.

[0004] Therefore, how to utilize the geometric constraint relationship between the end face normal and the line connecting the center point to dynamically adjust the circumferential point selection strategy in order to suppress the systematic deviation in the direction of the central axis of the long cylinder has become an urgent problem to be solved in the practical engineering application of existing methods. Summary of the Invention

[0005] The purpose of this invention is to provide a method for back-calculating the parameters of a Mesh cylinder based on an end-face triangular fan structure, which solves the problem that existing technologies cannot utilize the geometric constraint relationship between the end-face normal and the line connecting the center point to dynamically adjust the circumferential point selection strategy in order to suppress the systematic deviation in the direction of the central axis of the long cylinder.

[0006] The technical problem to be solved by this invention is: how to provide a method for back-calculating the parameters of a Mesh cylinder based on an end-face triangular fan structure, which can dynamically adjust the circumferential point selection strategy by utilizing the geometric constraint relationship between the end face normal and the line connecting the center point, so as to suppress the systematic deviation in the direction of the central axis of the long cylinder.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] A method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure, including:

[0009] Obtain the basic parameter set of the Mesh cylinder to be processed, and determine the direction of the center point connection line, the first normal direction, and the second normal direction based on the basic parameter set.

[0010] Based on preset weights, the direction of the line connecting the center points, the direction of the first normal, and the direction of the second normal are weighted and fused to obtain the candidate axis direction;

[0011] Calculate the deviation angle between the candidate axis direction and the direction of the line connecting the center point, as well as the angle between the candidate axis direction and the first normal direction and the second normal direction;

[0012] Based on the deviation angle, the included angle of the first normal, the included angle of the second normal, and the relative deviation statistics of the distance from each end face circumference point to the corresponding end face center point, adjust the circumference point screening threshold of each end face;

[0013] The set of circumferential points of each end face is re-extracted using the adjusted filtering threshold, and the corresponding end face center point, end face radius and end face normal are updated.

[0014] Repeat the weighted fusion, deviation calculation, threshold adjustment and end face parameter update until the convergence condition is met to obtain the final axis direction;

[0015] The updated center points of the first and second end faces are projected onto the final axis direction to obtain the corrected center points of the first and second end faces, and the parameterized information of the cylinder is output.

[0016] The present invention has the following beneficial effects:

[0017] 1. By using the end face normal as an independent observation source and weighting the direction of the line connecting the center point, the angle between the fused axis and the normal is used to dynamically adjust the circumferential point screening threshold, forming a closed-loop iterative correction; this effectively suppresses the systematic drift of the axis direction caused by the high amplification of the radial error of the end face center point in the long cylinder, so that the axis estimation accuracy no longer depends excessively on the recognition quality of the initial center point;

[0018] 2. By calculating the upper quartile of the relative deviation sequence of the distances from the circumferential points to the center point of each end face as the geometric noise factor, and combining it with the included angle of the normal to construct a dynamic amplification factor, the adaptive adjustment of the circumferential point screening threshold is realized. When there are local irregularities or the normal is tilted on the end face, the threshold is automatically widened to retain valid circumferential points. When the geometric quality of the end face is high, the threshold is automatically tightened to remove abnormal points, thereby avoiding the problem of information loss or noise mixing under complex end face conditions with a fixed threshold.

[0019] 3. The entire iterative process requires no manual intervention. Only a lightweight weighted fusion and threshold adjustment calculation needs to be added after the basic parameter extraction process. The additional computational overhead is far lower than the overall computational load of the basic scheme. By presetting the convergence angle threshold and the maximum number of iterations, the algorithm is guaranteed to terminate in a limited number of steps under extreme end face conditions. It is suitable for batch automatic parameter back calculation of a large number of cylindrical objects in industrial models.

[0020] 4. This solution is not only applicable to ideal cylinders, but can also stably output parameters even in non-ideal situations such as slight elliptical deformation of the end face, local defects of the triangular sector, or non-uniform distribution of circumferential points. The algorithm's engineering stability is enhanced through a backoff mechanism and low-confidence marking. It can be widely used in the parametric restoration of Mesh models and digital twin scenarios of long cylindrical components such as pipes, cylinders, and supports in the process industry. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is the main flowchart of the method in Embodiment 1 of the present invention;

[0023] Figure 2 This is a sub-flowchart of step S4 in Embodiment 1 of the present invention. Detailed Implementation

[0024] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] In industrial models, mesh cylinders with triangular fans at the end face are common. The conventional approach is to count the vertices of the end face triangles to find the center point, and use the line connecting the two center points as the axis. When the end face is intact and the height is moderate, the parameters can be extracted, but the accuracy of the axis is completely tied to the geometric quality of these two center points. In long cylinders, the height is much greater than the radius, and the radial error at the center point is amplified, resulting in a significant deviation in the axis angle. Although existing methods calculate the end face normal at the same time, they are only used for posterior confidence verification and are not integrated into the active correction process of the axis. The fixed distance deviation threshold used for selecting circumferential points cannot detect the differences in the geometric quality of the end face, which may lead to the set of circumferential points participating in the axis calculation containing outliers or missing valid points, further deteriorating the accuracy of the axis estimation.

[0026] If the above problems are not resolved, the axial direction of the long cylinder will continue to deviate from the true value; the unsuppressed radial error at the center point will cause the axial deflection angle to increase linearly with the cylinder height, making the position error at the other end of the cylinder comparable to the radius; and the rigidity of the circumferential point screening threshold will cause local irregularities on the end face to be incorrectly averaged into the axial calculation, resulting in a systematic drift in the axial direction; the final output cylinder parameters will cause millimeter-level positioning deviations in engineering scenarios such as long pipe docking and precision assembly, leading to misjudgment of collision detection or failure of assembly gap analysis, and failing to meet the geometric accuracy requirements of digital twin applications in the process industry.

[0027] Example 1: As Figure 1-2 As shown, the inverse calculation method for the parameters of a Mesh cylinder based on an end-face triangular fan structure includes:

[0028] Step S1: Obtain the basic parameter set of the Mesh cylinder to be processed, and determine the direction of the center point connection, the first normal direction, and the second normal direction based on the basic parameter set; perform weighted fusion of the center point connection direction, the first normal direction, and the second normal direction based on preset weights to obtain the candidate axis direction;

[0029] In the specific implementation of step S1, the basic parameter set of the Mesh cylinder to be processed is obtained. This basic parameter set is not the original vertex data, but a set of geometric features obtained in advance through end face triangular fan structure analysis. Specifically, it includes: the center point of the first end face, the set of the circumference points of the first end face, the set of triangles of the first end face, the radius of the first end face, the normal of the first end face, the center point of the second end face, the set of the circumference points of the second end face, the set of triangles of the second end face, the radius of the second end face, and the normal of the second end face. The above parameters can be provided by the upstream end face recognition and parameter extraction module, which is obtained based on vertex reference count statistics and boundary edge extraction methods. In this embodiment, it is directly used as input.

[0030] After obtaining the basic parameter set, calculate the observation vectors in three directions; calculate the direction of the line connecting the center points: with the center point of the first end face as the reference point. The starting point and the center point of the second end face. The vector ending at is then normalized by dividing it by its magnitude, denoted as . For example, suppose = (2.0, 3.0, 5.0), = (2.0, 13.0, 5.0), then = (0.0, 1.0, 0.0); In each iteration, based on the current center point of the first end face... Second end face center point Recalculate the direction of the line connecting the center points Then retrieve the current stored first end face normal. Calculate its relationship with If the dot product is less than zero, then... Invert the dot product to obtain the first normal direction. ; for the normal to the second end face Performing the same operation yields The sign correction step is performed at the beginning of each iteration; this sign adjustment ensures that the three observation directions are distributed within the same hemisphere, avoiding invalid cancellation due to opposite directions during subsequent weighted fusion.

[0031] The three directions are weighted and fused based on preset weights to obtain candidate axis directions; the preset weights are not fixed constants, but are adaptively calculated based on the end face geometry and cylindrical shape; three weighting factors are defined: the first weighting factor... Used for the direction of the line connecting the center points, second weighting factor Used for the first normal direction, third weighting factor Used for the second normal direction; the calculation formula is as follows:

[0032] First weighting factor The calculation process is as follows: First, obtain the confidence score of the center point of the first end face. Confidence level of identification with the center point of the second end face Take the arithmetic mean of the two. This is a quality index output from the end-face center point identification process (vertex reference count statistics and distance variance verification), with a value ranging from 0 to 1. A higher value indicates a more reliable center point location. Specifically, when the ratio of the maximum to the second-largest reference count is greater than 2 and the distance variance is less than 1, the center point is considered more reliable. When the confidence level is 1, it is reduced proportionally; otherwise, the ratio of cylinder height to cylinder radius is calculated, where the cylinder height is... cylinder radius , and Let these be the radii of the first and second end faces, respectively; then, using this ratio as an exponent, take the negative power of the natural constant; multiply the average confidence level by this exponent, i.e. ;like (e.g. 10) −6 If ), then directly output an error or downgrade to single-endpoint processing; if If the cylinder is invalid, the process terminates.

[0033] Where α is a preset attenuation coefficient (in this embodiment, α = 0.03); this formula expresses the attenuation coefficient of a long cylinder ( When the center point is relatively large, the confidence level of the direction of the line connecting the center points should be appropriately reduced in order to suppress the effect of the radial error being highly amplified.

[0034] Second weighting factor The calculation process is as follows: Take the number of triangles from the first end face that participate in the normal calculation. (This value is determined by the initial set of end face triangles and does not change in subsequent iterations due to the selection of circumference points or the update of the center point.) Compare this value with the preset normalization base. Comparing with =10, we obtain the normalized value. Calculate the relative standard deviation of the first end face radius, i.e., the standard deviation of the first end face radius. With the radius of the first end face The ratio; using the relative standard deviation as the exponent, raise it to the negative power of the natural constant; multiply the normalized triangle count by this exponent, i.e. ; At that time, Set to 0 and record the error flag.

[0035] Where β is a preset sensitivity coefficient (β=5.0 in this embodiment); this formula expresses that the more triangles involved in the normal calculation and the smaller the radius distribution, the more reliable the normal direction and the higher the weight; the third weighting factor Calculate using the same method: .

[0036] For example, suppose =0.92, =0.88, average value is 0.90; H=200.0, =10.0, the ratio is 20.0, exp(-0.03×20.0)=exp(-0.6)≈0.5488, then ≈0.90 × 0.5488 = 0.4939; Let =15, which becomes 1.0 after normalization; =0.15, =10.0, the relative standard deviation is 0.015, exp(-5.0×0.015)=exp(-0.075)≈0.9277, then ≈0.9277; similarly, it can be calculated .

[0037] After obtaining the three weighting factors, a weighted fusion is performed. The direction of the line connecting the center points, the direction of the first normal, and the direction of the second normal are treated as three unit vectors, and their respective self-multiplication outer product matrices are constructed (each is a 3×3 symmetric matrix). Each matrix is ​​multiplied by its corresponding weighting factor and then summed to obtain the target matrix. Before constructing the matrix, check if the sum of the total weights is less than 10. −12 If so, then use directly. As a candidate axis.

[0038] Finding the eigenvector corresponding to the largest eigenvalue of the matrix yields the weighted fused direction; this embodiment uses the power iteration method: the direction is determined by connecting the center points. as initial vector Repeatedly Post-normalization typically leads to convergence after 6 iterations; the normalized eigenvectors after convergence are denoted as the candidate axis directions. To ensure a unique direction (without distinguishing between positive and negative), if and If the dot product is negative, then take At this point, step S1 is complete, and the candidate axis directions are output. For use in subsequent steps.

[0039] Throughout the iteration process, the cylinder height H and the current average radius... and the relative standard deviation of the radii of each end face. , All are based on the radius of the first end face currently stored. With the radius of the second end face Standard deviation of the first end face radius Standard deviation of the second end face radius Instead of using the initial value from the first iteration, the calculation is performed in real time; specifically, each time step S1 is executed, the value updated before the start of that round is used. , , , Substitute into the formula.

[0040] Step S2: Calculate the deviation angle between the candidate axis direction and the direction of the line connecting the center point, as well as the angle between the candidate axis direction and the first normal direction and the second normal direction;

[0041] Obtain candidate axis direction Next, step S2 requires calculating three angle values: the deviation angle between the candidate axis and the direction of the line connecting the center point, the angle between the candidate axis and the first normal direction, and the angle between the candidate axis and the second normal direction. These three angle values ​​will serve as the basis for dynamically adjusting the circumferential point screening threshold in subsequent steps.

[0042] The deviation angle is defined as the angle between the direction of the candidate axis and the direction of the line connecting the center point, and its value ranges from 0 to... Between radians; during calculation, first obtain the direction of the line connecting the center points that has been normalized in step S1. and the candidate axis direction obtained by current fusion Calculate the dot product of the two vectors; since both vectors are unit vectors, the absolute value of the dot product is the absolute value of the cosine of the included angle; to ensure that the deviation angle is always non-negative and not greater than a right angle, take the absolute value of the dot product and then calculate the inverse cosine; the specific formula is: ;

[0043] For example, let = (0.0, 1.0, 0.0), = (0.0174, 0.9998, 0.0), the dot product is 0.9998, and the absolute value is still 0.9998, then... Radius (approximately 1.15°); if the dot product is negative, for example... = (0.0, -0.9998, 0.0), then the dot product is -0.9998, the absolute value is 0.9998, which also yields approximately 0.02 radians; this step eliminates the ambiguity of the axial direction through absolute value processing.

[0044] The calculation method for the angle between the first normal and the first normal is similar, but it does not require taking the absolute value, because the direction of the first normal has already been adjusted by sign in step S1 to ensure that it is consistent with the first normal. The dot product is not less than zero, and and The included angle is usually less than 90°, so the dot product is naturally positive; the included angle between the candidate axis direction and the first normal direction is calculated directly. ;

[0045] because and The included angle may be very small (in an ideal cylinder, the two are parallel or antiparallel), while Between these two values, the dot product should be close to 1.0, resulting in... It is a small angle; similarly, the included angle of the second normal is... ;

[0046] Continuing with the example above, let's assume... = (0.0, 1.0, 0.0), then =0.9998, radians; let = (0.0087, 0.9999, 0.0), the dot product is approximately 0.9994. radian.

[0047] In practical engineering implementation, to avoid the dot product being slightly greater than 1.0 or slightly less than -1.0 due to numerical errors, the dot product result can be limited before calculation: if the dot product is greater than 1.0, it is set to 1.0; if it is less than -1.0, it is set to -1.0.

[0048] After completing the above calculations, the system will output the three angle values ​​( , , ) and the candidate axis directions obtained in step S1 Output them together for use in step S3; among which Used to determine whether the iteration has converged (if it is less than a preset threshold, the iteration is terminated). and This directly contributes to the construction of the amplification factor for the screening threshold of each end face circumference point; it is worth noting that these three angular quantities are all stored in radians, and right angles will be needed in subsequent steps. (Approximately 1.5708) is used to calculate the ratio.

[0049] Step S3: Based on the deviation angle, the first normal angle, the second normal angle, and the relative deviation statistics of the distance from each end face circumference point to the corresponding end face center point, adjust the circumference point filtering threshold of each end face; use the adjusted filtering threshold to re-extract the circumference point set of each end face, and update the corresponding end face center point, end face radius, and end face normal.

[0050] Step S3 consists of three sub-stages: calculating the relative deviation statistics of the distances between each end face and adjusting the circumferential point filtering threshold accordingly; re-extracting the circumferential point set using the new threshold; and updating the end face center point, radius, and normal using the re-extracted circumferential points. This process requires the use of the first normal angle output from step S2. Angle between the second normal and the second normal The set of circumferential points of each end face, the current center point, and the radius obtained in step S1.

[0051] For any end face (taking the first end face as an example), extract the currently stored set of circumferential points for that end face. Current center point and current end face radius The current end face radius refers to the radius value stored after the most recent update; calculate the Euclidean distance from each circumference point to the center point. Calculate the absolute value of the relative deviation between this distance and the current radius. .

[0052] The relative deviations of all the circumference points constitute a sequence. This embodiment defines the distance relative deviation statistic. To find the upper quartile of the sequence: Sort the sequence in ascending order and take the value at the 75th percentile; when the number is 4, take the 3rd value after sorting (i.e., the 75th percentile) as the upper quartile; when the number is greater than 4, take the 3rd value after sorting (i.e., the 75th percentile) as the upper quartile. There are n values ​​(where n is the number of points on the circle). (Rounded up); for example, when n=4, the 3rd quartile is taken, when n=5, the 4th quartile is taken, when n=6, the 5th quartile is taken, and so on; if the number of circumferential points is less than 4, the maximum value in the sequence is taken; the reason for using the upper quartile instead of the mean or median is that the upper quartile is not sensitive to a few local outliers, while reflecting the distribution of most circumferential points, which is suitable for scenarios where there are slight deformations in the triangular sector; for example, if there are 12 circumferential points on a certain end face, and the relative deviation sequence is sorted as [0.002, 0.003, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.012, 0.025, 0.030, 0.045], then the upper quartile is the 9th value (0.012), that is =0.012.

[0053] get Then, the system adjusts the circumferential point filtering threshold of the first end face; a baseline relative deviation threshold is preset. In this embodiment, =0.05 (meaning the distance deviation of a single circumferential point is allowed to not exceed 5% of the current radius); then construct two magnification factors: the first magnification factor is based on the first normal angle. Calculations are required, but prior to the calculations, it is necessary to... Limiting the amplitude: Take the included angle and the right angle. Add 1 to the ratio, that is The second amplification factor is directly taken as 1+ Multiply the reference threshold by the two amplification factors to obtain the new relative deviation threshold for the first end face. ;

[0054] For example, let =0.02 radians, then 1 + 0.02 / 1.5708 ≈ 1.0127; =0.012, then 1 + 0.012 = 1.012; =0.05, the product is 0.05×1.0127×1.012≈0.0512; it can be seen that when the end face geometric quality is good ( and When all values ​​are very small, the new threshold is only slightly higher than the baseline; when there is a significant tilt on the end face or a large circumferential point dispersion, the threshold is appropriately relaxed; the same method is used for the second end face. and calculate .

[0055] After the new threshold is determined, the system re-extracts the set of circumferential points of the end face; taking the first end face as an example, it extracts the set of triangles from the pre-stored original end face. Extract all candidate circumferential points; the extraction method follows the boundary edge extraction method in the basic scheme: in Internally, the reference count of each undirected edge is counted, and the two endpoints of the edge with a reference count of 1 are selected as candidate circumferential points; for each candidate circumferential point... Calculate its distance to the current center point The distance d is then used to calculate the relative deviation. If the relative deviation is less than or equal to If a point is found to be true, it is retained; otherwise, it is discarded. All retained points form a new set of points on the circumference. ;like If the number of points is less than 3, the new threshold is deemed too strict, resulting in the loss of valid points. In this case, the baseline threshold should be used again. Extract again and mark the first end face as a low-confidence state (this marking is only used for subsequent confidence calculations and does not affect geometric updates); after the rollback operation, if the number of circumferential points is still less than 3, directly mark the end face as an "invalid end face" and terminate the iteration, outputting the single end face result or reporting an error; perform the same operation on the second end face to obtain... .

[0056] Update the end face center point: For the first end face, in the original end face triangle set The number of times each vertex is referenced by the triangle is counted, and the vertex with the highest number of references is selected as a candidate center point. ; Calculate the set of candidate points to the new circular points The distances to all points are used to obtain a distance sequence. Then calculate the variance of the sequence. ,in The number of new points on the circle. The mean distance; if Less than the preset variance threshold (This embodiment takes) If the candidate point is selected, then the candidate point is accepted as the updated center point of the first end face. Otherwise, select the vertex with the second highest number of references as a new candidate and repeat the above variance verification until a vertex that meets the conditions is found or a preset number of candidates (such as the first 5) are traversed. If no vertex that meets the variance conditions is found after traversing a preset number of candidate vertices, keep the original center point unchanged and set the confidence of the center point identification of the end face to zero.

[0057] Use the new center point and the new set of circumference points Recalculate the end face radius; first calculate the distance from each new circumference point to the center point to obtain the distance sequence. The outlier removal averaging method is used to calculate the mean of the sequence. and standard deviation Remove all that exceed For points within the range, take the arithmetic mean of the distances to the remaining points to obtain the updated radius of the first end face. Simultaneously calculate the updated standard deviation of the radius. (Based on the remaining points after anomaly removal); the update of the end face normal is achieved by updating the original set of end face triangles. The vector average of the face normals of all triangles in the equation is then normalized to obtain the result. If the number of triangles is less than 3, then a new center point will be used. and For any two non-collinear points on a circle, calculate the cross product of their vectors and normalize it to obtain the normal vector.

[0058] Perform the exact same process on the second end face to obtain... , , , , The updated parameters will replace the corresponding values ​​currently stored and will be used as input for the next iteration. After step S3 is completed, the system will pass the updated end face data to step S4 to determine whether the convergence condition is met or to continue iterating.

[0059] Step S4: Repeat the weighted fusion, deviation calculation, threshold adjustment and end face parameter update until the convergence condition is met to obtain the final axis direction;

[0060] Step S4 is essentially an iterative control process, responsible for repeatedly executing steps S1 to S3 and outputting the final axis direction when a preset termination condition is met. Before entering the loop, two global control parameters are set: the convergence angle threshold. and maximum number of iterations In this embodiment Taking 0.05°, the equivalent in radians is approximately 0.000873. Set the value to 3; simultaneously initialize the iteration counter k=0, and record the direction of the candidate axis generated in the previous iteration. This is an invalid value (used to skip the convergence check during the first iteration).

[0061] In each iteration, the system performs the following operations in sequence: First, it calls step S1, using the currently stored set of end face center points, normals, radii, and circumferential points to calculate the direction of the candidate axis. and the corresponding three weighting factors; then call step S2, based on and the current , , Calculate the deviation angle Angle between the first normal and the first normal Angle between the second normal and the second normal Then, step S3 is called, utilizing... , The system calculates the relative deviation statistics of the current end face, adjusts the filtering threshold of the circumferential points of each end face, re-extracts the set of circumferential points, and updates the center point, radius, and normal of the end face. After completing step S3, the system uses the updated geometric parameters as the input for the next iteration.

[0062] At the end of each iteration, the system checks the convergence condition; the convergence condition consists of two sub-conditions, and iteration stops when either one is satisfied; the first sub-condition is... The first condition is that the deviation angle between the candidate axis direction and the direction of the line connecting the center point is less than the preset convergence threshold; the second sub-condition is... If the number of iterations has reached the preset maximum limit, then k is incremented by one, and the next round of iteration begins.

[0063] Illustrate the convergence process with an example; suppose that after the first iteration, the result is calculated... =0.02 radians (approximately 1.15°), greater than 0.000873, and k=0<3, therefore the iteration continues; after updating the end face parameters in step S3, the candidate axis direction in the second iteration is closer to the true axis, and the calculated... =0.005 radians (approximately 0.29°), still greater than the threshold, continue with the third iteration; after the third iteration =0.0005 radians (approximately 0.029°), less than At this point, stop the iteration and change the direction of the candidate axis obtained in the third iteration. As the final axis direction If the deviation angle is still greater than the threshold after three iterations, for example, it remains around 0.01 radians, then the counter reaches its maximum value after k=2 and the third iteration is completed. The system also stops iterating and outputs the candidate axis direction obtained in the last iteration as the final axis direction. At the same time, it records a convergence failure flag, which indicates that the algorithm failed to converge within the preset number of iterations. The confidence level is forced to be set to zero when the final output is given.

[0064] It should be noted that in each iteration, the direction of the center point connection used in step S1 is different. It will be based on the updated and Recalculation is performed, so the axis direction will gradually approach the true value as the end face parameters are optimized; while the deviation angle in the convergence condition... It is calculated based on the candidate axis direction obtained in the current iteration and the direction of the line connecting the current center point. Both of these quantities are updated with each iteration. Therefore, this condition directly measures the consistency between the weighted fusion result and the line connecting the center points. When the angle between the two is small enough, it means that the weighted fusion can no longer further correct the axis, and the iteration terminates.

[0065] After the iteration is complete, the system will determine the final axis direction. and the center point of the first end face obtained after the last iteration. Center point of the second end face First end face normal Second end face normal First end face radius Second end face radius The corresponding set of circumferential points is passed to step S5; at the same time, the iteration number k+1 (because counting starts from 0, the actual number of executions is k+1) and the final deviation angle are recorded. This is used for subsequent confidence level calculations.

[0066] Step S5: Project the updated center points of the first and second end faces onto the final axis direction to obtain the corrected center points of the first and second end faces, and output the parameterized information of the cylinder.

[0067] Step S5 receives the final axis direction output from step S4. And the center point of the first end face obtained after the last iteration update. Center point of the second end face First end face radius Second end face radius First end face normal Second end face normal The iterative process has brought the axis direction closer to the optimal value, but the center point of the end face may not fall exactly on the axis. This is because when updating the center point in step S3, it is only done within the triangle set of each end face, and there is no requirement that the center point be located on the final axis. Step S5 pulls the two center points back onto the axis through orthogonal projection, while keeping the cylinder height unchanged, so as to ensure that the output geometric parameters strictly satisfy the cylinder definition that "the axis passes through the center of the two end faces".

[0068] Project the center point of the first end face; calculate exist Projection scalar value in direction This is the dot product operation; the scalar value represents the distance from the origin (the origin of the global coordinate system) along the axis to the foot of the perpendicular; similarly, the projection scalar value of the center point of the second end face is calculated. For example, suppose = (0.0, 1.0, 0.0), = (0.1, 5.0, 0.0), then =5.0; = (-0.05, 205.0, 0.05), then =205.0; the arithmetic mean of the two projected scalar values. This midpoint corresponds to the projection of the cylinder's geometric center along the axis.

[0069] Keep the cylinder height constant; current cylinder height Alternatively, the absolute value of the difference between the projected scalar values ​​can be used directly. In the example above =200.0; with Take the midpoint as the reference point and take values ​​on both sides. The length is used to obtain two new projected scalar values. , .

[0070] The corrected coordinates of the end face center point are: , ;

[0071] because It is a unit vector, and the result of the multiplication is a three-dimensional vector whose direction is consistent with the axis, and whose magnitude is equal to the absolute value of the projected scalar value; in the example above... = (0.0, 5.0, 0.0), = (0.0, 205.0, 0.0); Radial deviation is completely eliminated.

[0072] After obtaining the corrected center point, the system assembles the final parameterized information of the cylinder; the specific output includes: the cylinder center point. ;Cylinder axis direction (Unit vector); Cylinder radius Cylinder diameter D = 2R; Cylinder height Center point of the first end face and its normal ,radius Circular point set Center point of the second end face and its normal ,radius Circular point set (The output set of circumferential points represents the original circumferential point positions after the last iteration update, and has not moved with the center point projection; it is only used for reverse lookup.) Additionally, an overall confidence score is output; this confidence score is calculated based on the low-confidence flags recorded in step S3, the number of iterations recorded in step S4, and the final deviation angle; specifically, the base confidence score... The result is obtained by weighted summation of the following five components, each with a value range of [0, 1]. The weighting coefficients can be preset according to the application scenario (equal weights are used in this embodiment):

[0073] Center point identification quality: determined by the ratio of the number of references to the distance variance of the candidate center point on the end face. The higher the number of references and the smaller the distance variance, the closer this component is to 1.

[0074] Radius stability: determined by the ratio of the standard deviation of the end face radius to the radius; the smaller the ratio, the higher the radius stability.

[0075] Axis consistency: determined by the average value of the cosine of the angle between the lines connecting the normals of the two end faces and the center point; the smaller the angle, the higher the consistency.

[0076] Lateral support: Randomly sample several vertices on the side and calculate the ratio of their distance from the axis to the radius. The proportion of vertices whose deviation ratio is less than a preset threshold (such as 5%) is the lateral support.

[0077] Circular point coverage: Determined by the ratio of the angular range covered by the circular points to 360 degrees. The more complete the coverage, the higher this component.

[0078] Calculate the residual deviation penalty factor of the axis ,in It is the deviation angle (in radians) of the last iteration; if the number of iterations reaches the maximum number of iterations. and Still greater than the convergence threshold Then multiply by the convergence penalty coefficient. Set it to 0.95; if normal convergence occurs (i.e., the angle threshold is met before the maximum number of iterations is reached), then the convergence penalty coefficient is... Set the confidence level to 1.0; final confidence level This embodiment will As part of the output, it is used by downstream engineering systems to judge the reliability of the parameters; after step S5 is completed, the entire parameter back calculation process ends; if a convergence failure flag is recorded in step S4, then regardless of the result of the basic confidence calculation, the final confidence is directly output as zero.

[0079] Through the aforementioned iterative optimizations, this scheme introduces multi-source weighted fusion of the axial direction and dynamic feedback adjustment of the circumferential point screening threshold in the basic parameter extraction process, forming a closed-loop correction mechanism. When the cylinder height is much greater than the end face radius, the traditional method causes a significant deviation in the axial direction due to the amplified radial error of the center point, resulting in a lateral offset at the other end of the cylinder reaching an order of magnitude comparable to the radius. In contrast, this scheme effectively suppresses systematic drift in the axial direction by fusing end face normal information that is insensitive to center point offset and adaptively adjusting the screening threshold based on the angle between the end face normals and the circumferential point distance distribution, keeping the residual deviation within an acceptable range for engineering applications. During the iteration process, the circumferential point screening threshold can be automatically widened or tightened according to the actual geometric quality of the end face, avoiding the problem of abnormal points being mistakenly included or effective points being missed due to a fixed threshold. This ensures that the cylinder axis estimation accuracy no longer excessively depends on the initial end face center point identification quality. The entire processing flow requires no manual intervention and has minimal additional computational overhead, making it suitable for high-precision parameter back-calculation scenarios for long cylinders in batch industrial models.

[0080] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0081] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. A method for inverse calculation of parameters of a Mesh cylinder based on an end-face triangular fan structure, characterized in that, include: Obtain the basic parameter set of the Mesh cylinder to be processed, and determine the direction of the center point connection line, the first normal direction, and the second normal direction based on the basic parameter set. Based on preset weights, the direction of the line connecting the center points, the first normal direction, and the second normal direction are weighted and fused to obtain the candidate axis direction; Calculate the deviation angle between the candidate axis direction and the direction of the line connecting the center point, and the first normal angle and the second normal angle between the candidate axis direction and the first normal direction and the second normal direction; Based on the deviation angle, the first normal angle, the second normal angle, and the relative deviation statistics of the distance from each end face circumference point to the corresponding end face center point, adjust the circumference point filtering threshold of each end face; The set of circumferential points of each end face is re-extracted using the adjusted filtering threshold, and the corresponding end face center point, end face radius and end face normal are updated. Repeat the weighted fusion, deviation calculation, threshold adjustment and end face parameter update until the convergence condition is met to obtain the final axis direction; The updated center points of the first and second end faces are projected onto the final axis direction to obtain the corrected center points of the first and second end faces, and the parameterized information of the cylinder is output.

2. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 1, characterized in that, The basic parameter set includes: the center point of the first end face, the set of points around the first end face, the set of triangles on the first end face, the radius of the first end face, the normal of the first end face, the center point of the second end face, the set of points around the second end face, the set of triangles on the second end face, the radius of the second end face, and the normal of the second end face.

3. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 2, characterized in that, The specific steps for determining the direction of the line connecting the center points, the direction of the first normal, and the direction of the second normal are as follows: Calculate and normalize the vector from the center point of the first end face to the center point of the second end face to obtain the direction of the line connecting the center points; adjust the sign of the normal of the first end face so that its dot product with the direction of the line connecting the center points is not less than zero to obtain the direction of the first normal; adjust the sign of the normal of the second end face so that its dot product with the direction of the line connecting the center points is not less than zero to obtain the direction of the second normal.

4. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 2, characterized in that, The preset weights include a first weight factor, a second weight factor, and a third weight factor: the first weight factor is proportional to the average of the confidence scores for identifying the center point of the first end face and the center point of the second end face, and multiplied by a factor that decreases exponentially as the ratio of the cylinder height to the cylinder radius increases; the second weight factor is proportional to the normalized value of the number of triangles participating in the normal calculation of the first end face, and multiplied by a factor that decreases exponentially as the relative standard deviation of the first end face radius increases; the third weight factor is proportional to the normalized value of the number of triangles participating in the normal calculation of the second end face, and multiplied by a factor that decreases exponentially as the relative standard deviation of the second end face radius increases. The cylinder height is the Euclidean distance from the center point of the first end face to the center point of the second end face, and the cylinder radius is the arithmetic mean of the radii of the first end face and the radii of the second end face.

5. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 1, characterized in that, The relative deviation statistic is calculated as follows: For any end face, calculate the absolute value of the difference between the distance from each circumferential point in the set of circumferential points of the end face to the corresponding end face center point and the current end face radius, divide it by the current end face radius, and obtain the relative deviation sequence; if the number of circumferential points is greater than or equal to four, take the upper quartile of the relative deviation sequence as the relative deviation statistic of the end face; if the number of circumferential points is less than four, take the maximum value of the relative deviation sequence as the relative deviation statistic of the end face.

6. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 1, characterized in that, The specific steps for adjusting the circumferential point filtering thresholds of each end face are as follows: For the first end face, a first magnification factor is constructed based on the ratio of the first normal angle to the right angle, and a second magnification factor is constructed based on the relative deviation statistics of the distance of the first end face. The preset benchmark relative deviation threshold is multiplied by the first magnification factor and the second magnification factor to obtain the new relative deviation threshold of the first end face. For the second end face, the same method is used to obtain the new relative deviation threshold of the second end face based on the second normal angle and the relative deviation statistics of the distance of the second end face.

7. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 6, characterized in that, The process of re-extracting the set of circumferential points for each end face using the adjusted filtering threshold includes: for the first end face, extracting candidate circumferential points from the original end face triangle set, calculating the relative deviation between the distance of each candidate circumferential point to the current center point of the first end face and the current radius of the first end face, retaining candidate circumferential points whose relative deviation is less than or equal to the new relative deviation threshold of the first end face, and forming a new set of circumferential points for the first end face; if the number of points in the new set of circumferential points for the first end face is less than three, then reverting to re-extracting using the reference relative deviation threshold.

8. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 2, characterized in that, The specific steps for updating the corresponding end face center point are as follows: Count the number of times each vertex is referenced by the triangular face in the end face triangle set, and select the vertex with the highest reference count as a candidate center point; calculate the distance from the candidate center point to each point in the newly extracted circumferential point set, obtain a distance sequence, and calculate the variance of the sequence; if the variance is less than a preset variance threshold, then the candidate center point is determined as the updated end face center point; otherwise, the vertex with the second highest reference count is selected as a new candidate center point and the verification is repeated until a vertex that meets the variance condition is found or a preset number of candidate vertices are traversed.

9. The method for inverse calculation of Mesh cylinder parameters based on end-face triangular fan structure according to claim 1, characterized in that, The convergence condition is specifically: the deviation angle between the candidate axis direction and the direction of the line connecting the center point is less than a preset angle threshold, or the number of repeated iterations reaches the preset maximum number of iterations.

10. The method for inverse calculation of parameters of a Mesh cylinder based on an end-face triangular fan structure according to claim 1, characterized in that, Projecting the updated center points of the first and second end faces onto the final axis direction specifically includes: calculating the projection scalar values ​​of the updated center points of the first and second end faces and the current center point of the second end face onto the final axis direction; calculating the arithmetic mean of the two projection scalar values, using the mean as the midpoint and the Euclidean distance between the updated center points of the first and second end faces as the length, and redetermining the two new projection scalar values; multiplying the final axis direction by the two new projection scalar values ​​respectively to obtain the corrected center points of the first and second end faces.