Solidworks model-based processing program generation method and system
Through automated processing feature recognition and program generation based on Solidworks model, the cumbersome and inefficient operation in the process of G-code generation of three-dimensional models to CNC machine tools is solved, and efficient and accurate automatic generation of CNC machining programs is achieved, improving the production efficiency and quality of the manufacturing industry.
Patent Information
- Application Number
- CN202510432686.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-08-26
AI Technical Summary
In the prior art, the process of processing G codes from three-dimensional models to CNC machine tools is cumbersome, inefficient and prone to errors. The manual programming work is large, making it difficult to meet the requirements of modern manufacturing for processing accuracy and efficiency.
Based on the processing feature recognition and automatic generation of CNC machining programs based on the Solidworks model, G codes are automatically generated through steps such as feature recognition, dimensional tolerance extraction, processing process analysis, coordinate conversion and path calculation.
Significantly reduce manual programming workload, reduce error rates, improve processing efficiency and accuracy, enhance production flexibility, reduce material waste, and promote the development of manufacturing industry to efficient and intelligent development.
Smart Images

Figure CN120540206A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer-aided manufacturing, and in particular relates to a method and system for generating a machining program based on a SolidWorks model. Background Art
[0002] Machining, a key forming process in the manufacturing industry, plays a vital role in machining, automotive manufacturing, construction machinery, and numerous other manufacturing sectors. In today's modern manufacturing landscape, with the increasing complexity of products, the demands for machining precision and efficiency are also rising. In previous production models, 2D drawings served as the primary medium for information transmission, while 3D models typically played a supporting role. However, this traditional method of information transmission suffers from significant deficiencies in completeness, accuracy, and efficiency. Manual programming methods are not only inefficient but also prone to errors when handling complex part machining tasks.
[0003] With the rapid development of 3D digital design technology, 3D models have become a core information carrier throughout the entire product lifecycle, from product design and process planning to manufacturing execution and post-production maintenance. 3D models not only contain a wealth of geometric and topological information, but also, through feature recognition technology, can transform this information into geometric shapes with practical machining significance, known as machining features. The combination of 3D model machining feature recognition and automatic programming technology represents a significant trend in modern manufacturing towards automation and intelligence. SolidWorks, a widely used software in the field of 3D mechanical design, plays a significant role. In traditional applications, engineers first use SolidWorks to construct a 3D model and then write the corresponding machining program code based on the model's specific parameters. Obviously, in this traditional process, the design and programming steps are independent of each other. Therefore, developing a method and system for generating machining programs based on SolidWorks models is extremely important for improving production efficiency and machining accuracy. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and system for generating a machining program based on a Solidworks model, which can identify machining features of a three-dimensional model and automatically generate a NC machining program, thereby greatly reducing the workload and error rate of manual programming.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] The first object of the present invention is to provide a method for generating a machining program based on a SolidWorks model, comprising:
[0007] S1. Obtain a SolidWorks model, analyze the modeling features of each part in the SolidWorks model to generate an entity, organize the modeling feature sketch contours and sketch plane normal vectors, match and analyze the modeling feature sketch contours and sketch plane normal vectors with a feature library to obtain processing feature categories, and use a processing priority determination model to group features according to processing feature categories and processing directions;
[0008] S2, identify and extract the part dimensions and tolerances marked in the modeling feature sketch and incorporate them into the processing decision factors;
[0009] S3. Analyze the machining process of parts based on the machining feature category, part size and tolerance based on the machining process knowledge graph;
[0010] S4. Determine the blank type, machining allowance distribution, processing steps and clamping method based on the part's appearance characteristics, part machining process and dimensional accuracy requirements;
[0011] S5. Rotate and translate the normal vector of the sketch plane according to the standard machining coordinate system of various machine tools defined according to the blank type and machining steps, convert the three-dimensional space coordinates of the machining contour into machine tool machining coordinates and sort the machining information;
[0012] S6. Calculate the machining path of the part machining process based on the results of the part machining profile, depth, machining allowance and dimensional accuracy identification;
[0013] S7. Based on the machining path and the instructions supported by the specific machine tool, the program segments are optimized through instruction merging and interpolation, and G code is generated through post-processing.
[0014] Preferably, S1 includes:
[0015] S11. Determine whether the SolidWorks model contains valid entity modeling features. If not, terminate the process. If so, identify the processing feature category to which the part modeling features belong. For entity modeling features that contain sketch subfeatures, obtain the following data: the outline or sketch, depth, or path that generates the entity modeling feature. For entity modeling features that do not contain sketch subfeatures, obtain the following data: the object or edge of the modeling feature and the parameters defined by the modeling feature. Distinguish the obtained data according to the modeling feature category.
[0016] S12, traversing the sketch that generates the solid modeling feature to extract the part machining contour, identifying the number of contours or sketch sub-features, obtaining the elements contained in the sketch one by one, and obtaining the characteristic parameters of each sketch element; judging the closedness, concavity, and direction of the sketch line contour, using a sorting algorithm to adjust and reorganize the sketch elements in a counterclockwise direction, and storing each contour information as a group; parsing the contour of the solid modeling feature;
[0017] S13. Analyze the machining direction according to the normal vector of the sketch plane. The machining direction of the cut solid modeling feature is from the sketch plane to the solid, and the machining direction of the added solid modeling feature is from the sketch plane to the outside. Combine the modeling feature contour or the shape of the sketch with the feature library data, analyze the machining feature category, and use the machining priority judgment model to group the feature recognition data according to the machining feature category and machining direction.
[0018] Preferably, in S2, the tolerance includes dimensional tolerance, shape tolerance, position tolerance, and tolerance value, and the allowable upper and lower deviations are calculated and incorporated into the processing technology decision factors.
[0019] Preferably, S3 includes: matching the machining process database, determining the part machining process corresponding to the machining feature according to the machining accuracy requirements and the dimensional accuracy, surface roughness and cutting efficiency that can be achieved by different machining processes, and the part machining process includes turning, milling, boring, drilling, countersinking and tapping.
[0020] Preferably, S4 includes:
[0021] S41. Obtain the material and envelope size of the part from the part model. Determine the type and machining allowance of the blank based on the part entity type, material, envelope size, processing technology, and dimensional accuracy requirements. Compare and generate an optimal machining allowance distribution. The blank types include round steel, square steel, steel pipe, envelope block, casting, and forging. The blank size data of castings and forgings can be obtained from the model.
[0022] S42. Determine the processing steps and clamping methods based on the part machining process and machining direction, and decompose the part machining process into processing steps.
[0023] Preferably, S5 includes:
[0024] S51. Establish parameters for spatial coordinate system transformation: X, Y, Z rotation matrices, X, Y, Z translation vectors, and scaling factors;
[0025] S52. The principles of machine tool machining coordinate systems include: During part modeling, the coordinate origin and reference coordinate system are manually set. For models with a machining reference coordinate system and reference point set, the coordinate system and origin data are directly obtained. For models without a reference coordinate system set, the machine tool machining coordinate system definition rule is unified, with the intersection of the machining start position and the axis as the origin of the machine tool machining coordinate system, using a right-handed rectangular Cartesian coordinate system, and the machining coordinate system matching the machine tool coordinate system.
[0026] S53. Determine the part clamping method and number of times based on the part blank type, machining feature category, machining direction, and machining steps, and obtain the position of the origin of the machine tool machining coordinate system in the part modeling space coordinate system to obtain the translation vector and the rotation vector of the sketch plane relative to each axis of the part coordinate system;
[0027] S54, sorting the processing steps according to the processing technology category, process sequence, and part clamping method to obtain an array sequence that meets the processing requirements, wherein the default processing sequence is from outside to inside, from top to bottom, and from right to left according to the process;
[0028] S55. Convert the three-dimensional modeling coordinate system of the part into a standard workpiece coordinate system, and obtain the translation coordinates of the machining contour of each clamping and each machining step relative to the origin of the machining coordinate system according to the coordinate conversion calculation method.
[0029] Preferably, S6 includes:
[0030] S61. The principles of machining path calculation include: meeting the dimensional accuracy and surface quality of the machined parts and the shortest tool path;
[0031] S62. Optimize the cutting path. Select the cutting sequence and cutting parameters according to the geometric characteristics of the part surface. Combined with the process characteristics of the part, select the corresponding cutting parameters and cutting path.
[0032] A second object of the present invention is to provide a system for generating a machining program based on a SolidWorks model, comprising:
[0033] The feature analysis module obtains the SolidWorks model, analyzes the features of each part in the SolidWorks model, organizes the solid modeling feature sketch profiles and sketch plane normal vectors, matches and analyzes the feature sketch profiles and sketch plane normal vectors with the feature library, obtains the processing feature category, and uses the processing priority judgment model to group features according to the processing feature category and processing direction;
[0034] Parameter recognition module, which identifies and extracts part dimensions and tolerances marked in the solid modeling feature sketch and incorporates them into the processing technology decision-making factors;
[0035] The process analysis module analyzes the machining process of parts based on the machining feature category, part size and tolerance based on the machining process knowledge graph;
[0036] Type determination module, which determines the blank type, machining allowance distribution, processing steps and clamping method based on the part's appearance characteristics, part machining process and dimensional accuracy requirements;
[0037] The sorting module rotates and translates the normal vector of the sketch plane according to the standard machining coordinate system of various machine tools according to the blank type and machining steps, converts the three-dimensional space coordinates of the machining contour into machine tool machining coordinates and sorts the machining information;
[0038] The path calculation module calculates the machining path of the part machining process based on the results of the part's machining contour, depth, machining allowance and dimensional accuracy identification;
[0039] The code generation module combines the machining path with the instructions supported by the specific machine tool, optimizes the program segments through instruction merging and interpolation, and generates G code through post-processing.
[0040] A third object of the present invention is to provide a computer-readable storage medium comprising instructions, which, when executed on a computer, enable the computer to execute the above-mentioned method for generating a machining program based on a Solidworks model.
[0041] A fourth object of the present invention is to provide a computer program product, comprising a computer program, which, when executed by a processor, implements the above-mentioned method for generating a machining program based on a Solidworks model.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The core of the present invention is the ability to identify the processing features based on the Solidworks model and to automatically generate CNC machining programs. This innovation significantly reduces the workload of manual programming, while the automatic extraction of processing features and dimensional tolerances greatly reduces the error rate caused by human operation. In addition, the present invention also has the ability to automatically generate corresponding optimized processing paths and program segments according to different processing technologies and machine tool equipment conditions. Such functions not only improve processing efficiency and product quality, but also reduce the professional skills requirements for programmers. This enables manufacturing companies to adapt to market changes and meet the production needs of diversified products more flexibly. The present invention effectively solves the technical difficulties encountered in the process of generating G codes from three-dimensional models to CNC machine tools, such as cumbersome operations, low efficiency, over-reliance on experience, and easy errors. It realizes an efficient and automated connection from design to manufacturing, greatly improving the efficiency and accuracy of the entire production process. Through the implementation of the present invention, a complete process has been established, including methods for identifying and matching SolidWorks modeling features and sketches / contours, determining machining priorities, grouping features, identifying and calculating tolerances, splitting machining processes, optimizing the distribution of blank machining allowances and process analysis, converting machining coordinate systems, calculating machining paths, optimizing program instructions, and post-processing. These methods work together to automatically extract and analyze three-dimensional model information, eliminating the need for human intervention throughout the entire process, thereby significantly improving the degree of automation. This not only greatly shortens the time it takes to generate machining programs, but also improves programming accuracy and efficiency. The implementation of the present invention reduces reliance on technical personnel and reduces labor costs. Its recognition algorithm provides accurate input for automatic programming, enabling the automatic generation of optimal machining paths and parameters, thereby improving machining accuracy and consistency. This enhances production flexibility, reduces material waste and machining time, and improves resource utilization efficiency by accurately calculating and optimizing machining paths. Ultimately, the present invention promotes the development of the machining industry towards greater efficiency, intelligence, and sustainability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flowchart of a preferred embodiment of the present invention;
[0045] Figure 2 Schematic diagram of the Solidworks model feature recognition process in a preferred embodiment of the present invention;
[0046] Figure 3 Schematic diagram of a Solidworks model in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative work shall fall within the scope of protection of the present invention.
[0048] like Figures 1 to 3 As shown:
[0049] A first preferred embodiment, a method for generating a machining program based on a SolidWorks model, comprising:
[0050] S1. Obtain a SolidWorks model, analyze the solid modeling features of each part in the SolidWorks model, organize the modeling feature sketch contours and sketch plane normal vectors, match and analyze the feature sketch contours and sketch plane normal vectors with the feature library, obtain the processing feature category, and use the processing priority determination model to group the features according to the processing feature category and processing direction;
[0051] In S1, the Solidworks model is uploaded through the user interface, and the part 3D modeling feature analysis method is used to obtain effective features, organize information such as feature sketch contours and sketch plane normal vectors, match the feature sketch contours and sketch plane normal vectors with feature library data, analyze the part's processing feature categories, and group features according to processing feature categories and processing directions. Specifically, it includes:
[0052] S11. Upload the Solidworks model and determine whether the Solidworks model meets the preset requirements. The preset requirements are whether it contains valid solid modeling features. If the Solidworks model does not meet the preset requirements, terminate. If it does, continue with the following steps. Valid solid modeling features may include stretching, rotation, scanning, lofting, chamfering, filleting, etc. The part modeling features identify the processing feature category they conform to. For solid modeling features that contain sketch sub-features, obtain the outline or sketch, depth or path of the solid modeling features respectively; for solid modeling features that do not contain sketch sub-features (chamfers, fillets, arrays, etc.), obtain the object or edge of the feature, as well as the parameters of the feature definition. The acquired data is distinguished according to the modeling feature category. For example, in the preferred embodiment, the model feature categories of the roller shaft include rotation, chamfering, stretching cut, rotation cut, and material information;
[0053] S12, traverse the sketch of the solid modeling features to extract the part machining contour (features without sketches such as chamfers and fillets extract edge lines or surface data), identify the number of contours or sketch sub-features, obtain the elements contained in the sketch one by one (straight lines, arcs, ellipses, curves, etc.), and obtain the characteristic parameters of each sketch element (including type, feature point coordinates, direction, etc.). The closedness, convexity, and direction of the sketch line contour are judged, and the sketch elements are adjusted and reorganized in a counterclockwise direction using a sorting algorithm. Each contour information is stored as a group; the contours of the solid modeling features (such as revolving contours, boss contours, scanning contours, holes, slots, etc.) are analyzed. For example, the characteristic contours of the roller shaft in the preferred embodiment include rotating contours, chamfers, plane contours, simple hole contours, slot contours, and center hole contours.
[0054] S13, analyze the processing direction according to the normal vector of the sketch plane, and the processing direction of the cut solid modeling feature is from the sketch plane to the solid, and the processing direction of the added solid modeling feature is from the sketch plane to the outside. Combined with the shape of the modeling feature contour or sketch and the feature library data matching, the category of the processing feature is analyzed, and the feature recognition data is grouped according to the machining feature category (including part end face, outer circle, inner hole, chamfer, fillet, plane, groove, simple hole, special-shaped hole, thread, etc.) and processing direction. Determine the processing priority in three-dimensional space to avoid interference in part processing. For example, in the preferred embodiment, the processing feature categories of the roller shaft model include end face, outer circle, fillet, chamfer, groove, plane, simple hole, and center hole.
[0055] S2. Identify and extract the part dimensions and tolerances marked in the sketch. In this step, all dimensions in the part sketch are obtained, and the dimension values and tolerances marked in the sketch are identified and stored. The identified data includes information such as tolerance type, basic dimensions, annotation text, tolerance value, and limit dimensions. The tolerance annotation information is used as one of the important factors in process decision-making, and the process parameters of precision machining are automatically matched based on the cutting parameter adaptive algorithm. Specifically:
[0056] S21. Obtain the basic dimensions and tolerance categories of the part from the part sketch by traversing, including dimensional tolerance, shape tolerance, position tolerance, etc. The shape and position tolerances need to take into account the machining accuracy of the machine tool itself and the clamping of the part;
[0057] S22. Calculate the upper and lower deviations allowed by the given tolerances to determine the machining accuracy that the machine tool should meet. For example, the outer contour size range of the roller shaft model is The tolerance grade is Φ35g6.
[0058] S3. Based on the machining process knowledge graph, analyze the machining process of parts according to the machining feature category, part size and tolerance. In this step, the machining process of parts is automatically analyzed according to the machining category and key part size and tolerance, including turning, milling, boring, drilling, countersinking, tapping, etc., and the model information is automatically split into process. Specifically:
[0059] S31. Matching the machining process database, determining the machining process (including turning, milling, boring, drilling, countersinking, tapping, etc.) corresponding to the machining feature based on machining accuracy requirements and the dimensional accuracy, surface roughness, and cutting efficiency that can be achieved by different machining processes;
[0060] S32. Determine whether roughing and finishing are necessary based on the accuracy requirements and machining allowance. For example, when machining the outer diameter of a roller shaft model, the lathe's machining accuracy should be no less than IT6, and both roughing and finishing are necessary.
[0061] S4. Determine the blank type, machining allowance distribution, machining steps and clamping method based on the part's shape characteristics, machining process and dimensional accuracy requirements. In this step, the blank type, machining steps and clamping method are determined based on the part's shape characteristics, machining process and dimensional accuracy requirements through the analysis method of the part blank and process. Specifically:
[0062] S41. Obtain the part's material and envelope size from the part model. Determine the blank type based on the part's entity type, material, envelope size, processing technology, and dimensional accuracy requirements. For example, in the preferred embodiment, the blank for the roller shaft model is Φ45×212 round steel, made of 40Cr. The blank output information is {"rawmaterial":{"material":"40Cr","type":"round steel","length":212.0,"width":45.0,"height":45.0};
[0063] S42. Determine the machining steps and clamping methods based on the machining process and machining direction, and decompose the machining process into work steps. For example, a roller shaft model requires four clamping steps to complete machining.
[0064] S5. Rotate and translate the normal vector of the sketch plane according to the defined standard machining coordinate systems of various machine tools according to the blank type and machining steps, convert the three-dimensional spatial coordinates of the machining contour into machine tool machining coordinates and sort the machining information; in this step, use the machining coordinate system conversion method to rotate and translate the vector according to the defined standard machining coordinate systems of various machine tools according to the identified part blank type and machining steps, convert the three-dimensional spatial coordinates of the machining contour into machine tool machining coordinates, sort the information, and output the results.
[0065] S51. Establish a calculation method for spatial coordinate system transformation, which includes seven parameters: the X, Y, and Z rotation matrices, the X, Y, and Z translation vectors, and the scaling factor. For parts modeled at a 1:1 scale, scaling is not required. For points on different machining contours within the same coordinate system, calculate the relative coordinates of the machine tool's machining coordinate system.
[0066] S52. Establish the machine tool machining coordinate system (workpiece coordinate system). The machine tool machining coordinate system defines the intersection of the machining starting position (i.e., the workpiece end face or top) and the axis (or centerline) as the origin of the machine tool machining coordinate system. A right-handed Cartesian coordinate system is used, and the machining coordinate system matches the machine tool coordinate system. For example, the coordinate origin for milling a roller shaft model is (-104, 21, 0), the X-axis direction is the part axis direction, and the positive Z-axis direction is the same as the positive direction of the machine tool spindle.
[0067] S53. According to the processing direction and steps, determine the method and number of part clamping, obtain the position of the origin of the machine tool processing coordinate system (top or end face center) in the part modeling space coordinate system to obtain the translation vector, and the rotation vector of the sketch plane relative to the axes of the part coordinate system.
[0068] S54. Sort the processing steps according to the processing technology category, process sequence, and part clamping method to obtain an array sequence that meets the processing requirements. The default processing sequence is from outside to inside, from top to bottom, and from right to left according to the process. For example, the processing sequence of the roller shaft is: the first sequence is to clamp the right end on the CNC lathe, turn the left end face, turn the outer circle, fillet, groove, chamfer, drill, and expand the center hole; the second sequence is to turn the head and clamp, turn the right end face, turn the outer circle, and chamfer; the third sequence is to mill the upper plane and drill holes on the machining center; the fourth sequence is to change the clamping position and drill holes;
[0069] S55. Convert the part machining contour coordinates into the standard workpiece coordinate system. According to the coordinate conversion calculation method, obtain the translation coordinates (relative coordinates) of the machining contour relative to the origin of the machining coordinate system for each clamping and machining step. For example, the workpiece coordinate system output information for the milling of the upper plane of the roller shaft is {"machprocess":"Milling plane","sketchname":"Cut-Extrude2-Sketch
[0070] 5","origincoordinate":[-104,21,0],"machpoints":[{"sketchtype":0,"startpoint":{"coordinate":[53.5,19.5,-1.5]},"endpoint":{"coordinate":[78.5,19.5,-1.5]},"centerp oint":null,"otherpoints":null,"radormajor":null,"minoraxis":null,"text":null},{"sketchtype":0,"startpoint":{"coordinate":[78.5,19.5,-1.5]},"endpoint":{"coordinate":[78.5,-19.5,-1.5]},"centerpoint":null,"otherpoints":null,"radormajor":null,"minoraxis":null,"text":null},{"sketchtype":0,"startpoint":{"coordinate":[78.5,-19.5,-1.5]},"endpoint":{"coordinate":[53.5,-19.5,-1.5]},"centerpoint":null,"other points":null,"radormajor":null,"minoraxis":null,"text":null},{"sketchtype":0,"st artpoint":{"coordinate":[53.5,-19.5,-1.5]},"endpoint":{"coordinate":[53.5,19.5,-1.5]},"centerpoint":null,"otherpoints":null,"radormajor":null,"minoraxis":null,"text":null}],"depthorangle":4.0,"depthorangle2":0.0,"vector3D":{"X":0.0,"Y":0.0,"Z":1.0}}。
[0071] S6. Calculate the machining path of the part machining process based on the results of the part machining contour, depth, machining allowance and dimensional accuracy identification. In this step, the machining path algorithm is established to calculate the machining path based on the results of the part machining contour, depth, machining allowance and dimensional accuracy identification. Specifically:
[0072] S61. The machining path calculation ensures the dimensional accuracy and surface quality of the machined parts, a smooth path, a reasonable cutting sequence, a minimal tool path, limits the tool's entry and exit, and eliminates sudden changes in cutting direction during the process, minimizing tool marks. For example, in a preferred embodiment, the path for milling the upper surface of the roller shaft can be circular cutting, which provides better cutting results.
[0073] S62. Optimize the cutting path based on the geometric characteristics of the part surface. Select the appropriate cutting sequence (e.g., uniform high-level cutting, spiral continuous cutting) and cutting parameters (including cutting depth, feed rate, etc.), and develop a corresponding cutting strategy to achieve efficient, high-quality machining. Consider the part's process characteristics (including material hardness, heat treatment status, etc.) to select appropriate cutting parameters and cutting paths. For example, the milling depth of the upper surface of a roller shaft is 4mm, which can be divided into two processes: roughing and semi-finishing, achieving good cutting results.
[0074] S7, based on the machining path and the instructions supported by the specific machine tool, generates post-processing G code by combining instructions and interpolating the optimized program segments. Specifically:
[0075] S71, reading and analyzing the tool position, and converting the generated tool path file into a G code instruction that can be recognized by the CNC machine tool;
[0076] S72. Determine whether to perform coordinate transformation or code conversion based on the selected machine tool, generate a complete NC program segment, set a suitable suffix name, and output it.
[0077] A second preferred embodiment, a SolidWorks model processing program generation system, is used to implement the method of the first preferred embodiment, comprising:
[0078] The feature analysis module obtains the SolidWorks model, analyzes the features of each part in the SolidWorks model, organizes the feature sketch profiles and sketch plane normal vectors, matches and analyzes the feature sketch profiles and sketch plane normal vectors with the feature library, obtains the processing feature category, and uses the processing priority judgment model to group features according to the processing feature category and processing direction;
[0079] Parameter recognition module, which identifies and extracts the part dimensions and tolerances marked in the sketch and incorporates them into the processing decision-making factors;
[0080] The process analysis module analyzes the machining process of parts based on the machining feature category, part size and tolerance based on the machining process knowledge graph;
[0081] Type determination module, which determines the blank type, machining allowance distribution, processing steps and clamping method based on the part's appearance characteristics, part machining process and dimensional accuracy requirements;
[0082] The sorting module rotates and translates the normal vector of the sketch plane according to the standard machining coordinate system of various machine tools according to the blank type and machining steps, converts the three-dimensional space coordinates of the machining contour into machine tool machining coordinates and sorts the machining information;
[0083] The path calculation module calculates the machining path of the part machining process based on the results of the part's machining contour, depth, machining allowance and dimensional accuracy identification;
[0084] The code generation module combines the machining path with the instructions supported by the specific machine tool, optimizes the program segments through instruction merging and interpolation, and generates G code through post-processing.
[0085] A third preferred embodiment is a computer-readable storage medium comprising instructions, which, when executed on a computer, cause the computer to execute the method of the second preferred embodiment.
[0086] A fourth preferred embodiment is a computer program product, comprising a computer program, which implements the method of the second preferred embodiment when executed by a processor.
[0087] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (e.g., infrared, wireless, microwave, etc.)) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating a machining program based on a Solidworks model, characterized in that: include: S1. Obtain a SolidWorks model, analyze the modeling features of each part in the SolidWorks model to generate an entity, organize the modeling feature sketch contours and sketch plane normal vectors, match and analyze the modeling feature sketch contours and sketch plane normal vectors with a feature library to obtain processing feature categories, and use a processing priority determination model to group features according to processing feature categories and processing directions; S2, identify and extract the part dimensions and tolerances marked in the modeling feature sketch and incorporate them into the processing decision factors; S3. Analyze the machining process of parts based on the machining feature category, part size and tolerance based on the machining process knowledge graph; S4. Determine the blank type, machining allowance distribution, processing steps and clamping method based on the part's appearance characteristics, part machining process and dimensional accuracy requirements; S5. Rotate and translate the normal vector of the sketch plane according to the standard machining coordinate system of various machine tools defined according to the blank type and machining steps, convert the three-dimensional space coordinates of the machining contour into machine tool machining coordinates and sort the machining information; S6. Calculate the machining path of the part machining process based on the results of the part machining profile, depth, machining allowance and dimensional accuracy identification; S7. Based on the machining path and the instructions supported by the specific machine tool, the program segments are optimized through instruction merging and interpolation, and G code is generated through post-processing.
2. The method for generating a processing program based on a SolidWorks model according to claim 1, wherein: S1 includes: S11. Determine whether the SolidWorks model contains valid entity modeling features. If not, terminate the process. If so, identify the processing feature category to which the part modeling features belong. For entity modeling features that contain sketch subfeatures, obtain the following data: the outline or sketch, depth, or path that generates the entity modeling feature. For entity modeling features that do not contain sketch subfeatures, obtain the following data: the object or edge of the modeling feature and the parameters defined by the modeling feature. Distinguish the obtained data according to the modeling feature category. S12, traversing the sketch that generates the solid modeling feature to extract the part machining contour, identifying the number of contours or sketch sub-features, obtaining the elements contained in the sketch one by one, and obtaining the characteristic parameters of each sketch element; judging the closedness, concavity, and direction of the sketch line contour, using a sorting algorithm to adjust and reorganize the sketch elements in a counterclockwise direction, and storing each contour information as a group; parsing the contour of the solid modeling feature; S13. Analyze the machining direction according to the normal vector of the sketch plane. The machining direction of the cut solid modeling feature is from the sketch plane to the solid, and the machining direction of the added solid modeling feature is from the sketch plane to the outside. Combine the modeling feature contour or the shape of the sketch with the feature library data, analyze the machining feature category, and use the machining priority judgment model to group the feature recognition data according to the machining feature category and machining direction.
3. The method for generating a processing program based on a SolidWorks model according to claim 2, characterized in that: In S2, the tolerances include size tolerance, shape tolerance, position tolerance, and tolerance value. The allowable upper and lower deviations are calculated and incorporated into the processing technology decision factors.
4. The method for generating a processing program based on a SolidWorks model according to claim 3, wherein: S3 includes: matching the machining process database, determining the part machining process corresponding to the machining features according to the machining accuracy requirements and the dimensional accuracy, surface roughness and cutting efficiency that can be achieved by different machining processes, and the part machining processes include turning, milling, boring, drilling, countersinking and tapping.
5. The method for generating a processing program based on a Solidworks model according to claim 4, wherein S4 include: S41. Obtain the material and envelope size of the part from the part model. Determine the type and machining allowance of the blank based on the part entity type, material, envelope size, processing technology, and dimensional accuracy requirements. Compare and generate an optimal machining allowance distribution. The blank types include round steel, square steel, steel pipe, envelope block, casting, and forging. The blank size data of castings and forgings can be obtained from the model. S42. Determine the processing steps and clamping methods based on the part machining process and machining direction, and decompose the part machining process into processing steps.
6. The method for generating a processing program based on a Solidworks model according to claim 5, wherein S5 include: S51. Establish parameters for spatial coordinate system transformation: X, Y, Z rotation matrices, X, Y, Z translation vectors, and scaling factors; S52. The principles of machine tool machining coordinate systems include: During part modeling, the coordinate origin and reference coordinate system are manually set. For models with a machining reference coordinate system and reference point set, the coordinate system and origin data are directly obtained. For models without a reference coordinate system set, the machine tool machining coordinate system definition rule is unified, with the intersection of the machining start position and the axis as the origin of the machine tool machining coordinate system, using a right-handed rectangular Cartesian coordinate system, and the machining coordinate system matching the machine tool coordinate system. S53. Determine the part clamping method and number of times based on the part blank type, machining feature category, machining direction, and machining steps, and obtain the position of the origin of the machine tool machining coordinate system in the part modeling space coordinate system to obtain the translation vector and the rotation vector of the sketch plane relative to each axis of the part coordinate system; S54, sorting the processing steps according to the processing technology category, process sequence, and part clamping method to obtain an array sequence that meets the processing requirements, wherein the default processing sequence is from outside to inside, from top to bottom, and from right to left according to the process; S55. Convert the three-dimensional modeling coordinate system of the part into a standard workpiece coordinate system, and obtain the translation coordinates of the machining contour of each clamping and each machining step relative to the origin of the machining coordinate system according to the coordinate conversion calculation method.
7. The method for generating a processing program based on a Solidworks model according to claim 6, wherein S6 include: S61. The principles of machining path calculation include: meeting the dimensional accuracy and surface quality of the machined parts and the shortest tool path; S62. Optimize the cutting path. Select the cutting sequence and cutting parameters according to the geometric characteristics of the part surface. Combined with the process characteristics of the part, select the corresponding cutting parameters and cutting path.
8. A Solidworks model processing program generation system, characterized in that: include: The feature analysis module obtains the SolidWorks model, analyzes the features of each part in the SolidWorks model, organizes the modeling feature sketch profiles and sketch plane normal vectors, matches and analyzes the feature sketch profiles and sketch plane normal vectors with the feature library, obtains the processing feature category, and uses the processing priority judgment model to group features according to the processing feature category and processing direction; Parameter recognition module, which identifies and extracts part dimensions and tolerances marked in the solid modeling feature sketch and incorporates them into the processing technology decision-making factors; The process analysis module analyzes the machining process of parts based on the machining feature category, part size and tolerance based on the machining process knowledge graph; Type determination module, which determines the blank type, machining allowance distribution, processing steps and clamping method based on the part's appearance characteristics, part machining process and dimensional accuracy requirements; The sorting module rotates and translates the normal vector of the sketch plane according to the standard machining coordinate system of various machine tools according to the blank type and machining steps, converts the three-dimensional space coordinates of the machining contour into machine tool machining coordinates and sorts the machining information; The path calculation module calculates the machining path of the part machining process based on the results of the part's machining contour, depth, machining allowance and dimensional accuracy identification; The code generation module combines the machining path with the instructions supported by the specific machine tool, optimizes the program segments through instruction merging and interpolation, and generates G code through post-processing.
9. A computer-readable storage medium, characterized in that The invention comprises instructions, which, when executed on a computer, enable the computer to execute the method for generating a machining program based on a SolidWorks model according to any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a processing program based on a SolidWorks model according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Feature-based numerical-control method for processing and manufacturing complicated parts
CN103235556A
Product customization method and system and readable storage medium
CN110096821A
Pipe tool path generation method based on SolidWorks secondary development
CN112906215A
Machining programming navigation system and method, computer equipment and storage medium
CN119717692A
Low-cost 2d plotter computer numeric control (CNC) machine using arduino
IN202041031464A
Cited By
Ship CAD (computer-aided design) system-based sheet part automatic nesting method, manufacturing method and system
CN121052015A
Non-standard mechanism guide plate automatic design method and device, electronic equipment and storage medium
CN121413296A
Non-standard mechanism guide plate automatic design method and device, electronic equipment and storage medium
CN121413296B
Automobile chassis part casting process model generation method and system based on multi-modal feature recognition
CN122286965A