A method for animating the machining process and obtaining the workpiece and undeformed chips after machining

Through customized frame decomposition and multi-threaded event-driven architecture, combined with OpenGL and Rhino software, the contradiction between accuracy and efficiency in machining simulation is resolved, achieving high-precision machining process visualization and efficient model generation.

CN120374800BActive Publication Date: 2025-09-26SHANDONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510837359.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-26
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

Existing machining simulation methods have difficulty in balancing accuracy and efficiency, and lack visualization of the machining process.

Method used

By customizing the frame decomposition processing process and combining it with the secondary development of OpenGL and Rhino software, quantitative control of accuracy and efficiency is achieved. A multi-threaded event-driven architecture is used for data acquisition, transmission and calculation, and high-precision swept volume modeling and mesh Boolean operations are performed.

Benefits of technology

It achieves high-precision visualization of the machining process and efficient generation of models of the workpiece and undeformed chips after machining, improving computing efficiency and optimizing resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374800B_ABST
    Figure CN120374800B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of machining simulation technology and discloses a method for animating a machining process and obtaining a workpiece and undeformed chips after machining, comprising the following steps: (1) decomposing the machining process into custom frames to generate a machining data set containing discrete coordinates of the swept surface and the spatiotemporal position of the tool tip; (2) connecting animation frames with events to achieve a closed loop of data acquisition, transmission, calculation, and animation rendering; and (3) secondary development of Rhino software to achieve Boolean operations and precision assurance, and output a model of the workpiece and an undeformed chip after machining. The present invention decomposes the machining process into frames, allowing users to customize the number of frames for a certain step as needed, and achieves precision-controlled swept volume modeling through linear adjustment. Increasing the number of frames can improve the sampling density of the swept surface and the precision of Boolean operations, while reducing the number of frames can optimize the computational efficiency, thereby forming a quantitative control mechanism for precision and efficiency, providing a high-precision and high-efficiency solution for complex gear machining simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for performing animation demonstration on a mechanical processing process and obtaining a processed workpiece and undeformed chips, belonging to the technical field of processing simulation. Background Art

[0002] In the field of CNC machining, machining simulation has become a core technology for verifying tool paths and predicting workpiece topography. Existing simulation methods mainly focus on tool swept volume construction and discretized Boolean operations. Their implementation paths can be divided into two typical methods:

[0003] The first method constructs a tool-swept volume, sampling the tool's swept surface and trajectory at a fixed time step. This generated volume then performs Boolean operations on the workpiece. While this method maintains an approximate continuity of motion, the fixed sampling step can easily lead to an imbalance between model accuracy and computational efficiency. Excessively large step sizes can result in loss of microscopic geometric features in the machined workpiece, while excessively small step sizes can lead to redundant computations.

[0004] The second method is a static discretized Boolean operation, which directly defines the tool motion path using fixed position intervals and performs independent Boolean operations at each discrete point. For example, the "Spiral Bevel Gear Processing Simulation Method" disclosed in CN118821344A constructs an STL model of the gear blank and cutter head and performs topological reconstruction on them. The relative positions of the two are adjusted to the starting point of the processing. The tool moves in jumps at a fixed time step, and a Boolean difference operation is performed at each static position. This method converts the continuous cutting process into a static discrete Boolean operation process, which has relatively low accuracy and lacks visualization of the processing process. Summary of the Invention

[0005] In response to the shortcomings of existing mechanical processing simulation technology, the present invention provides a method for realizing controllable precision, forming a quantitative control mechanism of precision and efficiency, and obtaining the workpiece and undeformed chips after processing, so as to simultaneously solve the contradiction between precision and efficiency when constructing the tool sweep volume and the problem of visualizing the processing process.

[0006] The method of the present invention for animating a machining process and obtaining a workpiece and undeformed chips after machining comprises the following steps:

[0007] (1) Custom frame decomposition of the processing process:

