File conversion method, device and equipment for template processing and readable storage medium

By splitting and compensating the cutting path of the cutter head, the DXF file is converted into NC code, which solves the problem of low conversion efficiency of DXF file in the existing technology, realizes the automation and efficiency improvement of template processing, and provides unmanned template factories with Key technical support.

CN118966157APending Publication Date: 2024-11-15GLODON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410983445.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the prior art, the efficiency of converting DXF files to NC files is low, resulting in inefficient template processing and lack of effective solutions.

Method used

By obtaining template information and identification in the DXF file, splitting the file, identifying and parsing the template shape and depth, determining the candidate cutting path, and compensating according to the radius width of the cutting head, generating the target cutting path, and finally turning it into Convert to NC code to control CNC machine tools for automated processing.

Benefits of technology

It improves the efficiency of template processing, reduces manual operations, saves costs, and provides a key technical foundation for unmanned template factories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118966157A_ABST
    Figure CN118966157A_ABST
Patent Text Reader

Abstract

The invention discloses a file conversion method and device for template processing, equipment and a readable storage medium, and the method comprises the steps: obtaining a DXF file used for template processing, the DXF file comprises a plurality of pieces of to-be-processed template information and a plurality of template identifiers, and the to-be-processed template information uniquely corresponds to the template identifiers; splitting the DXF file through the template identifier to obtain a plurality of intermediate files; identifying and analyzing a template shape and a template depth of the intermediate file, and determining a candidate tool bit cutting path according to the template shape and the template depth; the radius width of the cutting tool bit is obtained, the candidate tool bit cutting path is compensated through the radius width of the cutting tool bit, and a target tool bit cutting path is generated; and the target tool bit cutting path is converted into an NC code, and a numerical control machine tool is controlled to execute the NC code, so that automatic machining of the template is achieved. The algorithm for converting the DXF file into the NC file is provided, efficiency is improved, manual operation is omitted, and cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer-aided design, and in particular to a file conversion method, device, equipment and readable storage medium for template processing. Background Art

[0002] Formwork engineering in construction refers to a series of temporary structures designed and manufactured for pouring concrete. These structures are used to support and shape concrete until the concrete hardens and can bear its own weight. Formwork engineering is a very critical link in construction, which directly affects the structural quality, appearance and construction efficiency of the building. During the construction process, the installation, adjustment and removal of the formwork must be carried out in accordance with the design requirements and construction specifications to ensure the safety of the structure and the quality of construction.

[0003] Existing template processing is usually achieved in the following way: first design the template (DWG or DXF file) through CAD software; use CAM software to manually convert the DWG or DXF file into an NC file; and finally execute the NC file through a CNC machine. However, since CAD and CAM software are two sets of software, data transmission relies on manual transmission; at the same time, manual operation of CAM software to edit, configure, and manually edit NC files, the efficiency of template processing is low.

[0004] There is currently no effective solution to the technical problem of low efficiency in manually converting DXF files into NC files to achieve template processing in the prior art. Summary of the invention

[0005] The purpose of the present invention is to provide a file conversion method, device, equipment and readable storage medium for template processing, which can solve the technical problem of low efficiency in converting DXF files into NC files for template processing in the prior art.

[0006] One aspect of the present invention provides a file conversion method for template processing, the method comprising: obtaining a DXF file for template processing, wherein the DXF file contains multiple template information to be processed and multiple template identifiers, and the template information to be processed uniquely corresponds to the template identifier; splitting the DXF file according to the template identifier to obtain multiple intermediate files; identifying and parsing the template shape and template depth of the intermediate file, and determining a candidate tool head cutting path according to the template shape and template depth; obtaining the radius width of the cutting head, compensating the candidate tool head cutting path according to the radius width of the cutting head, and generating a target tool head cutting path; converting the target tool head cutting path into NC code, and controlling the CNC machine tool to execute the NC code to realize automated processing of the template.

[0007] Optionally, candidate tool head cutting paths are determined based on the template shape and template depth, including: determining the feature points of the template to be processed through the template shape and template depth; performing path planning on the feature points of the template to be processed to generate multiple tool head cutting paths; calculating the lengths of the tool head cutting paths respectively, and screening out a predetermined number of tool head cutting paths with the shortest length as the first tool head cutting paths; interchange the feature points of different first tool head cutting paths respectively to generate multiple second tool head cutting paths; interchange the feature points in each second tool head cutting path respectively to generate multiple third tool head cutting paths; calculating the length of the third tool head cutting path, and determining the shortest third tool head cutting path as the candidate tool head cutting path.

