Cylinder component surface pit detection method and system based on STL model fitting
Patent Information
- Application Number
- CN202610932103.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-10-23
AI Technical Summary
[0006]本发明要解决的技术问题在于克服现有技术中无法有效分析识别圆柱构件表面蚀坑的缺陷,从而提供一种基于STL模型拟合的圆柱构件表面蚀坑检测方法和系统
[0017]有益效果:本发明公开了一种基于STL模型拟合的圆柱构件表面蚀坑检测方法,通过依据STL三维网格模型在圆柱构件轴向的坐标分布,识别并剔除包含端面缺失、边界毛刺及扫描噪声等端部异常区域,仅在有效分析区间内进行截面求交与轮廓提取,避免了端部畸变数据对拟合过程的干扰,从而保证了理想圆柱参考模型的轴线与参考半径更加准确、稳定。基于扫描精度、测量噪声、表面粗糙度等多种扫描与表面状态相关参数动态确定自适应负阈值,取代了传统固定阈值判定,使得候选蚀坑点的筛选能够自适应不同扫描设备精度和构件表面质量,有效降低了复杂工况下的误检与漏检率。
Smart Images

Figure CN122966528A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent manufacturing quality assessment technology, specifically relating to a method and system for detecting surface pits in cylindrical components based on STL model fitting. Background Technology
[0002] During manufacturing and service, cylindrical components are highly susceptible to pitting due to corrosion, wear, or fatigue. Pit depth is a key quantitative indicator for assessing the degree of surface damage, remaining load-bearing capacity, and safe service life of components. With the rapid development of 3D optical scanning and reverse modeling technologies, surface defect detection based on STL 3D mesh models has gradually become an important means of industrial non-destructive testing.
[0003] Currently, the common approach for automated detection of pits on the surface of cylindrical components is to first construct an ideal cylindrical surface as a geometric reference, then calculate the radial deviation from the surface sampling point to this reference surface, and finally identify the pits based on the deviation. However, existing detection methods still have the following significant shortcomings in practical engineering applications: First, when constructing an ideal cylindrical datum, due to scan occlusion or boundary effects, the obtained STL model of the component often exhibits anomalies such as missing end faces, edge burrs, or incomplete local contours at both ends. Existing techniques often directly utilize the full-segment model data, including the ends, for datum fitting. Interference from abnormal areas at the ends can easily cause the fitted reference cylinder axis to shift or the radius to become distorted, resulting in subsequent deviation calculations losing accurate geometric datum.
[0004] Secondly, when screening potential defect points based on a reference surface, existing methods often use fixed empirical thresholds for discrimination. However, in actual scanning operations, the scanning accuracy, measurement noise level, and surface roughness of different equipment vary greatly, making it difficult for fixed thresholds to adapt to the changing scanning and surface conditions. If the threshold is set too high, it is easy to miss shallow actual pits; if the threshold is set too low, normal surface undulations or noise are easily misjudged as pits, resulting in poor generalization ability.
[0005] Finally, when identifying valid pit regions, existing techniques typically rely solely on the magnitude of local inward deviations. However, local model reconstruction errors and outlier noise points also manifest as numerical inward deviations and are often isolated. Relying solely on the magnitude of these deviations without considering the continuity of spatial distribution and regional geometry makes it difficult to effectively distinguish isolated pseudo-defects from genuine pits with continuous areas and specific geometric features, leading to reduced reliability of the final detection results. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to overcome the defect of the prior art that cannot effectively analyze and identify pits on the surface of cylindrical components, thereby providing a method and system for detecting pits on the surface of cylindrical components based on STL model fitting.
[0007] A method for detecting surface pits in cylindrical components based on STL model fitting includes the following steps: Step S1: Obtain the STL 3D mesh model of the cylindrical component to be detected, and parse the triangular facet data of the STL 3D mesh model; Step S2: Based on the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, identify and eliminate abnormal end regions to determine the effective analysis range; Step S3: Set multiple sampling sections along the axial direction within the effective analysis interval, intersect each sampling section with the triangular patch data to reconstruct the closed section profile, and extract the outer profile of the section; Step S4: Fit the center and radius of the cross-section based on the outer contour of each cross-section, and fit the axis of the ideal cylinder based on the center of each cross-section and the reference radius of the ideal cylinder based on the radius of each cross-section to construct the ideal cylinder reference model; Step S5: Using the vertices of the STL 3D mesh model as surface sampling points, calculate the deviation value of each surface sampling point relative to the ideal cylindrical surface based on the ideal cylinder axis and the ideal cylinder reference radius; Step S6: Determine an adaptive negative threshold based on the scanning and surface state related parameters, and determine the surface sampling points with deviation values less than or equal to the adaptive negative threshold as candidate pitting points; Step S7: Cluster the candidate pit points according to the grid topology adjacency relationship, construct candidate pit regions, and extract various regional geometric and continuity features of each candidate pit region; Step S8: Based on the various regional geometric and continuity features, comprehensively judge the candidate pitting regions and identify the effective pitting regions; Step S9: Determine the maximum inward deviation point within the effective pit area, determine its deviation value as the maximum pit depth, and output it.
[0008] Furthermore, based on the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, abnormal end regions are identified and eliminated to determine the effective analysis interval; the abnormal end regions include at least one of the following: end face missing region, boundary burr region, local incomplete cross-sectional contour region, and scanning noise concentration region; the effective analysis interval is determined by statistically analyzing the axial coordinates of the cylindrical component model, combined with the preset length range at both ends of the cylindrical component, the point density abrupt change region, and the local normal chaotic region.
[0009] Furthermore, multiple sampling sections are set along the axial direction within the effective analysis interval. The intersection of each sampling section with the triangular facet data is calculated to reconstruct the closed section contour, and the outer contour of the section is extracted. The intersection of the sampling section with the triangular facet is achieved by calculating the intersection points of each side of the triangular facet with the sampling section plane. After tolerance merging of repeated intersection points, a set of section line segments is constructed, and one or more closed section contours are reconstructed by endpoint matching. The outer contour of the section is the contour with the largest enclosing area among the closed section contours.
[0010] Furthermore, the ideal cylindrical reference model is constructed by fitting the center and radius of the cross-sections based on the outer contour of each cross-section, fitting the ideal cylindrical axis based on the center of each cross-section, and fitting the ideal cylindrical reference radius based on the radius of each cross-section. The center and radius of the cross-sections are obtained by least-squares circle fitting. The ideal cylindrical axis is obtained by robustly fitting a straight line to the center of multiple cross-sections. The ideal cylindrical reference radius is obtained by statistically analyzing the median after removing outliers from multiple cross-section radii.
[0011] Furthermore, using the STL 3D mesh model as surface sampling points, and based on the ideal cylinder axis and the ideal cylinder reference radius, the deviation value of each surface sampling point relative to the ideal cylindrical surface is calculated; the deviation value of any surface sampling point relative to the ideal cylindrical surface satisfies Δi = r i -R ref , where r i R is the shortest distance from the sampling point on the surface to the axis of the ideal cylinder. ref The reference radius is for the ideal cylinder.
[0012] Furthermore, using the STL 3D mesh model as surface sampling points, and based on the ideal cylinder axis and the ideal cylinder reference radius, the deviation value of each surface sampling point relative to the ideal cylinder surface is calculated; the scanning and surface state related parameters include scanning accuracy parameters, measurement noise parameters, surface roughness baseline parameters, local sampling density parameters, and cross-sectional fitting fluctuation parameters; the adaptive negative threshold T n Satisfy: T n =-(w1·P′+w2·N′+w3·R′+w4·D′+w5·V′+b), where P′ is the normalized scanning accuracy parameter, N′ is the normalized measurement noise parameter, R′ is the normalized surface roughness baseline parameter, D′ is the normalized local sampling density parameter, V′ is the normalized cross-section fitting fluctuation parameter, b is the basic correction term, and w1~w5 are the corresponding weight coefficients.
[0013] Furthermore, the candidate pit points are clustered based on grid topology adjacency relationships to construct candidate pit regions, and various regional geometric and continuity features of each candidate pit region are extracted. The candidate pit regions are obtained through connected domain clustering based on grid topology adjacency relationships. The various regional geometric and continuity features include local curvature features, surface normal variation features, neighborhood deviation continuity features, connected region area features, and region depth features. The region depth features include at least one of average depth, maximum depth, and depth variance. The connected region area features are obtained by accumulating triangular facets within the candidate pit regions.
[0014] Furthermore, the candidate pit regions are comprehensively judged based on the various regional geometric and continuity features to identify effective pit regions; a comprehensive scoring model is used to judge the candidate pit regions, the comprehensive scoring model satisfying: S=αK+βL+γA+δH+εQ, where K is the local curvature index, L is the neighborhood continuity index, A is the connected region area index, H is the region depth index, Q is the normal change stability index, and α, β, γ, δ, and ε are the corresponding weights; when S is greater than or equal to the identification threshold S0, and the candidate pit region satisfies the minimum area threshold A0 and the minimum number of points threshold N0, it is identified as an effective pit region.
[0015] Furthermore, it also includes: performing local secondary sampling, mesh-refined sampling, or local interpolation sampling on the effective pit area to obtain encrypted sampling points; recalculating the deviation value within the effective pit area based on the encrypted sampling points, and using the recalculated maximum inward deviation value as the maximum pit depth; visually marking the maximum pit point and the effective pit area in the three-dimensional model, and generating a detection report.
[0016] A system for detecting surface pits on cylindrical components based on STL model fitting, comprising: The model parsing module is used to obtain the STL 3D mesh model of the cylindrical component to be detected and to parse and obtain the triangular facet data of the model. The interval determination module is used to identify and eliminate abnormal end regions and determine the effective analysis interval based on the coordinate distribution of the STL three-dimensional mesh model along the axial direction of the cylindrical component. The contour extraction module is used to set multiple sampling sections along the axial direction within the effective analysis range, intersect each sampling section with the triangular patch data to reconstruct the closed section contour, and extract the outer contour of the section. The cylinder fitting module is used to fit the center and radius of the cross section based on the outer contour of each cross section, and to fit the ideal cylinder axis based on the center of each cross section and the ideal cylinder reference radius based on the radius of each cross section, thereby constructing an ideal cylinder reference model; The deviation calculation module is used to calculate the deviation value of each surface sampling point relative to the ideal cylindrical surface, based on the ideal cylindrical axis and the ideal cylindrical reference radius, using the vertices of the STL three-dimensional mesh model as surface sampling points. The candidate point screening module is used to determine an adaptive negative threshold based on scanning and surface state related parameters, and to identify surface sampling points with deviation values less than or equal to the adaptive negative threshold as candidate pitting points. The feature extraction module is used to cluster the candidate pit points based on the grid topology adjacency relationship, construct candidate pit regions, and extract various regional geometric and continuity features of each candidate pit region. The region discrimination module is used to comprehensively discriminate candidate pit regions based on the various regional geometric and continuity features, and identify effective pit regions. The result output module is used to determine the maximum inward deviation point within the effective pit area, determine its deviation value as the maximum pit depth, and output it.
[0017] Beneficial Effects: This invention discloses a method for detecting surface pits on cylindrical components based on STL model fitting. By using the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, it identifies and eliminates abnormal end regions, including those with missing end faces, boundary burrs, and scanning noise. Cross-sectional intersection and contour extraction are performed only within the effective analysis interval, avoiding interference from end-distortion data on the fitting process. This ensures that the axis and reference radius of the ideal cylindrical reference model are more accurate and stable. An adaptive negative threshold is dynamically determined based on various scanning and surface condition-related parameters such as scanning accuracy, measurement noise, and surface roughness, replacing the traditional fixed threshold judgment. This allows the selection of candidate pit points to adapt to different scanning equipment accuracies and component surface qualities, effectively reducing the false detection and false negative rates under complex working conditions.
[0018] This invention, after screening candidate pits, relies not only on the magnitude of the deviation but also on the mesh topological adjacency relationship for clustering, and extracts various regional geometric and continuity features for comprehensive discrimination. This mechanism can effectively distinguish isolated noise points, outliers, and real pits with spatial continuity and specific geometric shapes, eliminating false defect areas and significantly improving the accuracy of identification. Within the effective pit area, the maximum inward deviation point is located to determine the maximum pit depth, and the deviation value is further recalculated through local secondary sampling, mesh refinement, or interpolation sampling, improving the local calculation accuracy of depth detection. Simultaneously, the combination of 3D visualization markers and detection report generation makes the detection results more intuitive and complete. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the main method steps of the present invention; Figure 2 This is a schematic diagram of the effective analysis interval structure of the present invention; Figure 3 This is a schematic diagram of the cross-sectional outer contour structure of the present invention; Figure 4 This is a schematic diagram illustrating the calculation of the deviation value in this invention.
[0021] Explanation of reference numerals in the attached figures: 1. Cylindrical component; 2. End anomaly region; 3. Effective analysis interval; 4. Sampling section; 11. Triangular facet; 12. Intersection point; 13. Section segment; 14. Closed section profile; 15. Outer profile of section; 21. Surface sampling point; 22. Ideal cylinder axis; 23. Ideal cylinder reference radius; 24. Ideal cylinder surface; 25. Deviation value. Detailed Implementation
[0022] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0023] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0024] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0025] Example 1: This embodiment provides a method for detecting surface pits in cylindrical components based on STL model fitting, such as... Figure 1 As shown, the specific steps include: Step S1: Obtain the STL 3D mesh model of the cylindrical component to be detected, and parse the triangular facet data of the STL 3D mesh model; Step S2: Based on the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, identify and eliminate abnormal end regions to determine the effective analysis range; Step S3: Set multiple sampling sections along the axial direction within the effective analysis interval, intersect each sampling section with the triangular patch data to reconstruct the closed section profile, and extract the outer profile of the section; Step S4: Fit the center and radius of the cross-section based on the outer contour of each cross-section, and fit the axis of the ideal cylinder based on the center of each cross-section and the reference radius of the ideal cylinder based on the radius of each cross-section to construct the ideal cylinder reference model; Step S5: Using the vertices of the STL 3D mesh model as surface sampling points, calculate the deviation value of each surface sampling point relative to the ideal cylindrical surface based on the ideal cylinder axis and the ideal cylinder reference radius; Step S6: Determine an adaptive negative threshold based on the scanning and surface state related parameters, and determine the surface sampling points with deviation values less than or equal to the adaptive negative threshold as candidate pitting points; Step S7: Cluster the candidate pit points according to the grid topology adjacency relationship, construct candidate pit regions, and extract various regional geometric and continuity features of each candidate pit region; Step S8: Based on the various regional geometric and continuity features, comprehensively judge the candidate pitting regions and identify the effective pitting regions; Step S9: Determine the maximum inward deviation point within the effective pit area, determine its deviation value as the maximum pit depth, and output it.
[0026] As a preferred embodiment, the cylindrical component is a steel wire. In other embodiments of this embodiment, the cylindrical component can be other cylindrical components that may have surface pits.
[0027] Specifically, in step S1, the STL 3D mesh model of the cylindrical component to be detected is obtained. By reading the model file, the vertex data and triangular facet data of the STL 3D mesh model are parsed and obtained, and a topological index structure of the mesh is established. Through this step, the unstructured mesh file is transformed into a data structure with topological relationships, providing necessary data support for subsequent cross-section intersection and topological clustering. In this embodiment, the STL 3D mesh model of the cylindrical component is parsed using MATLAB software, and the vertex data is used to identify the overall shape.
[0028] In step S2, refer to Figure 2 As shown, based on the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, abnormal end regions are identified and eliminated to determine the effective analysis interval. Specifically, the abnormal end regions include at least one of the following: end face missing areas, boundary burr areas, areas with incomplete local cross-sectional contours, and areas with concentrated scanning noise. The effective analysis interval is determined by statistically analyzing the axial coordinates of the cylindrical component model, combined with the preset length ranges at both ends of the cylindrical component, areas of abrupt changes in point density, and areas of chaotic local normals. Thus, the preset length ranges at both ends, along with the aforementioned abnormal regions, are eliminated. By eliminating abnormal end regions, fitting interference caused by end face occlusion, edge burrs, or local scanning noise accumulation is effectively avoided, thereby reducing the offset impact of end distortion on the subsequent construction of the reference cylindrical datum and ensuring the stability of the datum.
[0029] Specifically, multiple pre-detection sections are extracted at preset intervals along the axial direction, and the contour integrity C of each pre-detection section is calculated. i Cross-sectional area A i and point density P i And based on the cross-sectional area change rate G of adjacent pre-detection sections i =|A i -A i-1 | / A i-1 Make a judgment; when C exists in multiple consecutive pre-detection sections near either end of the steel wire i Less than the integrity threshold C0, G i Greater than the rate of change threshold G0 or P i When the density is less than the point density threshold P0, the corresponding region is identified as an end abnormal region.
[0030] In step S3, refer to Figure 3As shown, multiple sampling sections are set at equal intervals along the axial direction with a preset step size within the effective analysis interval. The intersection of each sampling section with the triangular facet data is calculated to reconstruct the closed section contour and extract the outer contour of the section. Specifically, the intersection of the sampling section and the triangular facet is achieved by calculating the intersection points of each side of the triangular facet with the sampling section plane. When there is a valid intersection, the repeated intersection points are merged with tolerance to construct a set of section line segments. Based on the topological connection relationship between the endpoints of the line segments, one or more closed section contours are reconstructed by endpoint matching. The outer contour of the section is the contour with the largest enclosed area among the closed section contours. Through section intersection and tolerance merging, the outer contour representing the true boundary of the outer surface of the component can be robustly obtained, eliminating the interference of internal holes or stray contours.
[0031] In this embodiment, the number of sampling sections is adaptively determined based on the wire model length, scanning accuracy, and axial sampling resolution, and an upper limit is set on the total number of sampling sections to balance detection accuracy and computational efficiency; specifically, the number N of sampling sections is based on the effective analysis interval length L. eff Axial sampling interval D z and preset upper limit value N max It is determined that N = min{N} max ,ceil(L eff / D z )+1};where, D z =k·e, where e is the scanning precision and k is a preset scaling factor greater than or equal to 1.
[0032] In step S4, the center and radius of each cross-section are fitted based on its outer contour. An ideal cylindrical reference model is then constructed by fitting the axis of the cylinder to the center of each cross-section and the reference radius to the radius of each cross-section. Specifically, the center and radius of each cross-section are obtained through least-squares circle fitting; the ideal cylindrical axis is obtained by robustly fitting a straight line to the centers of multiple cross-sections; and the ideal cylindrical reference radius is obtained by statistically analyzing the median after removing outliers from the multiple cross-section radii. Through robust straight-line fitting and median statistics, the interference of local defects or fitting outliers on the overall axis and radius is effectively suppressed, improving the stability and accuracy of the overall geometric datum construction of the cylinder.
[0033] In step S5, refer to Figure 4 As shown, using the vertices of the STL 3D mesh model as initial surface sampling points, and based on the ideal cylinder axis and the ideal cylinder reference radius, the deviation value of each surface sampling point relative to the ideal cylinder surface is calculated. Specifically, the deviation value of any surface sampling point relative to the ideal cylinder surface satisfies Δi = r i -R ref , where r iR is the shortest distance from the sampling point on the surface to the axis of the ideal cylinder. ref The radius of the ideal cylinder is used as a reference. When Δi is negative, it indicates that the sampling point deviates inward relative to the ideal cylindrical surface; the larger the absolute value, the more pronounced the indentation. This step provides a reliable numerical basis for the initial screening of pits by accurately quantifying the deviation of the surface sampling point from the reference.
[0034] In step S6, an adaptive negative threshold is determined based on the scanning and surface condition correlation parameters, and surface sampling points with deviation values less than or equal to the adaptive negative threshold are identified as candidate pitting points. Specifically, the scanning and surface condition correlation parameters include scanning accuracy parameters, measurement noise parameters, surface roughness baseline parameters, local sampling density parameters, and cross-sectional fitting fluctuation parameters; the adaptive negative threshold Tn satisfies: T n =-(w1·P′+w2·N′+w3·R′+w4·D′+w5·V′+b), where P′ is the normalized scanning accuracy parameter, N′ is the normalized measurement noise parameter, R′ is the normalized surface roughness baseline parameter, D′ is the normalized local sampling density parameter, V′ is the normalized cross-sectional fitting fluctuation parameter, b is the basic correction term, and w1~w5 are the corresponding weighting coefficients. By introducing a multi-parameter adaptive negative threshold to replace the traditional fixed threshold, the judgment threshold can dynamically adapt to the varying conditions such as the accuracy of different scanning devices, the surface roughness of different components, and the sampling density, significantly enhancing the adaptability under complex working conditions and reducing the risk of false detection and missed detection.
[0035] In step S7, the candidate pits are clustered based on grid topological adjacency relationships to construct candidate pit regions, and various regional geometric and continuity features of each candidate pit region are extracted. Specifically, the candidate pit regions are obtained through connected domain clustering based on grid topological adjacency relationships; the various regional geometric and continuity features include local curvature features, surface normal variation features, neighborhood deviation continuity features, connected region area features, and region depth features; the region depth features include at least one of average depth, maximum depth, and depth variance; the connected region area features are obtained through the accumulation of triangular facets within the candidate pit regions. By expanding from isolated points to topologically connected regions and extracting multidimensional features, rich morphological and continuity constraints are provided to distinguish real pits from local isolated noise points.
[0036] Specifically, the connected component clustering based on grid topology adjacency relationships includes: using each candidate pit point as a graph node, reading the vertex-edge-face adjacency relationship of the STL triangular facets; when two candidate pit points belong to the same triangular facet, share a grid edge, or their shortest adjacency distance along the grid surface is not greater than a preset adjacency distance d0, establishing a connected edge between the corresponding nodes to form a connected graph; traversing the connected graph using depth-first search, breadth-first search, or disjoint-set data structure algorithms to obtain several disjoint connected components, and determining the set of candidate pit points and their adjacent triangular facets corresponding to each connected component as a candidate pit region. For adjacent connected components separated by a small number of non-candidate points, when their boundary spacing is not greater than a merging threshold d... m When the average deviation changes continuously, they are merged into the same candidate pit region; for connected components with fewer than the preset candidate point number threshold or consisting only of isolated points, the corresponding noise region is marked and removed.
[0037] In step S8, candidate pit regions are comprehensively judged based on the various regional geometric and continuity features to identify valid pit regions. Specifically, a comprehensive scoring model is used to judge candidate pit regions, which satisfies: S = αK + βL + γA + δH + εQ, where K is the local curvature index, L is the neighborhood continuity index, A is the area index of the connected region, H is the region depth index, Q is the normal change stability index, and α, β, γ, δ, and ε are the corresponding weights. When S is greater than or equal to the identification threshold S0, and the candidate pit region satisfies the minimum area threshold A0 and the minimum number of points threshold N0, it is identified as a valid pit region. By combining the comprehensive scoring model with multi-dimensional features and dual threshold constraints, misjudgments caused by isolated noise points, burrs, and false defects can be accurately eliminated, significantly improving the reliability of pit identification results.
[0038] Specifically, K, L, A, H, and Q are used to characterize different features of the candidate pitting region. K is the local curvature index, reflecting whether the region has a significant depression; the more pronounced the depression, the larger the K value. L is the neighborhood continuity index, reflecting whether the deviation values of adjacent candidate pitting points within the region change continuously; the better the continuity, the larger the L value. A is the connected region area index, reflecting the actual coverage area of the candidate pitting region; regions with excessively small areas can be identified as noise or false defects. H is the region depth index, reflecting the average or maximum depth of the region; the greater the depth, the larger the H value. Q is the normal variation stability index, reflecting whether the surface normal variation of the region is smooth and stable; the more stable the variation, the larger the Q value. After normalization, these indices are input into the comprehensive scoring model. When the comprehensive score reaches the identification threshold, and the candidate region simultaneously meets the minimum area and minimum number of points requirements, the candidate region is identified as a valid pitting region.
[0039] In this embodiment, the specific values of the local curvature index K, the neighborhood continuity index L, the connected region area index A, the region depth index H, and the normal change stability index Q can be calculated using existing conventional calculation methods, thereby reflecting the corresponding indices.
[0040] In step S9, the maximum inward deviation point is determined within the effective pit region, and its deviation value is determined as the maximum pit depth and output. In this embodiment, the maximum inward deviation point is the point with the largest deviation value within the effective pit region. Further, local secondary sampling, mesh refinement sampling, or local interpolation sampling is performed on the effective pit region to obtain refined sampling points; the deviation value within the effective pit region is recalculated based on the refined sampling points, and the recalculated maximum inward deviation value is used as the maximum pit depth; the maximum pit point and the effective pit region are visually marked in the 3D model, and a detection report is generated. By recalculating the deviation through local refined sampling, the depth calculation error caused by the original mesh vertices not being at extreme points is effectively compensated, further improving the quantification accuracy of the maximum pit depth; at the same time, the visual marking and report output make the detection results more intuitive and complete.
[0041] In this embodiment, the output also includes at least one of the following: maximum pit depth, maximum pit coordinates, and number of effective pits.
[0042] Example 2 This embodiment provides a surface pit detection system for cylindrical components based on STL model fitting. This system executes the method described in Embodiment 1 above, achieving the same technical effect as Embodiment 1 through the coordinated operation of its modules. The system includes: The model parsing module is used to obtain the STL 3D mesh model of the cylindrical component to be detected, and to parse and obtain the triangular facet data of the model to provide a data foundation for subsequent processing. The interval determination module is used to identify and eliminate abnormal end regions based on the coordinate distribution of the STL three-dimensional mesh model along the axial direction of the cylindrical component, and determine the effective analysis interval, thereby avoiding interference from end distortion on the benchmark fitting. The contour extraction module is used to set multiple sampling sections along the axial direction within the effective analysis range, intersect each sampling section with the triangular patch data to reconstruct the closed section contour, and extract the outer contour of the section to robustly obtain the component boundary; The cylinder fitting module is used to fit the center and radius of the cross section based on the outer contour of each cross section, and to fit the ideal cylinder axis based on the center of each cross section and the ideal cylinder reference radius based on the radius of each cross section, thereby constructing an ideal cylinder reference model and providing a stable geometric benchmark. The deviation calculation module is used to calculate the deviation value of each surface sampling point relative to the ideal cylindrical surface based on the STL three-dimensional mesh model as surface sampling points and the ideal cylindrical axis and ideal cylindrical reference radius, thereby quantifying the degree of surface depression. The candidate point screening module is used to determine an adaptive negative threshold based on scanning and surface state related parameters, and to identify surface sampling points with deviation values less than or equal to the adaptive negative threshold as candidate pitting points, thereby achieving adaptive initial screening under different working conditions. The feature extraction module is used to cluster the candidate pit points based on the grid topology adjacency relationship, construct candidate pit regions, and extract various regional geometric and continuity features of each candidate pit region to provide constraints for distinguishing real pits. The region discrimination module is used to comprehensively discriminate candidate pit regions based on the various regional geometric and continuity features, identify effective pit regions, and accurately eliminate false defects. The result output module is used to determine the maximum inward deviation point within the effective pit area, determine its deviation value as the maximum pit depth and output it, improve the quantification accuracy through local densification and recalculation and intuitively display the results.
[0043] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0044] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting surface pits in cylindrical components based on STL model fitting, characterized in that, Includes the following steps: A three-dimensional STL mesh model of the cylindrical component to be inspected is obtained, and the triangular facet data of the STL mesh model is parsed and obtained. Based on the coordinate distribution of the STL mesh model along the axial direction of the cylindrical component, abnormal end regions are identified and eliminated to determine the effective analysis interval. Multiple sampling sections are set along the axial direction within the effective analysis interval, and the intersection of each sampling section with the triangular facet data is calculated to reconstruct the closed section contour and extract the outer contour of the section. The center and radius of each section are fitted based on the outer contour of each section, and the ideal cylindrical axis is fitted based on the center of each section and the ideal cylindrical reference radius is fitted based on the radius of each section to construct an ideal cylindrical reference model. The vertices of the STL mesh model are used as surface sampling points, and the deviation value of each surface sampling point relative to the ideal cylindrical surface is calculated based on the ideal cylindrical axis and the ideal cylindrical reference radius. An adaptive negative threshold is determined based on the scanning and surface state related parameters, and surface sampling points with deviation values less than or equal to the adaptive negative threshold are determined as candidate pit points. Based on the grid topology adjacency relationship, the candidate pit points are clustered to construct candidate pit regions, and various regional geometric and continuity features of each candidate pit region are extracted. Based on the aforementioned multiple regional geometric and continuity features, the candidate pitting regions are comprehensively judged to identify the effective pitting regions; Within the effective pitting area, determine the point of maximum inward deviation, define its deviation value as the maximum pitting depth, and output it.
2. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, Based on the coordinate distribution of the STL 3D mesh model along the axial direction of the cylindrical component, abnormal end regions are identified and eliminated to determine the effective analysis interval. The abnormal end regions include at least one of the following: end face missing region, boundary burr region, local incomplete cross-sectional contour region, and scanning noise concentration region. The effective analysis interval is determined by statistically analyzing the axial coordinates of the cylindrical component model, combined with the preset length range at both ends of the cylindrical component, the point density abrupt change region, and the local normal disorder region.
3. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, Multiple sampling sections are set along the axial direction within the effective analysis interval. The intersection of each sampling section with the triangular facet data is calculated to reconstruct the closed section contour and extract the outer contour of the section. The intersection of the sampling section and the triangular facet is achieved by calculating the intersection points of each side of the triangular facet with the plane of the sampling section. After tolerance merging of repeated intersection points, a set of section line segments is constructed, and one or more closed section contours are reconstructed by endpoint matching. The outer contour of the section is the contour with the largest enclosing area among the closed section contours.
4. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, The ideal cylindrical reference model is constructed by fitting the center and radius of the cross-sections based on the outer contour of each cross-section, fitting the ideal cylindrical axis based on the center of each cross-section, and fitting the ideal cylindrical reference radius based on the radius of each cross-section. The center and radius of the cross-sections are obtained by least-squares circle fitting. The ideal cylindrical axis is obtained by robustly fitting a straight line to the center of multiple cross-sections. The ideal cylindrical reference radius is obtained by statistically analyzing the median after removing outliers from multiple cross-section radii.
5. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, The vertices of the STL 3D mesh model are used as surface sampling points. Based on the ideal cylinder axis and the ideal cylinder reference radius, the deviation value of each surface sampling point relative to the ideal cylinder surface is calculated. The deviation value of any surface sampling point relative to the ideal cylinder surface satisfies Δi = r i -R ref , where r i R is the shortest distance from the sampling point on the surface to the axis of the ideal cylinder. ref The reference radius is the ideal cylinder radius.
6. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 5, characterized in that, The method uses the vertices of the STL 3D mesh model as surface sampling points, and calculates the deviation value of each surface sampling point relative to the ideal cylindrical surface based on the ideal cylindrical axis and the ideal cylindrical reference radius; the scanning and surface state related parameters include scanning accuracy parameters, measurement noise parameters, surface roughness baseline parameters, local sampling density parameters, and cross-sectional fitting fluctuation parameters; the adaptive negative threshold T n Satisfy: T n =-(w1·P′+w2·N′+w3·R′+w4·D′+w5·V′+b), where P′ is the normalized scanning accuracy parameter, N′ is the normalized measurement noise parameter, R′ is the normalized surface roughness baseline parameter, D′ is the normalized local sampling density parameter, V′ is the normalized cross-section fitting fluctuation parameter, b is the basic correction term, and w1~w5 are the corresponding weight coefficients.
7. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, The candidate pitting points are clustered based on the grid topology adjacency relationship to construct candidate pitting regions, and various regional geometric and continuity features of each candidate pitting region are extracted. The candidate erosion pit regions are obtained by clustering connected domains based on grid topological adjacency relationships; the various regional geometric and continuity features include local curvature features, surface normal variation features, neighborhood deviation continuity features, connected region area features, and region depth features; the region depth features include at least one of average depth, maximum depth, and depth variance; the connected region area features are obtained by accumulating triangular facets within the candidate erosion pit regions.
8. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 7, characterized in that, The candidate pitting regions are comprehensively judged based on the various regional geometric and continuity features to identify the effective pitting regions; A comprehensive scoring model is used to identify candidate pit regions. The comprehensive scoring model satisfies: S = αK + βL + γA + δH + εQ, where K is the local curvature index, L is the neighborhood continuity index, A is the area index of the connected region, H is the region depth index, Q is the normal change stability index, and α, β, γ, δ, and ε are the corresponding weights. When S is greater than or equal to the identification threshold S0, and the candidate pit region satisfies the minimum area threshold A0 and the minimum number of points threshold N0, it is identified as a valid pit region.
9. The method for detecting surface pits of cylindrical components based on STL model fitting according to claim 1, characterized in that, It also includes: performing local secondary sampling, mesh-refined sampling, or local interpolation sampling on the effective pit area to obtain encrypted sampling points; recalculating the deviation value within the effective pit area based on the encrypted sampling points, and using the recalculated maximum inward deviation value as the maximum pit depth; visually marking the maximum pit point and the effective pit area in the three-dimensional model, and generating a detection report.
10. A system for detecting surface pits on cylindrical components based on STL model fitting, characterized in that, include: The model parsing module is used to obtain the STL 3D mesh model of the cylindrical component to be detected and to parse and obtain the triangular facet data of the model. The interval determination module is used to identify and eliminate abnormal end regions and determine the effective analysis interval based on the coordinate distribution of the STL three-dimensional mesh model along the axial direction of the cylindrical component. The contour extraction module is used to set multiple sampling sections along the axial direction within the effective analysis range, intersect each sampling section with the triangular patch data to reconstruct the closed section contour, and extract the outer contour of the section. The cylinder fitting module is used to fit the center and radius of the cross section based on the outer contour of each cross section, and to fit the ideal cylinder axis based on the center of each cross section and the ideal cylinder reference radius based on the radius of each cross section, thereby constructing an ideal cylinder reference model; The deviation calculation module is used to calculate the deviation value of each surface sampling point relative to the ideal cylindrical surface, based on the ideal cylindrical axis and the ideal cylindrical reference radius, using the vertices of the STL three-dimensional mesh model as surface sampling points. The candidate point screening module is used to determine an adaptive negative threshold based on scanning and surface state related parameters, and to identify surface sampling points with deviation values less than or equal to the adaptive negative threshold as candidate pitting points. The feature extraction module is used to cluster the candidate pit points based on the grid topology adjacency relationship, construct candidate pit regions, and extract various regional geometric and continuity features of each candidate pit region. The region discrimination module is used to comprehensively discriminate candidate pit regions based on the various regional geometric and continuity features, and identify effective pit regions. The result output module is used to determine the maximum inward deviation point within the effective pit area, determine its deviation value as the maximum pit depth, and output it.