Method for quadric surface fitting of three-dimensional model, electronic equipment and storage medium

By extracting multi-target features from the 3D model and performing feature segmentation and fitting merging, the problems of inaccurate segmentation and insufficient merging accuracy in the existing quadratic surface processing are solved, achieving efficient and accurate quadratic surface fitting.

CN121708262APending Publication Date: 2026-03-20DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511763265.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies suffer from inaccurate segmentation and insufficient merging precision when dealing with noisy models and highly continuous surfaces, making it difficult to achieve efficient and accurate quadratic surface fitting.

Method used

By calculating the normal, vertex normal, principal curvature, and principal direction of the triangular surface mesh of the 3D model, dihedral features, surface type features, and cross-field rotation features are extracted. Feature segmentation and fitting merging are performed, and rank constraints and distance constraints are used for merging optimization, combined with error-driven free growth optimization.

Benefits of technology

This method achieves both accuracy in quadratic surface segmentation and efficiency in merging, obtaining a target quadratic surface that closely matches the original model and has accurate mathematical representation. It solves the problems of inaccurate segmentation of single features and insufficient merging precision in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121708262A_ABST
    Figure CN121708262A_ABST
Patent Text Reader

Abstract

The invention discloses a quadric surface fitting method for a three-dimensional model, electronic equipment and a storage medium. The method comprises the following steps: calculating grid information in a triangular surface grid of a three-dimensional model, wherein the grid information at least comprises a normal direction of a triangular surface, a normal direction of each vertex, a main curvature and a main direction; extracting a multi-target feature based on the grid information, wherein the multi-target feature comprises a dihedral angle feature, a curved surface type feature and a cross field rotation feature corresponding to a main direction; performing feature segmentation on the triangular surface grid according to the multi-target features to obtain a plurality of sub-blocks; and fitting and merging the plurality of sub-blocks to obtain a target quadric surface. By using the scheme of the invention, quadric surface processing with accurate segmentation, efficient combination and accurate fitting can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application generally relates to the technical field of computer graphics. More specifically, the present application relates to a method for quadric surface fitting of a three-dimensional model, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Quadric surfaces (such as planes, cylindrical surfaces, conical surfaces, ellipsoidal surfaces, etc.) are the core basic elements constituting three-dimensional models, and their segmentation, merging and fitting accuracy and efficiency directly determine the reliability of subsequent design analysis, manufacturing and processing in large-scale CAD model design, digital twin modeling, complex surface reconstruction and reverse engineering scenarios. Precise quadric surface processing technology can achieve efficient simplification and accurate characterization of the model, providing support for cross-platform data interaction and rapid prototyping.

[0003] The existing quadric surface processing technology has four core limitations: first, the feature extraction is single, traditional methods mostly rely on dihedral angles or single curvature features, which are difficult to meet the geometric recognition challenge of high continuity (G1 / G2) surfaces (G1 represents first-order derivative continuity, and G2 represents second-order derivative continuity), and are prone to segmentation boundary ambiguity, missing segmentation or over-segmentation problems in noisy models or mixed surface models; second, the surface type classification is rough, and the principal curvatures are not normalized. Noise interference leads to inaccurate surface type determination, and cannot accurately distinguish the subdivision types of planes, parabolic surfaces, ellipsoidal surfaces and hyperbolic surfaces; third, the merging strategy lacks double constraints, relying only on single distance or rank judgment, resulting in incomplete elimination of redundant blocks, or false merging due to noise, and reduced fitting accuracy; fourth, the skin optimality is insufficient, and there is no adaptive growth mechanism. For blocks that do not meet the skin optimality after merging, the block range cannot be dynamically adjusted, manual intervention is required, and it is difficult to meet the needs of automation and high-precision processing.

[0004] Therefore, the present application provides a scheme for quadric surface fitting of a three-dimensional model to achieve accurate segmentation, efficient merging and accurate fitting of quadric surface processing, and effectively solve the pain points of existing technologies in noisy model, large-scale model and high continuity surface processing. SUMMARY

[0005] In order to at least solve one or more technical problems as mentioned above, the present application provides a scheme for quadric surface fitting of a three-dimensional model in multiple aspects.