[0008] Optionally, the candidate tool head cutting path is compensated by the radius width of the cutting head to generate a target tool head cutting path, including: parsing to obtain multiple graphic bounding boxes contained in the template shape, wherein the image bounding box contains feature points of the candidate tool head cutting path; determining the path compensation direction through the nested relationship of the graphic bounding boxes; according to the radius width of the cutting head, the feature points of the candidate tool head cutting path are offset along the path compensation direction, and the offset feature points are connected to generate the target tool head cutting path.

[0009] Optionally, the path compensation direction is determined by the nesting relationship of the graphic bounding boxes, including: determining the path compensation direction of the largest graphic bounding box as an outward offset; determining the nesting relationship level of other graphic bounding boxes with the largest graphic bounding box, and determining the path compensation direction of other graphic bounding boxes according to the nesting relationship level; if the nesting relationship level of other graphic bounding boxes with the largest graphic bounding box is an odd number, determining the path compensation direction of other graphic bounding boxes as an inward offset; if the nesting relationship level of other graphic bounding boxes with the largest graphic bounding box is an even number, determining the path compensation direction of other graphic bounding boxes as an outward offset.

[0010] Optionally, the target tool head cutting path is converted into NC code, and the CNC machine tool is controlled to execute the NC code, including: step 1, in response to the start instruction of template processing, obtaining tool attribute information and processing feed rate; step 2, presetting the CNC machine tool through the tool attribute information and processing feed rate to obtain an initialized CNC machine tool; step 3, processing the template to be processed based on the initialized CNC machine tool according to the NC code obtained by executing the conversion; step 4, judging whether there is graphic information in the NC code, if so, returning to step 2, otherwise, executing step 5; step 5, controlling the tool of the CNC machine tool to stop rotating and the program of template processing to stop, and the template processing operation ends.

[0011] Optionally, according to the NC code obtained by executing the conversion, the template to be processed is processed based on the initialized CNC machine tool, including: moving the tool of the initialized CNC machine tool to the first graphic element position of the template to be processed through the NC code; controlling the tool to move downward in the direction close to the template to be processed until the tool is tangent to the template to be processed; controlling the tool to move according to the path information in the NC code; after the tool passes through the last graphic element in the NC code, controlling the tool to move up and restore in the direction away from the template to be processed; restoring the feed rate of the CNC machine tool, and the corresponding processing flow of the template to be processed ends.

[0012] Another aspect of the present invention provides a file conversion device for template processing, the device comprising: an acquisition module, used to acquire a DXF file for template processing, wherein the DXF file contains multiple template information to be processed and multiple template identifiers, and the template information to be processed uniquely corresponds to the template identifier; a splitting module, used to split the DXF file by template identifier to obtain multiple intermediate files; a path determination module, used to identify and parse the template shape and template depth of the intermediate file, and determine a candidate tool head cutting path according to the template shape and template depth; a compensation module, used to acquire the radius width of the cutting head, compensate the candidate tool head cutting path by the radius width of the cutting head, and generate a target tool head cutting path; a conversion module, used to convert the target tool head cutting path into NC code, and control the CNC machine tool to execute the NC code to realize automated processing of the template.

[0013] Optionally, the path determination module is also used to: determine the feature points of the template to be processed through the template shape and template depth; perform path planning on the feature points of the template to be processed to generate multiple tool head cutting paths; calculate the lengths of the tool head cutting paths respectively, and screen out a predetermined number of tool head cutting paths with the shortest length as the first tool head cutting paths; interchange the feature points of different first tool head cutting paths respectively to generate multiple second tool head cutting paths; interchange the feature points in each second tool head cutting path respectively to generate multiple third tool head cutting paths; calculate the length of the third tool head cutting path, and determine the shortest third tool head cutting path as the candidate tool head cutting path.

[0014] Another aspect of the present invention provides a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the file conversion method for template processing of any of the above-mentioned embodiments when executing the computer program.

[0015] Another aspect of the present invention provides a computer storage medium having a computer program stored thereon, which implements the file conversion method for template processing of any of the above embodiments when the computer program is executed by a processor. Further, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of a blockchain node, etc.