[0008] The machining process is decomposed frame by frame according to the accuracy requirements, and divided into a dense frame area for cutting motion and a sparse frame area for non-cutting motion. Through the timed redrawing and coordinate acquisition functions of OpenGl, the position coordinates of the tool sweep surface, tool tip point and workpiece are recorded in each frame to generate a machining data set containing the discrete coordinates of the sweep surface and the spatiotemporal position of the tool tip point.

[0009] High-frame sampling density of 5-30 frames / mm or 2-10 frames / degree is set for high-frame sampling of cutting motion (such as coordinated rotation of the tool and workpiece, and tool feed). Different frame densities are also distinguished for linear and circular interpolation of the tool. For disc-type tools, a multi-slice asynchronous recording mode is used, with delayed triggering of recording events for each group of slices in steps of Δ = 360° / number of slices. The recording duration is Δ + 10°, achieving non-uniform sampling of the cutting trajectory and data compression.

[0010] The sparse frame number area of ​​the non-cutting motion (such as tool setting, tool retraction, and idle stroke motion) is set to a low frame density sampling of 1-5 frames / mm.

[0011] (2) Animation frames are connected with events (multi-threaded event-driven and dynamic binding):

[0012] Based on a multi-threaded event-driven architecture, the machining process is decomposed into five key events triggered by serial, parallel, and cyclic events, including motion events, data recording events, forward transmission events, calculation events, and reverse transmission events. Each frame is connected to one or more events (whose execution has three major characteristics: parallelism, cyclicity, and conditional triggering), realizing a closed loop of data acquisition, transmission, calculation, and animation rendering. Among them:

[0013] Motion events: Drive linear interpolation (G01), clockwise circular interpolation (G02), and counterclockwise circular interpolation (G03) between the tool and the workpiece, and update the 3D pose in real time through the OpenGL coordinate transformation matrix; control the animation playback speed by adjusting the frame rate.

[0014] Data recording events: Records three types of data: the relative position coordinates of the swept surface, the time-space point set of the tool tip during cutting, and the time-space point set of the tool tip during complete machining. All data are written into independent lists, namely the swept surface list, the tool tip point list during cutting, and the tool tip point list during complete machining. Among them:

[0015] The swept surface list is constructed by converting the line segments constituting the swept surface into discrete point sets, obtaining the coordinates of the discrete point sets of the tool swept surface frame by frame, and converting the coordinates of the discrete point sets of the tool swept surface into the coordinates of the relative position discrete point sets in the workpiece static coordinate system by inverse workpiece motion matrix, thereby forming a time-space related swept surface list;

[0016] The tool tip point list during cutting, when in a dense frame (during cutting), obtains the position coordinates of the tool tip point in the current frame, converts the coordinates into relative position coordinates in the workpiece static coordinate system, records the time-space point set of the tool tip point during the entire cutting process, generates a material removal trajectory line through non-uniform rational B-spline interpolation, and jointly constructs a swept volume model with the swept surface list;

[0017] The complete machining tool tip point list records the time-space point set of the tool tip points during the entire machining process and is used to generate and visualize the tool trajectory line.

[0018] Forward transfer event: This function writes and transfers data. The swept surface list is written to a csv file (for easy reconstruction of the swept surface). The tool tip point list is written to an obj file (for easy trajectory generation). Both files are transferred to the Rhino temporary buffer.

[0019] Computational events: Perform swept volume reconstruction and mesh Boolean segmentation operations, synchronously output the processed workpiece model and the undeformed chip model, and then perform multi-level geometry repair.

[0020] Backward transmission events: The STL model generated by Rhino is sent back to the user interface, and PBR (physical based rendering) material mapping and dynamic lighting rendering are implemented through the OpenGL engine.

[0021] (3) Secondary development of Rhino software to achieve Boolean operations and accuracy assurance:

[0022] Through Python script bridging, Rhino can run silently in the background, perform swept volume reconstruction, mesh Boolean operation segmentation and multi-level geometry repair, and simultaneously output the workpiece model after processing and the undeformed chip model; the script covers the software startup stage, swept volume reconstruction stage, Boolean operation stage and post-processing stage.