[0006] In a first aspect, the application provides a method for quadric surface fitting of a three-dimensional model, comprising: calculating mesh information in a triangular surface mesh of the three-dimensional model, wherein the mesh information at least includes normal of a triangular face, normal of each vertex, principal curvature and principal direction; extracting multi-target features based on the mesh information, wherein the multi-target features include dihedral angle feature, surface type feature and cross-field rotation feature corresponding to the principal direction; performing feature segmentation on the triangular surface mesh according to the multi-target features to obtain a plurality of sub-blocks; and fitting and merging the plurality of sub-blocks to obtain a target quadric surface.

[0007] In some embodiments, the dihedral angle feature is extracted by calculating the dot product of the normals of two adjacent triangular faces, and obtaining a dihedral angle value based on the triangular inverse cosine of the dot product.

[0008] In some embodiments, the surface type feature is extracted by normalizing the principal curvature of a vertex, and determining the surface type of the neighborhood of the vertex according to the sign and size of the normalized principal curvature.

[0009] In some embodiments, the surface type feature at least includes one of a concave or convex ellipsoid, a concave or convex cylinder, a concave or convex hyperboloid or a plane.

[0010] In some embodiments, the cross-field rotation feature corresponding to the principal direction is extracted by constructing a cross-field of a vertex based on the normal and the principal direction of the vertex, and calculating the rotation angle difference between the cross-fields of adjacent vertices.

[0011] In some embodiments, the feature segmentation on the triangular surface mesh according to the multi-target features to obtain a plurality of sub-blocks comprises: marking a feature edge according to the comparison between the dihedral angle feature, the surface type feature and the cross-field rotation feature corresponding to the principal direction and the corresponding preset value; and performing feature segmentation on the triangular surface mesh based on the feature edge to obtain a plurality of sub-blocks.

[0012] In some embodiments, the fitting and merging of the plurality of sub-blocks to obtain a target quadric surface comprises: constructing a target surface equation set based on the surface features corresponding to each sub-block; simultaneously solving the target surface equation sets of any two sub-blocks to form a joint equation set; performing preliminary fitting screening based on the rank of the corresponding matrix of the joint equation set; performing fitting and merging based on the actual distances of all points in the two sub-blocks after preliminary fitting screening to the merged surface; and until any two sub-blocks meet the rank constraint and the distance constraint, to obtain the target quadric surface after fitting and merging.

[0013] In some embodiments, further comprising: performing, based on error-driven free growth, outlier removal, un-fitted patch marking and fitting optimization operation of sub-patch growth on the target quadric surface; until the overall error of the target quadric surface meets a preset tolerance, to obtain a final target quadric surface.

[0014] In a second aspect, the present application provides an electronic device, comprising: a processor; and a memory having computer instructions for quadric surface fitting of a three-dimensional model stored thereon, which, when executed by the processor, causes the method in the foregoing first aspect to be implemented.

[0015] In a third aspect, the present application provides a computer-readable storage medium having computer program instructions for quadric surface fitting of a three-dimensional model stored thereon, which, when executed by one or more processors, causes the method in the foregoing first aspect to be implemented.

[0016] Through the above-mentioned scheme for quadric surface fitting of a three-dimensional model, the embodiments of the present application calculate the triangle face normal, vertex normal, principal curvature and principal direction of the triangular surface grid of the three-dimensional model, extract dihedral angle features, surface type features and cross-field rotation features to realize feature segmentation, and then perform fitting and merging on the segmented sub-patches. Based on this, the complex curved surface boundary can be accurately identified, and segmentation redundancy can be effectively eliminated, so that the target quadric surface that fits the original model and has accurate mathematical representation is finally obtained, solving the problem of inaccurate single feature segmentation and insufficient precision of the merged curved surface in the prior art, realizing the accuracy and efficiency of quadric surface segmentation, merging and fitting, and providing reliable support for subsequent design, analysis and other applications of the three-dimensional model. BRIEF DESCRIPTION OF DRAWINGS