[0016] The present invention provides a DXF file to NC file conversion algorithm, which can automatically convert the BIM design file of the template into a CNC machine tool control instruction NC file, improve efficiency, omit manual operation, save costs, and at the same time lay a key technical foundation for the subsequent establishment of a fully automatic unmanned template factory on the construction site. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0018] Figure 1 An optional flow chart of the file conversion method for template processing provided in the first embodiment of the present invention is shown;

[0019] Figure 2 A structural block diagram of a file conversion device for template processing provided by Embodiment 2 of the present invention is shown; and

[0020] Figure 3 A block diagram of a computer device suitable for implementing a file conversion method for template processing provided by a third embodiment of the present invention is shown. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0022] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0023] Embodiment 1

[0024] This embodiment provides a file conversion method for template processing. Figure 1 A flowchart of the template processing file conversion method is shown, as shown in Figure 1 As shown, the template processing file conversion method may include steps S101 to S105, wherein:

[0025] Step S101, obtaining a DXF file for template processing, wherein the DXF file contains a plurality of template information to be processed and a plurality of template identifiers, and the template information to be processed and the template identifier are uniquely corresponding;

[0026] A DXF file is a text file that stores detailed information of a graphic in the form of ASCII code and is used to exchange graphic data between different CAD applications. It contains all the information of the template graphic to be processed, including geometric shape, layer, line type, color, size, etc.

[0027] The template identification may be a template number, which is used to distinguish different types of templates to be processed.

[0028] Step S102, splitting the DXF file by template identification to obtain multiple intermediate files;

[0029] There is only one type of information about the template to be processed in an intermediate file. Splitting the DXF file into multiple intermediate files can effectively avoid confusion between different types of data during template processing, greatly improving the efficiency of template processing.

[0030] Step S103, identifying and parsing the template shape and template depth of the intermediate file, and determining a candidate tool head cutting path according to the template shape and template depth;

[0031] The template shape and template depth are set by the designer according to the scene requirements.

[0032] The candidate tool head cutting path may be a combination of contour lines and connecting lines (line segments between different contour lines) of all graphics of the template.

[0033] When different construction workers process the same template, due to different personal habits, the same template has different processing procedures, and the corresponding time of different processing procedures is also different. Some processing procedures will seriously reduce the processing efficiency of the template and affect the smooth progress of actual construction. The determination of the candidate cutting path provides the shortest and most effective solution for the actual processing of the CNC machine tool. Processing the template based on the planned path greatly improves the efficiency of template processing.

[0034] Step S104, obtaining the radius width of the cutting head, compensating the candidate cutting path of the cutting head by the radius width of the cutting head, and generating a target cutting path of the cutting head;

[0035] Since the cutting head of the CNC machine tool has a radius width, if the center of the cutting head is cut along the candidate cutting path, the shape of the template will be destroyed, resulting in precision errors, and the processed template cannot be directly used on the construction site. The candidate cutting path is compensated by the radius width of the cutting head, so that the outline of the cutting head of the CNC machine tool is tangent to the outline of the template image, thereby ensuring more accurate processing accuracy of the template.

[0036] Step S105, converting the target tool head cutting path into NC code, and controlling the CNC machine tool to execute the NC code to realize automatic processing of the template.

[0037] The purpose of converting the target tool head cutting path into NC code is to solve the problems of when to call the instruction, what instruction to call, what the instruction parameters are, etc., which can realize the automatic processing of the target by the CNC machine tool and improve the efficiency of template processing.

[0038] Preferably, step S103 may include steps S1031 to S1036, wherein:

[0039] Step S1031, determining the feature points of the template to be processed according to the template shape and template depth;

[0040] The feature point may be a corner vertex (such as a rectangle vertex) or a cross-section center (such as a hole cross-section center) of a graphic in the template.

[0041] Step S1032, performing path planning on the feature points of the template to be processed to generate multiple tool head cutting paths;

[0042] Path planning can generate multiple paths by connecting feature points in different orders.

[0043] Step S1033, respectively calculating the lengths of the tool head cutting paths, and selecting a predetermined number of tool head cutting paths with the shortest lengths as the first tool head cutting paths;

[0044] The reservation quantity can be set according to the scene requirements and there is no limit here.

[0045] Step S1034, exchanging feature points of different first tool head cutting paths respectively to generate multiple second tool head cutting paths;