[0023] During the software startup phase, Python's subprocess module is used to create a Rhino process, configure startup information of the STARTUPINFO class, set it to hidden window mode, and disable interface rendering to reduce resource usage. In the Python script, the Rhino API is called through the rhinoscriptsyntax library, and the native instructions of the macro editor are converted into string format and embedded in the rs.Command() function for execution (the code is more concise, easy to understand, and executes quickly).

[0024] During the swept volume reconstruction phase, Rhino's single-track sweeping function is used to uniquely pair the swept surface numbering system with the trajectory line to avoid abnormal connections between the beginning and end of multiple trajectory lines. Based on the ratio of the number of swept surfaces to the number of trajectory points, the non-uniform rational B-spline (NURBS) algorithm is used to fit the ratioed number of trajectory points into a high-precision curve. When setting the single-track sweep parameters, the tool axis is selected as the direction, and the re-approximation section tolerance is selected as 0.01 mm.

[0025] In the Boolean operation stage, the sweeping body is converted into a mesh model with a preset density using the closing and mesh conversion functions of Rhino, and the mesh Boolean segmentation operation function is performed to simultaneously obtain the models of the machined workpiece and the undeformed chip.

[0026] In the post-processing stage, the mesh repair function of Rhino is used to repair the mesh in sequence according to multiple levels of precision, merge fragmented surfaces ≤ 0.005 mm, screen defective bodies, and stitch them to an error of ≤ 0.002 mm.

[0027] The present invention constructs a composite user interface that integrates tool library management, process parameter configuration, and kinematic visualization through secondary development of Rhino software, embedding of OpenGL engine, and PYQT interface design. It supports customized frame division, import of tool and workpiece models, process parameter adjustment, Boolean operation execution, model material rendering, and animation speed control, and realizes rapid data transmission between the user interface and Rhino software. The user interface can display the updated workpiece geometric features, tool trajectory, and corresponding chip solid model for each tool.

[0028] This invention decomposes the CNC machining process into frames, allowing users to customize the frame count for a specific step as needed. This allows for precision-controlled swept volume modeling through linear adjustment. Increasing the frame count improves the sampling density of the swept surface and the accuracy of Boolean operations, while reducing the frame count optimizes computational efficiency, forming a quantitative control mechanism for both precision and efficiency. The animation speed is controlled using frame rate: dynamic playback rate adjustment from 1 to 20 frames per second is supported, with low-speed mode (≤5 frames per second) used for process detail verification and high-speed mode (≥10 frames per second) for overall process demonstration.

[0029] The present invention provides a high-precision and high-efficiency solution for complex gear machining simulation through the close combination of animation frames and process parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a process flow chart of the method of the present invention.

[0031] Figure 2 It is a software window interface diagram of the method of the present invention.

[0032] Figure 3 This is a schematic diagram of the hypoid gear before processing.

[0033] Figure 4 This is a schematic diagram of the processing position setting.

[0034] Figure 5 It is a schematic diagram of process parameter settings.

[0035] Figure 6 This is the left-angle view of the relative positions of the workpiece and the cutter head after tool setting.

[0036] Figure 7 This is a bird's-eye view of the relative positions of the workpiece and cutter head after tool setting.

[0037] Figure 8This is a schematic diagram of frame decomposition.

[0038] Figure 9 It is a frame number-event flow chart.

[0039] Figure 10 It is a partial dataset.

[0040] Figure 11 This is a schematic diagram of the hypoid gear after processing.

[0041] Figure 12 It is a schematic diagram of the tool path.

[0042] Figure 13 It is a schematic diagram of undeformed chips.

[0043] Figure 14 This is a schematic diagram of the hypoid gear after actual processing. DETAILED DESCRIPTION

[0044] Figure 1 The implementation process of the method of the present invention for animating the machining process and obtaining the workpiece and undeformed chips after machining is given. Specifically, the method includes the following steps.

[0045] 1. Customize the frame decomposition of the processing process.

[0046] The actual machining process on the CNC machine tool is decomposed frame by frame according to the accuracy requirements of the workpiece after machining. Each frame accurately records the tool sweep surface, tool tip point and the position coordinates of the workpiece, and the machining process data set is constructed frame by frame to generate a more accurate and reliable swept volume.