[0017] The above and other objects, features and advantages of the example embodiments of the present application will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which several embodiments of the present application are shown by way of example, and wherein like or corresponding elements show like or corresponding parts, by referring to which; and in which: Figure 1 is an exemplary flow chart showing a method 100 for quadric surface fitting of a three-dimensional model according to an embodiment of the present application; Figure 2 is an overall exemplary flow chart showing quadric surface fitting of a three-dimensional model according to an embodiment of the present application; Figure 3 is an exemplary schematic diagram showing a triangular surface grid of a three-dimensional model according to an embodiment of the present application; Figure 4 is an exemplary schematic diagram showing extraction of principal curvature and principal direction according to an embodiment of the present application; Figure 5This is an exemplary schematic diagram illustrating surface segmentation according to an embodiment of this application; Figure 6 This is an exemplary schematic diagram showing the surface type before and after smoothing according to an embodiment of this application; Figure 7 This is an exemplary schematic diagram illustrating the free growth of a curved surface according to an embodiment of this application; Figure 8 This is an exemplary structural block diagram illustrating an electronic device 800 according to an embodiment of this application. Detailed Implementation

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

[0019] It should be understood that the terms "comprising" and "including" used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0020] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0021] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0022] The specific embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0023] Figure 1This is an exemplary flowchart illustrating a method 100 for fitting a quadratic surface to a three-dimensional model according to an embodiment of this application. Figure 1 As shown, the method 100 includes: step S101: calculating the mesh information in the triangular surface mesh of the 3D model, wherein the mesh information includes at least the normal of the triangular face, the normal of each vertex, the principal curvature, and the principal direction; step S102: extracting multi-target features based on the mesh information, wherein the multi-target features include dihedral features, surface type features, and cross-field rotation features corresponding to the principal direction; step S103: performing feature segmentation on the triangular surface mesh according to the multi-target features to obtain multiple sub-blocks; and step S104: fitting and merging the multiple sub-blocks to obtain the target quadratic surface.

[0024] First, in step S101, the mesh information of the triangular surface mesh of the 3D model is calculated, wherein the mesh information includes at least the normal of the triangular face, the normal of each vertex, the principal curvature, and the principal direction. In some implementation scenarios, the 3D model can be, for example, but not limited to, an engine block, gears, bolts, a dome structure in architectural design, a knee joint prosthesis, a 3D printed organ model, an animal body, or an antique model obtained by 3D scanning.

[0025] It can be understood that a triangular surface mesh is a discretized representation of a 3D model, consisting of a vertex set (V), an edge set (E), and a facet set (F), denoted as M=(V,E,F), where each facet is a triangle, serving as the fundamental carrier for mesh information calculation, feature extraction, and segmentation and merging. In other implementation scenarios, the aforementioned triangular surface mesh can be obtained through methods such as 3D scanning and point cloud processing, parametric modeling, or reverse engineering and data conversion.

[0026] Based on the obtained triangular surface mesh, mesh information including the normals of the triangular faces, the normals of each vertex, the principal curvatures, and the principal directions can be calculated. The normal of a triangular face is a unit vector perpendicular to the facet, its direction determined by the right-hand rule, reflecting the facet's spatial orientation and serving as a prerequisite for calculating vertex normals and dihedral features. The normal of each triangular facet can be obtained by taking the cross product of its sides in the same direction.

[0027] The normal of a vertex is the area-weighted average of the normals of all triangular faces within the vertex's neighborhood. This aims to make the vertex normal more closely resemble the actual curvature of the surface, improving the accuracy of subsequent principal curvature calculations. Specifically, the vertex normal can be obtained by weighting its one-neighborhood based on the normal of each triangular face.