[0046] Step S1035, respectively interchange the characteristic points in each second tool head cutting path to generate multiple third tool head cutting paths;

[0047] Step S1036, calculating the length of the third tool head cutting path, and determining the shortest third tool head cutting path as the candidate tool head cutting path.

[0048] It should be noted that in step S1036, after calculating the length of the third tool head cutting path, the process can return to step S1033 to continue executing the subsequent steps until the specified number of iterations is reached, and then the shortest tool head cutting path is selected as the candidate tool head cutting path.

[0049] In addition, during path planning, additional path corrections can be made based on the following business requirements: 1) punch holes first and then cut contours; 2) cut small contours first and then large contours.

[0050] When implementing path planning, the above-mentioned genetic algorithm starts searching from multiple paths, which has a wide coverage and is conducive to global optimization; it processes multiple paths at the same time, that is, evaluates multiple solutions in the search space, which reduces the risk of falling into a local optimal solution. At the same time, the algorithm itself is easy to parallelize.

[0051] Preferably, step S104 may include steps S1041 to S1043, wherein:

[0052] Step S1041, parsing and obtaining a plurality of graphic bounding boxes contained in the template shape, wherein the image bounding box contains feature points of the candidate tool head cutting path;

[0053] Step S1042, determining the path compensation direction through the nested relationship of the graphic bounding boxes;

[0054] The path compensation direction includes outward offset and inward offset. Outward offset means that the node at the corresponding position of the tool cutting path is offset toward the outer area of ​​the outline of the template figure; inward offset means that the node at the corresponding position of the tool cutting path is offset toward the inner area of ​​the outline of the template figure.

[0055] Specifically, S1042 is implemented by the following steps A1 to A4:

[0056] Step A1, determining the path compensation direction of the maximum graphic boundary box to be offset outward;

[0057] The outermost graphic area of ​​the template is usually processed in cutting mode. Some nodes of the candidate tool head cutting path are obtained through the corner vertices of the graphic. In order to maintain the integrity of the maximum graphic bounding box, when cutting the maximum graphic bounding box, the path compensation direction of the maximum graphic bounding box should be determined as an outward offset.

[0058] Step A2, determining the nesting relationship level between other graphic bounding boxes and the maximum graphic bounding box, and determining the path compensation direction of other graphic bounding boxes according to the nesting relationship level;

[0059] The nesting relationship levels include odd-numbered levels and even-numbered levels. Among them, the odd-numbered levels can be level 1, level 3, level 5... the even-numbered levels can be level 2, level 4, level 6...

[0060] Step A3: if the nesting relationship level between the other graphic bounding boxes and the maximum graphic bounding box is an odd number, then determining the path compensation direction of the other graphic bounding boxes to be inward offset;

[0061] Step A4: if the nesting relationship level between the other graphic bounding boxes and the maximum graphic bounding box is an even level, then the path compensation direction of the other graphic bounding boxes is determined to be outward offset.

[0062] The above steps are explained below by using an example, which does not limit the present technical solution.

[0063] The template to be processed includes graphics A (rectangle), B (circle), C (circle), D (rectangle), and E (circle). A contains B, C, D, and E, B contains D and E, and D contains E. It can be seen that A is the largest graphic bounding box, and the path compensation direction is outward offset; the nesting relationship level of B, C, and E with A is an odd level, and the path compensation direction of B, C, and E is inward offset; the nesting relationship level of D with A is an even level, and the path compensation direction of D is outward offset.

[0064] Step S1043, according to the radius width of the cutting head, the feature points of the candidate tool head cutting path are offset along the path compensation direction, and the offset feature points are connected to generate the target tool head cutting path.

[0065] After determining the path compensation direction of each template figure, find the feature points corresponding to each template figure in the candidate tool head cutting path, and offset the cutting tool head radius width in the path compensation direction. Connect the offset feature points to generate the target tool head cutting path.

[0066] This embodiment takes into account the width of the tool head radius and corrects the candidate tool head cutting path to ensure that the template meets the actual design standards during the processing and has higher accuracy.

[0067] Preferably, step S105 may include the following steps:

[0068] Step 1, in response to a start instruction of template processing, obtaining tool attribute information and processing feed rate;

[0069] Step 2, presetting the CNC machine tool through tool attribute information and machining feed rate to obtain an initialized CNC machine tool;

