CN-121999136-A - High-order continuity maintaining and error control method in STL curved surface reconstruction process
Abstract
The invention provides a high-order continuity maintaining and error control method in an STL curved surface reconstruction process, which relates to the technical field of three-dimensional modeling and comprises the following steps: and acquiring connection information of discrete data, constructing a continuous normal vector field based on spherical harmonic decomposition, carrying out frequency domain processing on vertex coordinates and normal vectors to identify high-frequency details, calculating a principal curvature direction, determining an insertion control point, and iteratively optimizing normal deviation until convergence. The invention can effectively maintain the high-order continuity of the STL curved surface, accurately control the reconstruction error and improve the geometric accuracy and quality of the reconstructed curved surface.
Inventors
- GAO YIFENG
Assignees
- 苏州数益基点信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260128
Claims (10)
- The high-order continuity maintaining and error control method in the STL curved surface reconstruction process is characterized by comprising the following steps: Acquiring discretized geometric data, identifying the shared edges and vertexes of the triangular patches to obtain connection information, determining vertex coordinates of common boundaries on adjacent triangular patches based on the connection information, and projecting the vertex coordinates to a tangent plane of the corresponding triangular patches to obtain parameter coordinates; Extracting vertex normal vectors at two sides of the public boundary, performing spherical harmonic decomposition to obtain spherical harmonic coefficients, constructing a continuous normal vector field based on the spherical harmonic coefficients and the parameter coordinates, and performing path integration to obtain a curved surface sheet control point and a curvature tensor component; Performing frequency domain transformation on the vertex coordinates and the vertex normal vector to obtain frequency domain coefficients, determining high-frequency coefficients by combining a preset coefficient threshold value, performing inverse transformation on the high-frequency coefficients to obtain high-frequency vertex coordinates, and determining a high-frequency triangular surface patch; Calculating a main curvature direction of a parameter coordinate area corresponding to the high-frequency triangular patch according to the curvature tensor component, determining an insertion position and an additional control point based on the main curvature direction, and merging the insertion position and the additional control point with the curved patch control point to obtain a merging control point; and constructing a parameterized curved surface sheet based on the merging control points and the parameter coordinates, determining a curved surface sampling point, calculating a normal projection distance from the curved surface sampling point to the surface of the triangular curved surface sheet to obtain a normal deviation, determining a deviation spectrum, iteratively updating the merging control points according to the amplitude distribution of the deviation spectrum until the normal deviation converges, obtaining a convergence control point, and combining the parameter coordinates to generate a reconstructed curved surface.
- 2. The method of claim 1, wherein obtaining discretized geometric data and identifying edges and vertices shared by triangular patches to obtain connection information, determining vertex coordinates of a common boundary on adjacent triangular patches based on the connection information and projecting the vertex coordinates to a tangent plane of a corresponding triangular patch to obtain parameter coordinates comprises: Acquiring discretized geometric data comprising a plurality of triangular patches, traversing vertex coordinates of each triangular patch in the discretized geometric data, calculating vertex coincidence ratio between any two triangular patches, identifying a triangular patch pair with the vertex coincidence ratio larger than zero as an adjacent triangular patch, and extracting coincident vertexes of the adjacent triangular patches as shared vertexes; Based on the shared vertex traversing the edges of the adjacent triangular patches, identifying edges containing the same shared vertex pair as shared edges, and establishing an index relationship between the shared edges and the adjacent triangular patches to obtain the connection information; Extracting shared edges of each pair of adjacent triangular patches based on the connection information, determining shared vertexes on the shared edges as common boundary vertexes, and extracting vertex coordinates of the common boundary vertexes as common boundary vertex coordinates; Calculating the barycenter coordinates of three vertex coordinates of the triangular surface patch, constructing a tangent plane taking the barycenter coordinates as an origin based on the vertex normal vector of the triangular surface patch, projecting the common boundary vertex coordinates to the tangent plane to obtain projection coordinates, constructing a two-dimensional coordinate system on the tangent plane, and representing the projection coordinates under the two-dimensional coordinate system to obtain the parameter coordinates.
- 3. The method of claim 1, wherein extracting vertex normal vectors on both sides of the common boundary for sphere blending decomposition to obtain sphere blending coefficients, constructing a continuous normal vector field based on the sphere blending coefficients and the parameter coordinates, and performing path integration to obtain a surface patch control point and curvature tensor component comprises: Identifying adjacent triangular patches on two sides of the public boundary based on the connection information, extracting vertex normal vectors of the adjacent triangular patches to serve as public boundary vertex normal vectors, and mapping the public boundary vertex normal vectors to a unit spherical surface to obtain spherical coordinates; performing spherical harmonic function expansion on the spherical coordinates, calculating a function value of the spherical harmonic function at the spherical coordinates, and performing least square fitting on the basis of the function value and the common boundary vertex normal vector to obtain spherical harmonic coefficients of each order; establishing a grid point set based on the parameter coordinates, calculating a spherical harmonic function reconstruction value based on the spherical harmonic coefficients for each grid point, reversely mapping the spherical harmonic function reconstruction value from a unit spherical surface to a three-dimensional space to obtain grid point normal vectors, and constructing the continuous normal vector field based on the grid point normal vectors; extracting normal vector components of the continuous normal vector field along the parameter coordinate direction, performing line integration on the normal vector components along the corresponding parameter coordinate direction to obtain an integral curve, and determining the control point of the curved surface sheet based on the intersection point coordinates of the integral curves of different parameter coordinate directions; And calculating partial derivatives of the continuous normal vector field in the coordinate directions of all parameters and constructing the curvature tensor component based on the partial derivatives.
- 4. The method of claim 1, wherein performing frequency domain transformation on the vertex coordinates and the vertex normal vector to obtain frequency domain coefficients and determining high frequency coefficients in combination with a preset coefficient threshold, performing inverse transformation on the high frequency coefficients to obtain high frequency vertex coordinates and determining a high frequency triangular patch comprises: Extracting vertex coordinates of all triangular patches in the discretized geometric data, constructing a vertex adjacency matrix by combining the connection information, constructing a normalized graph Laplacian matrix based on the vertex adjacency matrix, performing spectrum decomposition to obtain a feature vector group, performing joint embedding on the vertex coordinates and the vertex normal vector in a spectrum domain space formed by the feature vector group, and calculating to obtain a coordinate frequency domain coefficient and a normal frequency domain coefficient by minimizing a reconstruction error; Calculating gradient correlation of the coordinate frequency domain coefficient and the normal frequency domain coefficient, adaptively weighting the amplitude of the coordinate frequency domain coefficient and the amplitude of the normal frequency domain coefficient based on the gradient correlation to obtain spectrum energy distribution, performing multi-scale wavelet decomposition on the spectrum energy distribution to extract energy mutation points, and taking a spectrum energy value corresponding to the energy mutation points as the coefficient threshold; Recognizing a coordinate frequency domain coefficient with the spectral energy exceeding the coefficient threshold as the high-frequency coefficient, extracting a corresponding feature vector to construct a high-frequency spectrum base, performing spectrum back projection on the high-frequency coefficient on the high-frequency spectrum base, and performing optimization reconstruction by combining with a preset local geometric constraint to obtain the high-frequency vertex coordinate; Traversing all triangular patches, identifying triangular patches containing the high-frequency vertex coordinates, calculating corresponding discrete Gaussian curvatures and average curvatures, constructing curvature tensors based on the discrete Gaussian curvatures and the average curvatures, calculating principal curvatures, and marking triangular patches with principal curvatures exceeding a preset curvature threshold as the high-frequency triangular patches.
- 5. The method of claim 1, wherein calculating a principal curvature direction of a parameter coordinate region corresponding to the high-frequency triangular patch from the curvature tensor component, determining an insertion position and an additional control point based on the principal curvature direction, and merging with the patch control point to obtain a merged control point includes: Extracting a parameter coordinate region corresponding to the high-frequency triangular patch, acquiring curvature tensor components of each parameter grid point in the parameter coordinate region, performing feature decomposition to obtain a feature value and a feature vector, taking the feature vector corresponding to the maximum feature value as a maximum principal curvature direction, and taking the feature vector corresponding to the minimum feature value as a minimum principal curvature direction; Respectively constructing curvature change rate fields along the maximum principal curvature direction and the minimum principal curvature direction, carrying out morphological gradient operation on the curvature change rate fields to identify curvature change rate extreme points, and taking parameter coordinates of the curvature change rate extreme points in the parameter coordinate area as the insertion positions; Calculating the covariant derivative of the curvature tensor along the maximum principal curvature direction and the minimum principal curvature direction at the insertion position, constructing a local curvature compensation vector based on the covariant derivative, and shifting the parameter coordinate of the insertion position along the local curvature compensation vector to obtain the parameter coordinate of the additional control point; and carrying out curved surface mapping calculation on the parameter coordinates of the additional control points to obtain the space coordinates of the additional control points, obtaining the curved surface sheet control points, combining the space coordinates of the additional control points with the curved surface sheet control points according to the parameter coordinate sequence, and carrying out topology recombination on the combined control points to obtain the combined control points.
- 6. The method of claim 1, wherein constructing a parameterized surface patch based on the merge control point and the parametric coordinates and determining a surface sampling point, calculating a normal projection distance of the surface sampling point to the surface of the triangular patch to obtain a normal deviation and determining a deviation spectrum comprises: Acquiring the space coordinates of the merging control points and the parameter boundaries of the parameter coordinate areas, constructing a T spline basis function based on the space coordinates of the merging control points, inserting node vectors into the parameter coordinate areas through a local refinement algorithm, generating non-uniform parameter grids, and calculating to obtain the space coordinates of the curved surface sampling points based on the nodes in the non-uniform parameter grids and the T spline basis function; Constructing an octree spatial index based on the spatial coordinates of the curved surface sampling points, inquiring a triangular patch closest to the curved surface sampling points, calculating a tangent plane normal vector of the parameterized curved surface patch at the curved surface sampling points, projecting the curved surface sampling points to the surface of the closest triangular patch along the tangent plane normal vector direction to obtain projection points, and calculating a directed distance between the curved surface sampling points and the projection points as the normal projection distance; Taking parameter coordinates corresponding to nodes in the non-uniform parameter grid as sampling positions, taking the normal projection distance as a deviation amplitude value at the sampling positions, and constructing a non-uniform sampling deviation field based on the sampling positions and the deviation amplitude value; And carrying out non-uniform fast Fourier transform on the non-uniform sampling deviation field to obtain a frequency domain representation, and extracting the power spectral density of each frequency component in the frequency domain representation to obtain the deviation spectrum.
- 7. The method of claim 1, wherein iteratively updating the merged control point according to the magnitude distribution of the deviation spectrum until the normal deviation converges, obtaining a converged control point and generating a reconstructed surface in combination with the parameter coordinates comprises: Extracting the amplitude of each frequency component in the deviation spectrum, performing frequency weighting calculation to obtain frequency domain deviation energy, and constructing a control point sensitivity matrix based on the frequency domain deviation energy; Singular value decomposition is carried out on the control point sensitivity matrix to obtain a dominant sensitivity direction, the position adjustment quantity of the merging control points is calculated along the dominant sensitivity direction, and the space coordinates of the merging control points are updated along the position adjustment quantity to obtain optimized merging control points; Reconstructing a parameterized curved surface sheet based on the optimization combination control point and the parameter coordinates, determining updated curved surface sampling points, and calculating the normal projection distance from the updated curved surface sampling points to the surface of the triangular surface sheet to obtain an optimized normal deviation; And calculating the deviation change rate between the optimized normal deviation and the normal deviation before updating, judging whether the deviation change rate is smaller than a preset convergence threshold, if so, taking the optimized merging control point as a convergence control point, and if not, taking the optimized merging control point as a new merging control point, repeatedly executing construction control point sensitivity matrix and calculating the normal deviation until the deviation change rate is smaller than the convergence threshold, and reconstructing the parameterized curved surface sheet based on the convergence control point and the parameter coordinates to obtain the reconstructed curved surface.
- A high order continuity maintenance and error control system in stl surface reconstruction process for implementing the method of any one of the preceding claims 1-7, comprising: The information extraction unit is used for acquiring discretized geometric data, identifying the shared edges and vertexes of the triangular patches to obtain connection information, determining vertex coordinates of a common boundary on the adjacent triangular patches based on the connection information, and projecting the vertex coordinates to a tangent plane of the corresponding triangular patches to obtain parameter coordinates; The normal field construction unit is used for extracting vertex normal vectors at two sides of the public boundary to carry out spherical harmonic decomposition to obtain spherical harmonic coefficients, constructing a continuous normal vector field based on the spherical harmonic coefficients and the parameter coordinates, and carrying out path integration to obtain a curved surface sheet control point and curvature tensor component; The high-frequency identification unit is used for carrying out frequency domain transformation on the vertex coordinates and the vertex normal vector to obtain frequency domain coefficients, determining high-frequency coefficients by combining a preset coefficient threshold value, carrying out inverse transformation on the high-frequency coefficients to obtain high-frequency vertex coordinates and determining a high-frequency triangular surface patch; the control point solving unit is used for calculating the main curvature direction of the parameter coordinate area corresponding to the high-frequency triangular patch according to the curvature tensor component, determining an insertion position and an additional control point based on the main curvature direction, and merging the insertion position and the additional control point with the curved patch control point to obtain a merging control point; And the curved surface reconstruction unit is used for constructing a parameterized curved surface sheet based on the merging control points and the parameter coordinates, determining a curved surface sampling point, calculating the normal projection distance from the curved surface sampling point to the surface of the triangular surface sheet to obtain normal deviation, determining a deviation spectrum, iteratively updating the merging control points according to the amplitude distribution of the deviation spectrum until the normal deviation converges to obtain a convergence control point, and combining the parameter coordinates to generate a reconstructed curved surface.
- 9. An electronic device, comprising: A processor; A memory for storing processor-executable instructions; Wherein the processor is configured to invoke the instructions stored in the memory to perform the method of any of claims 1 to 7.
- 10. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 7.
Description
High-order continuity maintaining and error control method in STL curved surface reconstruction process Technical Field The invention relates to the technical field of three-dimensional modeling, in particular to a high-order continuity maintaining and error control method in an STL curved surface reconstruction process. Background STL is a three-dimensional model representation format widely used in the fields of additive manufacturing, numerical simulation, and computer-aided design, and is generally composed of discretized triangular patches, and can approximate complex curved surfaces. In high precision manufacturing and analytical applications, it is desirable to reconstruct discrete triangular patches into parameterized surfaces with high order continuity to meet product design and precision machining requirements. The traditional curved surface reconstruction method mainly comprises the technologies of point cloud-based curved surface fitting, grid-based parameterization, subdivision curved surfaces and the like, discrete data are converted into continuous representations through different mathematical models, such as NURBS curved surfaces, B-spline curved surfaces and the like, the key challenges in the curved surface reconstruction process are to maintain geometric continuity, control approximation errors and process complex topological structures, but the existing STL curved surface reconstruction technology still has the problems that high-order geometric continuity and accurate local feature expression are difficult to ensure at the same time, continuity breakage or excessive smoothness can occur, a global optimization strategy is usually adopted, effective error control is difficult to be carried out on local high-frequency features, the reconstruction accuracy is insufficient, the density of control points cannot be automatically adjusted according to the local geometric characteristics of the curved surfaces, and the problems of calculation resource waste, low expression efficiency and the like exist. Disclosure of Invention The embodiment of the invention provides a high-order continuity maintaining and error control method in an STL curved surface reconstruction process, which at least can solve part of problems in the prior art. In a first aspect of the embodiment of the present invention, a method for maintaining high-order continuity and controlling error in an STL curved surface reconstruction process is provided, including: Acquiring discretized geometric data, identifying the shared edges and vertexes of the triangular patches to obtain connection information, determining vertex coordinates of common boundaries on adjacent triangular patches based on the connection information, and projecting the vertex coordinates to a tangent plane of the corresponding triangular patches to obtain parameter coordinates; Extracting vertex normal vectors at two sides of the public boundary, performing spherical harmonic decomposition to obtain spherical harmonic coefficients, constructing a continuous normal vector field based on the spherical harmonic coefficients and the parameter coordinates, and performing path integration to obtain a curved surface sheet control point and a curvature tensor component; Performing frequency domain transformation on the vertex coordinates and the vertex normal vector to obtain frequency domain coefficients, determining high-frequency coefficients by combining a preset coefficient threshold value, performing inverse transformation on the high-frequency coefficients to obtain high-frequency vertex coordinates, and determining a high-frequency triangular surface patch; Calculating a main curvature direction of a parameter coordinate area corresponding to the high-frequency triangular patch according to the curvature tensor component, determining an insertion position and an additional control point based on the main curvature direction, and merging the insertion position and the additional control point with the curved patch control point to obtain a merging control point; and constructing a parameterized curved surface sheet based on the merging control points and the parameter coordinates, determining a curved surface sampling point, calculating a normal projection distance from the curved surface sampling point to the surface of the triangular curved surface sheet to obtain a normal deviation, determining a deviation spectrum, iteratively updating the merging control points according to the amplitude distribution of the deviation spectrum until the normal deviation converges, obtaining a convergence control point, and combining the parameter coordinates to generate a reconstructed curved surface. In an alternative embodiment of the present invention, Obtaining discretized geometric data, identifying edges and vertexes shared by triangular patches to obtain connection information, determining vertex coordinates of a common boundary on adjacent triangular patches base