A curved surface engraving control method based on a laser engraving machine
By collecting discrete point data of the intersection of planar rectangular grids in a laser engraving machine, establishing a surface fitting model and determining the three-dimensional engraving trajectory, the problem of engraving irregular curved objects by laser engraving machines is solved, and efficient automatic engraving is achieved.
Patent Information
- Application Number
- CN202511419754.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-09-30
AI Technical Summary
Existing laser engraving technology has difficulty in automatically engraving irregular curved surfaces, resulting in low engraving efficiency.
By using the intersection points of rectangular grids as acquisition points in the planar coordinate system of the surface to be processed, discrete point data is collected and parametric calculations are performed to establish a surface fitting model, determine the three-dimensional carving trajectory, and control the laser carving machine to carve according to the carving trajectory.
It enables automatic carving of irregular curved surfaces, improving carving efficiency.
Smart Images

Figure CN120885883B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of laser engraving, and particularly to a curved surface engraving control method based on a laser engraving machine. BACKGROUND
[0002] The laser engraving machine is a device for engraving materials to be engraved by using a laser, which can improve the engraving efficiency and make the surface to be engraved smooth and round. The existing laser engraving technology usually only supports engraving a planar pattern, and it is difficult to realize automatic engraving on the surface of an irregular object. Therefore, the existing laser engraving technology still has the problem of difficulty in engraving irregular curved surfaces. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a curved surface engraving control method based on a laser engraving machine, which can realize automatic engraving on irregular curved surface objects and improve the engraving efficiency of irregular curved surface objects.
[0004] In order to achieve the above-mentioned purpose, the technical solutions adopted by the embodiments of the present application are as follows:
[0005] In a first aspect, the embodiments of the present application provide a curved surface engraving control method based on a laser engraving machine, which comprises:
[0006] In the to-be-processed region of the to-be-processed curved surface object, the intersection points of the planar rectangular grid in the planar coordinate system are taken as the collection points to collect the discrete point data; wherein the discrete point data includes the planar coordinate data and the height data of the collection points;
[0007] The discrete point data of each group of intersection points in the horizontal axis direction of the planar coordinate system is subjected to parameterization calculation to obtain a first virtual data sequence, and the discrete point data of each group in the vertical axis direction of the planar coordinate system is subjected to parameterization calculation to obtain a second virtual data sequence; wherein the vertical coordinates of each discrete point in each group of discrete points in the horizontal axis direction are equal, and the horizontal coordinates of each discrete point in each group of discrete points in the vertical axis direction are equal;
[0008] Based on the first virtual data sequence and the second virtual data sequence, a curved surface fitting model of the to-be-processed region is determined;
[0009] A preset engraving image is obtained, and based on the preset engraving image and the curved surface fitting model, a three-dimensional engraving track is determined;
[0010] The laser of the laser engraving machine is controlled to engrave in the to-be-processed region according to the three-dimensional engraving track, so as to form the preset engraving image in the to-be-processed region.
[0011] Further, the embodiment of the present application provides a first possible implementation manner of the first aspect, wherein the determining the curved surface fitting model of the to-be-processed area based on the first virtual data sequence and the second virtual data sequence comprises:
[0012] obtaining a virtual data relationship set matrix based on the first virtual data sequence and the second virtual data sequence;
[0013] performing curved surface fitting based on the virtual data relationship set matrix to determine the curved surface fitting model of the to-be-processed area.
[0014] Further, the embodiment of the present application provides a second possible implementation manner of the first aspect, wherein before the parameterized calculation of the discrete point data of each group of intersection points in the horizontal axis direction of the plane coordinate system, the method further comprises:
[0015] complementing the collection points based on the height data, and collecting the discrete point data of the complemented collection points.
[0016] Further, the embodiment of the present application provides a third possible implementation manner of the first aspect, wherein the complementing the collection points based on the height data, and collecting the discrete point data of the complemented collection points comprises:
[0017] calculating the height difference between every two adjacent collection points in the horizontal axis direction based on the height information; when the height difference between any two adjacent collection points in the horizontal axis direction is greater than a preset height difference threshold, a new collection point is complemented between the two collection points with the height difference greater than the preset height difference threshold, and the discrete point data of the new collection point is collected;
[0018] and / or,
[0019] calculating the height difference between every two adjacent collection points in the vertical axis direction based on the height information of each discrete point; when the height difference between any two adjacent collection points in the vertical axis direction is greater than a preset height difference threshold, a new collection point is complemented between the two collection points with the height difference greater than the preset height difference threshold, and the discrete point data of the new collection point is collected.
[0020] Further, the embodiment of the present application provides a fourth possible implementation manner of the first aspect, wherein the complementing the collection points based on the height data, and collecting the discrete point data of the complemented collection points comprises:
[0021] Calculate the height difference between every two adjacent vertices of each rectangle in the rectangular grid, and record at least two rectangles with height difference greater than a preset height difference threshold as target rectangles;
[0022] Supplement new collection points in the target rectangle, and collect discrete point data for the new collection points.
[0023] Further, the embodiment of the present application provides a fifth possible implementation manner of the first aspect, wherein the supplementing of collection points in the region to be processed based on the height data and the collection of discrete point data for the supplemented collection points comprises:
[0024] Calculating the height difference between every two adjacent collection points in the rectangular grid;
[0025] Counting the number of collection points with height difference greater than a preset height difference threshold, or counting the proportion of the number of height differences greater than the preset height difference threshold in all the calculated height differences;
[0026] When the number of discrete points is greater than a first preset number, or when the proportion is greater than a preset proportion, supplementing new collection points between every two collection points and inside each rectangle of the rectangular grid, and collecting discrete point data for the supplemented collection points.
[0027] Further, the embodiment of the present application provides a sixth possible implementation manner of the first aspect, wherein the supplementing of collection points in the region to be processed based on the height data and the collection of discrete point data for the supplemented collection points comprises:
[0028] When the number of height differences greater than the preset height difference threshold in the horizontal axis direction is greater than a second preset number, and the number of height differences greater than the preset height difference threshold in the vertical axis direction is greater than a third preset number, uniformly supplementing new collection points in the region to be processed, and collecting discrete point data for the supplemented collection points.
[0029] Further, the embodiment of the present application provides a seventh possible implementation manner of the first aspect, wherein the supplementing of collection points in the region to be processed based on the height data and the collection of discrete point data for the supplemented collection points comprises:
[0030] Dividing the matrix grid in the region to be processed into a plurality of grid regions;
[0031] Calculating the height difference between every two adjacent collection points in each grid region;
[0032] counting the number of the collection points with the height difference greater than the preset height difference threshold in each of the grid areas, and recording the grid area with the number of the collection points greater than a fourth preset number as a target grid area;
[0033] supplementing a new collection point between each two collection points in the target grid area, and collecting the discrete point data for the supplemented collection point.
[0034] Further, the embodiments of the present application provide an eighth possible implementation manner of the first aspect, wherein the step of performing surface fitting based on the virtual data relationship set matrix to obtain the surface fitting model of the to-be-processed area comprises:
[0035] determining an equation relationship between the measurement points and the control points of the surface fitting model according to the virtual data relationship set matrix;
[0036] determining an optimal solution of the control point coordinates based on the equation relationship between the measurement points and the control points by using an optimization algorithm to obtain the surface fitting model; wherein the surface fitting model is a cubic B-spline surface model.
[0037] Further, the embodiments of the present application provide a ninth possible implementation manner of the first aspect, wherein the step of obtaining a preset engraving image, and determining a three-dimensional engraving track according to the preset engraving image and the surface fitting model comprises:
[0038] generating a planar two-dimensional path of the engraving track based on the preset engraving image, and projecting the planar two-dimensional path onto the surface fitting model to form the three-dimensional engraving track.
[0039] The embodiment of the present application provides a curved surface engraving control method based on a laser engraving machine, which comprises the following steps: collecting discrete point data by taking the intersection points of a planar rectangular grid in a planar coordinate system as the collection points in a to-be-processed region of a to-be-processed curved surface object; wherein the discrete point data comprises planar coordinate data and height data of the collection points; performing parameterized calculation on the discrete point data of each group of intersection points in the horizontal axis direction of the planar coordinate system to obtain a first virtual data sequence, and performing parameterized calculation on each group of discrete point data in the vertical axis direction of the planar coordinate system to obtain a second virtual data sequence; wherein the vertical coordinates of each discrete point in each group of discrete points in the horizontal axis direction are equal, and the horizontal coordinates of each discrete point in each group of discrete points in the vertical axis direction are equal; determining a curved surface fitting model of the to-be-processed region based on the first virtual data sequence and the second virtual data sequence; obtaining a preset engraving image, determining a three-dimensional engraving track according to the preset engraving image and the curved surface fitting model; and controlling a laser of the laser engraving machine to engrave in the to-be-processed region according to the three-dimensional engraving track, so as to form the preset engraving image in the to-be-processed region. By taking the intersection points of the planar rectangular grid in the coordinate system in which the to-be-processed region of the to-be-processed curved surface object is located as the collected discrete point data, and performing parameterized calculation on the discrete point data to obtain the first virtual data sequence and the second virtual data sequence, the curved surface fitting model of the to-be-processed region can be quickly and accurately established based on the plurality of discrete point data. By determining the three-dimensional engraving track according to the preset engraving image and the curved surface fitting model, and controlling the laser of the laser engraving machine to engrave in the to-be-processed region according to the three-dimensional engraving track, automatic engraving of the irregular curved surface object can be realized, and the engraving efficiency of the irregular curved surface object is improved.
[0040] Other features and advantages of the embodiments of the present application will be described in the following description, or can be learned from the description, or can be determined without any doubt, or can be known by implementing the above-mentioned technologies of the embodiments of the present application.
[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative labor.
[0043] Figure 1 A flow chart of a curved surface engraving control method based on a laser engraving machine provided by the embodiment of the present application is shown;
[0044] Figure 2a A coordinate system establishment schematic diagram provided by the embodiment of the present application is shown;
[0045] Figure 2b A rectangular grid schematic diagram provided by the embodiment of the present application is shown;
[0046] Figure 3a A supplementary collection point schematic diagram provided by the embodiment of the present application is shown;
[0047] Figure 3b Another supplementary collection point schematic diagram provided by the embodiment of the present application is shown;
[0048] Figure 3c Still another supplementary collection point schematic diagram provided by the embodiment of the present application is shown;
[0049] Figure 3d Yet another supplementary collection point schematic diagram provided by the embodiment of the present application is shown;
[0050] Figure 3e A uniform supplementary collection point schematic diagram provided by the embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present application more clear, the technical scheme of the present application will be described below in combination with the drawings. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments of the present application. The embodiments of the present application will be described in detail below.
[0052] The embodiment provides a curved surface engraving control method based on a laser engraving machine. The method can be applied to a controller of the laser engraving machine. Referring to a flow chart of the curved surface engraving control method based on the laser engraving machine shown in Figure 1 The method mainly includes the following steps:
[0053] In step S102, the intersection points of the planar rectangular grid in the planar coordinate system are taken as the collection points in the to-be-processed region of the to-be-processed curved surface object, and the collection of the discrete point data is performed.
[0054] A coordinate system is established in the to-be-processed region of the to-be-processed curved surface object. Referring to a coordinate system establishment schematic diagram shown in Figure 2a A coordinate system XY is established in the to-be-processed region of the to-be-processed curved surface object. Referring to a rectangular grid schematic diagram shown in Figure 2b A rectangular grid of a set size is drawn in the coordinate system XY. The size of the rectangular grid can be determined according to the number of discrete points to be collected. The smaller the size of the rectangular grid, the more the number of discrete points to be collected.
[0055] The discrete point data includes planar coordinate data and height data of the collection points; planar coordinate data of each intersection point of a planar rectangular grid in a planar coordinate system is obtained, height data of each intersection point of the planar rectangular grid is measured based on a height measuring device, and the discrete point data is obtained.
[0056] In step S104, parameterized calculation is performed on the discrete point data of each group of intersection points in the horizontal axis direction of the planar coordinate system to obtain a first virtual data sequence, and parameterized calculation is performed on each group of discrete point data in the vertical axis direction of the planar coordinate system to obtain a plurality of parameter vector sets in the horizontal axis direction, denoted as a second virtual data sequence.
[0057] The parameterized calculation is performed on the discrete point data of each group of intersection points in the horizontal axis direction by using a chord length parameterization strategy or other parameterization methods to obtain a plurality of parameter vector sets in the vertical axis direction, denoted as the first virtual data sequence. The parameterized calculation is performed on each group of discrete point data in the vertical axis direction by using the chord length parameterization strategy or other parameterization methods to obtain the second virtual data sequence. In each group of discrete points in the horizontal axis direction, the vertical coordinates of the discrete points are equal, and in each group of discrete points in the vertical axis direction, the horizontal coordinates of the discrete points are equal.
[0058] For example, a group of discrete points in the X direction is (the vertical coordinates of the group of discrete points are the same), the distance between the adjacent two discrete points is calculated as , and the parameter value is accumulated as , and finally the parameter vector in the X direction is obtained as . The parameterized calculation is performed on each group of discrete points to obtain the first virtual data sequence composed of a plurality of parameter vector sets. Meanwhile, the parameterized calculation is performed on each group of discrete points in the Y direction to obtain the second virtual data sequence composed of a plurality of parameter vector sets.
[0059] In step S106, a curved surface fitting model of the region to be processed is determined based on the first virtual data sequence and the second virtual data sequence.
[0060] The curved surface fitting is performed on the first virtual data sequence and the second virtual data sequence based on a curved surface fitting algorithm, and the curved surface fitting model of the region to be processed is fitted. The curved surface fitting algorithm can be a Non-Uniform Rational B-Splines (NURBS) algorithm, and the curved surface fitting model can be a cubic B-spline curved surface model.
[0061] In step S108, a preset carving image is obtained, and a three-dimensional carving track is determined according to the preset carving image and the curved surface fitting model.
[0062] The preset engraving image needed to be engraved in the to-be-processed region of the to-be-processed curved surface object is acquired, a two-dimensional engraving path is extracted from the preset engraving image according to a path extraction algorithm, and the two-dimensional engraving path is converted into a three-dimensional curved surface fitting model to obtain a three-dimensional engraving track.
[0063] In a specific embodiment, a planar two-dimensional path of the engraving track is generated based on a preset engraving image, and the planar two-dimensional path is projected onto a curved surface fitting model to form a three-dimensional engraving track.
[0064] The target engraving image is converted into raster data by a rasterization algorithm, that is, the image is represented by a pixel matrix, each pixel point has a color value and a position coordinate, the raster data is converted into a vector graphic, and lines, contours and other features in the image are extracted and represented by a vector coordinate sequence.
[0065] A centerline vectorization method (such as a related function in ArcMap) is used to extract a centerline path from the vector graphic, that is, the extracted pixel points are fitted into a spline curve, and the fitted curve is sampled to obtain points, the original points without topological relationship are converted into a secondary continuous curve position relationship to obtain a planar two-dimensional path of the engraving track.
[0066] A coordinate conversion matrix between the two-dimensional preset engraving image and the three-dimensional curved surface fitting model is acquired, the coordinate points of the planar two-dimensional path are converted into standardized curved surface node parameters according to the coordinate conversion matrix, and a three-dimensional path coordinate mapped onto the curved surface fitting model is calculated based on a curve fitting algorithm to obtain a three-dimensional engraving track.
[0067] In step S110, the laser of the laser engraving machine is controlled to engrave the to-be-processed region according to the three-dimensional engraving track to form the preset engraving image in the to-be-processed region.
[0068] The laser of the laser engraving machine is controlled to perform laser processing and engraving on the to-be-processed region based on the three-dimensional engraving track, the laser engraving track is engraved according to the generated three-dimensional engraving track, and the preset engraving image is engraved in the to-be-processed region.
[0069] The above-mentioned curved surface engraving control method based on a laser engraving machine provided in the embodiment can quickly and accurately establish a curved surface fitting model of a to-be-processed region based on a plurality of discrete point data by taking the intersection points of the planar rectangular grid in the coordinate system of the to-be-processed region of the to-be-processed curved surface object as the collected discrete point data and calculating first and second virtual data sequences from the discrete point data parameters, can realize automatic engraving of a non-regular curved surface object by determining a three-dimensional engraving track according to a preset engraving image and a curved surface fitting model and controlling a laser of a laser engraving machine to engrave the to-be-processed region according to the three-dimensional engraving track, and can improve the engraving efficiency of the non-regular curved surface object.
[0070] In one embodiment, the present embodiment provides an implementation of determining a curved surface fitting model of a region to be processed based on a first virtual data sequence and a second virtual data sequence, which can be specifically implemented by referring to the following steps:
[0071] Step (1): obtaining a virtual data relationship set matrix based on the first virtual data sequence and the second virtual data sequence;
[0072] According to each group of X-direction parameter vector set (i.e. the first virtual data sequence) and each group of Y-direction parameter vector (i.e. the second virtual data sequence), each discrete point is assigned with parameter value data {x i,j} and {y i,j} in the X direction and the Y direction, to obtain the parameter value (x i,j , y i,j ) of each discrete point, to form a set of discrete point parameter values, and to obtain the virtual data relationship set matrix.
[0073] Step (2): performing curved surface fitting based on the virtual data relationship set matrix to determine the curved surface fitting model of the region to be processed.
[0074] Based on the virtual data relationship set matrix, a NURBS curved surface is fitted to obtain the curved surface fitting model of the region to be processed.
[0075] Taking a set of spatial measurement points arranged in a two-dimensional array (the virtual data relationship set matrix) as input, the measurement points are arranged in row-major order by default (i.e. from left to right and from top to bottom), and the data is collected by advancing in a snake shape, and the required B-spline curved surface order is set in the input parameters. An initial matrix of uniform weights is constructed, and the corresponding U-direction and V-direction node vectors (using the clamped method to seal the ends) are automatically generated to build the basic parameter structure required for the NURBS curved surface. After parameter initialization, the input measurement points are parameter vector estimated by using the chord length parameterization strategy, and the curved surface is normalized parameter assigned along the U direction and the V direction, respectively. In order to accurately calculate the control point coordinates, the base function response weight relationship between each measurement point in the curved surface space and each control point is constructed to form a coefficient matrix A, and based on the NURBS base function formula S(u, v), it is converted into a least square solution problem.
[0076] This embodiment solves for the X, Y, and Z coordinates in three-dimensional space independently, constructing a system of linear equations. The precise positions of the control point grid are then derived using normal equations, achieving a close fit to the three-dimensional measurement points. During the calculation of the B-spline basis functions, boundary value behavior at end nodes is considered to ensure numerical continuity and accuracy. After fitting, a sampling evaluation mechanism is implemented on the B-spline surface, generating a series of spatial path points within the defined parameter domain using a fixed step size. Simultaneously, a trajectory file (.NC) in standard G-code format is generated based on the sampling order, where the starting point is marked with a fast move (G0) and subsequent paths are output using linear interpolation (G1).
[0077] In one specific implementation, the equation relationship between the measurement points and control points of the surface fitting model is determined based on the virtual data relationship set matrix;
[0078] Based on the equation relationship between the measurement points and the control points, an optimization algorithm is used to determine the optimal solution of the control point coordinates, resulting in a surface fitting model; wherein, the surface fitting model is a cubic B-spline surface model.
[0079] The measurement points Q of the surface fitting model are determined based on the virtual data relationship set matrix. i,j The parameter value (x) i,j y i,j ) and control point P i,j The equations relating the points are used to define node vectors U in the X direction and V in the Y direction. The proximity of the surface to the measurement points can be adjusted by regulating the spacing between nodes; increasing the spacing between adjacent nodes makes the surface closer to the measurement point corresponding to the next node. Based on the X and Y parameter vectors corresponding to each discrete point, discrete points or regions with excessive height differences are identified, and the node vectors are adjusted to make the surface closer to these discrete points or regions.
[0080] For each control point P i,j Determine a weight W i,j This forms a weight matrix W. The weight matrix W is initialized to 1 to ensure that all control points have the same influence on the surface. In the parameter value data {x i,j} and {y i,j For regions or discrete points with significant variations, the weights are increased, and the parameter values in the data {U} are... i,j} and {V i,j When the discrete points with significant variations are less than a set value, the weight is set to 1. Based on the parameter vectors in the X and Y directions corresponding to each discrete point, discrete points or regions with excessive height differences are identified, and their weights are increased to make the surface more closely fit the point / region.
[0081] Based on measurement point Q i,j The parameter value (x)i,j , y i,j ), node vectors, and weights W i,j , determine the equation relationship between the measurement points Q i,j and the control points P i,j ;
[0082] According to the parameter values (x i,j , y i,j ) of each measurement point Q i,j and the node vectors, the corresponding NURBS basis function values N i,k (x) and M j,l (y) are calculated, and according to each basis function value N i,k (x) and M j,l (y) and the weights W i,j , a coefficient matrix A is constructed, and each element in the coefficient matrix A represents the weight relationship between the measurement points Q k and the control points P k .
[0083] The NURBS surface formula S(x, y) is a parametric surface defined by the control points P i,j , the weights W i,j , the NURBS basis function values N i,k (x) and M j,l (y), where k and l are the orders in the x direction and the y direction, respectively, and i and j are the serial numbers of the control points in the x direction and the y direction, respectively.
[0084] According to the NURBS surface formula S(x, y), the equation relationship between the measurement points and the control points is established. The NURBS surface formula S(x, y) can be a first-order quadratic, a second-order cubic, or a third-order quartic. The higher the order, the larger the calculation amount, and the greater the influence of a single point on the surface. The appropriate order can be selected by judging the gradient / height difference between the adjacent two points in the X direction and the Y direction.
[0085] According to the equation relationship between the measurement points and the control points, the optimal solution of the control points P i,j is determined. The optimal solution of the control points P i,j is converted into a least squares form, i.e., minimizing the sum of squares of errors between the measurement points and the fitted surface. An optimization algorithm is used to solve the optimal solution of the coordinates of the control points P i,j . The optimization algorithm can be a least squares method, a gradient descent method, a Newton method, a conjugate gradient method, a quasi-Newton method (such as BFGS), and a trust region method. For example, a least squares method (such as a Gauss-Newton method, a Levenberg-Marquardt optimization algorithm, etc.) is used to solve the coefficient matrix A and the measurement point coordinates to obtain the optimal solution of the coordinates of the control points P i,j .
[0086] In one implementation, U and V can be sampled within a defined parameter domain with a fixed step size to generate parameter values for each sampling point, based on the parameter values for each sampling point (u i v j ), use the B-spline surface formula to calculate the corresponding spatial coordinates S(u). i v j This process generates a series of spatial path points. Simultaneously, it generates a trajectory file (.NC) in standard G-code format based on the sampling order. The starting point can be marked using fast movement (G0), and subsequent paths are output using linear interpolation (G1). An alarm is triggered when the calculated surface gradient angle exceeds 45°.
[0087] In one embodiment, prior to step S104 above, the method provided in this embodiment further includes:
[0088] Based on the height data, additional collection points are added to the area to be processed, and discrete point data is collected from the additional collection points.
[0089] Calculate the height difference ΔZ between every two adjacent discrete points in the X and Y directions based on the height data of the discrete points. See example... Figure 3a The diagram showing supplementary data collection points illustrates that when the height difference ΔZ between any two adjacent discrete points is large, supplementary data collection points are added within the measurement area, such as... Figure 3a As shown, a sampling point is added between two discrete points with a large height difference ΔZ (i.e., a sampling point is added on the grid line between the vertices of the two rectangular grids). Figure 3a The red dots in the diagram represent the added collection points, which means increasing the number of discrete collection points, obtaining the planar coordinate data and height data of the newly added collection points, and collecting the discrete point data of the new collection points.
[0090] By supplementing the sampling points based on the height difference of discrete points, new sampling points can be added between discrete points with large height differences, so that the generated surface fitting model is closer to the real surface shape of the object to be processed.
[0091] In one implementation, this embodiment provides six implementation methods for supplementing the data collection points in the area to be processed based on various height data, and for collecting discrete point data from the supplemented data collection points:
[0092] Implementation method 1: Calculate the height difference between every two adjacent collection points in the horizontal axis direction based on the height information; when the height difference between any two adjacent collection points in the horizontal axis direction is greater than the preset height difference threshold, add a new collection point between the two collection points whose height difference is greater than the preset height difference threshold, and collect discrete point data for the new collection point.
[0093] Calculate the height difference between every two adjacent discrete points in the X direction. When the height difference between two adjacent discrete points in the X direction is too large, add a new sampling point between the two sampling points whose height difference is greater than the preset height difference threshold, or add a new sampling point at the corresponding position in all X directions.
[0094] For example, see such as Figure 3b The diagram shows another supplementary sampling point. If the height difference between the third and fourth sampling points in the X direction is greater than a preset height difference threshold, then new sampling points are added at corresponding positions in all X directions (i.e., between the third and fourth sampling points in the X direction). Figure 3b The red dots in the image represent the added data collection points.
[0095] Implementation Method 2: Calculate the height difference between every two adjacent acquisition points along the vertical axis based on the height information of each discrete point; when the height difference between any two adjacent acquisition points along the vertical axis is greater than a preset height difference threshold, add a new acquisition point between the two acquisition points whose height difference is greater than the preset height difference threshold, and collect discrete point data for the new acquisition point.
[0096] Calculate the height difference between every two adjacent discrete points in the Y direction. When the height difference between two adjacent discrete points in the Y direction is too large, add a new sampling point between the two sampling points whose height difference is greater than the preset height difference threshold, or add a new sampling point at the corresponding position in all Y directions.
[0097] For example, see such as Figure 3c The diagram illustrates another method for supplementing data collection points. If the height difference between the third and fourth data collection points in the Y direction is greater than a preset height difference threshold, then new data collection points are added at corresponding positions in all Y directions (i.e., between the third and fourth data collection points in the Y direction). Figure 3c The red dots in the image represent the added data collection points.
[0098] Implementation Method 3: Calculate the height difference between two adjacent vertices of each rectangle in the rectangular grid, and record the rectangles with at least two height differences greater than a preset height difference threshold as target rectangles;
[0099] Add new collection points within the target rectangle and collect discrete point data from these new collection points.
[0100] For each rectangle in the rectangular grid, calculate the height difference between every two adjacent vertices. When at least two height differences exceed a preset height difference threshold, see [example missing]. Figure 3d The diagram illustrates another method of supplementing collection points. New collection points are added to a rectangular area (such as on the four sides of a rectangular grid and / or at the center point of the rectangular grid) to increase the collection point density of the target rectangle. Figure 3dThe red dots in the figure are the added collection points. The planar coordinate data and height data of the newly added collection points are obtained, and the discrete point data of the newly added collection points is collected.
[0101] Embodiment four: calculating the height difference between each two adjacent collection points in the rectangular grid;
[0102] The number of collection points with a height difference greater than the preset height difference threshold is counted, or the proportion of the number of height differences greater than the preset height difference threshold in all calculated height differences is counted.
[0103] When the number of discrete points is greater than the first preset number, or when the proportion is greater than the preset proportion, new collection points are added between each two collection points and inside each rectangle of the rectangular grid, and discrete point data of the added collection points is collected.
[0104] For each rectangle in the rectangular grid, the height difference between each two adjacent vertices is calculated, and the number of collection points with a height difference greater than the preset height difference threshold or the proportion of height differences greater than the preset height difference threshold is detected. When the number of discrete points is greater than the first preset number, or when the proportion is greater than the preset proportion, it indicates that the number of collection points with a large height difference is large, and the collection points in the region to be processed are sparse (or the length of the rectangle of the rectangular grid is set to be large), resulting in a large height difference between adjacent collection points. Referring to the collection point uniform supplementing diagram as shown in Figure 3e , new collection points are added between each two collection points and inside each rectangle of the rectangular grid, Figure 3e The red dots in the figure are the added collection points. The planar coordinate data and height data of the newly added collection points are obtained, and the discrete point data of the newly added collection points is collected.
[0105] Embodiment five: when the number of height differences greater than the preset height difference threshold in the horizontal axis direction is greater than the second preset number, and the number of height differences greater than the preset height difference threshold in the vertical axis direction is greater than the third preset number, new collection points are uniformly added in the region to be processed, and discrete point data of the added collection points is collected.
[0106] The height difference between each two adjacent collection points in the horizontal axis direction is calculated, and the height difference between each two adjacent collection points in the vertical axis direction is calculated. When the number of height differences greater than the preset height difference threshold in the horizontal axis direction is greater than the second preset number, and the number of height differences greater than the preset height difference threshold in the vertical axis direction is greater than the third preset number, it indicates that the surface shape of the region to be processed is relatively complex, or the collection points in the region to be processed are relatively sparse. In order to make the established surface fitting model close to the true surface shape of the curved surface object to be processed, as shown in Figure 3e , new collection points are uniformly added in the region to be processed. The planar coordinate data and height data of the newly added collection points are obtained, and the discrete point data of the newly added collection points is collected.
[0107] Embodiment six: dividing the matrix grid in the region to be processed into a plurality of grid regions;
[0108] calculating the height difference between each two adjacent collection points in each grid region;
[0109] counting the number of collection points with a height difference greater than a preset height difference threshold in each grid region, and recording the grid region with a collection point number greater than a fourth preset number as a target grid region;
[0110] supplementing new collection points between each two collection points in the target grid region, and collecting discrete point data of the supplemented collection points.
[0111] The matrix grid in the region to be processed is divided into a plurality of small regions, i.e., grid regions, the height difference between each two adjacent collection points in each grid region is calculated, when the number of collection points with a height difference greater than a preset height difference threshold in the grid region is large, the grid region is recorded as a target grid region, new collection points are uniformly added in the target grid region, such as supplementing new collection points between each two collection points and supplementing new collection points at the center position of the rectangular grid. The planar coordinate data and height data of the newly supplemented collection points are obtained, and the discrete point data of the new collection points is collected.
[0112] The embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, the memory has a computer program which can run on the processor, when the processor executes the computer program, the steps of the method provided by the above embodiment are realized.
[0113] The embodiment of the present application provides a computer readable medium, wherein the computer readable medium stores computer executable instructions, when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to realize the method described in the above embodiment.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system can refer to the corresponding process in the foregoing embodiments, which will not be repeated here.
[0115] The computer program product of the curved surface engraving control method based on the laser engraving machine provided by the embodiment of the present application includes a computer readable storage medium storing program codes, the instructions included in the program codes can be used to execute the method described in the foregoing method embodiment, and specific implementation can be referred to the method embodiment, which will not be repeated here.
[0116] In addition, in the description of the embodiments of the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting" should be understood in a broad sense, for example, can be fixed connection, can also be detachable connection, or integral connection; can be mechanical connection, can also be electrical connection; can be direct connection, can also be indirect connection through intervening medium, can be internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0117] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the prior art or the part of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and various program code storage media.
[0118] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.
[0119] Finally, it should be noted that the above-described embodiments are merely specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit the same. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any person skilled in the art can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features, within the technical scope disclosed by the present application. The modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for controlling curved surface engraving based on a laser engraving machine, characterized in that, include: In the processing area of the curved surface object to be processed, the intersection points of the planar rectangular grid in the planar coordinate system are used as the acquisition points to collect discrete point data; wherein, the discrete point data includes the planar coordinate data and height data of the acquisition points; Parametric calculations are performed on the discrete point data of each set of intersection points along the horizontal axis in the planar coordinate system to obtain a first virtual data sequence. Parametric calculations are performed on the discrete point data of each set of discrete points along the vertical axis in the planar coordinate system to obtain a second virtual data sequence. In this sequence, the vertical coordinates of each discrete point in each set of discrete points along the horizontal axis are equal, and the horizontal coordinates of each discrete point in each set of discrete points along the vertical axis are equal. Based on the first virtual data sequence and the second virtual data sequence, a surface fitting model for the region to be processed is determined. Obtain a preset carving image, and determine the three-dimensional carving trajectory based on the preset carving image and the surface fitting model; The laser of the laser engraving machine is controlled to engrave in the area to be processed according to the three-dimensional engraving trajectory, so as to form the preset engraving image in the area to be processed; The step of determining the surface fitting model of the region to be processed based on the first virtual data sequence and the second virtual data sequence includes: obtaining a virtual data relationship set matrix based on the first virtual data sequence and the second virtual data sequence; and performing surface fitting based on the virtual data relationship set matrix to determine the surface fitting model of the region to be processed. The step of performing surface fitting based on the virtual data relationship set matrix to determine the surface fitting model of the region to be processed includes: determining the equation relationship between the measurement points and control points of the surface fitting model according to the virtual data relationship set matrix; and using an optimization algorithm to determine the optimal solution of the coordinates of the control points based on the equation relationship between the measurement points and the control points, thereby obtaining the surface fitting model.
2. The surface carving control method according to claim 1, characterized in that, Before performing parameterization calculations on the discrete point data of each set of intersection points along the horizontal axis in the planar coordinate system, the method further includes: Based on the height data, additional collection points are added to the area to be processed, and discrete point data is collected from the additional collection points.
3. The surface engraving control method according to claim 2, characterized in that, The process of supplementing the collection points in the area to be processed based on the height data, and collecting discrete point data from the supplemented collection points, includes: Calculate the height difference between every two adjacent collection points in the horizontal axis direction based on the height information; when the height difference between any two adjacent collection points in the horizontal axis direction is greater than a preset height difference threshold, add a new collection point between the two collection points whose height difference is greater than the preset height difference threshold, and collect the discrete point data for the new collection point. And / or, The height difference between any two adjacent acquisition points along the vertical axis is calculated based on the height information of each discrete point. When the height difference between any two adjacent acquisition points along the vertical axis is greater than a preset height difference threshold, a new acquisition point is added between the two acquisition points whose height difference is greater than the preset height difference threshold, and the discrete point data is acquired at the new acquisition point.
4. The surface engraving control method according to claim 2, characterized in that, The process of supplementing the collection points in the area to be processed based on the height data, and collecting discrete point data from the supplemented collection points, includes: Calculate the height difference between two adjacent vertices of each rectangle in the rectangular grid, and record at least two rectangles whose height difference is greater than a preset height difference threshold as target rectangles; New collection points are added within the target rectangle, and discrete point data is collected at the new collection points.
5. The surface engraving control method according to claim 2, characterized in that, The process of supplementing the collection points in the area to be processed based on the height data, and collecting discrete point data from the supplemented collection points, includes: Calculate the height difference between any two adjacent sampling points in the rectangular grid; The number of collection points whose height difference is greater than a preset height difference threshold is counted, or the percentage of height differences greater than the preset height difference threshold among all the calculated height differences is counted. When the number of discrete points is greater than a first preset number, or when the proportion is greater than a preset ratio, new collection points are added between every two collection points and inside each rectangle of the rectangular grid, and the discrete point data is collected from the added collection points.
6. The surface engraving control method according to claim 3, characterized in that, The process of supplementing the collection points in the area to be processed based on the height data, and collecting discrete point data from the supplemented collection points, includes: When the number of height differences greater than the preset height difference threshold in the horizontal direction is greater than a second preset number, and the number of height differences greater than the preset height difference threshold in the vertical direction is greater than a third preset number, new collection points are uniformly added in the processing area, and discrete point data is collected from the added collection points.
7. The surface engraving control method according to claim 2, characterized in that, The process of supplementing the collection points in the area to be processed based on the height data, and collecting discrete point data from the supplemented collection points, includes: The matrix grid within the area to be processed is divided into multiple grid regions; Calculate the height difference between any two adjacent sampling points in each of the grid regions; Count the number of collection points in each grid region where the height difference is greater than a preset height difference threshold, and record the grid region where the number of collection points is greater than a fourth preset number as the target grid region; New acquisition points are added between every two acquisition points in the target grid area, and discrete point data are acquired at the added acquisition points.
8. The surface engraving control method according to claim 1, characterized in that, The surface fitting model is a cubic B-spline surface model.
9. The surface engraving control method according to claim 1, characterized in that, The step of obtaining a preset carving image and determining a three-dimensional carving trajectory based on the preset carving image and the surface fitting model includes: A two-dimensional planar path for carving is generated based on the preset carving image, and the two-dimensional planar path is projected onto the surface fitting model to form a three-dimensional carving trajectory.
Citation Information
Patent Citations
Saxophone reed curved surface model establishing method
CN113781629A
Three-dimensional laser engraving method and device, computer equipment and storage medium
CN118905459A