[0028] The principal curvature is the maximum curvature value of a vertex on a surface along two mutually perpendicular principal directions. ) and minimum curvature value ( The main directions are the two corresponding perpendicular directions, which together describe the local bending characteristics of the surface, such as flatness, convexity, concavity, and saddle shape. They are the core parameters for extracting surface type features and cross-field rotation features. In some implementation scenarios, it is assumed that there exists Given two adjacent triangular facets, and assuming their normal vectors are... And the area is This allows the construction of tensor matrices. Next, through the tensor matrix... Eigenvalue decomposition yields the maximum and minimum eigenvalues, which correspond to the maximum curvature values, respectively. ) and minimum curvature value ( The corresponding eigenvectors are the maximum principal direction and the minimum principal direction, respectively.

[0029] In some implementation scenarios, when the principal directions are not orthogonal, i.e., there is no stable principal direction, the vertex is considered a planar point. To facilitate subsequent block division, the principal curvature of the vertex can be set to 0 and the principal direction can be set to the normal to the vertex.

[0030] Next, in step S102, multi-target features are extracted based on the grid information. These multi-target features include dihedral features, surface type features, and cross-field rotation features corresponding to the main direction. These three types of features target sharp surfaces, surface geometry types, and gentle surface boundaries, respectively, working together to achieve comprehensive and accurate feature recognition.

[0031] In some embodiments, dihedral angle features can be extracted by: calculating the dot product of the normals of two adjacent triangular faces, and obtaining the dihedral angle value based on the trigonometric inverse cosine of the dot product, thereby extracting the dihedral angle features. A dihedral angle is the angle between two adjacent triangular faces at their common edge, reflecting the spatial angular relationship between the two faces, and can be used to segment sharp curved surface regions.

[0032] Specifically, assuming two adjacent triangular facets , Each has a unit normal vector and And the unit normal vector satisfies , .in, Representing vectors The 2-norm. The dihedral angle value can be based on... calculate, Representing vectors and The dot product, assuming ), , In the implementation scenario, dihedral feature data can be formed by recording the dihedral angle values ​​and their corresponding sampling point location information.

[0033] In some embodiments, surface type features can be extracted by normalizing the principal curvatures of a vertex and determining the surface type of the vertex's neighborhood based on the sign and magnitude of the normalized principal curvatures. In some embodiments, the surface type features include at least one of a concave or convex ellipsoid, a concave or convex cylinder, a concave or convex hyperboloid, or a plane. These surface type features can be used to identify the boundaries of gently sloping surfaces such as rounded chamfers.

[0034] Specifically, first, the principal curvature of each vertex is... , Normalization is performed, and the normalization formula is: Then, the surface type of the vertex's neighborhood is determined based on the sign (positive or negative) and magnitude of the normalized principal curvature. Among these, the local planar region includes: and At this time, Gaussian curvature and mean curvature All values ​​approach zero, exhibiting perfectly flat geometric characteristics. Convex local parabolic surface: With Gaussian curvature K=0 and mean curvature H>0, its geometric characteristics are a convex surface of a cylinder. Concave local parabolic surface: A Gaussian curvature K=0, mean curvature H<0, and geometric characteristics of a concave surface within a cylinder. A convex local ellipsoid: The Gaussian curvature K > 0 and the mean curvature H > 0, and the geometric feature is an elliptic body with a convex surface.

[0035] Furthermore, the concave local ellipsoid: Gaussian curvature K > 0, mean curvature H < 0, geometrically characterized as an elliptic concave surface. Convex-dominated local hyperboloid: The Gaussian curvature K < 0 and the mean curvature H > 0, with geometric characteristics of a convex-dominated region in a saddle surface. A locally hyperboloid dominated by concavity: , The Gaussian curvature K < 0 and the mean curvature H < 0, and the geometric feature is a region dominated by concavity in the saddle surface.

[0036] Due to noise or mesh discretization errors, the surface type of some vertices may be inconsistent with that of their neighbors. In some implementation scenarios, this can be corrected using, for example, a global smoothing optimization algorithm based on neighborhood statistics. As an example, for each vertex in a triangular mesh... Collect its one-ring neighborhood The type distribution of all vertices within the domain is used, and a majority voting mechanism is employed to determine the optimal type of each vertex. Its mathematical expression is Among them, the type set It includes the aforementioned seven surface types. This is the indicator function. Additionally, all vertex types are updated in parallel using an iterative optimization strategy.

[0037] In some embodiments, the cross-field rotation features corresponding to the main direction can be extracted by the following operation: constructing the cross-field of a vertex based on the vertex normal and the main direction, calculating the rotation angle difference between the cross-fields of adjacent vertices, in order to extract the cross-field rotation features corresponding to the main direction. It can be understood that the cross-field is a cross-shaped direction field constructed based on the vertex normal and the main direction, and the rotation angle difference between the cross-fields of adjacent vertices reflects the degree of change in the surface direction.

[0038] Specifically, the normal to each vertex is taken as the Z-axis (perpendicular to the tangent plane of the surface), and the direction of maximum principal curvature is taken as... Construct the X-axis as a reference, with the direction of minimum principal curvature. Using the Y-axis as the axis, an XY tangent plane is formed, which in turn constructs a cross-field. That is, the orthogonal cross directions formed by the X-axis and Y-axis correspond to the cross field. This cross-field allows rotation around the Z-axis exceeding π / 2 without requiring forced smooth transitions or feature alignment, adapting to directional changes on complex surfaces.