[0047] For cutting motions (such as the combined motion of the tool's spindle rotation and feed motion in milling), dense frame allocation (5-30 frames / mm or 2-10 frames / degree) should be used to accurately describe the machining trajectory. This needs to be further differentiated based on the interpolation type: linear interpolation motion uses a relatively low-density frame allocation, while circular interpolation motion with higher geometric complexity requires a higher-density frame allocation. Conversely, for non-cutting motions (such as tool setting, tool retraction, and idle travel motion), system resource consumption can be optimized by allocating sparse frames to achieve a balance between accuracy and efficiency.

[0048] 2. Animation frames are connected to events.

[0049] Construct five types of serial and parallel trigger events (motion, data recording, forward / reverse transmission, and calculation), integrate the PyQt interface, OpenGL engine, and Rhino secondary development module, and realize a closed-loop process of real-time tool trajectory update, swept volume modeling, mesh Boolean operation segmentation, and model material rendering.

[0050] Based on a multi-threaded event-driven architecture, this invention decomposes the CNC machining process into five key events that can be triggered serially, parallelly, and cyclically. Each frame can be connected to one or more events simultaneously, and its execution has three major characteristics: parallelism, cyclicity, and conditional triggering. The specific events are as follows:

[0051] The first type of event is a motion event, which drives linear interpolation (G01), clockwise circular interpolation (G02), and counterclockwise circular interpolation (G03) between the tool and the workpiece. Kinematic matrix transformations update the swept surface and tool tip position in real time as the tool performs translation / rotation operations. All motion events are dynamically rendered in OpenGL using 3D coordinate transformation functions. Since they are linked to animation frames, the frame rate can be adjusted to control the animation playback speed.

[0052] The second type of event is a data recording event. The present invention establishes three data collection lists:

[0053] (1) Sweep surface list: The line segments constituting the sweep surface are converted into discrete point sets, and the coordinates of the discrete point sets of the tool sweep surface are obtained frame by frame. By inversely calculating the workpiece motion matrix, the coordinates of the discrete point sets of the tool sweep surface are converted into the coordinates of the relative position discrete point sets in the workpiece stationary coordinate system, thus forming a time-space related sweep surface list;

[0054] (2) Tool tip point list during cutting: When in a dense frame (during cutting), obtain the position coordinates of the tool tip point in the current frame, convert the coordinates into the relative position coordinates in the workpiece static coordinate system, record the tool tip point time-space point set of the entire cutting process, generate the material removal trajectory line through non-uniform rational B-spline interpolation, and jointly construct the swept volume model with the swept surface list;

[0055] (3) Tool tip point list during complete machining: records the time-space point set of the tool tip point during the entire machining process, which is used to generate and visualize the tool trajectory line.

[0056] The third event is a forward data transfer event, which writes the data recorded in the second event to an .obj file (tool tip point list) and a .csv file (swept surface list). The workpiece model is then exported as an STL file. After saving, it is sent to Rhino via a script function. All three files can be recognized, read, and processed by Rhino, completing the one-way data transfer from the user interface to Rhino.

[0057] The fourth event is the calculation event, which is executed every time the tool completes a process step. The macro editor instructs Rhino to use the received data to generate a swept volume, perform a mesh Boolean segmentation operation on the workpiece, and obtain the model of the machined workpiece and the undeformed chip. The model is then subjected to multi-level geometric repair.

[0058] The fifth event is the reverse data transmission event, which saves the model processed by Rhino in STL format and passes it back to the user interface. The model is rendered with materials and lighting and then displayed in OpenGL. At this point, a cycle process ends.

[0059] 3. Secondary development of Rhino software.

[0060] Obtaining the workpiece model after machining and the undeformed cutting model requires two operations: Boolean difference and Boolean intersection of the workpiece and the tool sweep volume, which is time-consuming. Rhino's mesh Boolean operation segmentation function can simultaneously perform Boolean difference and Boolean intersection operations. Therefore, we chose to carry out secondary development of Rhino to improve Boolean efficiency.

[0061] Rhino's secondary development relies on its macro editor and RhinoPython compiler. This paper embeds macro editor commands into Python code. By combining Python with macro commands, the background implements NURBS trajectory and swept volume generation (Z-axis orientation, cross-section tolerance 0.01mm), mesh Boolean operation optimization, and a multi-level geometry repair mechanism (including merging fragmented surfaces, screening defective bodies, and stitching repair) to ensure model errors ≤ 0.002mm. The specific implementation is divided into four stages.

[0062] During the software startup phase, Python's subprocess module is used to create a Rhino process. The startup information of the STARTUPINFO class is configured, set to hidden window mode, and interface rendering is disabled to reduce resource usage. In the Python script, the Rhino API is called through the rhinoscriptsyntax library. The native instructions of the macro editor are converted into string format and embedded in the rs.Command() function for execution. The calculation time for a single step is ≤15 seconds.

[0063] During the swept volume reconstruction phase, Rhino was used to implement precise sweeping capabilities. Strict adherence to the "surface-line correspondence" principle was required, with the swept surface numbering system uniquely pairing the trajectory lines to avoid unintended connections between multiple trajectory lines. Based on the ratio of the number of swept surfaces to the number of trajectory points, a non-uniform rational B-spline (NURBS) algorithm was used to fit the proportional number of trajectory points into a high-precision curve. When setting the single-track sweep parameters, the tool axis was selected as the orientation, and the cross-sectional tolerance (0.01 mm) was re-approximated.

[0064] During the Boolean operation phase, Rhino's closing and mesh conversion functions are used to convert the swept volume into a mesh model with a preset density. The mesh Boolean operation segmentation function is then performed to obtain the machined workpiece and undeformed chip models. The macro commands are as follows:

[0065] (1) Execute "rhinoscriptsyntax.Command('_Cap')" to close the entity object;

[0066] (2) Execute “rhinoscriptsyntax.Command('_-Mesh P,100 Enter')” to convert the entity into a mesh model with a mesh density of 100;

[0067] (3) Execute “rhinoscriptsyntax.MeshBooleanSplit(result, object2[i],delete_input=True)” to perform mesh Boolean splitting operation on the workpiece and the swept body in sequence according to the number, and the processed workpiece model and the undeformed cutting model can be obtained at the same time.

[0068] In the post-processing stage, multi-level precision repair is performed for geometric defects caused by Boolean operations:

[0069] (1) Execute “rhinoscriptsyntax.Command('_MergeAllFaces Enter')” to merge the fragmented surfaces with a tolerance of ≤ 0.005 mm;

[0070] (2) Execute "rhinoscriptsyntax.Command('_SelBadObjects Enter')" to filter the defective body. If it is found, execute "rhinoscriptsyntax.Command('_Repair Enter')" to repair it. The final entity stitching error is ≤0.002mm;

[0071] (3) Execute “rhinoscriptsyntax.Command('_-Export "result.stl" Enter')” to output the processed model.

[0072] This solution reduces Rhino's memory usage from an average of 750Mb to 500Mb, and reduces the calculation time for a single workstep from an average of 20 seconds to 15 seconds, improving performance by approximately 30%.

[0073] The following is an embodiment using hypoid gear processing as an example.

[0074] 1. Open the user interface. In order to better display the animation and facilitate user operation, a user interface is created, such as Figure 2 As shown, the area division of the interface refers to the following table:

[0075] Table 1 Functional partition table

[0076] Region Name Location Detailed functions Operation Steps Box Upper left corner of the interface Record user operation steps Processing control bar Vertical bar on the left side of the interface 1. Tool and workpiece import, 2. Parameter setting, 3. Tool setting, 4. Processing start and stop, 5. Tool path and chip inspection Parameter display bar Horizontal bar on the upper side of the interface 1. Preset parameter loading, 2. Parameter display Comprehensive control bar Vertical bar on the right side of the interface 1. Frame rate control, 2. Field of view control, 3. Light control, 4. Material rendering Visualization Window Central area of ​​the interface 1. Display models and animations, 2. Model interaction

[0077] 2. Import the workpiece and tool models. If there are pre-set models, you can also select them from the tool and workpiece library. The model will be displayed in the visualization window, such as Figure 3 shown.

[0078] 3. Select the processing method and simulate the Klingelnberg C50 gear milling machine to process quasi-curved gears. The C50 gear milling machine is a six-axis CNC machine tool (A, B, C, X, Y, and Z axes). The A axis is the cutter head rotation axis, the B axis is the workpiece rotation axis, the C axis controls the workpiece tilt, and the X, Y, and Z axes control three-dimensional linear motion perpendicular to each other.

[0079] The basic parameters of the cutter head and wheel blank have been determined, as shown in the following table:

[0080] Table 2 Basic parameters of cutterhead

[0081]

[0082] Table 3 Basic parameters of gear blank

[0083]

[0084] According to the principle of forming method for machining hypoid gears and the basic parameters of the cutter head and workpiece, the machine tool adjustment parameters required for machining hypoid gears using the Klingelnberg C50 gear milling machine can be determined, including the tool position S, tool position angle q, vertical wheel position Em, horizontal wheel position correction Xp, bed position Xb, and wheel blank installation angle δm.

[0085] The calculation formula of tool position S is as follows:

[0086] ;

[0087] Where, R m is the midpoint cone distance of the gear, r is the nominal radius of the cutter head, β m is the midpoint helix angle of the gear, and the calculated value is S=99.571mm.

[0088] The calculation formula of tool position angle q is as follows:

[0089] ;

[0090] The calculation results show that q=50.775°.

[0091] According to the tool position S and the tool position angle q, the horizontal wheel position Xp0 (Z axis) and the radial tool position Sr (Y axis) can be obtained:

[0092] ;

[0093] .

[0094] When machining a hypoid gear, the axis of the forming wheel intersects with the axis of the gear being machined, so the vertical wheel position Em=0; the designed intersection point coincides with the calculated intersection point for gear cutting, so the horizontal wheel position correction XP1=0.

[0095] The bed position Xb is equal to the tooth root height of the gear being processed, so the bed position Xb = -10.635mm; the wheel blank installation angle δ m It is equal to the pitch angle of the gear being processed, so the wheel blank installation angle δ m =74.750°.

[0096] The machine parameters are organized into the following table:

[0097] Table 4 Machine tool parameters

[0098]

[0099] Set the machining parameters and complete the tool setting. Figure 4 and Figure 5 As shown in the figure, users can input the machine parameters or set the parameters by themselves to observe the processing effects brought by different parameters. Figure 6 As shown, the relative position and the top view angle are as follows Figure 7 shown.

[0100] 4. Set the number of frames for the motion, based on the relative motion characteristics of the tool and workpiece, such as Figure 8 As shown, the processing process is decomposed into frames (you can enter the frame number and drag the slider to change the frame number linearly).

[0101] (1) Coordinated rotation phase (motion events and data recording events are parallel): Taking 5 frames / degree as an example, the tool and workpiece rotate synchronously around the spindle (frame interval 1-1930). Each frame is connected to the motion event and the recording event. The cutterhead has 17 blades. Every time the cutterhead rotates 21 degrees, a blade group prepares to begin cutting. Recording all tool tip points would increase the computational complexity. Therefore, a multi-blade asynchronous recording mode is used to record the tool tip point list during cutting. The data recording rule is as follows: each tool group is deferred triggered with a step size of Δ = 21 degrees (105 frames) and the tool tip point position is recorded as it moves 30 degrees (150 frames). The recording interval for the i-th group is [1 + Δ × (i-1), 30 + Δ × (i-1)]. For example, the recording interval for the first blade group is 1-30 degrees (1-150 frames), the second blade group is 22-51 degrees (106-255 frames), and so on. The recording interval for the seventeenth blade group is 337-386 degrees (1681-1930 frames). After all recordings are completed, the recording cycle restarts.

[0102] (2) Transmission and calculation phase (transmission events and calculation events are serial): After the motion and recording events are completed, the transmission and calculation events are automatically assigned to the next three frames. That is, the 1931st frame is connected to the forward transmission event, the 1932nd frame is connected to the calculation event, and the 1933rd frame is connected to the reverse transmission event. The next frame will not be executed until the current frame is completed. Therefore, the task can be completed by connecting the transmission event and calculation event to only one frame.

[0103] (3) Axial feed motion stage (optional, motion events and data recording events are parallel): the tool feeds along the axis (frame interval 1934-1953), and each frame connects the motion event and the recording event.

[0104] 5. When the processing starts, the system initializes the frame counter (initial value = 0) and triggers the preset events frame by frame through the multi-threaded event distributor. The process is as follows Figure 9 As shown in the figure, motion events drive the translation / rotation of the tool and workpiece, and the frame rate is dynamically controlled (1-20 frames / second) to achieve smooth animation presentation; data recording events synchronously collect the time and space point sets of the tool sweep surface discrete points and tool tip points to form a data set for cutting trajectory and swept volume modeling. Some data sets are shown in the figure. Figure 10 As shown in the figure, the data transmission event exports the swept surface list as .csv format and saves the tool tip point list as .obj format to a temporary cache directory in real time for Rhino backend call; the calculation event triggers the RhinoPython script to automatically perform swept surface reconstruction, trajectory point NURBS fitting, swept volume generation and mesh Boolean segmentation operations.

[0105] Each time a single step is completed, the counter automatically returns to zero, and the progress bar on the interface dynamically updates the percentage based on the accumulated frame count until all steps are completed and the progress reaches 100%. The resulting hypoid gear geometry (see Figure 11 ), multi-tool composite tool path (see Figure 12 ) and the undeformed chip morphology of the third cutting (see Figure 13 ).

[0106] 6. After the processing simulation is completed, the results are verified and subsequently processed:

[0107] (1) The user interface based on the OpenGL engine supports multi-view interactive observation. Users can observe the workpiece surface morphology, tool trajectory and undeformed chip morphology through the field of view adjustment module (translation, rotation, zoom) of the integrated control bar to achieve a preliminary evaluation of the process quality. Figure 11 ) and the actual processed hypoid gear (see Figure 14 ) were compared and it was found that the tooth profiles of the two were highly consistent, which verified the effectiveness of the method of the present invention.