[0070] Tool attribute information can include radius compensation value, length compensation value, tool motion information (rapid movement, linear interpolation, circular interpolation), and spindle speed. Machining feed rate includes linear feed rate and vertical feed rate.

[0071] Step 3, according to the NC code obtained by executing the conversion, the template to be processed is processed based on the initialized CNC machine tool;

[0072] Step 4, determine whether there is graphic information in the NC code, if so, return to step 2, otherwise, execute step 5;

[0073] Step 5, controlling the tool of the CNC machine tool to stop rotating and the template processing program to stop, and the template processing operation ends.

[0074] Preferably, the template to be processed is processed based on the initialized numerical control machine tool according to the NC code obtained by executing the conversion, including:

[0075] Move the tool of the initialized CNC machine tool to the first element position of the template to be processed through the NC code;

[0076] Control the tool to move downward in a direction close to the template to be processed until the tool is tangent to the template to be processed;

[0077] Control the tool to move according to the path information in the NC code;

[0078] After the tool passes through the last primitive in the NC code, the tool is controlled to move up and down in a direction away from the template to be processed to recover;

[0079] The feed rate of the CNC machine tool is restored, and the processing flow of the corresponding template to be processed is completed.

[0080] This embodiment provides a DXF file to NC file conversion algorithm, which can automatically convert the BIM design file of the template into a CNC machine tool control instruction NC file, improve efficiency, omit manual operations, save costs, and at the same time lay a key technical foundation for the subsequent establishment of a fully automatic unmanned template factory on the construction site.

[0081] Embodiment 2

[0082] The second embodiment of the present invention further provides a file conversion device for template processing, which corresponds to the file conversion method for template processing provided in the first embodiment above. The corresponding technical features and technical effects are not described in detail in this embodiment, and the relevant parts can refer to the first embodiment above. Specifically, Figure 2 FIG. 4 shows a structural block diagram of the file conversion device for template processing. Figure 2 As shown, the template processing file conversion device 200 includes an acquisition module 201, a splitting module 202, a path determination module 203, a compensation module 204 and a conversion module 205, wherein:

[0083] The acquisition module 201 is used to acquire a DXF file for template processing, wherein the DXF file contains a plurality of template information to be processed and a plurality of template identifiers, and the template information to be processed and the template identifier are uniquely corresponding;

[0084] The splitting module 202 is connected to the acquisition module 201 and is used to split the DXF file by template identification to obtain multiple intermediate files;

[0085] A path determination module 203, connected to the splitting module 202, is used to identify the template shape and template depth of the parsed intermediate file, and determine the candidate tool head cutting path according to the template shape and template depth;

[0086] The compensation module 204 is connected to the path determination module 203 and is used to obtain the radius width of the cutting head, and compensate the candidate cutting path of the cutting head by the radius width of the cutting head to generate the target cutting path of the cutting head;

[0087] The conversion module 205 is connected to the compensation module 204 and is used to convert the target tool head cutting path into NC code and control the CNC machine tool to execute the NC code to realize automatic processing of the template.

[0088] Optionally, the path determination module is also used to: determine the feature points of the template to be processed by the template shape and the template depth; perform path planning on the feature points of the template to be processed to generate multiple tool head cutting paths; calculate the lengths of the tool head cutting paths respectively, and screen out a predetermined number of tool head cutting paths with the shortest lengths as the first tool head cutting paths; interchange the feature points of different first tool head cutting paths respectively to generate multiple second tool head cutting paths; interchange the feature points in each second tool head cutting path respectively to generate multiple third tool head cutting paths; calculate the length of the third tool head cutting path, and determine the shortest third tool head cutting path as the candidate tool head cutting path.

[0089] Head cutting path.

[0090] Optionally, the compensation module is also used to: parse and obtain multiple graphic bounding boxes contained in the template shape, wherein the image bounding box contains feature points of the candidate tool head cutting path; determine the path compensation direction through the nested relationship of the graphic bounding boxes; offset the feature points of the candidate tool head cutting path along the path compensation direction according to the radius width of the cutting tool head, and connect the offset feature points to generate the target tool head cutting path.

