Parallelization triangular mesh generation method for cutting curved surface
By performing parallel discretization on the boundary curve type of the trimmed surface, constructing a closed polygonal loop, and dividing the parameter domain in parallel to generate a high-quality triangular mesh, the problems of messy and irregular mesh generation and low efficiency of the trimmed surface mesh are solved, and high-precision and efficient triangular mesh generation is achieved.
Patent Information
- Application Number
- CN202511046923.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, the mesh generation results of trimmed curved surfaces are messy and irregular, making it difficult to guarantee accuracy, and the generation efficiency is low, making it difficult to achieve parallel acceleration.
Based on the type of the boundary curve of the trimmed surface, the corresponding parallel discretization method is selected to construct a closed polygonal loop, the parameter domain is divided using the bisection method, the initial subdivision unit is classified, and triangulation is performed in parallel to generate a high-quality triangular mesh.
It improves the accuracy and efficiency of generating triangular meshes for trimmed surfaces, avoids serial bottlenecks, ensures that triangles are located within the effective area, and reduces computational resource consumption.
Smart Images

Figure CN120974815A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer-aided design, in particular to a parallelized triangular mesh generation method for trimmed surface. BACKGROUND
[0002] The trimmed surface refers to the region defined by the trimmed curve on the geometric surface, which is a key topological element in computer-aided design. In order to perform numerical analysis, visualization rendering or NC machining trajectory planning on the trimmed surface, it is usually necessary to divide the trimmed surface into discrete triangular meshes; the core difficulty of this process is how to quickly generate high-quality triangular meshes for complex trimmed surfaces, and ensure that they meet the requirements of different application scenarios for meshes in terms of geometric accuracy, computational efficiency and adaptability, etc.
[0003] The current mesh generation technology for trimmed surfaces usually adopts a triangular meshing method based on an incremental point insertion strategy, and the basic process is as follows: firstly, the boundary curves of the trimmed surface are adaptively subdivided to generate an initial discrete point set; then the discrete points of these curves are mapped to the two-dimensional parameter space of the surface and constraints are established; then the discrete points on the surface are obtained by sampling in the parameter domain, and the initial triangular mesh is generated based on these points by constrained Delaunay triangulation (CDT); finally, it is judged whether the triangle meets the accuracy requirement, if the accuracy requirement is not met, the barycenter point of the triangle is inserted as a new point into the point set, and Delaunay triangulation is performed; the iteration is repeated until the triangle meets the accuracy requirement, or the iteration number reaches the set upper limit.
[0004] However, the method based on the barycenter insertion strategy of the triangle lacks global guidance, resulting in unstructured distribution of the point set after multiple iterations, making the resulting mesh irregular; in the surface discretization stage, if only the Delaunay triangulation of the constrained boundary curve is relied on, the generated triangular mesh may not effectively approximate the surface geometry, even if the maximum iteration number is reached, it is still difficult to meet the target accuracy; and the Delaunay triangulation strategy of global point insertion in the trimmed surface is difficult to realize parallel acceleration, and the efficiency of the triangulation is low. SUMMARY
[0005] Therefore, the technical problem to be solved by the present application is to overcome the problems of irregular mesh generation results, low triangulation accuracy and low efficiency of triangulation based on the Delaunay triangulation strategy in the prior art.
[0006] To solve the above technical problems, the present application provides a parallelized triangular mesh generation method for trimmed surface, comprising: For each boundary curve in the trimmed surface, based on its curve type, a corresponding discrete method is selected for parallel discretization to obtain a discrete point set corresponding to each boundary curve; Mapping the discrete points in the discrete point set of all boundary curves into the parametric domain space of the clipping surface to obtain a two-dimensional point set; Based on the two-dimensional point set, a closed polygon ring is constructed on the parametric domain of the clipping surface as a discrete boundary; the closed polygon ring includes an outer ring representing an external boundary and an inner ring representing an internal hole; For a free-form surface, based on the parametric domain range and the geometric dimension in three-dimensional space, the free-form surface is divided by using a dichotomy method to obtain initial partition units; Based on the positional relationship between each initial partition unit and the discrete boundary, the initial partition unit is divided into an external parametric rectangle, an internal parametric rectangle, and a phase angle parametric rectangle, and a corresponding division mode is selected to divide the initial partition unit into triangles in parallel; Mapping all the triangles to the three-dimensional space to integrate them into a triangular mesh.
[0007] Preferably, based on the curve type thereof, a corresponding discrete method is selected for parallel discretization, including: If the boundary curve is a straight line, two end points of the boundary curve are obtained to form a discrete point set of the boundary curve; If the boundary curve is a circular arc, an optimal step length is obtained based on the radius of the circular arc, the chord height error, and the angle error, and the circular arc is discretized by using the optimal step length to construct a discrete point set of the boundary curve; If the boundary curve is a free curve, after the free curve is discretized by using an equal parameter, a plurality of curve segments are obtained, and each curve segment is discretized by using an adaptive step length to obtain a discrete point set of the boundary curve.
[0008] Preferably, after each curve segment is discretized by using an adaptive step length to obtain a discrete point set of the boundary curve, the following step is further included: a midpoint is inserted by using a dichotomy method, so that a discrete line segment formed by any two discrete points meets the chord height error and the angle error requirements, and an optimized discrete point set of the boundary curve is obtained, including: Traversing the discrete point set corresponding to the free curve, for any three continuous discrete points therein, if a line segment formed by any two discrete points meets the chord height error and the angle error, the second discrete point among the three continuous discrete points is deleted from the discrete point set to construct a de-redundant discrete point set; Traversing the de-redundant discrete point set, for a discrete line segment formed by any two continuous discrete points therein, if the discrete line segment does not meet the chord height error or the angle error, a midpoint is inserted by using a dichotomy method until the discrete line segment formed by any two continuous discrete points in the de-redundant discrete point set meets the chord height error and the angle error, and an optimized discrete point set is obtained; Among them, the discrete line segment composed of two discrete points satisfies the requirements of chord height error and rotation angle error, including: the distance from the discrete line segment to the boundary curve is not greater than the preset chord height error; the angle between the normal vectors of the boundary curve at the two endpoints of the discrete line segment is not greater than the preset rotation angle error.
[0009] Preferably, if the boundary curve is a circular arc, the optimal step size is obtained based on the arc radius, chord height error, and rotation angle error, expressed as: ; in, This represents the optimal step size when the boundary curve is a circular arc. Indicates the preset angle error. Indicates the preset chord height error. Indicates the radius of the arc.
[0010] Preferably, if the boundary curve is a free curve: Isoparametric step size for isoparametric discretization of free curves for: ; Adaptive step size for discretizing each curve segment for: ; in, This represents the larger parameter value between the two endpoints of the free curve. This represents the smaller parameter value between the two endpoints of the free curve. Indicates the order of the free curve; Indicates the radius of curvature at the current position. Indicates the preset chord height error. This represents the tangent vector at the current position.
[0011] Preferably, for regular curved surfaces, generating an optimized rectangular mesh using geometric properties includes: uniformly dividing along the parameter domain to generate initial subdivision elements.
[0012] Preferably, for a freeform surface, based on the parameter domain range and the three-dimensional spatial geometric scale, the freeform surface is divided using a bisection method to obtain initial subdivision elements, including: The freeform surface is initially divided into multiple parametric rectangles; For each parametric rectangle, it is further subdivided based on whether it satisfies the preset chord height error and preset rotation angle error in both the u and v directions of the parameter domain, and whether the diagonal length of the parametric rectangle is greater than the preset maximum side length, including: If the parameter rectangle does not meet the preset chord height error or preset rotation angle error in the u direction of the parameter domain, then the parameter rectangle is divided into two parameter rectangles along the u direction. if the parameter rectangle does not satisfy the preset chord height error or the preset corner error in the v direction of the parameter domain, the parameter rectangle is equally divided into two parameter rectangles along the v direction; if the diagonal length of the parameter rectangle is greater than the preset maximum side length, the parameter rectangle is divided into two parameter rectangles along the longer side; until all the leaf node parameter rectangles after the division satisfy the preset chord height error and the preset corner error, and the diagonals are not greater than the preset maximum side length, the division is completed, and the leaf node parameter rectangle is taken as the initial subdivision unit; wherein the parameter rectangle satisfying the preset chord height error means that the maximum distance of the parameter rectangle to the clipping surface is not greater than the preset chord height error; and the parameter rectangle satisfying the preset corner error means that the maximum angle between the normal vectors at each vertex of the parameter rectangle is not greater than the preset corner error.
[0013] Preferably, based on the positional relationship between each initial subdivision unit and the discrete boundary, the initial subdivision unit is divided into an external parameter rectangle, an internal parameter rectangle and a phase angle parameter rectangle, and a corresponding division mode is selected to divide the initial subdivision unit into triangles in parallel, including: if the initial subdivision unit is located outside the discrete boundary, it is classified as an external parameter rectangle, and the initial subdivision unit is skipped without being subjected to mesh subdivision; if the initial subdivision unit is located inside the discrete boundary, it is classified as an internal parameter rectangle, and the initial subdivision unit is divided based on the maximum minimum internal angle to generate a plurality of triangles; if the initial subdivision unit intersects with the discrete boundary, it is classified as an intersection parameter rectangle, and the intersection line between the initial subdivision unit and the discrete boundary is extracted, and the region inside the discrete boundary in the initial subdivision unit is taken as an effective region, and the boundary of the effective region is constrained and triangulated by using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles.
[0014] Preferably, if the initial subdivision unit is located inside the discrete boundary, it is classified as an internal parameter rectangle, and the initial subdivision unit is divided based on the maximum minimum internal angle to generate a plurality of triangles, including: discrete points on the edges of the initial subdivision unit are obtained, for each vertex of the initial subdivision unit, a triangle is formed with the previous discrete point and the next discrete point of the vertex, and the minimum internal angle of the triangle is calculated; the triangle with the maximum minimum internal angle among the triangles corresponding to the four vertices of the initial subdivision unit is added to the subdivision result set, and the initial subdivision unit is removed to obtain an updated subdivision unit; based on the vertices, the corresponding triangles are constructed in the updated subdivision unit, and the triangle with the maximum minimum internal angle is repeatedly selected and added to the subdivision result set, and the updated subdivision unit is removed; Until only three discrete points are left in the updated subdivision unit, form a triangle with the three discrete points, add the triangle to the subdivision result set, and complete the triangulation of the initial subdivision unit.
[0015] Preferably, if the initial subdivision unit intersects with the discrete boundary, it is classified as an intersection parameter rectangle, and the intersection line of the initial subdivision unit and the discrete boundary is extracted, and the area in the initial subdivision unit inside the discrete boundary is combined to form an effective area, and the boundary of the effective area is constrained and triangulated by using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles, including: The discrete points on the boundary of the initial subdivision unit are set with unique indexes, and are sorted in anticlockwise order on the outer ring and in clockwise order on the inner ring to obtain an outer ring ordered point set and an inner ring ordered point set; Based on the outer ring ordered point set and the inner ring ordered point set, all boundaries are marked as constraint edges, and a triangle is generated by using the constrained Delaunay triangulation algorithm.
[0016] The above technical solutions of the present application have the following beneficial effects compared with the prior art:
[0017] The parallelized triangulation method for cutting surfaces disclosed by the present application selects a corresponding discrete method for discretization based on the geometric characteristics of the curve for different types of curves, optimizes the discretization strategy for each boundary curve independently, improves the accuracy while avoiding serial bottlenecks, and improves the discretization efficiency. The present application distinguishes and sorts the inner ring and the outer ring, constructs a closed polygon ring based on the discrete points to generate the discrete boundary, divides the initial subdivision unit into external, internal and intersection rectangular parameters based on the position relationship between the initial subdivision unit and the discrete boundary, and respectively adopts the corresponding triangulation strategy to perform triangulation in parallel, thereby accelerating the generation of the triangular mesh and improving the subdivision efficiency.
[0018] The present application uses bisection method to divide the free-form surface, and classifies the divided parameter rectangle; for the external parameter rectangle, it is directly discarded; for the internal parameter rectangle, the initial subdivision unit is divided based on the minimum inner angle and maximum as the benchmark to generate a plurality of triangles; for the intersection parameter rectangle, the boundary of the effective area is constrained and triangulated by using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles; the present application uses the discrete boundary to distinguish and forcibly fit the discrete boundary, so that all the triangles obtained by subdivision are located in the effective area, there is no cross-boundary unit, the hole area is not filled by mistake, the quality of the divided triangle is improved, and the subdivision accuracy is improved.
[0019] The application controls linear approximation precision based on preset chord height error, controls normal change sensitivity based on preset corner error, and directly restricts the maximum side length of the triangle based on diagonal length limitation, to realize adaptive subdivision of the parameter domain, reduce unnecessary subdivision, save computing resources, and improve the subdivision precision. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to make the content of the application more easily understood, the application will be further described in detail below according to specific embodiments of the application and in conjunction with the drawings, in which: Figure 1 is a step flow chart of the parallelized triangular mesh subdivision method for clipping surfaces provided by the application; Figure 2 is a flow chart of parallel triangular subdivision Figure 3 is a chord height error and corner error schematic diagram; Figure 4 is an optimal step length schematic diagram of a circular arc curve; Figure 5 is a parameter rectangular subdivision result schematic diagram of a clipping surface; Figure 6 is a triangulation schematic diagram of an internal parameter rectangle; Figure 7 is a triangulation schematic diagram of an intersecting parameter rectangle; Figure 8 is a triangular mesh schematic diagram of a clipping surface; Figure 9 is a clipping surface mesh subdivision example diagram. DETAILED DESCRIPTION
[0021] The application will be further described below in conjunction with the drawings and specific embodiments, so that those skilled in the art can better understand the application and implement it, but the embodiments are not limiting to the application.
[0022] Referring to Figure 1 the step flow chart of the parallelized triangular mesh subdivision method for clipping surfaces provided by the application, the specific steps include: S101: for each boundary curve in the clipping surface, based on the curve type, respectively select the corresponding discrete method to perform parallel discretization, and obtain the discrete point set corresponding to each boundary curve; S102: map the discrete points in the discrete point set of all boundary curves to the parameter domain space of the clipping surface, to obtain a two-dimensional point set; S103: based on the two-dimensional point set, construct a closed polygon ring on the parameter domain of the clipping surface as a discrete boundary; the closed polygon ring includes an outer ring representing the outer boundary and an inner ring representing the internal hole; S104: For freeform surfaces, based on the parameter domain range and three-dimensional spatial geometric scale, the freeform surface is divided using the bisection method to obtain the initial subdivision elements; For regular curved surfaces, an optimized rectangular mesh is generated using geometric properties, including: uniformly dividing along the parameter domain to generate initial subdivision elements; S105: Based on the positional relationship between each initial partitioning unit and the discrete boundary, the initial partitioning unit is divided into external parameter rectangles, internal parameter rectangles and phase angle parameter rectangles, and the corresponding partitioning method is selected to divide the initial partitioning unit into triangles in parallel. S106: Map all triangles to three-dimensional space and integrate them into a triangular mesh.
[0023] The parallel triangular meshing method for trimming curved surfaces described in this invention selects corresponding discretization methods based on the geometric characteristics of different types of curves. Each boundary curve has its discretization strategy optimized independently, improving accuracy while avoiding serial bottlenecks and increasing discretization efficiency. This invention distinguishes and sorts inner and outer loops, constructing closed polygonal loops based on discrete points to generate discrete boundaries. Based on the positional relationship between the initial meshing unit and the discrete boundaries, the initial meshing unit is divided into external, internal, and intersecting rectangular parameters, and corresponding triangulation strategies are applied in parallel to accelerate the generation of triangular meshes and improve meshing efficiency.
[0024] Specifically, in step S101, based on the curve type, the corresponding discretization method is selected for parallel discretization, including: S101-1: If the boundary curve is a straight line, then obtain the two endpoints of the boundary curve to form a set of discrete points of the boundary curve; S101-2: If the boundary curve is a circular arc, then obtain the optimal step size based on the arc radius, chord height error and rotation angle error; and perform isoparametric discretization on the circular arc based on the optimal step size to construct the discrete point set of the boundary curve. The optimal step size is expressed as: ; in, This represents the optimal step size when the boundary curve is a circular arc. Indicates the preset rotation angle error. Indicates the preset chord height error. Indicates the radius of the arc; S101-3: If the boundary curve is a free curve, after discretizing the free curve with equal parameters, obtain multiple curve segments, and then perform adaptive step-size discretization on each curve segment to obtain the set of discrete points of the boundary curve. Among them, the isoparametric step size for isoparametric discretization of the free curve for: ; adaptive step length for: ; wherein, denotes a larger parameter value of two end points of the free curve, denotes a smaller parameter value of two end points of the free curve, denotes an order of the free curve; denotes a radius of curvature of the current position, denotes a preset chord height error, denotes a tangent vector of the current position.
[0025] Specifically, the adaptive step length is performed on each curve segment, and after the discrete point set of the boundary curve is obtained, the midpoint is inserted by using the dichotomy method, so that the discrete line segment composed of any two discrete points meets the chord height error and the corner error requirement, and the optimized discrete point set of the boundary curve is obtained, including: traversing the discrete point set corresponding to the free curve, for any three continuous discrete points therein, if the line segment composed of any two discrete points meets the chord height error and the corner error, the second discrete point in the three continuous discrete points is deleted from the discrete point set, and a de-redundant discrete point set is constructed; traversing the de-redundant discrete point set, for any two continuous discrete points therein, if the discrete line segment composed of the two continuous discrete points does not meet the chord height error or the corner error, the midpoint is inserted by using the dichotomy method until the discrete line segment composed of any two continuous discrete points in the de-redundant discrete point set meets the chord height error and the corner error, and an optimized discrete point set is obtained; wherein, the discrete line segment composed of two discrete points meets the chord height error and the corner error requirement, including: the distance from the discrete line segment to the boundary curve is not greater than the preset chord height error; the included angle of the normal vectors of the boundary curve at the two end points of the discrete line segment is not greater than the preset corner error.
[0026] Specifically, in step S104, for the free surface, based on the parameter domain range and the three-dimensional space geometric dimension, the dichotomy method is used to divide the free surface to obtain the initial subdivision unit, including: S104-1: the free surface is preliminarily divided into a plurality of parameter rectangles; S104-2: for each parameter rectangle, based on whether it meets the preset chord height error and the preset corner error in the u direction and the v direction of the parameter domain, and whether the diagonal length of the parameter rectangle is greater than the preset maximum side length, subdivision is performed, including: if the parameter rectangle does not meet the preset chord height error or the preset corner error in the u direction of the parameter domain, the parameter rectangle is equally divided into two parameter rectangles along the u direction; if the parameter rectangle does not meet the preset chord height error or the preset corner error in the v direction of the parameter domain, the parameter rectangle is equally divided into two parameter rectangles along the v direction; if the diagonal length of the parameter rectangle is greater than the preset maximum side length, the parameter rectangle is divided into two parameter rectangles along the longer side; S104-3: until all the leaf node parameter rectangles after division meet the preset chord height error and the preset corner error, and the diagonals are not greater than the preset maximum side length, the division is completed, and the leaf node parameter rectangle is taken as the initial subdivision unit; wherein the parameter rectangle meeting the preset chord height error means that the maximum distance of the parameter rectangle to the clipping surface is not greater than the preset chord height error; and the parameter rectangle meeting the preset corner error means that the maximum angle between the normal vectors at each vertex of the parameter rectangle is not greater than the preset corner error.
[0027] In the initial subdivision unit division, the linear approximation precision is controlled based on the preset chord height error, the normal change sensitivity is controlled based on the preset corner error, and the maximum side length of the triangle is directly constrained based on the diagonal length limit, so that the parameter domain adaptive subdivision is realized, unnecessary subdivision is reduced, calculation resources are saved, and the subdivision precision is improved.
[0028] Specifically, in step S105, based on the positional relationship between each initial subdivision unit and the discrete boundary, the initial subdivision unit is divided into an external parameter rectangle, an internal parameter rectangle and a phase angle parameter rectangle, and a corresponding division mode is selected to divide the initial subdivision unit into triangles in parallel, including: S105-1: if the initial subdivision unit is located outside the discrete boundary, it is classified as an external parameter rectangle, and the initial subdivision unit is skipped and not subjected to mesh subdivision; S105-2: if the initial subdivision unit is located inside the discrete boundary, it is classified as an internal parameter rectangle, and the initial subdivision unit is divided based on the minimum internal angle maximum to generate a plurality of triangles, including: obtaining the discrete points on the edges of the initial subdivision unit, for each vertex of the initial subdivision unit, a triangle is formed with the previous discrete point and the next discrete point of the vertex, and the minimum internal angle of the triangle is calculated; the triangle with the maximum minimum internal angle among the triangles corresponding to the four vertices of the initial subdivision unit is added to the subdivision result set, and the initial subdivision unit is removed to obtain an updated subdivision unit; in the updated subdivision unit, corresponding triangles are constructed based on the vertices, and the triangle with the maximum minimum internal angle is repeatedly selected and added to the subdivision result set, and the updated subdivision unit is removed; Until only three discrete points are left in the updated subdivision unit, form a triangle with the three discrete points, add the triangle to the subdivision result set, and complete the triangulation of the initial subdivision unit; S105-3: If the initial subdivision unit intersects with the discrete boundary, classify it as an intersection parameter rectangle, extract the intersection line of the initial subdivision unit and the discrete boundary, and group the area in the initial subdivision unit inside the discrete boundary to form an effective area; triangulate the effective area after constraining its boundary using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles, including: Sort the discrete points on the boundary of the initial subdivision unit in anticlockwise order for the outer ring and in clockwise order for the inner ring to obtain an outer ring ordered point set and an inner ring ordered point set; Based on the outer ring ordered point set and the inner ring ordered point set, mark all boundaries as constraint edges, and generate triangles using the constrained Delaunay triangulation algorithm.
[0029] The present application uses bisection to divide the free-form surface, and classifies the divided parameter rectangle; for the external parameter rectangle, it is directly discarded; for the internal parameter rectangle, the initial subdivision unit is divided based on the smallest inner angle and the largest basis to generate a plurality of triangles; for the intersection parameter rectangle, the boundary of the effective area is constrained and triangulated using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles; the present application uses the discrete boundary to distinguish and forcibly fit the discrete boundary, so that all the triangles obtained by subdivision are located in the effective area, there is no cross-boundary unit, and the quality of the divided triangles is improved, thereby improving the subdivision accuracy.
[0030] Based on the above embodiment, in the embodiment of the present application, the parallelized triangular mesh subdivision method for cutting surface provided by the embodiment of the present application is used for triangular mesh subdivision, and the flowchart of parallel triangulation is shown in Figure 2 The specific steps include:
[0031] S201: Discretization of curves; The user inputs the chord height error and the corner error to perform mesh subdivision on the cutting surface; The first step of the subdivision is to discretize all the boundary curves of the cutting surface, and the discretized curves will serve as the discrete boundaries of the cutting surface; during the curve discretization process, the chord height error represents the maximum distance from the discretized curve to the actual edge, and the corner error refers to the maximum angle between the normal vectors at the adjacent points of the discretized curve; the chord height error and the corner error are shown in Figure 3
[0032] Because the discretization process of each curve is independent, all the curves can be discretized in parallel, and different discretization methods can be used for different curves, including: ① If the curve is a straight line, the dispersion is defined as the line segment formed by the two end points of the curve; ② If the curve is a circular arc, the optimal step length is directly calculated according to the radius of the circular arc, the chord height error and the angle error, and the equal parameter dispersion is performed; Referring to Figure 4 , an optimal step length diagram of a circular arc curve is shown; the optimal step length is represented as: , wherein, is the chord height error set by the user, is the angle error set by the user, is the radius of the circular arc; ③ The curvatures of a free curve (such as a B-spline curve) are different in different regions, and have no regularity; if an equal parameter dispersion method is used, the dispersion data may be redundant or the dispersion data error may not meet the requirements; the adaptive dispersion method is used to disperse the free curve.
[0033] If the curve is a free curve, the curve is first dispersed into a plurality of curve segments in an equal parameter manner, and then the curve segments are dispersed in an adaptive step length manner according to the curvatures; wherein the equal parameter dispersion is limited to the minimum number of dispersed points of the free curve, and does not need to be strictly defined. Here, the step length of the equal parameter dispersion can be taken as , wherein is the larger parameter value of the two end points of the curve, is the smaller parameter value of the two end points of the curve, is the order of the curve; Let the current position be the start point of the curve segment, and calculate the adaptive dispersion step length , which is represented as: ; is the curvature radius of the current position, is the chord height error set by the user, is the tangent vector of the current position.
[0034] If the dispersion step length is smaller than the remaining length of the curve segment, the current position is advanced by , the current position is inserted into the dispersion result, and the above operation is repeated until the dispersion step length is greater than the remaining length of the curve segment, and the start and end points of the curve segment are inserted.
[0035] Traverse the dispersion result of the free curve, and let , , be three continuous dispersion points in the dispersion result, if the line segment , the line segment , and the line segment If the chord height error and the angle error are satisfied, the point The discrete result is deleted; the discrete result of the curve is traversed again, if the line segment composed of two continuous discrete points does not satisfy the chord height error or the angle error, the point is inserted by using the dichotomy method; the method is repeated until all the discrete line segments satisfy the chord height error and the angle error.
[0036] After the curve discretization is completed, the three-dimensional discrete points on the curve are mapped to the two-dimensional parameter space of the clipping surface, and are stored as the subdivision boundary of the parameter space of the clipping surface.
[0037] S202: The clipping surface is subdivided into a parameter matrix grid; In the second stage of the grid subdivision, the parameter domain (UV space) of the clipping surface needs to be subdivided into a rectangular grid.
[0038] Firstly, based on the discrete point set generated in the curve discretization stage, closed polygon rings are constructed in the parameter domain, which will be used as the discrete boundary in the parameter domain of the clipping surface, for defining the effective area of the parameter domain, including the outer ring representing the external boundary and the inner ring representing the internal hole.
[0039] For regular surfaces such as spherical surface, conical surface, cylindrical surface, torus, etc., the optimal parameter domain rectangular subdivision can be directly calculated based on the geometric characteristics thereof; for free-form surfaces (such as NURBS surface), the parameter space needs to be divided into several uniform rectangular blocks as initial subdivision units according to the UV range of the parameter domain and the geometric scale in the three-dimensional space, and then they are further adaptively discretized to satisfy the chord height error and the angle error.
[0040] In the parameter rectangular subdivision, the chord height error is represented as the maximum distance from the parameter rectangle to the surface, and the angle error is represented as the maximum angle between the normal vectors at the vertices of the parameter matrix. For the free-form surface, the adaptive dichotomy method is used for the subdivision, if the chord height error or the angle error is not satisfied in the u direction, the parameter rectangle is subdivided into two parameter rectangles along the u direction; if the error requirement is not satisfied in the v direction, the parameter rectangle is subdivided into two parameter rectangles along the v direction.
[0041] In addition, the method also satisfies the function of limiting the maximum edge length of the triangular mesh; in the final triangular mesh, the maximum edge length of the triangle can be the diagonal length of the maximum leaf node parameter matrix. In the subdivision process, the parameter rectangle with the diagonal length greater than the maximum edge length set by the user is further subdivided until the maximum edge length requirement is satisfied, so that the function of limiting the maximum edge length of the triangle is realized.
[0042] In the subdivision process, the parameter rectangle type is calculated simultaneously; if the parameter rectangle is outside the discrete boundary, it is marked as an external parameter rectangle; if the parameter rectangle is inside the discrete boundary, it is marked as an internal parameter rectangle; if the parameter rectangle intersects the discrete boundary, it is marked as an intersecting parameter rectangle. After the subdivision is completed, all intersecting rectangle blocks that are leaf nodes are collected, and the intersection points of the rectangle and the discrete boundary are calculated and stored. Referring to Figure 5 Fig. 4 shows a schematic diagram of the parameter rectangle subdivision result of the trimmed surface.
[0043] S203: Triangular mesh subdivision; The last stage of the mesh subdivision is triangular meshing of each face; first, all the rectangle blocks of the leaf nodes are collected, and the following triangularization operation is performed on them in parallel; different subdivision methods are used for different types of parameter rectangles, including: ① For the parameter rectangle of the external type, no mesh subdivision is performed.
[0044] ② For the parameter rectangle of the internal type, the subdivision region is a rectangle, and all points are located on the edges of the rectangle; if the nodes on the edge support further subdivision of the rectangle block into smaller rectangle blocks, the subdivision is continued, and then a simple subdivision algorithm is used for triangularization: the end points of the four edges of the rectangle and the previous point and the next point are selected, the smallest internal angle of the triangle formed by the three points is calculated, the triangle with the largest smallest internal angle is taken as the triangularization result, and the end point is removed from the subdivision region. The process is repeated until only three points remain in the subdivision region, and the three points also form a triangle, which is added to the subdivision result. Referring to Figure 6 Fig. 5 shows a schematic diagram of the triangularization of the internal parameter rectangle; ③ For the parameter rectangle of the intersecting type, the subdivision region is the intersection region of the effective region of the face and the rectangle, and the boundary of the subdivision region is sorted in counterclockwise order for the outer ring and in clockwise order for the inner ring. Then, the boundary is constrained using the constrained Delaunay triangular subdivision algorithm, and triangularization is performed.
[0045] Referring to Figure 7 Fig. 6 shows a schematic diagram of the triangularization of the intersecting parameter rectangle. In this process, to avoid data redundancy caused by repeated points, the same points of different parameter rectangles should use the same index. After the triangularization of all the leaf node parameter rectangles is completed, all the triangles are merged into a triangular mesh, and the triangular mesh of the trimmed surface is obtained; referring to Figure 8 Fig. 7 shows a schematic diagram of the triangular mesh of the trimmed surface. Note that the triangular subdivision here is performed in the two-dimensional parameter space. After the subdivision is completed, the two-dimensional vertices of the triangular mesh need to be mapped to the three-dimensional space.
[0046] Referring to Figure 9As shown, it is a cutting surface mesh cutting instance diagram; the parallelized triangular mesh cutting method for cutting surface provided by the embodiment of the application is widely applied to the display of the surface, and the numerical control machining tool path calculation of the surface, and provides basic guarantee for the over and under accuracy of the tool path.
[0047] The parallelized triangular mesh cutting method for cutting surface provided by the application selects corresponding discrete methods for discretization based on the geometric characteristics of the curve, optimizes the discretization strategy of each boundary curve independently, improves the accuracy while avoiding serial bottlenecks, and improves the discretization efficiency. The application distinguishes and sorts the inner ring and the outer ring, constructs a closed polygon ring based on the discrete points, and generates a discrete boundary; based on the position relationship between the initial cutting unit and the discrete boundary, the initial cutting unit is divided into external, internal and intersecting rectangular parameters, and corresponding triangulation strategies are adopted respectively, and the generation of the triangular mesh is accelerated, and the cutting efficiency is improved. The application divides the free-form surface by using the dichotomy method, and classifies the divided parameter rectangle; for the external parameter rectangle, it is directly discarded; for the internal parameter rectangle, the initial cutting unit is divided to generate a plurality of triangles based on the minimum internal angle maximum; for the intersecting parameter rectangle, the effective area boundary is constrained and triangulated by using the constrained Delaunay triangulation algorithm to obtain a plurality of triangles; the application uses the discrete boundary to distinguish and force the discrete boundary to fit, so that all the triangles cut are located in the effective area, without crossing the boundary unit, avoiding the error filling of the hole area, improving the quality of the divided triangle, and improving the cutting accuracy. When the initial cutting unit is divided, the linear approximation accuracy is controlled based on the preset chord height error, the normal change sensitivity is controlled based on the preset corner error, and the maximum side length of the triangle is directly constrained based on the diagonal length limit, realizing the adaptive subdivision of the parameter domain, reducing unnecessary subdivision, saving computing resources, and improving the cutting accuracy.
[0048] Those skilled in the art should understand that the embodiments of the application can be provided as a method, a system, or a computer program product. Therefore, the application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0049] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0050] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0051] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0052] Obviously, the above-described embodiments are only examples for clarity of description and are not limiting on the embodiments. Based on the above description, one of ordinary skill in the art can further make other different forms of changes or modifications. Here, all the embodiments are not required to be enumerated, and the obvious changes or modifications derived therefrom are still within the protection scope of the present application.
Claims
1. A parallelized triangular mesh generation method for trimming curved surfaces, characterized in that, include: For each boundary curve in the trimmed surface, based on its curve type, the corresponding discretization method is selected for parallel discretization to obtain the set of discrete points corresponding to each boundary curve. Map the discrete points in the discrete point set of all boundary curves to the parameter domain space of the trimmed surface to obtain a two-dimensional point set; Based on a two-dimensional point set, a closed polygonal ring is constructed as a discrete boundary in the parameter domain of the trimmed surface; the closed polygonal ring includes an outer ring representing the outer boundary and an inner ring representing the internal holes; For freeform surfaces, based on the parameter domain range and the three-dimensional spatial geometric scale, the freeform surface is divided using the bisection method to obtain the initial subdivision units; Based on the positional relationship between each initial partitioning unit and the discrete boundary, the initial partitioning unit is divided into external parameter rectangles, internal parameter rectangles and phase angle parameter rectangles, and the corresponding partitioning method is selected to divide the initial partitioning unit into triangles in parallel. Map all triangles to three-dimensional space and integrate them into a triangular mesh.
2. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 1, characterized in that, Based on the curve type, corresponding discretization methods are selected for parallel discretization, including: If the boundary curve is a straight line, then obtain the two endpoints of the boundary curve to form a discrete set of the boundary curve. If the boundary curve is a circular arc, the optimal step size is obtained based on the arc radius, chord height error, and rotation angle error; and the circular arc is discretized with equal parameters based on the optimal step size to construct a set of discrete points for the boundary curve. If the boundary curve is a free curve, after discretizing the free curve with equal parameters, obtain multiple curve segments, and then perform adaptive step-size discretization on each curve segment to obtain the set of discrete points of the boundary curve.
3. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 2, characterized in that, After performing adaptive step-size discretization on each curve segment to obtain the set of discrete points for the boundary curve, the process further includes: inserting the midpoint using the bisection method, ensuring that the discrete line segment formed by any two discrete points satisfies the requirements for chord height error and rotation angle error, and obtaining the optimized set of discrete points for the boundary curve, including: Traverse the set of discrete points corresponding to the free curve. For any three consecutive discrete points, if the line segment formed by any two discrete points satisfies both chord height error and rotation angle error, then delete the second discrete point from the set of discrete points to construct a set of redundant discrete points. Traverse the set of redundant discrete points. For any discrete line segment formed by two consecutive discrete points, if the discrete line segment does not satisfy the chord height error or rotation angle error, insert the midpoint using the bisection method until the discrete line segment formed by any two consecutive discrete points in the set of redundant discrete points satisfies the chord height error and rotation angle error, and obtain the optimized set of discrete points. Among them, the discrete line segment formed by two discrete points satisfies the requirements of chord height error and rotation angle error, including: the distance from the discrete line segment to the boundary curve is not greater than the preset chord height error; the angle between the normal vectors of the boundary curve at the two endpoints of the discrete line segment is not greater than the preset rotation angle error.
4. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 2, characterized in that, If the boundary curve is a circular arc, the optimal step size is obtained based on the arc radius, chord height error, and rotation angle error, expressed as: ; in, This represents the optimal step size when the boundary curve is a circular arc. Indicates the preset rotation angle error. Indicates the preset chord height error. Indicates the radius of the arc.
5. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 2, characterized in that, If the boundary curve is a free curve: Isoparametric step size for isoparametric discretization of free curves for: ; Adaptive step size for discretizing each curve segment for: ; in, This represents the larger parameter value between the two endpoints of the free curve. This represents the smaller parameter value between the two endpoints of the free curve. Indicates the order of the free curve; Indicates the radius of curvature at the current position. Indicates the preset chord height error. This represents the tangent vector at the current position.
6. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 1, characterized in that, For regular curved surfaces, an optimized rectangular mesh is generated using geometric properties, including: uniformly dividing along the parameter domain to generate initial subdivided elements.
7. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 1, characterized in that, For freeform surfaces, based on the parameter domain range and three-dimensional spatial geometric scale, a bisection method is used to divide the freeform surface and obtain initial subdivision elements, including: The freeform surface is initially divided into multiple parametric rectangles; For each parametric rectangle, it is further subdivided based on whether it satisfies the preset chord height error and preset rotation angle error in both the u and v directions of the parameter domain, and whether the diagonal length of the parametric rectangle is greater than the preset maximum side length, including: If the parameter rectangle does not meet the preset chord height error or preset rotation angle error in the u direction of the parameter domain, then the parameter rectangle is divided into two parameter rectangles along the u direction. If the parameter rectangle does not meet the preset chord height error or preset rotation angle error in the v direction of the parameter domain, then the parameter rectangle is divided into two parameter rectangles along the v direction. If the diagonal length of the parameter rectangle is greater than the preset maximum side length, then the parameter rectangle is subdivided into two parameter rectangles along the longer side; The division is completed when all leaf node parameter rectangles after division meet the preset chord height error and preset rotation angle error, and the diagonal is not greater than the preset maximum side length. The leaf node parameter rectangle is then used as the initial subdivision unit. Among them, the parameter rectangle satisfies the preset chord height error, which means that the maximum distance from the parameter rectangle to the trimmed surface is not greater than the preset chord height error; the parameter rectangle satisfies the preset rotation angle error, which means that the maximum angle between the normals at each vertex of the parameter rectangle is not greater than the preset rotation angle error.
8. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 1, characterized in that, Based on the positional relationship between each initial partitioning unit and the discrete boundary, the initial partitioning unit is divided into external parameter rectangles, internal parameter rectangles, and phase angle parameter rectangles. Then, by selecting the corresponding partitioning method, the initial partitioning unit is divided into triangles in parallel, including: If the initial meshing unit is located outside the discrete boundary, it is classified as an external parameter rectangle and skipped, and no meshing is performed on it. If the initial partitioning unit is located within the discrete boundary, it is classified as an internal parameter rectangle, and the initial partitioning unit is divided into multiple triangles based on the maximum minimum interior angle. If the initial subdivision unit intersects with the discrete boundary, it is classified as an intersection parameter rectangle, and the intersection line between the initial subdivision unit and the discrete boundary is extracted. This line, together with the region within the discrete boundary in the initial subdivision unit, forms an effective region. The boundary of the effective region is constrained and triangulated using the constrained Delaunay triangulation algorithm to obtain multiple triangles.
9. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 8, characterized in that, If the initial partitioned unit is located within the discrete boundary, it is classified as an internal parameter rectangle. Based on the maximum minimum interior angle, the initial partitioned unit is further divided into multiple triangles, including: Obtain discrete points on the edges of the initial partitioned unit. For each vertex of the initial partitioned unit, form a triangle with the previous and next discrete points of that vertex, and calculate the minimum interior angle of the triangle. Add the triangle with the largest minimum interior angle from the triangles corresponding to the four vertices of the initial subdivision unit to the subdivision result set, and remove it from the initial subdivision unit to obtain the updated subdivision unit; In the updated subdivision unit, a corresponding triangle is constructed based on each vertex. The triangle with the largest minimum interior angle is repeatedly selected and added to the subdivision result set, and the subdivision unit is updated. The process continues until only three discrete points remain in the updated subdivision unit. These three discrete points are then arranged into a triangle and added to the subdivision result set to complete the triangulation of the initial subdivision unit.
10. The parallelized triangular mesh generation method for trimming curved surfaces according to claim 8, characterized in that, If the initial partitioning unit intersects with the discrete boundary, it is classified as an intersection parameter rectangle, and the intersection line between the initial partitioning unit and the discrete boundary is extracted. This intersection line, along with the region within the discrete boundary in the initial partitioning unit, forms the effective region. Using the constrained Delaunay triangulation algorithm, the boundary of the effective region is constrained and triangulated to obtain multiple triangles, including: For discrete points on the boundary of the initial partitioning unit, a unique index is set, and they are sorted in counterclockwise order of the outer ring and clockwise order of the inner ring to obtain the ordered point set of the outer ring and the ordered point set of the inner ring. Based on the ordered point sets of the outer and inner rings, all boundaries are marked as constraint edges, and triangles are generated using the constrained Delaunay triangulation algorithm.
Citation Information
Cited By
Connode adaptive grid division method and device, medium and product
CN122263550A