[0039] Next, the rotation metric method is used to calculate the fields in both directions. and Distance between This is used to calculate the difference in rotation angle between the cross fields of adjacent vertices. When parameters exist... Make hour, ;otherwise ,in , They represent circumference respectively. Rotation matrix for axis rotation.

[0040] Based on the dihedral features, surface type features, and cross-field rotation features corresponding to the main direction obtained above, in step S103, the triangular surface mesh is segmented according to the multi-target features to obtain multiple sub-blocks. In some embodiments, feature edges can be marked by comparing the dihedral features, surface type features, and cross-field rotation features corresponding to the main direction with corresponding preset values, and the triangular surface mesh is segmented based on the feature edges to obtain multiple sub-blocks. That is, feature segmentation divides the triangular surface mesh into multiple connected sub-blocks based on feature edges (lines), and the surfaces within each sub-block have similar geometric features (such as the same surface type and gentle direction changes), which are the basic units for subsequent fitting and merging.

[0041] Specifically, for dihedral features, the corresponding preset value is π / 4. When the dihedral angle value θ > π / 4, the corresponding edge e is marked as a dihedral feature edge. For surface type features, the corresponding preset value is η = 0.1%. When the type change rate between two consecutive iterations is lower than the preset threshold η = 0.1%, the boundary vertex type is locked to determine the boundary, ensuring clear boundaries between different type regions. For the cross-field rotation feature corresponding to the main direction, the corresponding preset value is automatically determined by outlier analysis methods (such as the 3σ criterion based on Gaussian distribution). For example, calculating all distances... The mean μ and standard deviation σ, with a preset value τ_r = μ + 3σ, are the values ​​of the cross field distance between adjacent vertices a and b. When the value is greater than τ_r, its connecting edge e_ab is marked as a cross-field feature segmentation line.

[0042] Based on the aforementioned dihedral angle feature edges, surface type feature edges (connecting edges of vertices of different surface types), and cross-field feature dividing lines, the triangular surface mesh is fully divided to obtain multiple continuous sub-blocks.

[0043] Furthermore, in step S104, multiple sub-blocks are fitted and merged to obtain the target quadratic surface.

[0044] In some embodiments, a set of target surface equations is first constructed based on the surface features corresponding to each sub-block. The target surface equations of any two sub-blocks are then combined to form a joint equation set. Next, preliminary fitting and screening are performed based on the rank of the matrix corresponding to the joint equation set. The actual distances from all points in the two sub-blocks after preliminary fitting and screening to the merged surface are then used for fitting and merging until any two sub-blocks satisfy the rank constraint and the distance constraint, thereby obtaining the fitted and merged target quadratic surface.

[0045] In this process, quadratic surface fitting involves solving for the coefficient vector of the quadratic surface equation using sampling points within a sub-block, so that the quadratic surface fits the geometry of the sub-block to the greatest extent possible. The general form of the quadratic surface equation is: In the implementation scenario, when constructing the equation system of the target surface, the quadratic surface equation is first expressed as... ,in Let be a 10-dimensional coefficient vector, corresponding to the coefficients of aj. It is a 10-dimensional vector constructed from the coordinates of the sampling points within the sub-block.

[0046] Next, for a sub-block containing n sampling points, construct an n×10 matrix M, where the i-th row of the matrix corresponds to the F vector of the i-th sampling point, i.e.: Singular value decomposition (SVD) is performed on matrix M, and the decomposition form is as follows: Let U be an n×n orthogonal matrix, Σ be an n×10 diagonal matrix (diagonal elements are singular values), and V be a 10×10 orthogonal matrix. The solution obtained by taking the last column of V as the optimal coefficient vector c satisfies the following condition: under conditions minimize.

[0047] Furthermore, traverse all sub-blocks, and for any pair of sub-blocks to be merged, obtain the quadratic surface coefficient vectors of both. Then, the equations of the target surface are solved simultaneously. Next, the rank (M) of matrix M is calculated for preliminary fitting and screening. If rank (M) < n_cols (M), where n_cols (M) = 10, which is the number of columns in matrix M, then the sub-block pair is determined. Mathematically, if they belong to the same quadratic surface, they are feasible to merge and proceed to the distance constraint verification; otherwise, the merging pair is directly excluded. For those that pass the rank constraint... Based on the simultaneous equation system Mc=0, the coefficient vector c of the merged quadratic surface is solved by, for example, singular value decomposition, to obtain the merged target quadratic surface Q.