[0091] Optionally, the compensation module is also used to: determine the path compensation direction of the maximum graphic bounding box as an outward offset; determine the nesting relationship level between other graphic bounding boxes and the maximum graphic bounding box, and determine the path compensation direction of other graphic bounding boxes according to the nesting relationship level; if the nesting relationship level between other graphic bounding boxes and the maximum graphic bounding box is an odd number, determine the path compensation direction of other graphic bounding boxes as an inward offset; if the nesting relationship level between other graphic bounding boxes and the maximum graphic bounding box is an even number, determine the path compensation direction of other graphic bounding boxes as an outward offset.

[0092] Optionally, the conversion module is also used for: Step 1, in response to the start instruction of template processing, obtaining tool attribute information and processing feed rate; Step 2, presetting the CNC machine tool through the tool attribute information and processing feed rate to obtain an initialized CNC machine tool; Step 3, processing the processing template based on the initialized CNC machine tool according to the NC code obtained by executing the conversion; Step 4, judging whether there is graphic information in the NC code, if so, returning to Step 2, otherwise, executing Step 5; Step 5, controlling the tool of the CNC machine tool to stop rotating and the template processing program to stop, and the template processing operation ends.

[0093] Optionally, the conversion module is also used to: move the tool of the initialized CNC machine tool to the first graphic element position of the template to be processed through the NC code; control the tool to move downward in the direction close to the template to be processed until the tool is tangent to the template to be processed; control the tool to move according to the path information in the NC code; after the tool passes through the last graphic element in the NC code, control the tool to move up and restore in the direction away from the template to be processed; restore the feed rate of the CNC machine tool, and the corresponding processing flow of the template to be processed ends.

[0094] Embodiment 3

[0095] Figure 3 The block diagram of a computer device suitable for implementing the file conversion method for template processing provided by the third embodiment of the present invention is shown. In this embodiment, the computer device 300 can be a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server, or a server cluster composed of multiple servers) that executes a program. Figure 3As shown, the computer device 300 of this embodiment includes at least but is not limited to: a memory 301, a processor 302, and a network interface 303 that can be interconnected through a system bus. It should be noted that Figure 3 Only computer device 300 having components 301 - 303 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0096] In this embodiment, the memory 303 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 301 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 301 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 301 can also include both the internal storage unit of the computer device 300 and its external storage device. In this embodiment, the memory 301 is generally used to store the operating system and various application software installed on the computer device 300, such as the program code of the file conversion method of template processing, etc.

[0097] In some embodiments, the processor 302 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 302 is generally used to control the overall operation of the computer device 300. For example, the processor 302 performs control and processing related to data interaction or communication with the computer device 300. In this embodiment, the processor 302 is used to run the program code of the steps of the template processing file conversion method stored in the memory 301.

[0098] In this embodiment, the template processing file conversion method stored in the memory 301 can also be divided into one or more program modules and executed by one or more processors (processor 302 in this embodiment) to complete the present invention.

[0099] The network interface 303 may include a wireless network interface or a wired network interface, and the network interface 303 is generally used to establish a communication link between the computer device 300 and other computer devices. For example, the network interface 303 is used to connect the computer device 300 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 300 and the external terminal. The network can be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0100] Embodiment 4

[0101] This embodiment also provides a computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., on which a computer program is stored, and when the computer program is executed by a processor, the steps of the file conversion method for template processing are implemented.

[0102] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0103] It should be noted that the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0105] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A file conversion method for template processing, It is characterized in that The method comprises: Acquire a DXF file for template processing, wherein the DXF file contains a plurality of template information to be processed and a plurality of template identifiers, and the template information to be processed uniquely corresponds to the template identifier; Splitting the DXF file by the template identifier to obtain a plurality of intermediate files; Identify and analyze the template shape and template depth of the intermediate file, and determine a candidate tool head cutting path according to the template shape and the template depth; Acquire the radius width of the cutting head, and compensate the candidate cutting path of the cutting head by the radius width of the cutting head to generate a target cutting path of the cutting head; The target tool head cutting path is converted into NC code, and a numerically controlled machine tool is controlled to execute the NC code to realize automatic processing of the template.

2. The method according to claim 1, It is characterized in that The step of determining a candidate tool head cutting path according to the template shape and the template depth comprises: Determine the feature points of the template to be processed by the template shape and the template depth; Performing path planning on the characteristic points of the template to be processed to generate multiple tool head cutting paths; Calculating the lengths of the tool head cutting paths respectively, and selecting a predetermined number of tool head cutting paths with the shortest lengths as first tool head cutting paths; Exchanging feature points of different first tool head cutting paths respectively to generate a plurality of second tool head cutting paths; The characteristic points in each second cutter head cutting path are interchanged to generate multiple third cutter head cutting paths; The length of the third tool head cutting path is calculated, and the shortest third tool head cutting path is determined as a candidate tool head cutting path.

