Machining angle generation method and device, terminal equipment and storage medium
By projecting the inner wall processing line to the cross-section of the outer wall processing line and expanding it to a two-dimensional plane for endpoint matching, the problem of wrong judgment of cutting angle direction in five-axis laser pipe cutting technology is solved, achieving higher cutting accuracy and lower production costs.
Patent Information
- Application Number
- CN202510282813.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-11
AI Technical Summary
The existing five-axis laser pipe cutting technology is prone to errors when determining the cutting angle direction, resulting in cutting accuracy and quality problems, and increasing production costs and cycles.
By projecting the inner wall processing line of the pipe to be cut to the cross section where the outer wall processing line is located, and expanding it to a two-dimensional plane for endpoint matching and reconstruction, a vector and processing angle pointing from the inner wall to the outer wall are generated to ensure a clear direction.
It improves the accuracy of cutting angle calculation, reduces waste production, reduces production costs and cycles, and improves cutting accuracy and quality.
Smart Images

Figure CN120296896A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design and manufacturing, and particularly to a machining angle generation method, device, terminal device, and storage medium. Background Art
[0002] With the continuous development and maturity of the industrial manufacturing field, more stringent requirements have been put forward for the precision, efficiency, and quality of pipe cutting in various application fields. Laser pipe cutting technology is playing an increasingly important role. Five-axis laser pipe cutting technology is an advanced pipe processing technology that combines the high precision and high speed characteristics of laser cutting with the flexibility of five-axis linkage. This technology allows the laser cutting head to move and rotate in five different axial directions, including three linear axes (usually the X, Y, and Z axes) and two rotational axes, enabling precise cutting operations on different angles, positions, and surfaces of pipes to meet the processing requirements of complex shapes and bevels. Five-axis laser pipe cutting technology can perform precise cutting at different angles and positions of the pipe, achieving more complex cutting trajectories, thereby making the connection of the pipes tighter and seamless. This not only improves the strength and sealing performance of the pipe connection but also enhances the quality and performance of the entire product.
[0003] The common implementation methods of existing five-axis laser pipe cutting technology are mainly based on surface vector calculation. The implementation process mainly consists of three steps: First, use graphic recognition technology to determine the bevel surface to be processed; then, through vector operations, calculate the normal vector of the surface based on the vertex coordinates of the surface to be processed; finally, use the calculated surface normal to determine the posture angle of the processing bevel, which determines the movement trajectory and cutting direction of the laser cutting head. However, when using the surface vector calculation method, since there are two opposite directions for the surface normal, it is difficult to determine which direction is correct. Similarly, when converting the surface normal to the normal of the cutting angle, there are also two direction selection problems. If the direction is judged incorrectly, it will lead to a deviation in the cutting angle, thereby affecting the cutting precision and quality. In actual production, this incorrect direction judgment may result in a large number of defective products, increasing production costs and production cycles. Summary of the Invention
[0004] The present invention aims to provide a machining angle generation method, device, terminal device, and storage medium to solve the above technical problems and improve the calculation accuracy and efficiency of machining angles.
[0005] To solve the above technical problems, the present invention provides a machining angle generation method, including:
[0006] Project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located;
[0007] Aligning the starting points of the inner wall processing line and the outer wall processing line and unfolding them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe;
[0008] Performing endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtaining matching endpoints of each endpoint of the two-dimensional outer wall wireframe in the two-dimensional inner wall wireframe, and sequentially connecting corresponding matching endpoints according to the endpoint sequence of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line;
[0009] The reconstructed two-dimensional inner wall wireframe is restored to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and a vector pointing from the inner wall to the outer wall and a processing angle are generated according to the correspondence between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line.
[0010] In the above scheme, the inner wall processing line is projected onto the cross section where the outer wall processing line is located, which simplifies the complex three-dimensional spatial relationship and converts the problem into a positional relationship within the same plane, providing clearer and simpler basic data for subsequent processing and reducing the calculation errors caused by complex spatial relationships. Then, the three-dimensional inner and outer wall processing lines are expanded to a two-dimensional plane, reducing the dimension and complexity of data processing, making subsequent endpoint matching and reconstruction operations more intuitive and easy to implement. Through endpoint matching, a clear correspondence between the inner and outer wall wireframe endpoints is established, providing an accurate basis for the subsequent generation of vectors and processing angles, and avoiding cutting angle deviations caused by incorrect direction judgment. Endpoint matching on a two-dimensional plane can find corresponding points more accurately, reducing errors caused by inaccurate spatial position judgment, thereby improving the accuracy of reconstructing two-dimensional inner wall lines. The reconstructed two-dimensional inner wall wireframe is restored to the three-dimensional space of the pipe to be cut to obtain the reconstructed three-dimensional inner wall line. Since the previous projection, expansion, matching and other steps have clarified the correspondence between the inner wall and the outer wall, when generating a vector pointing from the inner wall to the outer wall, the direction is clear, avoiding the ambiguity of direction judgment, thereby improving the accuracy of cutting angle calculation, and being able to more accurately control the motion trajectory and cutting direction of the laser cutting head, thereby improving the cutting accuracy and quality, reducing the generation of waste, and reducing production costs and production cycles.
[0011] In one implementation, projecting the inner wall processing line of the pipe to be cut to the cross section where the outer wall processing line is located specifically includes:
[0012] Obtaining an inner wall processing line and an outer wall processing line of the pipe to be cut;
[0013] According to a preset arch height threshold, the inner wall processing line and the outer wall processing line are respectively discretized into a plurality of line segments to obtain a plurality of inner wall line segments and a plurality of outer wall line segments;
[0014] Project the inner wall line segment onto the cross-section where the outer wall line segment is located, so that the inner wall line segment and the outer wall line segment are in the same cross-section dimension.
[0015] In the above solution, the inner wall and outer wall processing lines are discretized into several line segments according to a preset bow height threshold, converting complex curves into simple line segments, which is more in line with the actual processing situation, reduces calculation errors caused by complex curves, and improves the accuracy of subsequent projection and calculation. Project the inner wall line segment onto the cross-section where the outer wall line segment is located, so that the two are in the same dimension, simplifying the three-dimensional space problem into a two-dimensional plane problem, reducing the complexity of data processing, facilitating subsequent operations such as endpoint matching, and improving processing efficiency.
[0016] In one implementation, aligning the starting points of the inner wall processing line and the outer wall processing line and unfolding them onto a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe specifically includes:
[0017] Obtain the starting point of the outer wall processing line, and calculate the distance between each endpoint of the inner wall line segment and the starting point;
[0018] Update the endpoint of the inner wall line segment with the shortest distance to the starting point as the starting point of the inner wall processing line, and unfold the inner wall processing line and the outer wall processing line from their respective starting points onto a two-dimensional plane to obtain the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe.
[0019] In the above solution, by calculating the distances between the endpoints of the inner wall and the starting point of the outer wall processing line, and updating the inner wall endpoint with the shortest distance as the starting point of the inner wall processing line, a unified starting benchmark is established for the inner wall and the outer wall processing lines, establishing an accurate corresponding relationship for subsequent operations, and ensuring the consistency and coherence of data processing. Unfolding the three-dimensional inner wall and outer wall processing lines from the starting point onto a two-dimensional plane converts the complex three-dimensional space geometry problem into a relatively simple two-dimensional plane problem, reducing the difficulty of data processing and improving processing efficiency. Unfolding to obtain a two-dimensional wireframe with the aligned starting point can more accurately reflect the positional and shape relationships between the inner wall and the outer wall processing lines, providing a more accurate data basis for subsequent operations such as endpoint matching, reconstruction, and generation of processing angles, thereby improving the accuracy and quality of the entire cutting and processing process.
[0020] In one implementation, performing endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe to obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe in the two-dimensional inner wall wireframe specifically includes:
[0021] Obtain the positions of each endpoint of the two-dimensional outer wall wireframe, and call the corresponding endpoint matching strategy according to the positions of the endpoints; among them, the endpoint matching strategy includes a ray method matching strategy and a nearest point matching strategy.
[0022] In the above solution, the matching strategy is selected according to the endpoint position, avoiding the problem of inaccurate matching that may be caused by using a single strategy. The ray method and the nearest point matching strategy each have their applicable scenarios. Selecting according to requirements can more accurately find the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, which can provide an accurate data basis for subsequent operations such as reconstructing the three-dimensional machining line.
[0023] In one implementation manner, the corresponding endpoint matching strategy is called according to the position of the endpoint, which specifically includes:
[0024] When the endpoint is at the start end or the end end of the pipe to be cut, the ray method matching strategy is called; wherein, the ray method matching strategy is to make a ray intersecting with the two-dimensional inner wall wireframe along the X-axis direction with the endpoint as the starting point, and use the endpoint on the two-dimensional inner wall wireframe that intersects with the ray as the matching endpoint;
[0025] When the endpoint is the endpoint of the pipe to be cut at the opening position, the nearest point matching strategy is called; wherein, the nearest point matching strategy is to use the endpoint in the two-dimensional inner wall wireframe that is the shortest distance from the endpoint as the matching endpoint.
[0026] In the above solution, directly calling the corresponding strategy according to the endpoint position avoids the complex judgment and invalid calculation that may occur when using a single general method to match all endpoints, reduces the time and computing resources required for matching, and improves the overall matching efficiency. Considering the different characteristics of the start end or the end end of the pipe to be cut and the endpoints at the opening position, the solution can adapt to a variety of different pipe cutting scenarios, and has strong versatility and flexibility.
[0027] In one implementation manner, generating a vector from the inner wall to the outer wall and a machining angle according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall machining line specifically includes:
[0028] Obtain the corresponding relationship between each endpoint between the reconstructed three-dimensional inner wall line and the outer wall machining line;
[0029] Generate a three-dimensional vector from the inner wall to the outer wall according to the three-dimensional coordinates of any pair of matching endpoints between the reconstructed three-dimensional inner wall line and the outer wall machining line;
[0030] Normalize the three-dimensional vector to generate a unit vector in the three-dimensional direction, and calculate the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction; wherein, the machining angle includes the turntable angle and the swivel head angle.
[0031] In the above solution, by obtaining the corresponding relationship between the endpoints of the reconstructed three-dimensional inner wall line and the outer wall processing line, the position correlation between each point of the inner wall and the outer wall can be accurately determined, providing an accurate basis for subsequent vector and angle calculations, and ensuring the precise matching of the processing positions of the inner wall and the outer wall during the processing. Generating a three-dimensional vector from the inner wall to the outer wall based on the three-dimensional coordinates of the matching endpoints can intuitively and clearly reflect the processing direction of the tool from the inner wall to the outer wall, making the directionality of the processing process clear and facilitating the operation of the five-axis machine tool according to this direction. Unitizing the three-dimensional vector to generate a unit vector in the three-dimensional direction eliminates the influence of the vector length on the calculation, unifies the calculation standard, makes the vectors at different positions consistent and comparable when calculating the processing angle, and improves the accuracy and stability of the calculation.
[0032] In one implementation manner, the unitizing of the three-dimensional vector to generate a unit vector in the three-dimensional direction and calculating the processing angle of the five-axis machine tool according to the unit vector in the three-dimensional direction specifically includes:
[0033] Obtaining a three-dimensional vector corresponding to any pair of matching endpoints; wherein, the expression of the three-dimensional vector is:
[0034] V ec =(X o -X i ,Y o -Y i ,Z o -Z i );
[0035] In the formula, (X i ,Y i ,Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o ,Z o ) are the endpoint coordinates on the outer wall processing line;
[0036] Unitizing the three-dimensional vector to obtain a unit vector in the three-dimensional direction; wherein, the expression of the unit vector is:
[0037]
[0038] In the formula, Vec.x is the component of the three-dimensional vector V ec in the X-axis direction; Vec.y is the component of the three-dimensional vector V ec in the Y-axis direction; Vec.z is the component of the three-dimensional vector V ec in the Z-axis direction; Len is the length of the three-dimensional vector V ec ;
[0039] Calculate the turntable angle and the swing head angle according to the unit vector; wherein, the expressions of the turntable angle and the swing head angle are:
[0040]
[0041] In the formula, ∠A is the turntable angle; ∠B is the swing head angle.
[0042] In the above solution, the three-dimensional vector is transformed into a unit vector through unitization operation, eliminating the influence of the vector length on the subsequent angle calculation. In the case of different positions and different scales, the unit vector can perform angle calculation with a unified standard, avoiding calculation errors caused by vector length differences, and improving the calculation accuracy and stability.
[0043] In a second aspect, the present application further provides a processing angle generation device, including: a projection module, an alignment module, a matching module, and a calculation module;
[0044] The projection module is used to project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located;
[0045] The alignment module is used to align the starting points of the inner wall processing line and the outer wall processing line and expand them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe;
[0046] The matching module is used to perform endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, and sequentially connect the corresponding matching endpoints according to the endpoint order of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line;
[0047] The calculation module is used to restore the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and generate a vector and a processing angle pointing from the inner wall to the outer wall according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line.
[0048] In the above solution, projecting the inner wall processing line onto the cross-section where the outer wall processing line is located simplifies the complex three-dimensional spatial relationship, transforms the problem into a positional relationship in the same plane, provides clearer and simpler basic data for subsequent processing, and reduces the calculation errors caused by the complex spatial relationship. Then, the three-dimensional inner wall and outer wall processing lines are unfolded onto a two-dimensional plane, reducing the dimension and complexity of data processing, making subsequent endpoint matching and reconstruction operations more intuitive and easier to implement. By endpoint matching, a clear corresponding relationship is established between the endpoints of the inner wall and outer wall wireframes, providing an accurate basis for generating vectors and processing angles subsequently, and avoiding cutting angle deviations caused by incorrect direction judgment. And performing endpoint matching on the two-dimensional plane can more accurately find the corresponding points, reducing the errors caused by inaccurate judgment of spatial positions, thereby improving the accuracy of reconstructing the two-dimensional inner wall line. Restoring the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut gives the reconstructed three-dimensional inner wall line. Since the previous steps of projection, unfolding, matching, etc. clarify the corresponding relationship between the inner wall and the outer wall, when generating a vector from the inner wall to the outer wall, the direction is clear, avoiding ambiguity in direction judgment, thereby improving the accuracy of cutting angle calculation, being able to more precisely control the movement trajectory and cutting direction of the laser cutting head, further improving the cutting accuracy and quality, reducing the generation of waste products, and lowering production costs and production cycles.
[0049] In one implementation, the projection module is used to project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located, and specifically includes:
[0050] Obtain the inner wall processing line and the outer wall processing line of the pipe to be cut;
[0051] Discretize the inner wall processing line and the outer wall processing line into a number of line segments respectively according to a preset sagitta threshold, obtaining a number of inner wall line segments and a number of outer wall line segments;
[0052] Project the inner wall line segments onto the cross-section where the outer wall line segments are located, so that the inner wall line segments and the outer wall line segments are in the same cross-section dimension.
[0053] In one implementation, the alignment module is used to align the starting points of the inner wall processing line and the outer wall processing line and unfold them onto a two-dimensional plane, obtaining a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe, and specifically includes:
[0054] Obtain the starting point of the outer wall processing line, and calculate the distance between each endpoint of the inner wall line segment and the starting point;
[0055] Update the endpoint of the inner wall line segment with the shortest distance from the starting point as the starting point of the inner wall processing line, and unfold the inner wall processing line and the outer wall processing line from their respective starting points onto the two-dimensional plane, obtaining the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe.
[0056] In one implementation, the matching module is used to perform endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe to obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, specifically including:
[0057] Obtain the positions of each endpoint of the two-dimensional outer wall wireframe, and call the corresponding endpoint matching strategy according to the positions of the endpoints; wherein, the endpoint matching strategy includes a ray method matching strategy and a nearest point matching strategy.
[0058] In one implementation, the calling of the corresponding endpoint matching strategy according to the positions of the endpoints specifically includes:
[0059] When the endpoint is at the start end or the end end of the pipe to be cut, call the ray method matching strategy; wherein, the ray method matching strategy is to make a ray starting from the endpoint and intersecting with the two-dimensional inner wall wireframe along the X-axis direction, and use the endpoint on the two-dimensional inner wall wireframe that intersects with the ray as the matching endpoint;
[0060] When the endpoint is the endpoint of the pipe to be cut at the hole opening position, call the nearest point matching strategy; wherein, the nearest point matching strategy is to use the endpoint on the two-dimensional inner wall wireframe that is the shortest distance from the endpoint as the matching endpoint.
[0061] In one implementation, the generating of the vector pointing from the inner wall to the outer wall and the machining angle according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall machining line specifically includes:
[0062] Obtain the corresponding relationship between each endpoint between the reconstructed three-dimensional inner wall line and the outer wall machining line;
[0063] Generate a three-dimensional vector pointing from the inner wall to the outer wall according to the three-dimensional coordinates of any pair of matching endpoints between the reconstructed three-dimensional inner wall line and the outer wall machining line;
[0064] Normalize the three-dimensional vector to generate a unit vector in the three-dimensional direction, and calculate the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction; wherein, the machining angle includes the turntable angle and the swing head angle.
[0065] In one implementation, the normalizing of the three-dimensional vector to generate a unit vector in the three-dimensional direction and the calculation of the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction specifically includes:
[0066] Obtain the three-dimensional vector corresponding to any pair of matching endpoints; wherein, the expression of the three-dimensional vector is:
[0067] V ec =(Xo -X i , Y o -Y i , Z o -Z i );
[0068] Wherein, (X i , Y i , Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o , Z o ) are the endpoint coordinates on the outer wall processing line;
[0069] Normalize the three-dimensional vector to obtain a unit vector in the three-dimensional direction; wherein, the expression of the unit vector is:
[0070]
[0071] Wherein, Vec.x is the component of the three-dimensional vector V ec in the X-axis direction; Vec.y is the component of the three-dimensional vector V ec in the Y-axis direction; Vec.z is the component of the three-dimensional vector V ec in the Z-axis direction; Len is the length of the three-dimensional vector V ec .
[0072] Calculate the turntable angle and the swing head angle according to the unit vector; wherein, the expressions of the turntable angle and the swing head angle are:
[0073]
[0074] Wherein, ∠A is the turntable angle; ∠B is the swing head angle.
[0075] In a third aspect, the present application further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the above-mentioned machining angle generation method is implemented.
[0076] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the above-mentioned machining angle generation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 is a schematic flowchart of a machining angle generation method provided in an embodiment of the present invention;
[0078] Figure 2 Schematic diagram of the projection result of the inner wall line segment in an embodiment of the present invention;
[0079] Figure 3 Schematic diagram of the unfolding result of the processing line in an embodiment of the present invention;
[0080] Figure 4 Schematic diagram of the endpoint position in an embodiment of the present invention;
[0081] Figure 5 Schematic diagram of the endpoint matching method in an embodiment of the present invention;
[0082] Figure 6 Schematic diagram of the modules of a processing angle generating device in an embodiment of the present invention. Detailed implementation manners
[0083] The following will further describe in detail the specific implementation manners of the present invention in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0084] The terms "first" and "second" etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0085] Referring to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase at various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0086] Embodiment 1
[0087] Refer to Figure 1 , Figure 1 is a flowchart of a processing angle generating method provided in an embodiment of the present invention. The embodiment of the present invention provides a processing angle generating method, including steps 101 to 104, and the specific steps are as follows:
[0088] Step 101: Project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located.
[0089] In one embodiment, the projection of the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located specifically includes: obtaining the inner wall processing line and the outer wall processing line of the pipe to be cut; discretizing the inner wall processing line and the outer wall processing line into a number of line segments respectively according to a preset sagitta threshold to obtain a number of inner wall line segments and a number of outer wall line segments; projecting the inner wall line segments onto the cross-section where the outer wall line segments are located so that the inner wall line segments and the outer wall line segments are in the same cross-section dimension.
[0090] In the embodiments of the present invention, the data of the inner wall processing line and the outer wall processing line can be obtained from the design drawings or three-dimensional models of the pipe. These data may be stored in different file formats, such as STEP, IGES, etc., and can be read using corresponding three-dimensional modeling software or data processing tools. The obtained processing line data may be in the form of curves. For the convenience of subsequent processing, it is necessary to convert it into a numerical format that can be recognized and processed by a computer, such as a sequence of coordinate points, and each point is represented by three-dimensional coordinates (x, y, z).
[0091] The sagitta threshold is an important parameter, which determines the accuracy of discretization. A smaller sagitta threshold will result in more line segments, and the discretization result is closer to the original curve, but it will increase the computational amount; a larger sagitta threshold will reduce the number of line segments and reduce the computational complexity, but may lose a certain amount of accuracy. The determination of the sagitta threshold needs to be weighed according to specific processing requirements and factors such as the size and shape of the pipe, and is not limited here. Exemplarily, the bisection method is used for discretization in the embodiments of the present invention. For the curve of the inner wall processing line or the outer wall processing line, take the starting point and the ending point of the curve, and connect these two points to form a straight line segment. Calculate the sagitta (i.e., the vertical distance between the curve and the straight line segment) at the midpoint of the straight line segment. If the sagitta is greater than the preset sagitta threshold, then divide the curve segment at the midpoint to obtain two new curve segments, and repeat the above steps to process these two new curve segments; if the sagitta is less than or equal to the preset sagitta threshold, it is considered that the curve segment can be approximately represented by this straight line segment, and it is used as one of the line segments after discretization. Repeat the above process until all curve segments are processed to obtain a number of inner wall line segments and a number of outer wall line segments. Discretizing the curve based on the preset sagitta threshold belongs to the conventional technical means in the art and will not be elaborated here.
[0092] Further, project the obtained inner wall line segments onto the cross-section where the outer wall line segments are located. First, it is necessary to clarify the position and orientation of the cross-section where the outer wall line segments are located. This cross-section can be determined by selecting a reference plane or based on the axis of the pipe and specific position information. For example, if the pipe is cylindrical, a plane perpendicular to the axis of the pipe can be selected as the cross-section. For each inner wall line segment, project its two endpoints onto the cross-section where the outer wall line segments are located. The projection method can use perpendicular projection. Exemplarily, calculate the perpendicular distance from the endpoint of the inner wall line segment to the cross-section. According to the perpendicular distance and the coordinates of the endpoint, move the endpoint along the direction perpendicular to the cross-section to the cross-section to obtain the projected endpoint coordinates. Connect the two projected endpoints to form the projected inner wall line segment. After the projection is completed, it is necessary to check whether the projected inner wall line segment and the outer wall line segment are in the same cross-section dimension. This can be checked by calculating whether the z-coordinate of the endpoint of the projected line segment (assuming the cross-section is perpendicular to the z-axis) is consistent with the z-coordinate of the cross-section. If there is an error, appropriate adjustment can be made. Refer to Figure 2 , Figure 2 is a schematic diagram of the projection result of an inner wall line segment provided in an embodiment of the present invention. Based on the above projection operation, the inner wall line segment and the outer wall line segment can be in the same cross-section dimension.
[0093] Step 102: Align the starting points of the inner wall processing line and the outer wall processing line and expand them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe.
[0094] In one embodiment, the aligning the starting points of the inner wall processing line and the outer wall processing line and expanding them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe specifically includes: obtaining the starting point of the outer wall processing line, and calculating the distance between each endpoint of the inner wall line segment and the starting point; updating the endpoint of the inner wall line segment with the shortest distance to the starting point as the starting point of the inner wall processing line, and expanding the inner wall processing line and the outer wall processing line from their respective starting points to the two-dimensional plane to obtain the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe.
[0095] In the embodiment of the present invention, extract the three-dimensional coordinates of the starting point from the previously processed outer wall processing line data (which has been discretized into line segments). The starting point is selected by the user according to the specific shape of the pipe and the cutting task. Whichever position is more suitable for starting the cutting is used as the starting point. For the two endpoints of each inner wall line segment, use the Euclidean distance formula in three-dimensional space to calculate the distance between them and the starting point of the outer wall processing line. The Euclidean distance formula is Among them, (X1, Y1, Z1) are the coordinates of the starting point of the outer wall processing line, and (X2, Y2, Z2) are the coordinates of the end point of the inner wall line segment. Traverse all the end points of the inner wall line segments, calculate the distances in sequence and store the results. Data structures such as lists or dictionaries can be used to store each end point and its corresponding distance. Compare the distances between all the stored end points of the inner wall line segments and the starting point of the outer wall processing line, and find the end point with the shortest distance. Update the end point of the inner wall line segment with the shortest distance to be the starting point of the inner wall processing line. After the starting point is updated, unfold the inner wall processing line and the outer wall processing line from their respective starting points to a two-dimensional plane. According to the shape of the pipe and the characteristics of the processing line, select a suitable unfolding method. Exemplarily, for a cylindrical pipe, a common unfolding method is to unfold its side surface into a rectangle. Unfold the processing line along the generatrix direction of the pipe to convert the three-dimensional curve into a two-dimensional straight line or curve. During the unfolding process, some key parameters need to be calculated, such as the unfolded length, angle, etc. For a cylindrical pipe, the unfolded length is equal to the circumference of the pipe multiplied by the unfolding radian ratio, and the angle is calculated according to the position of the processing line on the circumference. Convert the three-dimensional coordinates of the inner wall processing line and the outer wall processing line into two-dimensional coordinates. A mapping relationship between the three-dimensional coordinates and the two-dimensional coordinates can be established according to the unfolding method and parameters to achieve coordinate conversion. Refer to Figure 3 , Figure 3 which is a schematic diagram of the result of unfolding a processing line provided in an embodiment of the present invention. Connect the converted two-dimensional coordinates in sequence to form a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe. Preferably, a graphics library (such as Matplotlib in Python) can also be used to visualize the wireframe to check whether the unfolding result is correct.
[0096] Step 103: Perform end point matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtain the matching end points of each end point of the two-dimensional outer wall wireframe in the two-dimensional inner wall wireframe, and connect the corresponding matching end points in sequence according to the end point order of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line.
[0097] In one embodiment, the performing end point matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe to obtain the matching end points of each end point of the two-dimensional outer wall wireframe in the two-dimensional inner wall wireframe specifically includes: obtaining the positions of each end point of the two-dimensional outer wall wireframe, and calling the corresponding end point matching strategy according to the positions of the end points; wherein, the end point matching strategy includes a ray method matching strategy and a nearest point matching strategy.
[0098] In an embodiment of the present invention, extract the two-dimensional coordinates of each end point from the data structure (such as a list, an array, etc.) storing the two-dimensional outer wall wireframe, and these coordinates are usually represented in the form of (x, y). Different end point matching strategies are adopted according to different position situations of the end points.
[0099] In one embodiment, calling the corresponding endpoint matching strategy according to the position of the endpoint specifically includes: when the endpoint is located at the start end or the end end of the pipe to be cut, calling the ray method matching strategy; wherein, the ray method matching strategy is to make a ray starting from the endpoint and intersecting with the two-dimensional inner wall wireframe along the X-axis direction, and taking the endpoint on the two-dimensional inner wall wireframe that intersects with the ray as the matching endpoint; when the endpoint is the endpoint of the pipe to be cut at the opening position, calling the nearest point matching strategy; wherein, the nearest point matching strategy is to take the endpoint on the two-dimensional inner wall wireframe with the shortest distance from the endpoint as the matching endpoint.
[0100] In the embodiment of the present invention, according to the design information and related identifiers of the pipe to be cut, the characteristics or ranges of the start end, the end end, and the opening position are clarified. Each endpoint of the two-dimensional outer wall wireframe is traversed, and according to the above-determined characteristics or ranges, it is judged whether the endpoint is located at the start end or the end end of the pipe to be cut, or is the endpoint of the pipe to be cut at the opening position. Figure 4 This is a schematic diagram of the endpoint position provided in an embodiment of the present invention. The head is the wireframe located at the start end of the pipe to be cut, and the tail is the wireframe located at the end end of the pipe to be cut. For the endpoints located at the start end or the end end of the pipe to be cut, the ray method matching strategy is adopted, that is, a ray is generated starting from this endpoint along the positive X-axis direction (the negative direction can also be selected according to the actual situation if necessary). In computer implementation, this ray can be represented by setting the starting coordinates and direction vector of the ray. Each line segment of the two-dimensional inner wall wireframe is traversed, and an algorithm for the intersection of a straight line and a line segment is used to judge whether the ray intersects with the line segment. Common algorithms such as the vector cross product method are used to calculate the cross product of the ray vector and the line segment vector to judge their relative position relationship. If the ray intersects with the endpoint of the two-dimensional inner wall wireframe, directly take this endpoint as the matching endpoint. If the ray intersects with the line segment, it is necessary to further determine the matching endpoint according to the specific situation. For example, the endpoint of the line segment closest to the starting point of the ray can be selected as the matching endpoint, or the appropriate endpoint can be selected according to the connection order of the line segments and the actual application requirements. For the endpoints located at the opening position of the pipe to be cut, the nearest point method matching strategy is adopted, that is, the Euclidean distance formula is used to calculate the distance between this endpoint and all endpoints on the two-dimensional inner wall wireframe. Find the endpoint on the two-dimensional inner wall wireframe with the shortest distance and take it as the matching endpoint. In actual implementation, a variable can be used to record the current minimum distance and the corresponding endpoint, and the final matching endpoint can be obtained after traversing all endpoints. Store each endpoint of the two-dimensional outer wall wireframe and its corresponding matching endpoint in a suitable data structure, such as a dictionary in Python, with the key being the endpoint of the two-dimensional outer wall wireframe and the value being the corresponding matching endpoint. See Figure 5 , Figure 5A schematic diagram of an endpoint matching method provided in an embodiment of the present invention. According to the above endpoint matching method, each endpoint on the two-dimensional outer wall wireframe is matched, and then the corresponding matched endpoints are sequentially connected in the order of the endpoints of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line.
[0101] Step 104: Restore the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and generate a vector pointing from the inner wall to the outer wall and a machining angle according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall machining line.
[0102] In one embodiment, the generating a vector pointing from the inner wall to the outer wall and a machining angle according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall machining line specifically includes: obtaining the corresponding relationship between each endpoint between the reconstructed three-dimensional inner wall line and the outer wall machining line; generating a three-dimensional vector pointing from the inner wall to the outer wall according to the three-dimensional coordinates of any pair of matched endpoints between the reconstructed three-dimensional inner wall line and the outer wall machining line; normalizing the three-dimensional vector to generate a unit vector in the three-dimensional direction, and calculating the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction; wherein, the machining angle includes a turntable angle and a swivel head angle.
[0103] In the embodiment of the present invention, the reconstructed two-dimensional inner wall line is reversely operated according to the previous unfolding method and is wrapped and restored to the actual inner wall position of the pipe. This requires converting the two-dimensional coordinates into three-dimensional coordinates according to the parameters and mapping relationship during unfolding to obtain a three-dimensional reconstructed inner wall line. The reconstructed three-dimensional inner wall line is accurately restored to the actual inner wall position of the pipe through back-projection operation. The inner wall line points on the outer wall surface can be back-projected to the inner wall according to the previous projection parameters and geometric relationships. Then, each pair of matched endpoints between the reconstructed three-dimensional inner wall line and the outer wall machining line is traversed. For each pair of matched endpoints, a three-dimensional vector pointing from the inner wall to the outer wall can be generated according to the three-dimensional coordinates of the inner wall endpoint and the outer wall endpoint and the calculation formula of the vector. The expression of the three-dimensional vector is V ec =(X o -X i , Y o -Y i , Z o -Z i ), (X i , Y i , Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o , Z o) are the endpoint coordinates on the outer wall processing line. By normalizing the three-dimensional vector, the unit vector in the three-dimensional direction can be obtained. A five-axis machine tool usually has two rotating axes, namely a turntable and a swivel head. The turntable angle (generally represented by θ) controls the rotation of the workpiece around a certain axis, and the swivel head angle (generally represented by ) controls the tilt angle of the tool. The machining angles of the five-axis machine tool are calculated through the direction cosines of each unit vector.
[0104] In one embodiment, the step of normalizing the three-dimensional vector to generate a unit vector in the three-dimensional direction and calculating the machining angles of the five-axis machine tool based on the unit vector in the three-dimensional direction specifically includes:
[0105] Obtain the three-dimensional vector corresponding to any pair of matching endpoints; wherein, the expression of the three-dimensional vector is:
[0106] V ec =(X o -X i ,Y o -Y i ,Z o -Z i );
[0107] In the formula, (X i ,Y i ,Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o ,Z o ) are the endpoint coordinates on the outer wall processing line;
[0108] Normalize the three-dimensional vector to obtain a unit vector in the three-dimensional direction; wherein, the expression of the unit vector is:
[0109]
[0110] In the formula, Vec.x is the component of the three-dimensional vector V ec in the X-axis direction; Vec.y is the component of the three-dimensional vector V ec in the Y-axis direction; Vec.z is the component of the three-dimensional vector V ec in the Z-axis direction; Len is the length of the three-dimensional vector V ec ;
[0111] Calculate the turntable angle and the swivel head angle according to the unit vector; wherein, the expressions of the turntable angle and the swivel head angle are:
[0112]
[0113] Where, ∠A is the turntable angle; ∠B is the swing head angle.
[0114] In an embodiment of the present invention, according to the determined corresponding relationship, a three-dimensional vector pointing from the inner wall to the outer wall is calculated. The generated three-dimensional vector is normalized to obtain a unit vector in the three-dimensional direction, and the machining angles of the five-axis machine tool, including the turntable angle and the swing head angle, are calculated based on the unit vector. The turntable angle usually controls the rotation of the workpiece around the vertical axis (such as the Z axis) and can be calculated by the projection of the unit vector on the XY plane. The swing head angle controls the tilt angle of the tool relative to the vertical axis and can be calculated by the included angle between the unit vector and the Z axis. Based on the unit vector in the three-dimensional direction, the two machining angles of the five-axis machine tool can be obtained.
[0115] In an embodiment of the present invention, a machining angle generation device is further provided, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the above-mentioned machining angle generation method is implemented.
[0116] In an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the above-mentioned machining angle generation method.
[0117] Exemplarily, the computer program can be divided into one or more modules. One or more modules are stored in the memory and executed by the processor to complete the present invention. One or more modules can be a series of computer program instruction segments capable of completing specific functions, and these instruction segments are used to describe the execution process of the computer program in the machining angle generation device.
[0118] The machining angle generation device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The machining angle generation device can include, but is not limited to, a processor, a memory, and a display. Those skilled in the art can understand that the above components are only examples of the machining angle generation device and do not constitute a limitation on the machining angle generation device. It can include more or fewer components than those described, or combine certain components, or different components. For example, the machining angle generation device can further include input / output devices, network access devices, a bus, etc.
[0119] The so-called processor may be a Central Processing Unit (CPU), or it may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The processor is the control center of the machining angle generation device, and uses various interfaces and circuits to connect all parts of the entire machining angle generation device.
[0120] The memory can be used to store computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory, and by invoking the data stored in the memory, the processor realizes various functions of the machining angle generation device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, a text conversion function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a FlashCard, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0121] Among them, when the module generated based on the machining angle is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the method of the above embodiments of the present invention, it can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. Those of ordinary skill in the art can understand and implement it without creative work.
[0122] An embodiment of the present invention provides a method for generating a machining angle. Projecting the inner wall machining line onto the cross-section where the outer wall machining line is located simplifies the complex three-dimensional spatial relationship, converts the problem into a positional relationship in the same plane, provides clearer and simpler basic data for subsequent processing, and reduces the calculation error caused by the complex spatial relationship. Then, the three-dimensional inner wall and outer wall machining lines are unfolded onto a two-dimensional plane, reducing the dimension and complexity of data processing, making the subsequent endpoint matching and reconstruction operations more intuitive and easier to implement. By endpoint matching, a clear corresponding relationship is established between the endpoints of the inner wall and outer wall wireframes, providing an accurate basis for generating vectors and machining angles subsequently, and avoiding the cutting angle deviation caused by incorrect direction judgment. And performing endpoint matching on the two-dimensional plane can find the corresponding points more precisely, reducing the error caused by inaccurate spatial position judgment, thereby improving the accuracy of reconstructing the two-dimensional inner wall line. Restoring the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain the reconstructed three-dimensional inner wall line. Since the previous steps of projection, unfolding, matching, etc. clarify the corresponding relationship between the inner wall and the outer wall, when generating the vector pointing from the inner wall to the outer wall, the direction is clear, avoiding ambiguity in direction judgment, thereby improving the accuracy of cutting angle calculation, being able to more precisely control the movement trajectory and cutting direction of the laser cutting head, further improving the cutting accuracy and quality, reducing the generation of waste products, and reducing production costs and production cycles.
[0123] Embodiment 2
[0124] See Figure 6 , Figure 6The module schematic diagram of a processing angle generating device provided in an embodiment of the present invention. An embodiment of the present invention provides a processing angle generating device, including: a projection module 201, an alignment module 202, a matching module 203, and a calculation module 204;
[0125] The projection module 201 is configured to project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located;
[0126] The alignment module 202 is configured to align the starting points of the inner wall processing line and the outer wall processing line and expand them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe;
[0127] The matching module 203 is configured to perform endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, and sequentially connect the corresponding matching endpoints according to the endpoint order of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line;
[0128] The calculation module 204 is configured to restore the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and generate a vector and a processing angle pointing from the inner wall to the outer wall according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line.
[0129] In one embodiment, the projection module 201 is configured to project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located, specifically including: obtaining the inner wall processing line and the outer wall processing line of the pipe to be cut; discretizing the inner wall processing line and the outer wall processing line into a plurality of line segments respectively according to a preset bow height threshold to obtain a plurality of inner wall line segments and a plurality of outer wall line segments; projecting the inner wall line segments onto the cross-section where the outer wall line segments are located so that the inner wall line segments and the outer wall line segments are in the same cross-section dimension.
[0130] In one embodiment, the alignment module 202 is configured to align the starting points of the inner wall processing line and the outer wall processing line and expand them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe, specifically including: obtaining the starting point of the outer wall processing line, and calculating the distance between each endpoint of the inner wall line segment and the starting point; updating the endpoint of the inner wall line segment with the shortest distance from the starting point to be the starting point of the inner wall processing line, and expanding the inner wall processing line and the outer wall processing line from their respective starting points to the two-dimensional plane to obtain the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe.
[0131] In one embodiment, the matching module 203 is configured to perform endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe to obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, specifically including: obtaining the positions of each endpoint of the two-dimensional outer wall wireframe, and calling the corresponding endpoint matching strategy according to the positions of the endpoints; wherein, the endpoint matching strategy includes a ray method matching strategy and a nearest point matching strategy.
[0132] In one embodiment, the calling the corresponding endpoint matching strategy according to the positions of the endpoints specifically includes: when the endpoint is located at the start end or the end end of the pipe to be cut, calling the ray method matching strategy; wherein, the ray method matching strategy is to make a ray intersecting with the two-dimensional inner wall wireframe along the X-axis direction with the endpoint as the starting point, and taking the endpoint on the two-dimensional inner wall wireframe that intersects with the ray as the matching endpoint; when the endpoint is the endpoint of the pipe to be cut at the opening position, calling the nearest point matching strategy; wherein, the nearest point matching strategy is to take the endpoint on the two-dimensional inner wall wireframe with the shortest distance from the endpoint as the matching endpoint.
[0133] In one embodiment, the generating a vector from the inner wall to the outer wall and a machining angle according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall machining line specifically includes: obtaining the corresponding relationship between each endpoint between the reconstructed three-dimensional inner wall line and the outer wall machining line; generating a three-dimensional vector from the inner wall to the outer wall according to the three-dimensional coordinates of any pair of matching endpoints between the reconstructed three-dimensional inner wall line and the outer wall machining line; normalizing the three-dimensional vector to generate a unit vector in the three-dimensional direction, and calculating the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction; wherein, the machining angle includes a turntable angle and a swivel head angle.
[0134] In one embodiment, the normalizing the three-dimensional vector to generate a unit vector in the three-dimensional direction and calculating the machining angle of the five-axis machine tool according to the unit vector in the three-dimensional direction specifically includes: obtaining the three-dimensional vector corresponding to any pair of matching endpoints; wherein, the expression of the three-dimensional vector is:
[0135] V ec =(X o -X i ,Y o -Y i ,Z o -Z i );
[0136] In the formula, (X i ,Y i ,Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o,Z o ) are the endpoint coordinates on the outer wall processing line;
[0137] Normalize the three-dimensional vector to obtain a unit vector in the three-dimensional direction; where the expression of the unit vector is:
[0138]
[0139] In the formula, Vec.x is the component of the three-dimensional vector V ec in the X-axis direction; Vec.y is the component of the three-dimensional vector V ec in the Y-axis direction; Vec.z is the component of the three-dimensional vector V ec in the Z-axis direction; Len is the length of the three-dimensional vector V ec .
[0140] Calculate the turntable angle and the swing head angle according to the unit vector; where the expressions of the turntable angle and the swing head angle are:
[0141]
[0142] In the formula, ∠A is the turntable angle; ∠B is the swing head angle.
[0143] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described device can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.
[0144] An embodiment of the present invention provides a machining angle generation device, which projects the inner wall machining line onto the cross-section where the outer wall machining line is located, simplifies the complex three-dimensional spatial relationship, transforms the problem into a positional relationship in the same plane, provides clearer and simpler basic data for subsequent processing, and reduces the calculation error caused by the complex spatial relationship. Then, the three-dimensional inner wall and outer wall machining lines are unfolded onto a two-dimensional plane, reducing the dimension and complexity of data processing, making subsequent endpoint matching and reconstruction operations more intuitive and easier to implement. By endpoint matching, a clear corresponding relationship is established between the endpoints of the inner wall and outer wall wireframes, providing an accurate basis for subsequent vector generation and machining angle, and avoiding the cutting angle deviation caused by incorrect direction judgment. And endpoint matching on the two-dimensional plane can find the corresponding points more precisely, reducing the error caused by inaccurate spatial position judgment, thereby improving the accuracy of reconstructing the two-dimensional inner wall line. Restoring the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut gives the reconstructed three-dimensional inner wall line. Since the previous steps of projection, unfolding, matching, etc. clarify the corresponding relationship between the inner wall and the outer wall, the direction is clear when generating the vector pointing from the inner wall to the outer wall, avoiding the ambiguity of direction judgment, thereby improving the accuracy of cutting angle calculation, being able to more precisely control the movement trajectory and cutting direction of the laser cutting head, further improving the cutting accuracy and quality, reducing the generation of waste products, and reducing the production cost and production cycle.
[0145] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and replacements can be made, and these improvements and replacements should also be regarded as the protection scope of the present invention.
Claims
1. A method for generating a machining angle, characterized in that, Including: Projecting the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located; Aligning the starting points of the inner wall processing line and the outer wall processing line and unfolding them onto a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe; Performing endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtaining the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, and sequentially connecting the corresponding matching endpoints according to the endpoint order of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line; Restoring the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and generating vectors and processing angles pointing from the inner wall to the outer wall according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line.
2. The machining angle generation method according to claim 1, wherein The step of projecting the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located specifically includes: Obtaining the inner wall processing line and the outer wall processing line of the pipe to be cut; Discretizing the inner wall processing line and the outer wall processing line into a number of line segments respectively according to a preset arc height threshold to obtain a number of inner wall line segments and a number of outer wall line segments; Projecting the inner wall line segments onto the cross-section where the outer wall line segments are located so that the inner wall line segments and the outer wall line segments are in the same cross-section dimension.
3. The processing angle generation method according to claim 2, wherein The step of aligning the starting points of the inner wall processing line and the outer wall processing line and unfolding them onto a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe specifically includes: Obtaining the starting point of the outer wall processing line and calculating the distance between each endpoint of the inner wall line segment and the starting point; Updating the endpoint of the inner wall line segment with the shortest distance to the starting point as the starting point of the inner wall processing line, and unfolding the inner wall processing line and the outer wall processing line from their respective starting points onto a two-dimensional plane to obtain the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe.
4. A method for generating a machining angle according to claim 1, characterized in that The step of performing endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtaining the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe specifically includes: Obtaining the positions of each endpoint of the two-dimensional outer wall wireframe and calling the corresponding endpoint matching strategy according to the positions of the endpoints; wherein, the endpoint matching strategy includes a ray method matching strategy and a nearest point matching strategy.
5. A method for generating a machining angle as claimed in claim 4, wherein, The step of calling the corresponding endpoint matching strategy according to the positions of the endpoints specifically includes: When the endpoint is at the starting end or the ending end of the pipe to be cut, calling the ray method matching strategy; wherein, the ray method matching strategy is to make a ray intersecting with the two-dimensional inner wall wireframe along the X-axis direction with the endpoint as the starting point, and taking the endpoint on the two-dimensional inner wall wireframe that intersects with the ray as the matching endpoint; When the endpoint is the endpoint of the pipe to be cut at the opening position, calling the nearest point matching strategy; wherein, the nearest point matching strategy is to take the endpoint with the shortest distance to the endpoint in the two-dimensional inner wall wireframe as the matching endpoint.
6. The method for generating a machining angle according to claim 1, wherein The step of generating vectors and processing angles pointing from the inner wall to the outer wall according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line specifically includes: Obtaining the corresponding relationship between each endpoint between the reconstructed three-dimensional inner wall line and the outer wall processing line; Generate a three-dimensional vector pointing from the inner wall to the outer wall according to the three-dimensional coordinates of any pair of matching endpoints between the reconstructed three-dimensional inner wall line and the outer wall processing line; Normalize the three-dimensional vector to generate a unit vector in the three-dimensional direction, and calculate the machining angles of the five-axis machine tool according to the unit vector in the three-dimensional direction; wherein, the machining angles include the turntable angle and the swing head angle.
7. A machining angle generation method according to claim 6, characterized in that, The step of normalizing the three-dimensional vector to generate a unit vector in the three-dimensional direction and calculating the machining angles of the five-axis machine tool according to the unit vector in the three-dimensional direction specifically includes: Obtain the three-dimensional vector corresponding to any pair of matching endpoints; wherein, the expression of the three-dimensional vector is: V ec = (X o - X i , Y o - Y i , Z o - Z i ); Wherein, (X i , Y i , Z i ) are the endpoint coordinates on the reconstructed three-dimensional inner wall line; (X o Y o , Z o ) are the endpoint coordinates on the outer wall processing line; Normalize the three-dimensional vector to obtain a unit vector in the three-dimensional direction; wherein, the expression of the unit vector is: where Vec.x is the component of the three-dimensional vector V ec in the X-axis direction; Vec.y is the component of the three-dimensional vector V ec in the Y-axis direction; Vec.z is the component of the three-dimensional vector V ec in the Z-axis direction; Len is the length of the three-dimensional vector V ec , Calculate the turntable angle and the swing head angle according to the unit vector; wherein, the expressions of the turntable angle and the swing head angle are: In the formula, ∠A is the turntable angle; ∠B is the swing head angle.
8. A machining angle generating device, characterized in that, including: a projection module, an alignment module, a matching module and a calculation module; The projection module is used to project the inner wall processing line of the pipe to be cut onto the cross-section where the outer wall processing line is located; The alignment module is used to align the starting points of the inner wall processing line and the outer wall processing line and expand them to a two-dimensional plane to obtain a two-dimensional outer wall wireframe and a two-dimensional inner wall wireframe; The matching module is used to perform endpoint matching on the two-dimensional outer wall wireframe and the two-dimensional inner wall wireframe, obtain the matching endpoints of each endpoint of the two-dimensional outer wall wireframe on the two-dimensional inner wall wireframe, and sequentially connect the corresponding matching endpoints according to the endpoint order of the two-dimensional outer wall wireframe to obtain a reconstructed two-dimensional inner wall line; The calculation module is used to restore the reconstructed two-dimensional inner wall wireframe to the three-dimensional space of the pipe to be cut to obtain a reconstructed three-dimensional inner wall line, and generate a vector and a machining angle pointing from the inner wall to the outer wall according to the corresponding relationship between each point on the reconstructed three-dimensional inner wall line and the outer wall processing line.
9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the machining angle generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the machining angle generation method according to any one of claims 1 to 7.