[0048] Next, calculate the actual distance (e.g., Euclidean distance) d(p,Q) from all points in the merged point set to the merged surface, and find the maximum value among all distances. The merge is rejected if any of the following conditions are met: or ,in For a preset threshold (e.g.) to (magnitude) The length of the bounding box diagonal. The maximum distance before merging; otherwise, accept the merge. For sub-block pairs that accept the merge... Perform a fitting and merging operation, for example, by... Merge into a new sub-block P_new, update the sampling point set and quadratic surface coefficient vector c_new of P_new. Add P_new to the merged sub-block set, and delete... The updated sub-block set is regenerated and the pairs to be merged are verified until any two sub-blocks satisfy the rank constraint and the distance constraint, so as to obtain the target quadratic surface after fitting and merging.

[0049] In some embodiments, the method may further include: performing anomaly removal, unfitted patch marking, and sub-patch growth fitting optimization operations on the target quadratic surface based on error-driven free growth; until the overall error of the target quadratic surface meets a preset tolerance, so as to obtain the final target quadratic surface.

[0050] Specifically, for each piece of dough Calculate all its points To the target quadratic surface European distance Remove the requirement The anomalies, among which A preset distance threshold is used. The quadratic surface is refitted based on the remaining points, and the proportion of points removed is calculated. ,when The patch is then marked as an unfitted patch. Next, the unfitted patch is segmented into sub-patterns based on connectivity, and points are removed. The small sub-faces are classified into boundary points, where the following settings can be configured: Furthermore, starting from the edge points, a breadth-first traversal is performed to grow new sub-faces. When the number of points... At that time, for candidate points Calculate its path to the newly fitted target quadratic surface distance Only when Add sub-patterns when all points are classified into quadratic surface patches and the overall error is minimized. Time-termination algorithm, where By defining the error tolerance for the user, the final target quadratic surface is obtained. The aforementioned... The three-level threshold control process ensures that the final segmentation result meets the requirements. The accuracy requirements are usually... , The length of the bounding box diagonal. .

[0051] As described above, the embodiments of this application achieve accurate feature segmentation by calculating the triangular face normal, vertex normal, principal curvature and principal direction of the triangular surface mesh of the three-dimensional model, extracting dihedral angles, surface type, cross field rotation multi-objective composite features, and then fitting and merging the segmented sub-blocks through the dual constraints of rank constraint to ensure mathematical rationality and distance constraint to ensure engineering practicality. Finally, the fit is optimized by error-driven free growth.

[0052] Furthermore, the dihedral angle feature accurately identifies sharp boundaries, the surface type feature subdivides and smooths geometric regions, and the cross-field rotation feature quantifies and smooths surface direction differences. These features work together to make the segmentation boundaries more accurate. The dual constraint merging effectively eliminates redundancy and resists noise, and the free growth adaptively optimizes the fit. Ultimately, it achieves accurate quadratic surface segmentation, efficient merging, and accurate fitting, solving the problems of inaccurate segmentation, insufficient merging accuracy, and poor fit of existing technologies with single features. It provides reliable technical support for quadratic surface processing of 3D models.

[0053] Figure 2 This is an overall exemplary flowchart illustrating quadratic surface fitting for a three-dimensional model according to an embodiment of this application.Figure 2 As shown, in step S201, the mesh information of the triangular surface mesh of the 3D model is calculated. This mesh information includes the normal of the triangular face, the normal of each vertex, the principal curvature, and the principal direction. Next, in step S202, multi-target features are extracted based on the mesh information, including the dihedral features, surface type features, and cross-field rotation features corresponding to the principal directions found in steps S203, S204, and S205. Specific details of feature extraction can be found above. Figure 1 The description of the subject matter will not be repeated here.