3. The method according to claim 1, It is characterized in that The step of compensating the candidate tool head cutting path by the radius width of the cutting tool head to generate a target tool head cutting path includes: Parsing and obtaining a plurality of graphic bounding boxes contained in the template shape, wherein the image bounding boxes contain feature points of the candidate tool head cutting path; Determining a path compensation direction through the nested relationship of the graphic boundary boxes; According to the radius width of the cutting tool head, the feature points of the candidate tool head cutting path are offset along the path compensation direction, and the offset feature points are connected to generate a target tool head cutting path.

4. The method according to claim 3, It is characterized in that The determining of the path compensation direction through the nested relationship of the graphic boundary boxes includes: The path compensation direction of the maximum graphic bounding box is determined to be offset outward; Determine the nesting relationship level between the other graphic bounding boxes and the maximum graphic bounding box, and determine the path compensation direction of the other graphic bounding boxes according to the nesting relationship level; If the nesting relationship level between the other graphic bounding box and the maximum graphic bounding box is an odd number, determining the path compensation direction of the other graphic bounding box to be an inward offset; If the nesting relationship level between the other graphic bounding box and the maximum graphic bounding box is an even level, the path compensation direction of the other graphic bounding box is determined to be outward offset.

5. The method according to claim 1, It is characterized in that The step of converting the target tool head cutting path into NC code and controlling the numerical control machine tool to execute the NC code comprises: Step 1, in response to a start instruction of template processing, obtaining tool attribute information and processing feed rate; Step 2, presetting the CNC machine tool by using the tool attribute information and the machining feed rate to obtain an initialized CNC machine tool; Step 3, according to the NC code obtained by executing the conversion, the template to be processed is processed based on the initialized CNC machine tool; Step 4, determining whether there is graphic information in the NC code, if so, returning to step 2, otherwise, executing step 5; Step 5, controlling the tool of the CNC machine tool to stop rotating and the template processing program to stop, and the template processing operation ends.

6. The method according to claim 5, It is characterized in that The NC code obtained by executing the conversion is processed based on the initialized CNC machine tool to be processed, including: The tool of the initialized CNC machine tool is moved to the first primitive position of the template to be processed by the NC code; Controlling the tool to move downward in a direction close to the template to be processed until the tool is tangent to the template to be processed; Controlling the tool to move according to the path information in the NC code; After the tool passes through the last graphic element in the NC code, controlling the tool to move up and recover in a direction away from the template to be processed; The feed rate of the CNC machine tool is restored, and the processing flow of the corresponding template to be processed is completed.

7. A file conversion device for template processing, It is characterized in that The device comprises: An acquisition module, used for acquiring a DXF file for template processing, wherein the DXF file contains a plurality of template information to be processed and a plurality of template identifiers, and the template information to be processed is uniquely corresponding to the template identifier; A splitting module, used for splitting the DXF file according to the template identifier to obtain multiple intermediate files; A path determination module, used for identifying and parsing the template shape and template depth of the intermediate file, and determining a candidate tool head cutting path according to the template shape and the template depth; A compensation module, used for obtaining the radius width of the cutting head, compensating the candidate cutting path of the cutting head by the radius width of the cutting head, and generating a target cutting path of the cutting head; The conversion module is used to convert the target tool head cutting path into NC code and control the CNC machine tool to execute the NC code to realize the automatic processing of the template.

8. The device according to claim 7, It is characterized in that The path determination module is also used for: Determine the feature points of the template to be processed by the template shape and the template depth; Performing path planning on the characteristic points of the template to be processed to generate multiple tool head cutting paths; Calculating the lengths of the tool head cutting paths respectively, and selecting a predetermined number of tool head cutting paths with the shortest lengths as first tool head cutting paths; Exchanging feature points of different first tool head cutting paths respectively to generate a plurality of second tool head cutting paths; The characteristic points in each second cutter head cutting path are interchanged to generate multiple third cutter head cutting paths; The length of the third tool head cutting path is calculated, and the shortest third tool head cutting path is determined as a candidate tool head cutting path.

9. A computer device, wherein the computer device include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.