A method and device for automatically generating complex surface numerical control planning
By obtaining the three-dimensional model and generating the optimal path, it solves the problem of path planning for complex-shaped workpieces in CNC machining, improves processing efficiency and quality, and is suitable for workpieces in a variety of industries.
Patent Information
- Application Number
- CN202410891635.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-07-04
AI Technical Summary
Existing CNC machining technology is difficult to find the optimal path for complex-shaped workpieces, making it difficult to improve processing efficiency and quality. Advanced CAD/CAM software still has limitations in complex path planning.
By obtaining the three-dimensional model of the workpiece to be processed, calculating its complexity and determining the number of cutting layers, extracting the plane area and curved surface area, the optimal processing path is automatically generated based on the height and complexity of the three-dimensional model to ensure the linearity and continuity of the path. and optimal fit.
It significantly improves the efficiency and accuracy of CNC machining, reduces the error rate in path planning and execution, and improves the quality and reliability of processed products. It is suitable for workpieces of various complex shapes and meets the processing needs of various industries.
Smart Images

Figure CN118426402B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of equipment control, and in particular relates to a method and a device for automatically generating numerical control planning of a complex surface. Background Art
[0002] Numerical Control Machining (NC or CNC for short) is a method of using computer programs to control machine tools for automated processing. It is widely used in various processing operations in the manufacturing industry, such as turning, milling, drilling and grinding.
[0003] CNC machining path planning is a key step in the CNC machining process, which directly affects the machining quality, efficiency and tool life. Through reasonable CNC machining path planning, the machining efficiency and quality can be significantly improved, while reducing machining costs and tool wear. Although CNC machining path planning has greatly improved machining efficiency and quality in many aspects, it still has some limitations and challenges. Workpieces with complex shapes require complex path planning, which usually requires highly customized paths, which may increase the difficulty and time of planning. Even with advanced CAD / CAM software, it is sometimes difficult to find the optimal path. This is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for automatically generating a complex surface numerical control plan to solve the technical problem of difficulty in finding an optimal path.
[0005] A first aspect of an embodiment of the present invention provides a method for automatically generating a complex surface numerical control plan, the method comprising:
[0006] Obtaining a three-dimensional model of a workpiece to be processed;
[0007] Calculating the complexity of the three-dimensional model, and determining the number of cutting layers according to the complexity and the height of the three-dimensional model;
[0008] Extracting a plane area and a curved surface area in the cutting layer;
[0009] generating a first processing path of the plane area according to the length direction of the plane area and the drill size;
[0010] generating a second processing path for the curved surface area according to the normal vector of the curved surface area;
[0011] The first processing path and the second processing path corresponding to each cutting layer are used as the numerical control path planning corresponding to the complex surface.
[0012] Furthermore, the step of calculating the complexity of the three-dimensional model and determining the number of cutting layers according to the complexity and the height of the three-dimensional model includes:
[0013] Obtaining Gaussian curvature and mean curvature of the three-dimensional model;
[0014] Calculating the complexity of the three-dimensional model according to the Gaussian curvature and the mean curvature;
[0015] The number of cutting layers is determined according to the complexity and the height of the three-dimensional model.
[0016] Furthermore, the step of calculating the complexity of the three-dimensional model according to the Gaussian curvature and the mean curvature includes:
[0017] Substituting the Gaussian curvature and the mean curvature into the following function 1 to obtain the complexity of the three-dimensional model;
[0018] The function 1 is:
[0019] ;
[0020] in, Indicates the complexity of the 3D model, represents the surface of a three-dimensional model, represents the Gaussian curvature, represents the mean curvature, Represents a small area element, and Represents the weight coefficient, which is used to adjust the contribution of Gaussian curvature and mean curvature to complexity.
[0021] Furthermore, the step of determining the number of cutting layers according to the complexity and the height of the three-dimensional model includes:
[0022] Substituting the complexity and the height of the three-dimensional model into function 2 to obtain the number of cutting layers;
[0023] The second function is:
[0024] ;
[0025] in, Indicates the number of cutting layers, represents the height of the three-dimensional model, represents the complexity of the three-dimensional model, and Represents the adjustment parameter, which is used to control the degree of refinement of the number of layers. Indicates rounding.
[0026] Further, the step of generating a first processing path of the plane area according to the length direction of the plane area and the drill size includes:
[0027] Extracting the longest line segment of the plane area;
[0028] According to the drill bit size, the step interval is matched; the step interval refers to the distance between two adjacent processing paths;
[0029] Extracting parallel line segments in the plane region that are parallel to the direction of the longest line segment according to the direction of the longest line segment and the step interval; wherein the distance between adjacent parallel line segments is the step interval;
[0030] Taking the endpoint of the shortest parallel line segment as the starting point, all line segments are combined into a first processing path; wherein adjacent line segments are connected in a serpentine manner.
[0031] Furthermore, the step of generating a second processing path of the curved surface area according to the normal vector of the curved surface area includes:
[0032] According to the drill bit size, the surface area is discretized into a plurality of quadrilateral units;
[0033] Extracting the center coordinates of a plurality of quadrilateral units, and fitting the plurality of center coordinates into a plurality of curves based on contour lines;
[0034] Taking the endpoint of the shortest curve as the starting point, all curves are combined into a second processing path; wherein adjacent curves are connected in a serpentine manner.
[0035] A second aspect of an embodiment of the present invention provides a device for automatically generating a complex surface numerical control plan, comprising:
[0036] An acquisition unit, used for acquiring a three-dimensional model of a workpiece to be processed;
[0037] A calculation unit, used for calculating the complexity of the three-dimensional model, and determining the number of cutting layers according to the complexity and the height of the three-dimensional model;
[0038] A cutting unit, used for extracting a unit for extracting a plane area and a curved surface area in the cutting layer;
[0039] A first generating unit, used for generating a first processing path of the plane area according to the length direction of the plane area and the drill size;
[0040] A second generating unit, used for generating a second processing path of the curved surface area according to the normal vector of the curved surface area;
[0041] The planning unit is used to plan the first processing path and the second processing path corresponding to each cutting layer as the numerical control path corresponding to the complex surface.
[0042] A third aspect of an embodiment of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.
[0043] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0044] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: by obtaining the three-dimensional model of the workpiece to be processed and calculating its complexity, the number of cutting layers is determined, and the plane area and the curved surface area are extracted. The number of cutting layers is automatically determined according to the height and complexity of the three-dimensional model, which can effectively optimize the cutting path of each layer, thereby improving the processing efficiency and accuracy and avoiding unnecessary repeated cutting. By extracting the plane area and the curved surface area in the cutting layer, the optimal processing path can be generated for the two areas respectively. The path of the plane area is generated according to the length direction and the drill bit size to ensure the linearity and continuity of the path; the path of the curved surface area is generated according to the normal vector to ensure the best fit between the path and the curved surface. For the first processing path and the second processing path generated for the plane area and the curved surface area respectively, the precision of CNC processing can be significantly improved through an accurate path planning algorithm, and the quality of the processed product can be guaranteed. The first processing path and the second processing path corresponding to each cutting layer are integrated into the CNC path planning of the complex curved surface, which can effectively reduce the error rate in path planning and execution during the processing process and improve the overall reliability and stability. Adaptive adjustment is made according to the specific complexity and height of the three-dimensional model, and it is applicable to workpieces of various complex shapes. It has strong universality and can meet the processing needs of various industries. In summary, the complex surface CNC planning automatic generation method of the present invention does not require the use of CAD / CAM software. Through automated path generation and optimization, precise area identification and efficient path integration, it realizes efficient and high-precision processing path planning for complex workpieces, significantly improving the efficiency and quality of CNC processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1A schematic flow chart of a complex surface numerical control planning automatic generation method provided by the present invention is shown;
[0047] Figure 2 A schematic diagram of a complex surface numerical control planning automatic generation device provided by an embodiment of the present invention is shown;
[0048] Figure 3 A schematic diagram of a terminal device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0049] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0050] The embodiment of the present invention provides a method and device for automatically generating a complex surface numerical control plan to solve the technical problem of difficulty in finding an optimal path.
[0051] First, the present invention provides a method for automatically generating complex surface numerical control planning. Figure 1 , Figure 1 FIG. 1 is a schematic flow chart of a method for automatically generating a complex surface numerical control plan provided by the present invention. Figure 1 As shown, the complex surface numerical control planning automatic generation method may include the following steps:
[0052] Step 101: Obtain a three-dimensional model of a workpiece to be processed;
[0053] Step 102: Calculate the complexity of the three-dimensional model, and determine the number of cutting layers according to the complexity and the height of the three-dimensional model;
[0054] Since the processing complexity of different workpieces to be processed is different, the more complex the workpiece to be processed, the more sophisticated the processing plan is required to improve the processing accuracy. Therefore, this application calculates the complexity of the three-dimensional model corresponding to the workpiece to be processed, and determines the number of cutting layers according to the complexity and the height of the three-dimensional model, so as to adjust the processing accuracy by controlling the number of cutting layers, and then adapt to the processing requirements of different workpieces to be processed. Among them, the specific execution logic of step 102 is as follows:
[0055] Specifically, step 102 specifically includes steps 1021 to 1023:
[0056] Step 1021: Obtaining Gaussian curvature and mean curvature of the three-dimensional model;
[0057] At multiple preset sampling points of the three-dimensional model, multiple Gaussian curvatures and multiple average curvatures are collected, and average values of the multiple Gaussian curvatures and the multiple average curvatures are used as the Gaussian curvature and the average curvature of the three-dimensional model.
[0058] Gaussian curvature is the intrinsic curvature of a surface at a point, defined as the product of the two principal curvatures of the surface at that point. Gaussian curvature can reveal the local geometric properties of the surface. Mean curvature is the average of the two principal curvatures of a surface at a point. It reflects the local curvature of the surface at that point. Both Gaussian curvature and mean curvature can provide meaningful information about the complexity of the surface. Gaussian curvature reflects the intrinsic geometric properties of the surface, while mean curvature focuses on the local curvature of the surface. By analyzing these two types of curvature, we can gain a deep understanding of the morphology and complexity of the surface.
[0059] Step 1022: Calculate the complexity of the three-dimensional model according to the Gaussian curvature and the mean curvature;
[0060] Specifically, step 1022 includes:
[0061] Substituting the Gaussian curvature and the mean curvature into the following function 1 to obtain the complexity of the three-dimensional model;
[0062] The function 1 is:
[0063] ;
[0064] in, Indicates the complexity of the 3D model, represents the surface of a three-dimensional model, represents the Gaussian curvature, represents the mean curvature, Represents a small area element, and Represents the weight coefficient, which is used to adjust the contribution of Gaussian curvature and mean curvature to complexity.
[0065] By integrating Gaussian curvature and mean curvature, function 1 can accurately describe the geometric complexity of the surface of a three-dimensional model. Gaussian curvature reflects the intrinsic curvature of the surface at each point, while mean curvature represents the local concavity and convexity of the surface. Combining these two curvatures, function 1 can fully reflect the geometric characteristics of the model.
[0066] in, Represents a very small area element, which is the basic unit for surface integration. On a three-dimensional surface, the surface tiny area element It can be considered as a very small area on the surface. It can be used to approximate the local properties of the surface.
[0067] For parametric surfaces ,in, Represents parameter coordinates, surface micro-area elements It can be expressed as:
[0068] ;
[0069] Step 1023: Determine the number of cutting layers according to the complexity and the height of the three-dimensional model.
[0070] Specifically, step 1023 includes:
[0071] Substituting the complexity and the height of the three-dimensional model into function 2 to obtain the number of cutting layers;
[0072] The second function is:
[0073] ;
[0074] in, Indicates the number of cutting layers, represents the height of the three-dimensional model, represents the complexity of the three-dimensional model, and Represents the adjustment parameter, which is used to control the degree of refinement of the number of layers. Indicates rounding.
[0075] The number of cutting layers is adaptively determined based on the geometric complexity and height of the model. This means that for areas with higher complexity, the cutting will be finer, thereby improving the processing accuracy and surface quality of the model. For areas with lower complexity, the number of cutting layers can be reduced, saving processing time and resources.
[0076] The parameters in the above formula (such as , , and ) can be adjusted according to actual needs. To adapt to different types of 3D models and different processing requirements, and provide better cutting solutions.
[0077] By reasonably determining the number of cutting layers, the processing efficiency can be maximized. More cutting layers are used in complex areas, while fewer layers are used in simple areas, which not only ensures the processing quality but also avoids unnecessary waste of time.
[0078] In this embodiment, by obtaining the Gaussian curvature and mean curvature of the three-dimensional model, the geometric complexity of the model surface can be effectively evaluated. As two important parameters for describing the surface, Gaussian curvature and mean curvature can fully reflect the degree of concave-convex changes and shape characteristics of the model surface, thereby providing accurate data support for the calculation of complexity. By comprehensively considering Gaussian curvature and mean curvature, the geometric complexity of the three-dimensional model can be more accurately quantified. On this basis, the number of cutting layers can be reasonably determined according to the calculated complexity and the height of the three-dimensional model. The more complex the area, the more details it usually means, and the higher the cutting accuracy is required. Therefore, by combining complexity with height to determine the number of cutting layers, it is possible to achieve refined control of different complexity areas and improve the accuracy and efficiency of cutting. In addition, the method can optimize the number of cutting layers while ensuring the cutting quality, thereby effectively reducing cutting time and resource consumption. In general, the technical solution significantly improves the accuracy and efficiency of three-dimensional model cutting by determining the number of cutting layers based on the complexity calculation of Gaussian curvature and mean curvature combined with the model height.
[0079] Step 103: extracting a plane area and a curved surface area in the cutting layer;
[0080] Step 104: generating a first processing path of the plane area according to the length direction of the plane area and the drill size;
[0081] Specifically, step 104 includes steps 1041 to 1042:
[0082] Step 1041: extracting the longest line segment of the plane area;
[0083] In a planar region, the longest line segment can be found by geometric algorithms. The longest line segment determines the main direction of machining.
[0084] Step 1042: Matching the stepping interval according to the drill size; the stepping interval refers to the distance between two adjacent processing paths;
[0085] Since the drill bit size affects the width of each cut, the selection of the step interval needs to ensure that there is no omission and no excessive overlap between the processing paths. In this application, different drill bit sizes correspond to different step intervals.
[0086] Step 1043: extracting parallel line segments in the plane region that are parallel to the direction of the longest line segment according to the direction of the longest line segment and the step interval; wherein the distance between adjacent parallel line segments is the step interval;
[0087] Based on the direction of the longest line segment, several line segments parallel to the longest line segment are generated with the step interval as the spacing. These line segments cover the entire plane area and form multiple processing paths.
[0088] Step 1045: Taking the endpoint of the shortest parallel line segment as the starting point, all line segments are combined into a first processing path; wherein adjacent line segments are connected in a serpentine manner.
[0089] When connecting these parallel line segments into a continuous processing path, a serpentine connection method is used. This method can reduce empty strokes and improve processing efficiency. Specifically, after processing a line segment, the path will turn to the nearest adjacent parallel line segment and continue processing, forming a continuous path without breakpoints.
[0090] The serpentine connection method means: starting from the starting point, processing along the first parallel line segment until reaching the end point of the line segment. After reaching the end point of the first parallel line segment, turn to the end point of the nearest adjacent parallel line segment. This turn can be upward or downward, depending on the specific situation. At the end point of the adjacent parallel line segment, continue processing in the opposite direction of the line segment until reaching the other end of the line segment. Repeat the above steps, turn at the end of each parallel line segment and connect to the end point of the next adjacent parallel line segment. Continue this method to process each parallel line segment in turn.
[0091] In this embodiment, the longest line segment of the planar area is extracted to ensure that the directionality of the processing path is optimal. According to the drill bit size, the step interval is matched. The setting of the step interval not only takes into account the coverage effect of the processing path, but also ensures that the distance between the processing paths is uniform, avoiding repeated processing or omissions. According to the direction of the longest line segment, the parallel line segments parallel to it are extracted, and these line segments are combined into the first processing path through a serpentine connection method. This method can minimize the invalid stroke of the processing path and improve the processing efficiency. At the same time, taking the endpoint of the shortest parallel line segment as the starting point ensures the continuity and consistency of the path planning, and reduces the possible pauses and adjustment time during the processing process. In general, this technical solution significantly improves the processing efficiency and accuracy, and reduces the processing time and cost.
[0092] Step 105: generating a second processing path of the curved surface area according to the normal vector of the curved surface area;
[0093] Specifically, step 105 specifically includes steps 1051 to 1053:
[0094] Step 1051: discretizing the curved surface area into a plurality of quadrilateral units according to the drill bit size;
[0095] According to the size of the drill, the surface area to be processed is discretized into multiple quadrilateral units. The continuous surface is divided into many small, regular quadrilateral areas to facilitate subsequent path planning and processing operations.
[0096] Step 1052: extracting the center coordinates of a plurality of quadrilateral elements, and fitting the plurality of center coordinates into a plurality of curves based on the contour lines;
[0097] Extract the center coordinates of each quadrilateral element. These center points will be used to define a series of new curves representing the middle points of the machining path.
[0098] Using the contour method, these center coordinates are fitted into multiple curves. Contour lines usually refer to the technology of connecting points at the same height or depth into lines, which is used here to generate smooth processing paths. Each curve reflects the shape of a horizontal layer on the surface.
[0099] Step 1053: Taking the endpoint of the shortest curve as the starting point, all curves are combined into a second processing path; wherein adjacent curves are connected in a serpentine manner.
[0100] Select the endpoint of the shortest curve from the fitted curves as the starting point to start generating the machining path. Combine all the fitted curves in a certain order to form a complete machining path. This helps to ensure that the starting point of the path is reasonable and that the generation of the path has a certain optimization effect. Adjacent curves are connected in a serpentine manner, which means that between two adjacent segments of the path, the path will be connected in a zigzag form. This connection method can minimize the empty stroke between the paths, improve the machining efficiency, and ensure the continuity and smoothness of the machining path.
[0101] In this embodiment, the surface area is discretized into a plurality of quadrilateral units according to the drill bit size. This discretization method can ensure that the surface is reasonably segmented under the premise of considering the size of the processing tool, and ensure that the size of each unit matches the processing tool, thereby avoiding the situation of over-cutting or under-cutting that may occur during the processing. Next, the center coordinates of the plurality of quadrilateral units are extracted, and the plurality of center coordinates are fitted into a plurality of curves based on the contour lines. This step fits the center coordinates of the discretized quadrilateral units into curves through the contour lines, which not only retains the shape characteristics of the surface, but also simplifies the complexity of the path planning, so that the generated curve can better conform to the shape of the actual surface. Then, taking the endpoint of the shortest curve as the starting point, all the curves are combined into the second processing path. This method optimizes the starting point position of the processing path by selecting the endpoint of the shortest curve as the starting point, reduces the total length of the processing path, and thus improves the processing efficiency. Finally, a serpentine connection method is adopted between adjacent curves. This connection method can effectively reduce the empty stroke in the processing path and further optimize the processing efficiency. In addition, the serpentine connection can also balance the range of motion of the machine tool in path planning, reduce the frequent turning of the machine tool, and thus improve the processing stability and processing quality. Overall, this technical solution significantly improves the generation efficiency and accuracy of the second processing path of the curved surface area through a reasonable discretization method, accurate extraction and fitting of the center coordinates, optimized path starting point selection, and efficient serpentine connection, reduces processing time, and improves processing quality and stability.
[0102] Step 106: Use the first processing path and the second processing path corresponding to each cutting layer as numerical control path planning corresponding to the complex surface.
[0103] In this embodiment, by obtaining the three-dimensional model of the workpiece to be processed and calculating its complexity, the number of cutting layers is determined, and the plane area and the curved surface area are extracted. The number of cutting layers is automatically determined according to the height and complexity of the three-dimensional model, which can effectively optimize the cutting path of each layer, thereby improving the processing efficiency and accuracy and avoiding unnecessary repeated cutting. By extracting the plane area and the curved surface area in the cutting layer, the optimal processing path can be generated for the two areas respectively. The path of the plane area is generated according to the length direction and the drill bit size to ensure the linearity and continuity of the path; the path of the curved surface area is generated according to the normal vector to ensure the best fit between the path and the curved surface. For the first processing path and the second processing path generated for the plane area and the curved surface area respectively, the precision of CNC processing can be significantly improved through the precise path planning algorithm, and the quality of the processed product can be ensured. The first processing path and the second processing path corresponding to each cutting layer are integrated into the CNC path planning of the complex surface, which can effectively reduce the error rate in path planning and execution during the processing process, and improve the overall reliability and stability. Adaptive adjustment is performed according to the specific complexity and height of the three-dimensional model, which is suitable for workpieces of various complex shapes, has strong universality, and can meet the processing needs of various industries. In summary, the complex surface CNC planning automatic generation method of the present invention does not require the use of CAD / CAM software. Through automated path generation and optimization, precise area identification and efficient path integration, it realizes efficient and high-precision machining path planning for complex workpieces, significantly improving the efficiency and quality of CNC machining.
[0104] like Figure 2 The present invention provides a complex surface numerical control planning automatic generation device, see Figure 2 , Figure 2 FIG. 1 shows a schematic diagram of a complex surface numerical control planning automatic generation device provided by the present invention, such as Figure 2 The complex surface numerical control planning automatic generation device shown comprises:
[0105] An acquisition unit 21, used for acquiring a three-dimensional model of a workpiece to be processed;
[0106] A calculation unit 22, used for calculating the complexity of the three-dimensional model, and determining the number of cutting layers according to the complexity and the height of the three-dimensional model;
[0107] A cutting unit 23, used as an extraction unit, is used to extract a plane area and a curved surface area in the cutting layer;
[0108] A first generating unit 24, configured to generate a first processing path of the plane area according to the length direction of the plane area and the drill size;
[0109] A second generating unit 25, configured to generate a second processing path of the curved surface area according to the normal vector of the curved surface area;
[0110] The planning unit 26 is used to plan the first processing path and the second processing path corresponding to each cutting layer as the numerical control path corresponding to the complex surface.
[0111] The present invention provides a complex surface CNC planning automatic generation device, which obtains a three-dimensional model of a workpiece to be processed and calculates its complexity, determines the number of cutting layers, and extracts plane areas and surface areas. The number of cutting layers is automatically determined according to the height and complexity of the three-dimensional model, which can effectively optimize the cutting path of each layer, thereby improving processing efficiency and precision and avoiding unnecessary repeated cutting. By extracting the plane area and the surface area in the cutting layer, the optimal processing path can be generated for the two areas respectively. The path of the plane area is generated according to the length direction and the drill bit size to ensure the linearity and continuity of the path; the path of the surface area is generated according to the normal vector to ensure the best fit between the path and the surface. For the first processing path and the second processing path generated for the plane area and the surface area respectively, the precision of CNC processing can be significantly improved through an accurate path planning algorithm, and the quality of the processed product can be guaranteed. The first processing path and the second processing path corresponding to each cutting layer are integrated into the CNC path planning of the complex surface, which can effectively reduce the error rate in path planning and execution during the processing process, and improve the overall reliability and stability. Adaptive adjustment is made according to the specific complexity and height of the three-dimensional model, and it is applicable to workpieces of various complex shapes. It has strong universality and can meet the processing needs of various industries. In summary, the complex surface CNC planning automatic generation method of the present invention does not require the use of CAD / CAM software. Through automated path generation and optimization, precise area identification and efficient path integration, it realizes efficient and high-precision processing path planning for complex workpieces, significantly improving the efficiency and quality of CNC processing.
[0112] Figure 3 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 3 As shown, a terminal device 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program for automatically generating a complex surface numerical control plan. When the processor 30 executes the computer program 32, the steps in each of the above-mentioned embodiments of the method for automatically generating a complex surface numerical control plan are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 2 Function of the unit shown.
[0113] Exemplarily, the computer program 32 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 32 in the terminal device 3. For example, the computer program 32 may be divided into the following specific functions of each unit:
[0114] An acquisition unit, used for acquiring a three-dimensional model of a workpiece to be processed;
[0115] A calculation unit, used for calculating the complexity of the three-dimensional model, and determining the number of cutting layers according to the complexity and the height of the three-dimensional model;
[0116] A cutting unit, used for extracting a unit for extracting a plane area and a curved surface area in the cutting layer;
[0117] A first generating unit, used for generating a first processing path of the plane area according to the length direction of the plane area and the drill size;
[0118] A second generating unit, used for generating a second processing path of the curved surface area according to the normal vector of the curved surface area;
[0119] The planning unit is used to plan the first processing path and the second processing path corresponding to each cutting layer as the numerical control path corresponding to the complex surface.
[0120] The terminal device includes but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0121] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0122] The memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used to store the computer program and other programs and data required by the roaming control device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0123] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0124] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0125] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0126] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0127] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0128] If the integrated unit 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, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0131] In the embodiments provided by the present invention, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed over multiple network units.
[0133] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0134] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0135] As used in the present specification and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to monitoring, depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is monitored" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is monitored" or "in response to monitoring [described condition or event]", depending on the context.
[0136] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0137] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0138] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for automatically generating complex surface numerical control planning, characterized in that: The complex surface numerical control planning automatic generation method comprises: Obtaining a three-dimensional model of a workpiece to be processed; Obtaining Gaussian curvature and mean curvature of the three-dimensional model; Calculating the complexity of the three-dimensional model according to the Gaussian curvature and the mean curvature; Substituting the complexity and the height of the three-dimensional model into function 2 to obtain the number of cutting layers; The second function is: ; in, Indicates the number of cutting layers, represents the height of the three-dimensional model, represents the complexity of the three-dimensional model, and Represents the adjustment parameter, which is used to control the degree of refinement of the number of layers. Indicates rounding; Extracting a plane area and a curved surface area in the cutting layer; generating a first processing path of the plane area according to the length direction of the plane area and the drill size; generating a second processing path for the curved surface area according to the normal vector of the curved surface area; The first processing path and the second processing path corresponding to each cutting layer are used as the numerical control path planning corresponding to the complex surface.
2. The method for automatically generating complex surface numerical control planning according to claim 1, characterized in that: The step of calculating the complexity of the three-dimensional model according to the Gaussian curvature and the mean curvature comprises: Substituting the Gaussian curvature and the mean curvature into the following function 1 to obtain the complexity of the three-dimensional model; The function 1 is: ; in, Indicates the complexity of the 3D model, represents the surface of a three-dimensional model, represents the Gaussian curvature, represents the mean curvature, Represents a small area element, and Represents the weight coefficient, which is used to adjust the contribution of Gaussian curvature and mean curvature to complexity.
3. The method for automatically generating complex surface numerical control planning according to claim 1, characterized in that: The step of generating a first processing path of the plane area according to the length direction of the plane area and the drill bit size comprises: Extracting the longest line segment of the plane area; According to the drill bit size, the step interval is matched; the step interval refers to the distance between two adjacent processing paths; Extracting parallel line segments in the plane region that are parallel to the direction of the longest line segment according to the direction of the longest line segment and the step interval; wherein the distance between adjacent parallel line segments is the step interval; Taking the endpoint of the shortest parallel line segment as the starting point, all line segments are combined into a first processing path; wherein adjacent line segments are connected in a serpentine manner.
4. The method for automatically generating complex surface numerical control planning according to claim 1, characterized in that: The step of generating a second processing path of the curved surface area according to the normal vector of the curved surface area comprises: According to the drill bit size, the surface area is discretized into a plurality of quadrilateral units; Extracting the center coordinates of a plurality of quadrilateral units, and fitting the plurality of center coordinates into a plurality of curves based on contour lines; Taking the endpoint of the shortest curve as the starting point, all curves are combined into a second processing path; wherein adjacent curves are connected in a serpentine manner.
5. A complex surface numerical control planning automatic generation device, characterized in that: The complex surface numerical control planning automatic generation device comprises: An acquisition unit, used for acquiring a three-dimensional model of a workpiece to be processed; A calculation unit, used for obtaining Gaussian curvature and average curvature of the three-dimensional model; calculating the complexity of the three-dimensional model according to the Gaussian curvature and the average curvature; substituting the complexity and the height of the three-dimensional model into function 2 to obtain the number of cutting layers; The second function is: ; in, Indicates the number of cutting layers, represents the height of the three-dimensional model, represents the complexity of the three-dimensional model, and Represents the adjustment parameter, which is used to control the degree of refinement of the number of layers. Indicates rounding; A cutting unit, used for extracting a unit for extracting a plane area and a curved surface area in the cutting layer; A first generating unit, used for generating a first processing path of the plane area according to the length direction of the plane area and the drill size; A second generating unit, used for generating a second processing path of the curved surface area according to the normal vector of the curved surface area; The planning unit is used to plan the first processing path and the second processing path corresponding to each cutting layer as the numerical control path corresponding to the complex surface.
6. A terminal device, characterized in that: The device includes: a memory, a processor, and a complex surface CNC planning automatic generation program stored in the memory and executable on the processor, wherein the complex surface CNC planning automatic generation program is configured to implement the steps of the complex surface CNC planning automatic generation method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
