Free-form surface processing track generation method based on conformal mapping
Through a parameterization algorithm based on conformal mapping and a boundary priority expansion algorithm, the three-dimensional surface is flattened into a two-dimensional parameter plane, and the processing trajectory is planned within the design area, which solves the problems of poor expansion of the three-dimensional surface and insufficient trajectory accuracy in the existing technology, and achieves efficient and accurate machining trajectory planning.
Patent Information
- Application Number
- CN202411763292.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The existing method of machining trajectory planning using discrete parameterization is not effective when dealing with surfaces of non-topological discs. It is impossible to correctly unfold the three-dimensional surface into planes, and the geometric deformation generated by the mapping affects the accuracy of the trajectory.
The parameterization algorithm based on conformal mapping is used to flatten the input triangular mesh surface into a two-dimensional parameter plane, and the shape is adjusted through the boundary priority expansion algorithm to make it a rectangle to reduce mapping deformation. The machining trajectory is then planned within the design area and reverse mapped to the three-dimensional surface.
It effectively solves the problem of three-dimensional surface unfolding into planes, reduces mapping deformation, improves the accuracy and adaptability of processing trajectory, and is suitable for processing trajectory planning of complex free surfaces.
Smart Images

Figure CN119620681A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mechanical processing, and in particular to a method for generating a free-form surface processing trajectory based on conformal mapping. Background Art
[0002] In modern manufacturing, it is challenging to process free-form surfaces using CNC machines or robots. Free-form surfaces are widely used in aerospace, automotive, and shipbuilding industries due to their good continuity and shape expression capabilities. They usually do not have regular geometric features and cannot be effectively processed using traditional processing methods. The complex contours of free-form surfaces usually contain subtle geometric features, such as small radius bends, grooves, or complex patterns. These features place higher demands on the planning of processing paths. Taking the carvings on the surface of bracelets as an example, the patterns and lines are complex and varied, requiring the processing trajectory to be highly adaptable and accurate to ensure the consistency and aesthetics of the final product.
[0003] Trajectory planning techniques using discrete surface parameterization methods (such as conformal mapping) have recently gained popularity. Discrete surface parameterization constructs a mapping that maps a free-form surface to a plane. The machining trajectory is planned on the plane and then inversely mapped back onto the free-form surface to obtain the desired 3D machining trajectory. This allows for efficient machining trajectory planning for complex contours on free-form surfaces.
[0004] However, current methods for machining trajectory planning using discrete parameterization lack an effective solution for non-topological circular surfaces. They cannot correctly unfold the input triangular mesh surface into a plane. Furthermore, in order to achieve low distortion in the mapping, the shape of the unfolded parameter plane is often difficult to control, and the geometric deformation caused by discrete parameterization can significantly affect the accuracy of the planned machining trajectory. Summary of the Invention
[0005] The purpose of the present invention is to provide a free-form surface machining trajectory generation method based on conformal mapping, aiming to solve the technical problem that the existing machining trajectory planning method using discrete parameterization has poor effect in unfolding a three-dimensional surface into a plane.
[0006] To achieve the above object, the present invention provides a method for generating a free-form surface machining trajectory based on conformal mapping, comprising the following steps:
[0007] Step 1: Select a free-form surface as the input triangular mesh surface;
[0008] Step 2: Get the geometric information of the input triangular mesh surface;
[0009] Step 3: Flatten the input triangular mesh surface into a two-dimensional parametric plane using a parameterization algorithm based on conformal mapping;
[0010] Step 4: Select the vertices and flatten again to obtain a two-dimensional rectangular parametric plane;
[0011] Step 5: Zoom the 2D parameter plane to the specified design area;
[0012] Step 6: Plan the machining trajectory on the two-dimensional parameter plane;
[0013] Step 7: Inversely map the 2D machining trajectory to the input triangular mesh surface to obtain the final machining trajectory.
[0014] Optionally, the execution process of step 2 includes the following steps:
[0015] Step 2.1: Traverse all vertices of the input triangular mesh surface and save the information of its boundary vertices;
[0016] Step 2.2: Calculate the curvature of all vertices of the input triangular mesh surface;
[0017] Step 2.3: Introduce the Cotan-Laplacian matrix to calculate the Cotan-Laplacian weight of each vertex of the triangular mesh surface;
[0018] Step 2.4: Divide the vertices into two categories: internal vertices and boundary vertices according to their indices, and re-block the Cotan-Laplacian matrix to obtain a block matrix;
[0019] Step 2.5: Construct vectors corresponding to the boundary vertices of the input triangular mesh surface and obtain the Euclidean distance between the boundary vertices.
[0020] Optionally, in step 3, a boundary-first expansion algorithm is used to expand the input triangular mesh surface into a two-dimensional parameter domain triangular mesh plane.
[0021] Optionally, in step 4, the flattened shape of the two-dimensional parameter domain triangular mesh plane is adjusted to a rectangle to obtain the bounding box parameters of the final result finalUV, and the deformation caused by the mapping is minimized.
[0022] Optionally, in step 5, required coefficients are calculated based on the rectangular parameter plane and the design region, and the rectangular parameter plane is scaled to the design region.
[0023] Optionally, the execution process of step 6 is specifically to plan the two-dimensional processing trajectory in the design area, that is, on the deformed two-dimensional parameter domain triangular mesh plane.
[0024] Optionally, in step 7, each input trajectory curve is discretized into several groups of trajectory point sets, which are mapped onto a plane and processed, and finally inversely mapped onto a three-dimensional mesh surface to obtain the final three-dimensional processing trajectory.
[0025] The present invention provides a free-form surface machining trajectory generation method based on conformal mapping. First, a three-dimensional triangular mesh surface is selected as an input; then, a boundary-first expansion algorithm is used to expand it into a two-dimensional parameter domain triangular mesh plane, so that the obtained two-dimensional parameter domain triangular mesh plane is rectangular and the deformation caused by the mapping is minimized; the next step is to deform the shape of the two-dimensional parameter domain triangular mesh plane to the size of the design area; after the designer plans the two-dimensional machining trajectory on the design area, that is, the deformed two-dimensional parameter domain triangular mesh plane, the machining trajectory is discretized into a number of machining trajectory points, and the centroid coordinates of the corresponding triangle fragments on the two-dimensional parameter domain triangular mesh plane are calculated, and finally they are inversely mapped onto the input triangular mesh surface, thereby obtaining the input three-dimensional machining trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0027] Figure 1 It is a schematic flow chart of the steps of a free-form surface machining trajectory generation method based on conformal mapping of the present invention.
[0028] Figure 2 It is a schematic diagram of inputting a three-dimensional triangular mesh surface in a specific embodiment of the present invention.
[0029] Figure 3 It is a schematic diagram of flattening an input three-dimensional triangular mesh surface into a two-dimensional parameter domain mesh plane in a specific embodiment of the present invention.
[0030] Figure 4 It is a schematic diagram of selecting vertices on the plane boundary of a two-dimensional parameter domain grid in a specific embodiment of the present invention.
[0031] Figure 5 It is a schematic diagram of unfolding an input three-dimensional triangular mesh surface into a two-dimensional rectangular parameter domain triangular mesh plane according to selected vertices in a specific embodiment of the present invention.
[0032] Figure 6 It is a schematic diagram of a design plane in a specific embodiment of the present invention.
[0033] Figure 7 It is a schematic diagram of deforming a two-dimensional rectangular parameter domain triangular mesh plane into a design plane in a specific embodiment of the present invention.
[0034] Figure 8It is a schematic diagram of designing a machining trajectory within a two-dimensional rectangular parameter domain triangular mesh deformed to the size of a design plane in a specific embodiment of the present invention.
[0035] Figure 9 It is a schematic diagram of discretizing a processing curve in a specific embodiment of the present invention.
[0036] Figure 10 It is a schematic diagram of inverse mapping discrete machining trajectory points in a two-dimensional rectangular parameter domain triangular mesh plane to an input three-dimensional triangular mesh surface in a specific embodiment of the present invention.
[0037] Figure 11 It is a comparison diagram of the input three-dimensional triangular mesh surface before and after the processing trajectory is generated in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.
[0039] See also Figure 1 The present invention provides a free-form surface machining trajectory generation method based on conformal mapping, comprising the following steps:
[0040] Step 1: Select a free-form surface as the input triangular mesh surface;
[0041] Step 2: Get the geometric information of the input triangular mesh surface;
[0042] Step 3: Flatten the input triangular mesh surface into a two-dimensional parametric plane using a parameterization algorithm based on conformal mapping;
[0043] Step 4: Select the vertices and flatten again to obtain a two-dimensional rectangular parametric plane;
[0044] Step 5: Zoom the 2D parameter plane to the specified design area;
[0045] Step 6: Plan the machining trajectory on the two-dimensional parameter plane;
[0046] Step 7: Inversely map the 2D machining trajectory to the input triangular mesh surface to obtain the final machining trajectory.
[0047] The following is further explained in conjunction with the implementation steps and specific embodiments (the present invention is explained by designing the pattern processing trajectory, see Figures 2 to 11 ):
[0048] The specific steps are as follows:
[0049] The execution process of step 1 includes the following steps:
[0050] Conformal mapping, as used in this invention, refers to a mapping in complex variable function theory that preserves angles. The distances and areas at corresponding points in two shapes before and after the mapping may change, but the angles remain constant. Conformal mapping can transform complex geometric shapes into simpler forms, facilitating analysis and calculation.
[0051] Free-form surfaces are complex three-dimensional surfaces that cannot be described by simple geometric shapes such as planes, cylinders, and spheres. Their flexible and complex shapes are not constrained by simple mathematical equations. They are often used to represent irregular, smooth, and continuous surfaces in designs requiring smooth transitions.
[0052] In this embodiment, firstly, the 3D triangular mesh surface to be generated for the machining trajectory is imported into the CAD / CAM software, such as Figure 2 The input triangular mesh surface is shown as follows; it is used to generate a three-dimensional machining trajectory on the input mesh based on the two-dimensional machining trajectory.
[0053] The execution process of step 2 includes the following steps:
[0054] Step 2.1: Traverse all vertices of the input triangular mesh surface and save the information of its boundary vertices.
[0055] Step 2.2: Calculate the curvature of all vertices of the input triangular mesh surface. For internal vertices, calculate its Gaussian curvature Ω i , for the boundary vertex, calculate its geodesic curvature k i Specifically, it can be calculated using the following formula:
[0056]
[0057] The summation symbol on the right side of the equation indicates traversing all adjacent triangles of vertex i and accumulating the angle corresponding to vertex i on each adjacent triangle.
[0058] Gaussian curvature is a measure used in differential geometry to describe the intrinsic curvature of a surface at a point. It reflects the degree of curvature of the surface in all directions.
[0059] Geodesic curvature is a measure in differential geometry that describes the curvature of a curve relative to a surface. It represents the curvature of the curve at a point in the tangent direction (tangent to the surface). It reflects the degree to which the curve deviates from the "straightest" path on the surface (i.e., the geodesic).
[0060] Step 2.3: Calculate the Cotan-Laplacian weight of each vertex of the triangular mesh surface. For a discrete triangular mesh surface with N vertices, it can be represented as an N×N matrix. Specifically, it can be calculated using the following formula:
[0061]
[0062] The edge formed by vertex i and its adjacent vertex j is called dege ij , then α j and β j Denote the shared edge dege ij In the two triangles, the opposite edges ij The angle between the two vertices.
[0063] The Cotan-Laplacian matrix refers to a discrete Laplacian operator used to process triangular mesh data in discrete differential geometry. Its element A ij It refers to the cotangent weight of vertex i generated by vertex j adjacent to vertex i. Its element A ii It represents the negative value of the sum of the cotangent weights of all adjacent vertices of vertex i.
[0064] Step 2.4: According to the vertex index, it is divided into two categories: internal vertices and boundary vertices. The Cotan-Laplacian matrix is re-divided from left to right and from top to bottom into A II 、A IB 、A BI 、A BB Four sub-matrices. The block matrix is as follows:
[0065]
[0066] Reblocking of the Cotan-Laplacian matrix into A II 、A IB 、A BI 、A BB , refers to A II Corresponding to the cotangent weight of the internal vertex to the internal vertex, A IB The cotangent weight of the corresponding boundary vertex on the internal vertex, A BI Corresponding to the cotangent weight of the internal vertex on the boundary vertex, A BB The cotangent weight of the corresponding boundary vertex to the boundary vertex.
[0067] Step 2.5: For the bN boundary vertices of the input triangular mesh surface, construct a bN×1 vector l, whose i-th element l i It represents the Euclidean distance from the i-th boundary vertex to the i+1-th boundary vertex.
[0068] The Euclidean distance refers to the square root of the sum of the squares of the differences between the coordinate components of two vectors.
[0069] The execution process of step 3 includes the following steps:
[0070] Step 3.1: Create a bN×1 vector g, whose elements are all 0. It is the set of all boundary vertex elements within the conformal scaling factor u.
[0071] The conformal scaling factor u is a parameter used to measure the scaling scale of the conformal mapping, indicating the scaling scale of each vertex before and after the mapping. It can be calculated using the following formula:
[0072]
[0073] Step 3.2: Based on the Gaussian curvature and geodesic curvature of the vertices of the input triangular mesh surface and the vector g described in step 3.1, construct the discrete Newman number h of the boundary vertex during the mapping process, which can be calculated using the following formula:
[0074]
[0075] The matrix on the left is the Cotan-Laplacian matrix after the block division in step 2.4. I is an iN×1 vector, where each element represents the Gaussian curvature of the interior vertex, φ B is a bN×1 zero vector, where each element represents the Gaussian curvature of the boundary vertex, a B This is the conformal scaling factor g of the boundary vertex obtained in step 3.1.
[0076] Step 3.3: A II Perform Cholesky decomposition.
[0077] Cholesky decomposition is a decomposition method for symmetric positive definite matrices. It decomposes a symmetric positive definite matrix into the product of a lower triangular matrix and its transposed matrix.
[0078] Step 3.4: Solve the first row of the Cotan-Laplacian matrix in step 3.2 to obtain a I , specifically, it can be calculated using the following formula:
[0079] A II a I =φ I -A IB g
[0080] Step 3.5: Based on the a obtained in step 3.4I , solve the second row of the Cotan-Laplacian matrix in step 3.2 to obtain h, which can be calculated using the following formula:
[0081] h=φ B -(A BI a I +A BB g)
[0082] Step 3.6: Based on h obtained in step 3.5 and the geodesic curvature k of the boundary vertices of the input 3D triangular mesh surface, the geodesic curvature of the boundary vertices of the target 2D parameter plane can be obtained. It can be calculated using the following formula:
[0083]
[0084] Step 3.7: Based on the vector g constructed in step 3.1 and the vector obtained in step 3.6 Execute the main process phase of the boundary-first expansion algorithm.
[0085] Step 3.8: Calculate the boundary length of the target 2D parameter plane based on the boundary scaling factor g of the target 2D parameter domain mesh plane and the boundary length l of the input triangular mesh surface, using the bN×1 vector l * Indicates that each element It can be calculated using the following formula.
[0086]
[0087] Step 3.9: Calculated according to step 3.6 and l calculated in step 3.8 * , iteratively calculate the vertex coordinates of the optimized optimal boundary.
[0088] Step 3.10: Construct a bN×1 zero vector L and traverse it sequentially Each element of L is filled by accumulating each element of L. j , which can be calculated using the following formula:
[0089]
[0090] Step 3.11: Construct a bN×2 zero matrix Used to represent the tangent vector direction of the target two-dimensional parameter boundary vertex. According to the K obtained in step 3.10, traverse each element in L to calculate but The i-th row element in It can be calculated using the following formula:
[0091]
[0092] Step 3.12: The distance between two adjacent boundary vertices of the input triangular mesh surface calculated in step 2.5 can be represented by a bN×1 vector l. Calculate the dual edge del of the boundary vertex of the input triangular mesh surface. del is a bN×1 vector. Specifically, its i-th element del i It can be calculated using the following formula:
[0093]
[0094] The dual edge refers to the weighted segment length formed by the Euclidean distance between a vertex on the boundary and its two adjacent vertices.
[0095] Step 3.13: Calculate the target two-dimensional parameter boundary length l obtained in step 3.8 * , the tangent vector direction of the target two-dimensional parameter boundary vertex obtained in step 3.11 The dual edge del of the boundary vertex obtained in step 3.12 is used to calculate the boundary vertex length of the target two-dimensional parameter domain after the final optimization. It can be calculated using the following formula:
[0096]
[0097] Where N is a bN×bN diagonal matrix, and each element N on its diagonal is ii represents the inverse of the dual edge of the i-th boundary vertex, that is:
[0098]
[0099] Step 3.14: Calculate the target 2D parameter domain boundary vertex lengths obtained in step 3.13 The tangent vector direction of the target two-dimensional parameter boundary vertex calculated in step 3.11 is The final optimized target two-dimensional parameter domain boundary vertex coordinates can be calculated It is a bN×2 matrix whose p-th row stores the uv coordinates of the p-th boundary vertex, where the p-th element It can be calculated using the following formula:
[0100]
[0101] Step 3.15: The final optimized boundary vertex coordinates calculated according to step 3.14 Prepare to calculate the u and v coordinates of the internal vertices respectively.
[0102] Step 3.16: Using the Cotan-Laplacian matrix constructed in step 2.4, construct a linear equation to solve the u value of the vertex uv coordinate inside the target two-dimensional parameter domain, using a I Indicates that a B is the u value of the uv coordinate of the vertex on the boundary of the target 2D parameter domain. Solved according to step 3.14, it is a bN×1 vector. This linear equation system can be calculated using the following formula:
[0103]
[0104] Step 3.17: A II Perform Cholesky decomposition and solve the first row of the linear equations in step 3.16 to obtain a I , that is, the u value of the vertex uv coordinate inside the target two-dimensional parameter domain.
[0105] Step 3.18: Use the u value a of the vertex uv coordinate inside the target two-dimensional parameter domain calculated in step 3.17 I Traverse all boundary vertices and construct a bN×1 vector h b , for three consecutive boundary vertices i, j, k, for h b The jth element in It can be calculated using the following formula:
[0106]
[0107] Step 3.19: Construct an iN×1 zero vector h i , using the vector h obtained in step 3.18 b , vertical splicing h i and h b , get an N×1 vector h b .
[0108] Vertical concatenation refers to connecting two vectors of the same or different lengths end to end while keeping the order of the original elements unchanged to obtain a new vector.
[0109] Step 3.20: Using the Cotan-Laplacian matrix obtained in step 2.4, perform Cholesky decomposition on it and solve the following linear equation to obtain b I and b B , that is, the v value of the uv coordinates of the internal and boundary vertices of the target two-dimensional parameter domain:
[0110]
[0111] Step 3.21: Construct an N×2 matrix reorderedUV, traverse all internal vertices, and fill the uv values of the internal vertices of the two-dimensional parameter plane calculated in steps 3.17 and 3.20 into the rows corresponding to the indices in reorderedUV; traverse all boundary vertices, and fill the uv values of the boundary vertices of the two-dimensional parameter plane calculated in step 3.15 into the rows corresponding to the indices in reorderedUV.
[0112] Step 3.22: Expand the N×2 matrix reorderedUV obtained in step 3.21 into an N×3 matrix with all zeros in the third column.
[0113] Step 3.23: Calculate the bounding box of the coordinate points stored in the N×3 matrix reorderedUV obtained in step 3.22, and calculate the coordinate box of the lower left corner of the bounding box min and the upper right corner coordinate box max And the center coordinate box of the bounding box center .
[0114] The bounding box refers to the smallest aligned rectangle (in two-dimensional case) or cube (in three-dimensional case) that encloses an object, geometric figure or shape.
[0115] Step 3.24: Translate the set of coordinate points represented by the N×3 matrix reorderedUV obtained in step 3.22 so that its average center is at the origin of the coordinate axis. Specifically, it can be calculated using the following formula:
[0116]
[0117] Among them, C is the center of mass coordinate of reorderedUV.
[0118] Step 3.25: Get the major axis of the current 2D parameter plane. Use box max Subtract box min , get a three-dimensional vector box judge , if box judge The y element is less than or equal to box judge x element, then the long axis of the current two-dimensional parameter domain plane is determined to be on the x-axis and no processing is done; otherwise, the two-dimensional parameter domain plane is rotated 90 degrees counterclockwise around the z-axis. By constructing a rotation matrix, the rotatedUV is calculated:
[0119]
[0120] Step 3.26: The box calculated in step 3.23 min 、box max, we can calculate the scaling factor of rotatedUV in the x, y, and z directions, which can be represented by a three-dimensional vector scaleTerm:
[0121]
[0122] The rotatedUV calculated in step 3.25 is used to construct a scaling matrix to scale it to get the final result finalUV, which can be expressed as follows:
[0123]
[0124] Step 3.27: Display the finalUV on the screen as a 2D parametric domain mesh plane with the face connectivity of the input triangular mesh surface.
[0125] The surface connectivity described in step 3.27 refers to the relationship between the indices of all triangle fragments on the triangular mesh surface and the indices of their corresponding three vertices.
[0126] In this embodiment, based on the input three-dimensional triangular mesh surface, it is expanded into a two-dimensional parameter domain triangular mesh plane with the minimum angle deformation, such as Figure 3 The flattened diagram is shown in FIG; it is used to further generate a two-dimensional rectangular parameter domain triangular mesh plane.
[0127] The execution process of step 4 includes the following steps:
[0128] Step 4.1: The flattened shape will be a polygon close to a rectangle. Select four corner points on the boundary vertex of the 2D parameter domain mesh plane and save the index v of these four corner points c1 、v c2 、v c3 、v c4 .
[0129] In this embodiment, based on the polygon close to the rectangle obtained by flattening, the user manually selects the four vertices closest to the corners of the rectangle, such as Figure 4 The selected vertices are shown in the diagram. They are used to transform the polygon into a rectangle with minimal mapping distortion.
[0130] Step 4.2: Traverse all bN boundary vertices and create a bN×1 vector The corresponding vertex v c1 、v c2 、v c3 、v c4 The value of the index position is 0.5π, and the values of the other positions are 0. Save it as the outer angle of the target parameter domain for subsequent execution of the boundary-first expansion algorithm.
[0131] Step 4.3: The outer boundary angle of the target 2D parameter domain grid plane calculated in step 4.1 The geodesic curvature k of the boundary vertices of the three-dimensional triangular mesh surface input in step 2.2 is used to obtain the gradient h of the boundary during the mapping process, that is: According to h, a linear equation is constructed to solve the conformal scaling factor g of the boundary vertex during the mapping process, which can be calculated using the following formula:
[0132]
[0133] The matrix on the left is the Cotan-Laplacian matrix after the block division in step 2.4. I is an iN×1 vector, where each element represents the Gaussian curvature of the interior vertex, φ B is a bN×1 zero vector, where each element represents the Gaussian curvature of the boundary vertex, a B is the conformal scaling factor g of the boundary vertices of the target parameter domain mesh plane.
[0134] Step 4.4: To improve the solution speed, perform Cholesky decomposition on the large sparse matrix on the left side of the equation system in step 4.3, and then solve the linear equation system to obtain a I and a B The bN×1 vector a is constructed, and a is extracted B Save as g. Apply a constant offset to each item in g to prevent the obtained parameter from being too large or too small. Obtain the average value of g Subtract each element in g Finally we get the g we need.
[0135] Step 4.5: Based on the vector g calculated in step 4.4 and the vector obtained in step 4.2 Execute the main process phase of the boundary-first expansion algorithm.
[0136] Step 4.6: Calculate the boundary length of the target 2D parameter plane based on the boundary scaling factor g of the target 2D parameter domain mesh plane and the boundary length l of the input triangular mesh surface, using the bN×1 vector l * Indicates that each element It can be calculated using the following formula.
[0137]
[0138] Step 4.7: Calculated according to step 4.2 and l calculated in step 4.6 * , iteratively calculate the vertex coordinates of the optimized optimal boundary.
[0139] Step 4.8: Construct a bN×1 zero vector L and traverse it sequentially Each element of L is filled by accumulating each element of L. j , which can be calculated using the following formula:
[0140]
[0141] Step 4.9: Construct a bN×2 zero matrix Used to represent the tangent vector direction of the target two-dimensional parameter boundary vertex. According to the L obtained in step 4.8, traverse each element in L to calculate but The i-th row element in It can be calculated using the following formula:
[0142]
[0143] Step 4.10: The distance between two adjacent boundary vertices of the input triangular mesh surface calculated in step 2.5 can be represented by a bN×1 vector l. Calculate the dual edge del of the boundary vertex of the input triangular mesh surface. del is a bN×1 vector. Specifically, its i-th element del i It can be calculated using the following formula:
[0144]
[0145] Step 4.11: Calculate the target two-dimensional parameter boundary length l obtained in step 3.8 * , the tangent vector direction of the target two-dimensional parameter boundary vertex obtained in step 4.9 The dual edge del of the boundary vertex obtained in step 4.10 is used to calculate the boundary vertex length of the target two-dimensional parameter domain after the final optimization. It can be calculated using the following formula:
[0146]
[0147] Where N is a bN×bN diagonal matrix, and each element N on its diagonal is ii represents the inverse of the dual edge of the i-th boundary vertex, that is:
[0148]
[0149] Step 4.12: Calculate the target 2D parameter domain boundary vertex lengths obtained in step 4.11 The tangent vector direction of the target two-dimensional parameter boundary vertex calculated in step 4.9 is The final optimized target two-dimensional parameter domain boundary vertex coordinates can be calculated It is a bN×2 matrix whose p-th row stores the uv coordinates of the p-th boundary vertex, where the p-th element It can be calculated using the following formula:
[0150]
[0151] Step 4.13: The final optimized boundary vertex coordinates calculated according to step 4.12 Prepare to calculate the u and v coordinates of the internal vertices respectively.
[0152] Step 4.14: Using the Cotan-Laplacian matrix constructed in step 2.4, construct a linear equation to solve the u value of the vertex uv coordinate inside the target two-dimensional parameter domain, using a I Indicates that a B is the u value of the uv coordinate of the vertex on the boundary of the target 2D parameter domain. Solved according to step 4.12, it is a bN×1 vector. This linear equation system can be calculated using the following formula:
[0153]
[0154] Step 4.15: A II Perform Cholesky decomposition and solve the first row of the linear equations in step 4.14 to obtain a I , that is, the u value of the vertex uv coordinate inside the target two-dimensional parameter domain.
[0155] Step 4.16: Using the Cotan-Laplacian matrix constructed in step 2.4, construct a linear equation to solve the v value of the vertex uv coordinate inside the target two-dimensional parameter domain, using b I Indicates that b B is the v value of the uv coordinate of the vertex on the boundary of the target 2D parameter domain. Solved according to step 4.12, it is a bN×1 vector. This linear equation system can be calculated using the following formula:
[0156]
[0157] Step 4.17: For A II Perform Cholesky decomposition and solve the first row of the linear equations in step 4.16 to obtain b I , that is, the v value of the vertex uv coordinate inside the target two-dimensional parameter domain.
[0158] Step 4.18: Construct an N×2 matrix reorderedUV, traverse all internal vertices, and fill the uv values of the internal vertices of the two-dimensional parametric plane calculated in steps 4.15 and 4.17 into the rows corresponding to the indices in reorderedUV; traverse all boundary vertices and fill the uv values of the boundary vertices of the two-dimensional parametric plane calculated in step 4.12 into the rows corresponding to the indices in reorderedUV.
[0159] Step 4.19: Expand the N×2 matrix reorderedUV obtained in step 4.18 into an N×3 matrix with all zeros in the third column.
[0160] Step 4.20: Calculate the bounding box of the coordinate points stored in the N×3 matrix reorderedUV obtained in step 4.19, and calculate the coordinate box of the lower left corner of the bounding box min and the upper right corner coordinate box max And the center coordinate box of the bounding box center .
[0161] Step 4.21: Translate the set of coordinate points represented by the N×3 matrix reorderedUV obtained in step 4.19 so that its average center is at the origin of the coordinate axis. Specifically, it can be calculated using the following formula:
[0162]
[0163] Among them, C is the center of mass coordinate of reorderedUV.
[0164] Step 4.22: Get the major axis of the current 2D parameter plane. Use box max Subtract box min , get a three-dimensional vector box judge , if box judge The y element is less than or equal to box judge x element, then the long axis of the current two-dimensional parameter domain plane is determined to be on the x-axis and no processing is done; otherwise, the two-dimensional parameter domain plane is rotated 90 degrees counterclockwise around the z-axis. By constructing a rotation matrix, the rotatedUV is calculated:
[0165]
[0166] Step 4.23: The box calculated in step 4.20 min 、box max , we can calculate the scaling factor of rotatedUV in the x, y, and z directions, which can be represented by a three-dimensional vector scaleTerm:
[0167]
[0168] The rotatedUV calculated in step 4.22 is used to construct a scaling matrix to scale it to get the final result finalUV, which can be expressed as follows:
[0169]
[0170] Step 4.24: Display the finalUV on the screen as a 2D parametric domain mesh plane with the face connectivity of the input triangular mesh surface.
[0171] The surface connectivity described in step 4.24 refers to the relationship between the indices of all triangle fragments on the triangular mesh surface and the indices of their corresponding three vertices.
[0172] In this embodiment, a two-dimensional rectangular parameter domain triangular mesh plane is obtained based on four corner points selected on the two-dimensional parameter domain triangular mesh plane, as shown in FIG. Figure 5 The flattened rectangle is shown in the figure; it is used to further deform the plane into the shape of the design area.
[0173] The execution process of step 5 includes the following steps:
[0174] Step 5.1: Calculate the coordinates of the lower left corner of the bounding box of the design area Upper right corner coordinates Center coordinates Use the bounding box of the two-dimensional parameter domain grid plane calculated in step 4.20 min 、box max 、box center Calculate the translation coefficients T in the x and y directions of all coordinates finalUV of the two-dimensional parameter domain grid plane obtained in step 4.23 u 、T v , can be calculated using the following formula:
[0175]
[0176] Step 5.2: Calculate the scaling factor S in the x and y directions of the finalUV scaled to the design area u 、S v , can be calculated using the following formula:
[0177]
[0178] Step 5.3: Construct a homogeneous transformation to scale finalUV to the size of the design rectangular area, and obtain the two-dimensional parameter domain grid plane coordinate point set shapeMatchedUV that is consistent with the shape of the design area. It can be calculated using the linear equation system as follows:
[0179]
[0180] Specifically, the homogeneous transformation is a transformation method that uniformly expresses common spatial transformations (such as translation, rotation, and scaling) as matrix multiplication.
[0181] In this embodiment, the design processing area is first imported into the CAD / CAM software, such as Figure 6 The input design processing area is shown as follows; it is used to deform the two-dimensional parameter domain triangular mesh plane. Then, based on the obtained two-dimensional rectangular parameter domain triangular mesh plane, it is deformed into a rectangular plane of the design area size, as shown in Figure 7 It is used to plan the two-dimensional machining trajectory on the two-dimensional rectangular parameter domain triangular mesh plane of the design area size.
[0182] In step 6, the user performs trajectory planning in the design processing area in the CAD / CAM software, such as Figure 8 The trajectory planning is shown in FIG; it is used to discretize the two-dimensional machining trajectory.
[0183] The execution process of step 7 includes the following steps:
[0184] Step 7.1: Discretize each curve. Input the discrete parameter t, traverse all continuous trajectory curves, and split the current curve into t parts according to the parameter t, obtaining t+1 discrete trajectory points.
[0185] Step 7.2: Traverse i The jth discrete trajectory point on the discrete curve Find the triangle fragment to which it belongs on the two-dimensional parameter domain grid plane
[0186] Step 7.3: The triangle fragment obtained in step 7.2 calculate The three vertex coordinates are a(x1, y1, z1), b(x2, y2, z2), and c(x3, y3, z3).
[0187] Step 7.4: Calculated according to step 7.3 The three vertex coordinates of Area abc , can be calculated using the following formula:
[0188]
[0189] Step 7.5: Using the formula from step 7.4, calculate the discrete trajectory points obtained in step 7.2 The triangle fragment obtained in step 7.3 The area of the triangle formed by the three vertices a(x1, y1, z1), b(x2, y2, z2), and c(x3, y3, z3) is obtained. pbc 、Area pca .
[0190] Step 7.6: Area obtained from steps 7.4 and 7.5 abc 、Area pbc 、Area pca , we get three parameters t1, t2, and t3. We can use the following formula to calculate:
[0191]
[0192] Step 7.7: According to the formula in step 7.6, the discrete trajectory points obtained in step 7.2 are obtained. The triangle fragment obtained in step 7.3 The center of gravity coordinates (t1, t2, t3) within.
[0193] Optionally, the barycentric coordinates refer to a coordinate system defined based on the vertices of a polygon or polyhedron, and are often used to represent the position of any point inside or on the surface of a geometric shape, and the position of the point is determined by representing the weight of the point relative to the vertices of the shape.
[0194] Step 7.8: Traverse all triangle fragments of the input 3D triangular mesh surface and find the corresponding triangle fragments obtained in step 7.2. The triangle fragment corresponding to the index
[0195] Step 7.9: The triangle fragment obtained in step 7.8 Get the coordinates of its three vertices A(X1, Y1, Z1), B(X2, Y2, Z2), and C(X3, Y3, Z3).
[0196] Step 7.9: Based on the center of gravity coordinates (t1, t2, t3) obtained in step 7.7, calculate the discrete trajectory points obtained in step 7.2 Corresponding coordinates on the input 3D triangular mesh surface It can be calculated by the following formula:
[0197]
[0198] Step 7.10: Traverse each discrete trajectory point in all trajectory curves, iterate the process from step 7.2 to step 7.9, and finally obtain all trajectory points on the two-dimensional parameter domain grid plane. Corresponding to trajectory points on the 3D input mesh surface
[0199] In this embodiment, the discretized 2D machining trajectory points are inversely mapped to the discretized 3D machining trajectory points of the input triangular mesh surface, such as Figure 10 The inverse mapping result of Figure 11 As shown in the figure, for complex free-form surface machining, the machining trajectory generated by the method of the present invention has less deformation and higher machining efficiency.
[0200] In an embodiment of the present invention, by applying the steps 1 to 7 to the input three-dimensional triangular mesh surface, a low-distortion three-dimensional machining trajectory can be successfully generated, such as Figure 10 and Figure 11 As shown; when processing a curved surface, a mapping method including but not limited to the surface equation calculation can be used to map the generated two-dimensional trajectory to a three-dimensional space, thereby obtaining the desired curved surface area processing trajectory, such as Figure 10 and Figure 11 As shown in the figure, for complex and deformed free-form surface processing, the three-dimensional processing trajectory generated by the method of the present invention has less deformation and higher operability, thereby achieving higher processing efficiency.
[0201] In summary, compared with the prior art, the advantages and effects of the present invention are:
[0202] The present invention is applicable to the problem of machining trajectory planning for complex free-form surfaces. The method can reduce the dimension of tool path planning for complex free-form surfaces to a plane, reducing the complex and tedious problems such as spatial intersection, and the generated tool path trajectory has small deformation. It can adaptively generate a corresponding three-dimensional machining trajectory on the input triangular mesh surface based on the two-dimensional machining trajectory planned on the two-dimensional parameter domain triangular mesh plane, and can fit the surface well.
[0203] The above disclosure is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A free-form surface machining trajectory generation method based on conformal mapping, characterized in that: The following steps are involved: Step 1: Select the free-form surface as the input triangular mesh surface; Step 2: Get the geometric information of the input triangular mesh surface; Step 3: Flatten the input triangular mesh surface into a two-dimensional parameter plane using a parameterization algorithm based on conformal mapping; Step 4: Select the vertices and flatten again to obtain a two-dimensional rectangular parameter plane; Step 5: Zoom the 2D parameter plane to the specified design area; Step 6: Plan the machining trajectory on the two-dimensional parameter plane; Step 7: Inversely map the 2D machining trajectory to the input triangular mesh surface to obtain the final machining trajectory.
2. The free-form surface machining trajectory generation method based on conformal mapping according to claim 1, characterized in that: The execution process of step 2 includes the following steps: Step 2.1: Traverse all vertices of the input triangular mesh surface and save the information of its boundary vertices; Step 2.2: Calculate the curvature of all vertices of the input triangular mesh surface; Step 2.3: Introduce the Cotan-Laplacian matrix to calculate the Cotan-Laplacian weight of each vertex of the triangular mesh surface; Step 2.4: According to the vertex index, the vertices are divided into two categories: internal vertices and boundary vertices, and the Cotan-Laplacian matrix is re-blocked to obtain a block matrix; Step 2.5: Construct vectors corresponding to the boundary vertices of the input triangular mesh surface and obtain the Euclidean distance between the boundary vertices.
3. The free-form surface machining trajectory generation method based on conformal mapping according to claim 2, characterized in that: In step 3, the input triangular mesh surface is unfolded into a two-dimensional parameter domain triangular mesh plane using a boundary-first unfolding algorithm.
4. The method for generating a free-form surface machining trajectory based on conformal mapping according to claim 3, characterized in that: In step 4, the flattened shape of the two-dimensional parameter domain triangular mesh plane is adjusted to a rectangle to obtain the bounding box parameters of the final result finalUV, and the deformation caused by the mapping is minimal.
5. The method for generating free-form surface machining trajectory based on conformal mapping according to claim 4, characterized in that: In step 5, the required coefficients are calculated based on the rectangular parameter plane and the design region, and the rectangular parameter plane is scaled to the design region.
6. The method for generating a free-form surface machining trajectory based on conformal mapping according to claim 5, characterized in that: The execution process of step 6 is specifically to plan the two-dimensional processing trajectory in the design area, that is, on the deformed two-dimensional parameter domain triangular mesh plane.
7. The method for generating a free-form surface machining trajectory based on conformal mapping according to claim 6, characterized in that: In step 7, each input trajectory curve is discretized into several sets of trajectory point sets, which are mapped onto a plane and processed, and finally inversely mapped onto a three-dimensional mesh surface to obtain the final three-dimensional processing trajectory.
Citation Information
Patent Citations
Method for numerical control machining and path planning on mesh surface based on conformal parameterization
CN104570928A
Curved surface discrete point cloud model girdling tool path generation method based on harmonic mapping
CN110516388A
Curved surface regional girdling processing track generation method
CN114660991A
Robot operation track generation method based on complex grid curved surface NURBS fitting
CN114708402A
Free-form surface constant force milling trajectory planning method and device based on conformal mapping
CN115268363A