[0054] Next, in step S206, the triangular surface mesh is segmented based on multi-target features to obtain multiple sub-blocks. Specifically, feature edges are marked based on the comparison of each feature with its corresponding preset value, and the triangular surface mesh is segmented based on these feature edges to obtain multiple sub-blocks. In step S207, the multiple sub-blocks are fitted and merged. During fitting, firstly, a set of target surface equations for any two sub-blocks is constructed. Then, in step S208, preliminary fitting and filtering are performed based on the rank of the matrix. Finally, in step S209, fitting and merging are performed based on the actual distances from all points within the two pre-fitted sub-blocks to the merged surface. When any two sub-blocks satisfy the rank constraint and the distance constraint, the target quadratic surface is obtained.

[0055] Further, in step S210, a fitting optimization operation is performed based on the free growth of the surface, including outlier removal, unfitted patch marking, and sub-patch growth. When the overall error of the target quadratic surface meets the preset tolerance, the final target quadratic surface is obtained in step S211.

[0056] Figure 3 This is an exemplary schematic diagram illustrating a triangular surface mesh of a three-dimensional model according to an embodiment of this application. Figure 3 The example shown is a triangular surface mesh of a 3D bolt model, which, as previously described, can be obtained through methods such as 3D scanning and point cloud processing, parametric modeling, or reverse engineering and data conversion. The triangular surface mesh is a discretized representation of the 3D model, consisting of a vertex set, an edge set, and a facet set, where each facet is a triangle.

[0057] Figure 4 This is an exemplary schematic diagram illustrating the extraction of principal curvature and principal direction according to embodiments of this application. Figure 4 As shown by the arrows in the diagram, the arrows and their lengths respectively represent the principal direction and principal curvature.

[0058] Figure 5 This is an exemplary schematic diagram illustrating surface segmentation according to an embodiment of this application. For example... Figure 5 Figure (a) shows the segmentation of a sharp curved surface. Figure 5Figure (b) shows the segmentation of the rounded chamfer model. As mentioned earlier, based on the dihedral feature marking, accurate feature recognition can be achieved for sharp curved surfaces. Boundaries of gently curved surfaces such as rounded chamfers can be identified based on surface type features.

[0059] Figure 6 This is an exemplary schematic diagram showing the surface type before and after smoothing according to an embodiment of this application. For example... Figure 6 Figure (a) shows a schematic diagram of the smoothed surface type of the curved surface. Figure 6 Figure (b) shows a schematic diagram of the surface type after smoothing. As can be seen from the figure, by determining the surface type and smoothing it, clear boundaries between different types of regions can be maintained, making the segmentation more reasonable and uniform, and significantly improving the robustness of the algorithm. Different gray levels at each point represent different surface types.

[0060] Figure 7 This is an exemplary schematic diagram illustrating the free growth of a curved surface according to an embodiment of this application. For example... Figure 7 In Figure (a), the left side shows the original triangular surface mesh model of the mechanical part with two circular holes; the middle sub-figure shows the fitting error with a black-gray gradient, and obvious error stratification can be seen under a small scale (0-0.05) (such as light-colored stripes in the middle of the part), indicating that the fitting accuracy of the local area is insufficient when it has not been fully optimized by this application; the right sub-figure shows more significant non-uniformity of error distribution under a large scale (0-0.5), reflecting that the surface fit after segmentation and merging needs to be improved.

[0061] like Figure 7 Figure (b) shows the model optimized by error-driven free growth according to this application, which is more in line with the design intent in terms of shape. Under the small-range error scale of the middle sub-figure, the black and gray gradient becomes more uniform, with almost no obvious error layering, indicating that the local fitting accuracy is greatly improved after operations such as outlier removal and sub-surface growth. Under the large-range scale of the right sub-figure, the error distribution tends to darken as a whole, indicating that the overall fit is significantly optimized, which verifies the effectiveness of the dual constraint merging and free growth strategy of this application and achieves the technical goal of accurate quadratic surface segmentation and precise fitting.

[0062] Figure 8 This is an exemplary structural block diagram illustrating an electronic device 800 according to an embodiment of this application. For example... Figure 8 As shown, the electronic device 800 of this application may include a processor 801 and a memory 802, wherein the processor 801 and the memory 802 communicate via a bus. The memory 802 stores program instructions for fitting quadratic surfaces to a three-dimensional model. When the program instructions are executed by the processor 801, they enable the implementation of the above-described method in conjunction with the appendix. Figure 1 The method described is a quadratic surface fitting method for three-dimensional models.

