Tool collision point analysis methods, devices, electronic equipment and storage media
By splitting and projecting the line segments of the tool and the workpiece, the collision point can be accurately located, solving the problem of low computational efficiency in existing technologies and improving machining accuracy and quality.
Patent Information
- Application Number
- CN202512002941.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-26
AI Technical Summary
In the existing technology, the calculation efficiency of the collision point between the cutting tool and the workpiece is low, which makes it easy for overcutting defects to occur during the machining process.
By acquiring the rotating surface of the tool and the target line segment on the workpiece, the line segment is divided into multiple candidate line segments. The endpoints of the candidate line segments are projected onto the rotating surface. The collision point position is analyzed using the projection points and normal vectors. The line segments are iteratively divided until a preset length threshold is reached, and the collision point is accurately located.
It simplifies the collision point calculation process, improves calculation efficiency, prevents overcutting defects, and enhances machining accuracy and quality.
Smart Images

Figure CN122087970A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital machining technology, and more specifically to a method, apparatus, electronic device, and storage medium for tool collision point analysis. Background Technology
[0002] In the field of Computer-Aided Manufacturing (CAM), surface machining involves toolpath generation and optimization. Tool collision point analysis is crucial in toolpath generation, serving as a technical safeguard against overcutting defects during machining. The cutting portions of bullnose cutters and drum-shaped cutters, commonly used for surface machining, consist of the inner or outer sides of toroidal surfaces. Determining the collision point between these tools and the workpiece is a significant technical challenge. Current techniques typically employ the offset ellipse method or algebraic equations to determine the tool-workpiece contact point; however, these methods are computationally complex, resulting in low computational efficiency. Summary of the Invention
[0003] This invention provides a tool collision point analysis method, apparatus, electronic device, and storage medium to solve the problem of low calculation efficiency of the collision point between the tool and the workpiece.
[0004] In a first aspect, the present invention provides a method for analyzing tool collision points, the method comprising: Obtain the rotary surface of the cutting tool and the target line segment on the workpiece opposite to the rotary surface; The target line segment is split to obtain multiple candidate line segments; For each candidate line segment, the two endpoints of the candidate line segment are projected onto the surface of revolution, and the collision point between the tool and the workpiece to be processed is analyzed based on the projection points of the two endpoints to determine whether the collision point is located in the candidate line segment. For the target candidate line segment where the collision point is located, if the length of the target candidate line segment is greater than a preset length threshold, then the target candidate line segment is taken as the next target line segment, and the step of splitting the target line segment is returned; if the length of the target candidate line segment is less than or equal to the preset length threshold, then the collision point is determined based on the target candidate line segment.
[0005] In a second aspect, the present invention provides a tool collision point analysis device, the device comprising: The data acquisition module is used to acquire the rotary surface of the cutting tool and the target line segment on the workpiece opposite to the rotary surface; The line segment splitting module is used to split the target line segment to obtain multiple candidate line segments; The first analysis module is used to project the two endpoints of each candidate line segment onto the surface of revolution, and analyze whether the collision point between the tool and the workpiece to be processed is located in the candidate line segment through the projection points of the two endpoints. The second analysis module is used to determine the collision point based on the target candidate line segment where the collision point is located. If the length of the target candidate line segment is greater than a preset length threshold, the target candidate line segment is used as the next target line segment, and the step of splitting the target line segment is returned. If the length of the target candidate line segment is less than or equal to the preset length threshold, the collision point is determined based on the target candidate line segment.
[0006] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the tool collision point analysis method of the first aspect or any corresponding embodiment described above.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the tool collision point analysis method of the first aspect or any corresponding embodiment described above.
[0008] The tool collision point analysis method provided in this embodiment obtains the rotating surface of the tool and a target line segment on the workpiece opposite to the rotating surface, and then divides the target line segment into multiple candidate line segments. Next, the two endpoints of the candidate line segments are projected onto the rotating surface, and the collision point position is analyzed based on the projection points of the two endpoints. Then, the target candidate line segments containing collision points and whose length exceeds a preset length threshold are iteratively divided. When the length of a target candidate line segment is less than the preset length threshold, the collision point is accurately located based on the target candidate line segment. This method, based on projection operations and iterative calculations, simplifies the collision point calculation process, improves the efficiency of calculating the collision point between the tool and the workpiece, and effectively prevents overcutting defects during tool machining, thereby improving machining accuracy and quality. Attached Figure Description
[0009] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of the rotating surface of a cutting tool according to an embodiment of the present invention; Figure 2 This is the first schematic diagram for determining the collision point based on the ellipse offset method; Figure 3 This is a second schematic diagram for determining the collision point based on the ellipse offset method; Figure 4 This is a third schematic diagram for determining the collision point based on the ellipse offset method; Figure 5 This is a schematic flowchart of the first method for analyzing tool collision points according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating the process of determining the projection point of a torus surface onto a straight line according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the second process of the tool collision point analysis method according to an embodiment of the present invention; Figure 8 This is a flowchart illustrating the axial projection of the inner side of the surface of revolution and the target line segment according to an embodiment of the present invention. Figure 9 This is a schematic flowchart illustrating the radial projection of the inner side of the surface of revolution and the target line segment according to an embodiment of the present invention. Figure 10 This is a structural block diagram of a tool collision point analysis device according to an embodiment of the present invention; Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0013] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0014] Because tool projection is not limited by complex topological relationships between surfaces, it can handle composite surfaces that are difficult to process using other methods, avoiding overcutting or collisions between the tool and the workpiece during surface machining. Therefore, it is commonly used in semi-finishing and finishing processes of free-form surfaces. In surface machining, bullnose cutters and drum-shaped cutters are frequently used, such as... Figure 2 As shown, the rotating surfaces of bullnose and drum-shaped cutting tools during the cutting process are composed of the inner or outer sides of a torus surface. During tool projection, calculating the collision point of the spatial line segment projected onto the workpiece by a cylindrical tool is relatively simple. However, for bullnose and drum-shaped tools, the shape of the surface needs to be considered, making the calculation of the collision point between the tool and the workpiece more difficult. Therefore, the key to achieving axial or radial projection of bullnose and drum-shaped tools onto the spatial line segment of the workpiece lies in accurately calculating the collision point between the tool and the workpiece based on the cutting surface of the tool.
[0015] In related technologies, the offset ellipse method is typically used to determine the collision point (CutContact point, also known as the CC point) between the tool and the workpiece. For example... Figure 2 As shown, under normal circumstances, when the torus surface (i.e., the circular torus surface) of the tool used for surface machining contacts the spatial line segment on the workpiece to be machined, the principal radius of the torus surface is R1-R2, the secondary radius of the torus surface is R2, and the spatial line segment on the workpiece to be machined is composed of two endpoints, P1 and P2. Figure 3 As shown, the offset ellipse method includes the following steps: First, the line segment P1P2 is extended into a cylinder C1 with a radius of R2. Then, the XY two-dimensional plane of the torus is constructed, and the cross-section between the XY two-dimensional plane and the cylinder C1 is determined, i.e. Figure 3 The ellipse E1 is shown. A circle with radius R1-R2 is tangent to ellipse E1 at the contact point VCC. Using contact point VCC as the dynamic point ePoint, ePoint slides along the ellipse by a certain offset distance. ePoint will trace an offset ellipse. Then, the Brent root-finding algorithm is used to find the optimal ePoint, making ePoint coincide with the center point of the annulus. For example... Figure 4 As shown, when ePoint coincides with the center point of the annulus, the height of the center point of the annulus on the Z-axis is determined. Finally, the collision point between the tool and the spatial line segment on the workpiece is determined as the point on the line segment P1P2 projected from the contact point VCC on the circle with radius R1-R2. It can be seen that although the offset ellipse method can correctly determine the collision point between the tool and the workpiece, the Brent root-finding method used is computationally complex and slow in practical applications.
[0016] In view of the above-mentioned shortcomings of the offset ellipse method, the present invention provides a tool collision point analysis method. Compared with the offset ellipse method, the tool collision point analysis method proposed in this invention has a relatively simple way of handling collision points and can effectively improve the calculation efficiency of collision points between the tool and the workpiece.
[0017] According to an embodiment of the present invention, a method for analyzing tool collision points is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0018] This embodiment provides a tool collision point analysis method, which can be used in CNC machine tools, such as electronic devices used in CNC machine tools for planning machining paths for workpieces to be machined. Figure 5 This is a flowchart of a tool collision point analysis method according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps: Step S501: Obtain the rotary surface of the tool and the target line segment on the workpiece opposite to the rotary surface.
[0019] Optionally, the cutting tool can be a bullnose cutter, a drum cutter, or other cutting tools used for machining curved surfaces; no specific limitations are made here.
[0020] Among them, the rotating surface of the tool is the toroidal surface formed by the tool rotating around its axis once.
[0021] In practical applications, such as Figure 1 As shown, the surface of revolution of the tool is composed of the inner or outer sides of a torus surface, and the Gaussian curvature of the surface of revolution is positive. Figure 1 The black areas shown represent positive curvature, while the white areas represent negative curvature.
[0022] Step S502: The target line segment is split to obtain multiple candidate line segments.
[0023] Specifically, the target line segment is split into multiple candidate line segments by using the midpoint as the splitting point. Alternatively, a splitting point can be randomly selected within the target line segment to split it into multiple candidate line segments. No restriction is placed on the splitting method of the target line segment here.
[0024] Step S503: For each candidate line segment, project the two endpoints of the candidate line segment onto the rotating surface, and analyze whether the collision point between the tool and the workpiece to be processed is located in the candidate line segment through the projection points of the two endpoints.
[0025] The two endpoints include the first endpoint and the second endpoint.
[0026] Specifically, the two endpoints of the candidate line segment are projected onto the surface of revolution, resulting in two projection points corresponding to the two endpoints: the projection point of the first endpoint and the projection point of the second endpoint. Then, the normal vectors corresponding to the two projection points are determined, namely, the first normal vector and the second normal vector. Based on the relationship between the first normal vector, the second normal vector, and the direction vector of the target line segment, it is analyzed whether the collision point between the tool and the workpiece is located within the candidate line segment.
[0027] Step S504: For the target candidate line segment where the collision point is located, if the length of the target candidate line segment is greater than the preset length threshold, then the target candidate line segment is taken as the next target line segment, and the step of splitting the target line segment is returned; if the length of the target candidate line segment is less than or equal to the preset length threshold, then the collision point is determined based on the target candidate line segment.
[0028] The collision point is used to prevent the tool from overcutting during the machining of the workpiece.
[0029] Optionally, the preset length threshold can be 10. -6 mm, or 10 -7 mm can be adjusted according to the actual situation, and no specific limit is made here.
[0030] In practical applications, taking torus surfaces as an example, Figure 6 This is a schematic diagram for determining the projection point of a torus onto a straight line. There are two cases where a torus intersects a straight line: tangent at one point or intersecting at two points, and the line segment determined by the two intersection points lies inside the torus. Figure 6 A point A on a straight line L is projected onto a torus surface S. If the straight line is tangent to the torus, the point of tangency is the projection point of point A (i.e., the point of collision between the torus and the straight line). If the straight line intersects the torus at points A and B, the projection point must be inside the target line segment AB. Then, the midpoint C of the target line segment AB is selected for projection. The projection point must be inside either the candidate line segment AC or the candidate line segment BC. If the candidate line segment AC intersects the torus, the projection point is inside the candidate line segment AC; if the candidate line segment BC intersects the torus, the projection point is inside the candidate line segment BC. When the candidate line segment AC intersects the torus, the midpoint D of the candidate line segment AC is selected again, splitting the candidate line segment AC into candidate line segments AD and CD, and the projection point is then determined to be inside either candidate line segment AD or candidate line segment CD. By iteratively narrowing the length of candidate line segments, when the length of a candidate line segment is less than a preset length threshold, the midpoint of the candidate line segment is used as the projection point.
[0031] The tool collision point analysis method provided in this embodiment obtains the rotating surface of the tool and a target line segment on the workpiece opposite to the rotating surface, and then divides the target line segment into multiple candidate line segments. Next, the two endpoints of the candidate line segments are projected onto the rotating surface, and the collision point position is analyzed based on the projection points of the two endpoints. Then, the target candidate line segments containing collision points and whose length exceeds a preset length threshold are iteratively divided. When the length of a target candidate line segment is less than the preset length threshold, the collision point is accurately located based on the target candidate line segment. This method, based on projection operations and iterative calculations, simplifies the collision point calculation process, improves the efficiency of calculating the collision point between the tool and the workpiece, and effectively prevents overcutting defects during tool machining, thereby improving machining accuracy and quality.
[0032] In some optional embodiments, obtaining the target line segment on the workpiece to be processed that is opposite to the surface of revolution in step S501 above includes: Step a1: Project the surface of revolution onto the workpiece to be processed to obtain the projection range of the surface of revolution on the workpiece.
[0033] Step a2: Determine the target line segment based on the projection range.
[0034] Specifically, the line segment to be processed on the workpiece within the projection range is taken as the target line segment. The length of the target line segment does not exceed the projection range, so that both endpoints of the target line segment can be projected onto the surface of revolution.
[0035] The tool collision point analysis method provided in this embodiment obtains the projection range on the workpiece to be processed by projecting the rotating surface, and determines the target line segment based on the projection range, ensuring that all points on the target line segment can be projected onto the rotating surface, thereby improving the accuracy of collision point analysis.
[0036] In some optional implementations, the step S502 above, which involves splitting the target line segment to obtain multiple candidate line segments, includes: Step b1: Use the midpoint of the target line segment as the splitting point.
[0037] Step b2: The target line segment is split based on the split point to obtain multiple candidate line segments.
[0038] Specifically, the target line segment is split by selecting the midpoint of the target line segment to obtain multiple candidate line segments.
[0039] In some optional implementations, the two endpoints include a first endpoint and a second endpoint; the analysis of whether the collision point between the tool and the workpiece is located on the candidate line segment by projecting the two endpoints in step S503 above includes: Step c1: Obtain the direction vector of the target line segment, the first normal vector of the tangent plane where the projection point of the first endpoint is located, and the second normal vector of the tangent plane where the projection point of the second endpoint is located.
[0040] Step c2: Based on the direction vector, the first normal vector, and the second normal vector, analyze whether the collision point is located on the candidate line segment.
[0041] Specifically, based on the relationship between the first normal vector and the direction vector, and the relationship between the second normal vector and the direction vector, it is determined whether the collision point is located on the candidate line segment.
[0042] As an optional implementation, a first angular relationship between the direction vectors of the first normal vector and a second angular relationship between the second normal vector and the direction vectors are determined. The first angular relationship includes one of an acute angle, an obtuse angle, and a right angle, and the second angular relationship includes one of an acute angle, an obtuse angle, and a right angle. If the first and second angular relationships are not right angles (e.g., acute or obtuse angles), and the first and second angular relationships are inconsistent, then the collision point is determined to be located on a candidate line segment. For example, if the first angular relationship is obtuse and the second angular relationship is acute, then the collision point is determined to be located on a candidate line segment. If the first and second angular relationships are not right angles, and the first and second angular relationships are consistent, then the collision point is determined not to be located on a candidate line segment. For example, if the first and second angular relationships are both obtuse, then the collision point is determined not to be located on a candidate line segment. Understandably, if the first included angle relationship is inconsistent with the second included angle relationship, it indicates that there is a point in the process from the first endpoint to the second endpoint where the normal vector of the tangent plane containing the point is perpendicular to the direction vector. This point is the collision point.
[0043] In some optional implementations, step c2 above, which analyzes whether the collision point is located on the candidate line segment based on the direction vector, the first normal vector, and the second normal vector, includes: Step c21: Perform vector operations on the first normal vector and the direction vector to obtain the first operation result.
[0044] Vector operations are the dot product operations between vectors.
[0045] Specifically, a dot product operation is performed on the first normal vector and the direction vector to obtain a first operation result. This first operation result characterizes the angle between the first normal vector and the direction vector. If the first operation result is greater than 0, the angle between the first normal vector and the direction vector is acute; if the first operation result is less than 0, the angle between the first normal vector and the direction vector is obtuse.
[0046] Step c22: Perform vector operations on the second normal vector and direction vector to obtain the second operation result.
[0047] Specifically, a dot product operation is performed on the second normal vector and the direction vector to obtain the second operation result. This second operation result is used to characterize the angle between the second normal vector and the direction vector.
[0048] Step c23: Based on the first and second calculation results, analyze whether the collision point is located on the candidate line segment.
[0049] Specifically, based on the mathematical principle of the uniformity of the normal vector of a convex surface, the normal vector of a convex surface always points outward. Since the direction of the direction vector of the target line segment is fixed, when the candidate line segment intersects the surface of revolution, the direction vector is different from the first and second operation results of the first and second normal vectors (i.e., the angle types are different). Therefore, based on the first and second operation results, it can be analyzed whether the collision point is located on the candidate line segment.
[0050] The tool collision point analysis method provided in this embodiment obtains a first calculation result by performing vector operations on a first normal vector and a direction vector, thus clarifying the type of angle between the first normal vector and the direction vector. By performing vector operations on the first normal vector and the direction vector again, the first calculation result is obtained, clarifying the type of angle between a second normal vector and the direction vector. Furthermore, based on the first and second calculation results, it analyzes whether the collision point is located on a candidate line segment, accurately determining whether a collision point exists on the candidate line segment. This simplifies the calculation process of solving for collision points using algebraic equations and improves the calculation efficiency of collision points.
[0051] In some optional implementations, step c23 above, which analyzes whether the collision point is located on a candidate line segment based on the first and second calculation results, includes: Step c231: If the sign of the first operation result is inconsistent with the sign of the second operation result, then the collision point is determined to be located in the candidate line segment.
[0052] Specifically, if the sign of the first operation result is greater than 0 and the sign of the second operation result is less than 0, or the sign of the first operation result is less than 0 and the sign of the second operation result is greater than 0, then the collision point is determined to be located in the candidate line segment.
[0053] Step c232: If the sign of the first operation result is the same as the sign of the second operation result, then it is determined that the collision point is not located on the candidate line segment.
[0054] Specifically, if the sign of the first operation result and the sign of the second operation result are both greater than 0 or less than 0, then it is determined that the collision point is not located in the candidate line segment.
[0055] In some optional implementations, the tool collision point analysis method further includes: if the first calculation result or the second calculation result is 0, that is, the direction vector is perpendicular to the first normal vector or the second normal vector, then the candidate line segment is tangent to the surface of revolution. The tool collision point analysis method provided in this embodiment determines whether the collision point is located on a candidate line segment by analyzing whether the signs of the first calculation result and the second calculation result are consistent. It clarifies the collision point judgment criteria based on vector calculation and can quickly and accurately determine whether the collision point is located on a candidate line segment.
[0056] In some optional implementations, the step S504 above, which determines the collision point based on the target candidate line segment, includes: taking the midpoint of the target candidate line segment as the collision point.
[0057] In addition, if the preset length threshold is small enough, the target candidate line segment can also be used as the collision point. Alternatively, any point of the target candidate line segment can be used as the collision point.
[0058] Figure 7 This is a flowchart of the tool collision point analysis method according to an embodiment of the present invention. First, a dot product operation is performed to determine whether the collision point is inside the target line segment P1P2. If the dot product result indicates that the collision point is inside the target line segment P1P2, the midpoint m of the target line segment P1P2 is selected, and point m is projected onto the surface of revolution to obtain the projection point m_torus of m. Based on point m, the target line segment P1P2 is divided into candidate line segments P1m and P2m. If the length of either candidate line segment P1m or candidate line segment P2m is less than a preset length threshold, the projection point m_torus is taken as the collision point. If the length of candidate line segment P1m or candidate line segment P2m is less than a preset length threshold, update candidate line segment P1m or candidate line segment P2m to target line segment P1P2, repeat the above dot product operation process, determine whether the collision point is inside candidate line segment P1m or target candidate line segment P2m, until the length of the target candidate line segment where the collision point is located is less than or equal to the preset length threshold, and take the midpoint of the candidate line segment where the collision point is located as the collision point between the tool and the workpiece to be processed.
[0059] As an application embodiment of the present invention, taking the axial projection of the inner side of the surface of revolution and the target line segment as an example, such as... Figure 8As shown. The target line segment below the surface of revolution is P1P2, and the direction vector of line segment P1P2 is t, with the direction of t pointing from P1 to P2. P1 and P2 are projected onto the bottom surface of the surface of revolution, obtaining the projection points P1_torus of P1 and P2_torus of P2. The normal vector of the tangent plane containing P1_torus is n1, and the normal vector of the tangent plane containing P2_torus is n2. Then, n1 and t are multiplied to obtain the first result, and n2 and t are multiplied to obtain the second result. The calculation shows that the first result is less than 0, and the second result is greater than 0, indicating that the collision point between the tool and the workpiece is located inside line segment P1P2. Further, the midpoint m of line segment P1P2 is selected, dividing line segment P1P2 into candidate line segments P1m and mP2. Project m onto the bottom of the surface of revolution to obtain the projection point m_torus, and the normal vector of m_torus is n3. Repeat the above dot product operation process. The sign of the dot product of n3 and t is opposite to the sign of the dot product of n1 and t. It is determined that the collision point is located inside the candidate line segment P1m. The candidate line segment P1m is taken as the next target line segment, and the step of taking the midpoint of the target line segment is returned until the length of the candidate line segment where the collision point is located is less than or equal to the preset length threshold. The midpoint of the candidate line segment where the collision point is located is taken as the collision point between the tool and the workpiece to be processed.
[0060] As an application embodiment of the present invention, taking the radial projection of the inner side of the surface of revolution and the target line segment as an example, the radial projection of the inner side of the surface of revolution and the target line segment is as follows: Figure 9As shown. The portion of the workpiece coinciding with the side of the surface of revolution is taken as the target line segment P1P2, with the direction vector of P1P2 being t, where t points from P1 to P2. P1 and P2 are projected onto the bottom surface of the surface of revolution, respectively, to obtain the projection points P1_torus of P1 and P2_torus of P2. The normal vector of the tangent plane containing P1_torus is n1, and the normal vector of the tangent plane containing P2_torus is n2. Then, the dot product of n1 and t is performed to obtain the first calculation result, and the dot product of n2 and t is performed to obtain the second calculation result. The calculation shows that the first calculation result is less than 0, and the second calculation result is greater than 0, indicating that the collision point between the tool and the workpiece is located inside the line segment P1P2. Further, the midpoint m of the line segment P1P2 is selected, and the line segment P1P2 is divided into candidate line segments P1m and mP2. Project m onto the bottom of the surface of revolution to obtain the projection point m_torus, and the normal vector of m_torus is n3. Repeat the above dot product operation process. The sign of the dot product of n3 and t is opposite to the sign of the dot product of n1 and t. It is determined that the collision point is located inside the candidate line segment P1m. The candidate line segment P1m is taken as the next target line segment, and the step of taking the midpoint of the target line segment is returned until the length of the candidate line segment where the collision point is located is less than or equal to the preset length threshold. The midpoint of the candidate line segment where the collision point is located is taken as the collision point between the tool and the workpiece to be processed.
[0061] This embodiment also provides a tool collision point analysis device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0062] This embodiment provides a tool collision point analysis device, such as... Figure 10 As shown, it includes: The data acquisition module 1001 is used to acquire the rotary surface of the cutting tool and the target line segment on the workpiece opposite to the rotary surface.
[0063] The line segment splitting module 1002 is used to split the target line segment to obtain multiple candidate line segments.
[0064] The first analysis module 1003 is used to project the two endpoints of each candidate line segment onto the surface of revolution, and analyze whether the collision point between the tool and the workpiece to be processed is located on the candidate line segment through the projection points of the two endpoints.
[0065] The second analysis module 1004 is used to determine the collision point based on the target candidate line segment. If the length of the target candidate line segment is greater than a preset length threshold, the target candidate line segment is used as the next target line segment, and the step of splitting the target line segment is returned. If the length of the target candidate line segment is less than or equal to the preset length threshold, the collision point is determined based on the target candidate line segment.
[0066] In some optional implementations, the data acquisition module 1001 includes: The first acquisition unit is used to project the surface of revolution onto the workpiece to be processed, thereby obtaining the projection range of the surface of revolution on the workpiece to be processed.
[0067] The second acquisition unit is used to determine the target line segment based on the projection range.
[0068] In some optional implementations, the two endpoints include a first endpoint and a second endpoint; the first analysis module 1003 includes: The vector acquisition unit is used to acquire the direction vector of the target line segment, the first normal vector of the tangent plane where the projection point of the first endpoint is located, and the second normal vector of the tangent plane where the projection point of the second endpoint is located.
[0069] The collision analysis unit is used to analyze whether the collision point is located on the candidate line segment based on the direction vector, the first normal vector, and the second normal vector.
[0070] In some alternative implementations, the collision analysis unit includes: The first analysis subunit is used to perform vector operations on the first normal vector and the direction vector to obtain the first operation result.
[0071] The second analysis subunit is used to perform vector operations on the second normal vector and direction vector to obtain the second operation result.
[0072] The third analysis subunit is used to analyze whether the collision point is located on the candidate line segment based on the first and second calculation results.
[0073] In some optional implementations, the third analysis subunit is further configured to determine that the collision point is located on a candidate line segment if the sign of the first operation result is inconsistent with the sign of the second operation result; and to determine that the collision point is not located on a candidate line segment if the sign of the first operation result is consistent with the sign of the second operation result.
[0074] In some alternative implementations, the line segment splitting module 1002 includes: The first splitting unit is used to take the midpoint of the target line segment as the splitting point.
[0075] The second splitting unit splits the target line segment based on the splitting point to obtain multiple candidate line segments.
[0076] In some alternative implementations, the second analysis module 1004 includes: The second analysis subunit is used to take the midpoint of the target candidate line segment as the collision point.
[0077] The tool collision point analysis device provided in this embodiment of the invention can execute the tool collision point analysis method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0078] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0079] The following is a detailed reference. Figure 11 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1102 or a program loaded from memory 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the electronic device. The processor 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0080] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0081] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1109, or installed from a memory 1108, or installed from a ROM 1102. When the computer program is executed by the processor 1101, it performs the functions defined in the tool collision point analysis method of the embodiments of the present invention.
[0082] Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0083] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the tool collision point analysis method shown in the above embodiments is implemented.
[0084] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0085] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for analyzing tool collision points, characterized in that, The method includes: Obtain the rotary surface of the cutting tool and the target line segment on the workpiece opposite to the rotary surface; The target line segment is split to obtain multiple candidate line segments; For each candidate line segment, the two endpoints of the candidate line segment are projected onto the surface of revolution, and the collision point between the tool and the workpiece to be processed is analyzed based on the projection points of the two endpoints to determine whether the collision point is located in the candidate line segment. For the target candidate line segment where the collision point is located, if the length of the target candidate line segment is greater than a preset length threshold, then the target candidate line segment is taken as the next target line segment, and the step of splitting the target line segment is returned; if the length of the target candidate line segment is less than or equal to the preset length threshold, then the collision point is determined based on the target candidate line segment.
2. The method according to claim 1, characterized in that, Obtaining the target line segment on the workpiece to be processed that is opposite to the surface of revolution includes: The surface of revolution is projected onto the workpiece to be processed to obtain the projection range of the surface of revolution on the workpiece to be processed. The target line segment is determined based on the projection range.
3. The method according to claim 1, characterized in that, The two endpoints include a first endpoint and a second endpoint; the step of analyzing whether the collision point between the tool and the workpiece is located in the candidate line segment by projecting the points of the two endpoints includes: Obtain the direction vector of the target line segment, the first normal vector of the tangent plane where the projection point of the first endpoint is located, and the second normal vector of the tangent plane where the projection point of the second endpoint is located; Based on the direction vector, the first normal vector, and the second normal vector, it is analyzed whether the collision point is located on the candidate line segment.
4. The method according to claim 3, characterized in that, The step of analyzing whether the collision point is located within the candidate line segment based on the direction vector, the first normal vector, and the second normal vector includes: Perform vector operations on the first normal vector and the direction vector to obtain a first operation result; Perform vector operations on the second normal vector and the direction vector to obtain the second operation result; Based on the first calculation result and the second calculation result, analyze whether the collision point is located in the candidate line segment.
5. The method according to claim 4, characterized in that, The step of analyzing whether the collision point is located within the candidate line segment based on the first calculation result and the second calculation result includes: If the sign of the first calculation result is inconsistent with the sign of the second calculation result, then the collision point is determined to be located in the candidate line segment; If the sign of the first calculation result is the same as the sign of the second calculation result, then it is determined that the collision point is not located in the candidate line segment.
6. The method according to claim 1, characterized in that, The process of splitting the target line segment to obtain multiple candidate line segments includes: Use the midpoint of the target line segment as the splitting point; The target line segment is split based on the splitting point to obtain multiple candidate line segments.
7. The method according to claim 1, characterized in that, Determining the collision point based on the target candidate line segment includes: The midpoint of the target candidate line segment is taken as the collision point.
8. A tool collision point analysis device, characterized in that, The device includes: The data acquisition module is used to acquire the rotary surface of the cutting tool and the target line segment on the workpiece opposite to the rotary surface; The line segment splitting module is used to split the target line segment to obtain multiple candidate line segments; The first analysis module is used to project the two endpoints of each candidate line segment onto the surface of revolution, and analyze whether the collision point between the tool and the workpiece to be processed is located in the candidate line segment through the projection points of the two endpoints. The second analysis module is used to determine the collision point based on the target candidate line segment where the collision point is located. If the length of the target candidate line segment is greater than a preset length threshold, the target candidate line segment is used as the next target line segment, and the step of splitting the target line segment is returned. If the length of the target candidate line segment is less than or equal to the preset length threshold, the collision point is determined based on the target candidate line segment.
9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the tool collision point analysis method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the tool collision point analysis method according to any one of claims 1 to 7.