[0108] (2) The hypoid gear model generated by simulation is output in STL format and can be directly imported into CAE software such as COMSOL and Abaqus, providing a data basis for subsequent simulations such as thermodynamic analysis and static simulation.

[0109] (3) By initializing and resetting the process parameters, the influence of parameter adjustment on the tool motion trajectory, workpiece processing quality and undeformed chip morphology can be verified, providing an effective verification method for process parameter optimization.

Claims

1. A method for animating a machining process and obtaining a workpiece and undeformed chips after machining, characterized in that: The following steps are involved: (1) Custom frame decomposition of the processing process: The machining process is decomposed frame by frame according to the accuracy requirements, divided into a dense frame area of ​​cutting motion and a sparse frame area of ​​non-cutting motion. Through the timed redrawing and coordinate acquisition function of OpenGL, the position coordinates of the tool sweep surface, tool tip point and workpiece are recorded in each frame, generating a machining data set containing the discrete coordinates of the sweep surface and the spatiotemporal position of the tool tip point. (2) Animation frames are connected with events: Based on a multi-threaded event-driven architecture, the CNC machining process is decomposed into five key events triggered by serial and parallel cycles, including motion events, data recording events, forward transmission events, calculation events, and reverse transmission events. Each frame is connected to one or more events to achieve a closed loop of data acquisition, transmission, calculation, and animation rendering. (3) Secondary development of Rhino software to achieve Boolean operations and accuracy assurance: Through Python script bridging, Rhino can run silently in the background, perform swept volume reconstruction, mesh Boolean operation segmentation and multi-level geometry repair, and simultaneously output the workpiece model after processing and the undeformed chip model; the script covers the software startup stage, swept volume reconstruction stage, Boolean operation stage and post-processing stage.

2. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: In the step (1), the dense frame number area of ​​the cutting motion is set to a sampling density of 5-30 frames / mm or 2-10 frames / degree. For the cutter type tool, a multi-strip asynchronous recording mode is adopted, and the recording event of each group of blades is delayed with a step size of Δ=360 / number of blades, and the recording time is Δ+10°; the sparse frame number area of ​​the non-cutting motion is set to a sampling density of 1-5 frames / mm.

3. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: In step (2): Motion events: Drive linear interpolation, clockwise circular interpolation, and counterclockwise circular interpolation between the tool and the workpiece, and update the 3D pose in real time through the OpenGL coordinate transformation matrix; control the animation playback speed by adjusting the frame rate; Data recording events: records three types of data: the relative position coordinates of the swept surface, the space-time point set of the tool tip point during cutting, and the space-time point set of the tool tip point during complete machining. All data are written into independent lists, namely the swept surface list, the tool tip point list during cutting, and the tool tip point list during complete machining; Forward transfer event: realizes data writing and transmission, writes the swept surface list into a csv format file, writes the tool tip point list into an obj format file during cutting, and transfers both files to the Rhino temporary buffer area; Computational events: Execute swept volume reconstruction and mesh Boolean segmentation operations, synchronously output the processed workpiece model and the undeformed chip model, and then perform multi-level geometry repair work; Reverse transmission event: The STL model generated by Rhino is sent back to the user interface, and PBR material mapping and dynamic lighting rendering are implemented through the OpenGL engine.

4. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 3, characterized in that: The swept surface list converts the line segments constituting the swept surface into discrete point sets, obtains the discrete point set coordinates of the tool swept surface frame by frame, and converts the discrete point set coordinates of the tool swept surface into relative position discrete point set coordinates in the workpiece stationary coordinate system through the inverse workpiece motion matrix to form a time-space related swept surface list.

5. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 3, characterized in that: The tool tip point list during cutting, when in a dense frame, obtains the position coordinates of the tool tip point in the current frame, converts the coordinates into relative position coordinates in the workpiece static coordinate system, records the time-space point set of the tool tip point in the entire cutting process, generates the material removal trajectory line through non-uniform rational B-spline interpolation, and jointly constructs the swept volume modeling with the swept surface list.

6. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 3, characterized in that: The complete machining tool tip point list records the time-space point set of the tool tip points during the entire machining process and is used to generate and visualize the tool trajectory line.

7. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: During the software startup phase in step (3), the Rhino process is created using Python's subprocess module, the startup information of the STARTUPINFO class is configured, the process is set to hidden window mode, and interface rendering is disabled to reduce resource usage; in the Python script, the Rhino API is called through the rhinoscriptsyntax library, the native instructions of the macro editor are converted into a string format, and the rs.Command() function is embedded for execution.

8. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: In the swept volume reconstruction stage in step (3), the single-track sweep function of Rhino is used to uniquely pair the swept surface numbering system with the trajectory line to avoid abnormal connection between the beginning and the end of multiple trajectory lines. Based on the ratio of the number of swept surfaces to the number of trajectory points, the non-uniform rational B-spline algorithm is used to fit the ratioed number of trajectory points into a high-precision curve. When setting the single-track sweep parameters, the tool axis is selected as the direction, and the re-approximation section tolerance is selected as 0.01mm.

9. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: In the Boolean operation stage of step (3), the sweeping body is converted into a mesh model of a preset density using the closing and mesh conversion functions of Rhino, and the mesh Boolean segmentation operation function is performed to obtain the workpiece and the undeformed chip model after processing.

10. The method for animating a machining process and obtaining a workpiece and undeformed chips after machining according to claim 1, characterized in that: In the post-processing stage of step (3), the mesh repair function of Rhino is used to repair the mesh in multiple levels of precision, merge the fragmented surfaces with a size of ≤0.005 mm, screen the defective bodies and stitch them to an error of ≤0.002 mm.

Citation Information

Patent Citations

  • Machining simulation method of spiral bevel gear

    CN118821344A

  • Cylindrical gear hobbing non-deformation chip modeling method based on three-dimensional CAD software

    CN113064383A

  • Visualization method for displaying cutting machining process of cutter in webpage environment

    CN116662694A