[0063] Based on the foregoing description in conjunction with the accompanying drawings, those skilled in the art will understand that the embodiments of this application can also be implemented by software programs. Therefore, this application also provides a computer-readable storage medium. This computer-readable storage medium stores computer-readable instructions thereon for quadratic surface fitting of a three-dimensional model. When these computer-readable instructions are executed by one or more processors, they implement the embodiments of this application in conjunction with the accompanying drawings. Figure 1 The method described is for fitting quadratic surfaces to three-dimensional models.

[0064] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0065] It should be noted that although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0066] It should be understood that when the terms "first," "second," "third," and "fourth," etc., are used in the claims, specification, and drawings of this application, they are used only to distinguish different objects and not to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0067] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0068] Although the embodiments of this application are described above, the content is merely an example adopted for the purpose of facilitating understanding of this application and is not intended to limit the scope and application scenarios of this application. Any person skilled in the art described in this application may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be determined by the scope defined in the appended claims.

Claims

1. A method for fitting quadratic surfaces to a three-dimensional model, comprising: Calculate the mesh information in the triangular surface mesh of the 3D model, wherein the mesh information includes at least the normal of the triangular face, the normal of each vertex, the principal curvature, and the principal direction; Multi-target features are extracted based on the grid information, wherein the multi-target features include dihedral angle features, surface type features, and cross-field rotation features corresponding to the main direction; The triangular surface mesh is segmented based on the multi-target features to obtain multiple sub-blocks; The multiple sub-blocks are fitted and merged to obtain the target quadratic surface.

2. The method according to claim 1, wherein the dihedral features are extracted by the following operation: Calculate the dot product of the normals of two adjacent triangular faces; The dihedral angle value is obtained based on the trigonometric inverse cosine of the dot product, so as to extract the dihedral angle feature.

3. The method according to claim 1, wherein the surface type features are extracted by the following operation: Normalize the principal curvature of the vertices; The surface type of the vertex neighborhood is determined based on the sign and magnitude of the normalized principal curvature in order to extract the surface type features.

4. The method according to claim 3, wherein the surface type feature includes at least one of a concave or convex ellipsoid, a concave or convex cylinder, a concave or convex hyperboloid, or a plane.

5. The method according to claim 1, wherein the cross-field rotation features corresponding to the main direction are extracted by the following operation: The intersection field of a vertex is constructed based on the vertex's normal and principal direction; Calculate the difference in rotation angle between the cross fields of adjacent vertices to extract the cross field rotation features corresponding to the main direction.

6. The method according to claim 1, wherein segmenting the triangular surface mesh based on the multi-target features to obtain multiple sub-blocks comprises: Based on the comparison between the dihedral angle feature, the surface type feature, and the cross-field rotation feature corresponding to the main direction and the corresponding preset value, the feature edges are marked; Based on the feature edges, the triangular surface mesh is segmented to obtain multiple sub-blocks.

7. The method according to claim 1, wherein fitting and merging the plurality of sub-blocks to obtain the target quadratic surface comprises: Construct a set of equations for the target surface based on the surface features corresponding to each sub-block; Solve the simultaneous equations of the target surface for any two sub-blocks to form a joint equation system; Preliminary fitting and screening are performed based on the rank of the matrix corresponding to the joint equation system; The fitting and merging process is performed based on the actual distances from all points within the two sub-blocks after the initial fitting and screening to the merged surface. Continue until any two sub-blocks satisfy the rank constraint and distance constraint to obtain the target quadratic surface after fitting and merging.

8. The method according to claim 1 or 7, further comprising: Error-driven free growth is used to perform outlier removal, unfitted patch marking, and sub-patch growth fitting optimization operations on the target quadratic surface. The process continues until the overall error of the target quadratic surface meets the preset tolerance, thus obtaining the final target quadratic surface.

9. An electronic device, comprising: processor; as well as A memory storing computer instructions for fitting quadratic surfaces to a three-dimensional model, which, when executed by a processor, cause the method according to any one of claims 1-8 to be implemented.

10. A computer-readable storage medium storing computer program instructions for fitting a quadratic surface to a three-dimensional model, the computer program instructions, when executed by one or more processors, causing the method according to any one of claims 1-8 to be implemented.