A real-time material removal method for digital twin milling simulation based on Unity

By traversing and modifying the vertex coordinates of the mesh in the workpiece twin model within the Unity platform, the real-time problem of material removal in digital twin milling simulation is solved, achieving efficient and visualized simulation results applicable to various workpiece models.

CN118378386BInactive Publication Date: 2024-11-26NANJING UNIV OF SCI & TECH

Patent Information

Application Number
CN202410813902.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-11-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies lack real-time performance in material removal processes during digital twin milling simulations, have high computational complexity, and cannot meet the needs for real-time monitoring and prediction.

Method used

A Unity-based digital twin milling simulation method is adopted. By traversing the mesh vertex coordinates of the workpiece twin model in each frame update, the vertex coordinates that meet the conditions are selected and modified to achieve real-time dynamic simulation of the material removal process.

Benefits of technology

It achieves real-time and high-efficiency milling simulation, has universality for different workpiece models, reduces the computational load on the computer, and improves the simulation visualization effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378386B_ABST
    Figure CN118378386B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time material removal method for digital twin milling simulation based on Unity. The method constructs a twin of the workpiece to be milled after refinement for the workpiece model generated internally and imported externally, and uses the Mesh component to obtain the mesh information of the three-dimensional model; sets the tool radius to characterize the cutting range to establish the twin model of the tool; traverses and filters the vertices within the cutting range and reloads the workpiece mesh after modifying the corresponding coordinate values; and uses the operating principle of Unity mesh rendering and frame update to realize real-time simulation of material removal. The present invention can realize real-time simulation of the milling material removal process, and has better calculation efficiency and simulation real-time performance compared with the traditional Boolean operation method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional model mesh generation and real-time mesh reconstruction, and in particular to a real-time material removal method for digital twin milling simulation based on Unity. Background Art

[0002] In the early stage of computer application, researchers usually used a large number of cutting experiments to study parameter rotation, material deformation mechanism, milling data monitoring, etc. in the milling process. Because of the need for repeated tool removal, workpiece installation, tool adjustment and other steps, it often takes a lot of manpower and material resources. Therefore, simulation of milling can significantly reduce time and cost, while also increasing the visibility of processing monitoring.

[0003] Digital twin technology studies the digital twin of the milling process, collects and analyzes the processing data, and uses these data to perform geometric and physical simulations of the milling process in the virtual space, so as to monitor and even predict the milling process and parameter changes in real time. At present, the research on the real-time material removal method of digital twin milling simulation usually adopts two ideas: one is to construct a CSG or Brep model, perform real-time Boolean operations on the tool and workpiece in three-dimensional space, and realize the cutting simulation process of material removal. This method can accurately describe the appearance of the model and has the advantages of high precision; however, due to the large number of triangular facets in the model, there are problems such as huge calculation amount, low calculation efficiency, and easy misalignment error. In addition, after multiple cutting, the number of facets in the three-dimensional model will explode geometrically, which will further increase the computer load. Therefore, it can usually only be used for model segmentation and cannot be applied to the real-time simulation of digital twin milling. In order to avoid the problems of complex calculation and long calculation time, another research idea is to use the space segmentation method to construct the Dexel model, decompose the three-dimensional geometric shape into a series of basic element geometries, and convert the material removal process from three-dimensional Boolean operations to basic element Boolean operations to improve cutting efficiency. Furthermore, considering that material removal is caused by the relative displacement between the tool and the workpiece, a Boolean operation is performed on the swept volume formed by the workpiece Dexel model and the tool's Brep model to achieve material removal from the workpiece during the tool's movement. Although this type of research idea further reduces the computer's computing pressure, since the swept volume requires the tool to produce a relative displacement with the workpiece within a certain running time to form, the material cannot be removed during the tool's movement, so this type of method has poor real-time performance.

[0004] In order to overcome the above problems, the present invention proposes a real-time material removal method for digital twin milling simulation based on Unity. Summary of the invention

[0005] In view of the problem that real-time simulation of milling processing is difficult to accurately describe and characterize the workpiece material removal process, the present invention provides a real-time material removal method for digital twin milling processing simulation based on Unity, which is used to solve the technical problem raised in the background technology and realizes the simulation of the material removal process of milling processing with excellent real-time performance and high visualization.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] A real-time material removal method for digital twin milling simulation based on Unity, comprising the following steps:

[0008] S1. Establishing a twin model of the workpiece to be milled: Using a three-dimensional rendering method of triangular facets to establish a twin model of the workpiece to be milled in the digital twin milling processing simulation platform built by Unity; including the following sub-steps:

[0009] S11. For workpieces to be milled of different sources and different appearance shapes, twin models are built according to the degree of refinement required for the simulation effect. Workpieces to be milled are divided into two types: internal dynamic establishment and external import, among which:

[0010] The internal dynamically generated workpiece model is manually set through the C# script, the appearance size and degree of refinement are manually set in the digital twin milling simulation platform, and the coordinates of each vertex and the index order of the triangle surface are calculated according to the appearance size and degree of refinement and stored in the corresponding array.

[0011] For the externally imported workpiece model, 3DMAX software is used to refine it, and then exported to the digital twin milling processing simulation platform in FBX format.

[0012] S12. Add a Mesh component to the twin model of the workpiece to be milled, and obtain its mesh information while rendering the model; the mesh information includes a vertex coordinate array and a triangle face index array.

[0013] S2. Establishing a twin model of the tool: Importing the three-dimensional model of the tool into the digital twin milling processing simulation platform in FBX format to establish a twin model of the tool; including the following sub-steps:

[0014] S21. Import tool model from outside.

[0015] S22. Set the tool radius R; accordingly, scale the tool model in the horizontal direction.

[0016] S23. Create an empty object named T as a child object of the twin of the tool model; wherein the coordinate of T is set to the bottom center of the tool model, representing the actual cutting position of the tool.

[0017] S3. Cutting Algorithm: Call the cutting algorithm during the frame update of Unity to dynamically reconstruct the workpiece Mesh grid and achieve real-time dynamic simulation of the material removal process; it includes the following sub-steps:

[0018] S31. Screen the vertices of the workpiece Mesh grid to be milled that meet the conditions: all vertices whose Y coordinate is greater than T and whose horizontal coordinates are within the circular range with the T coordinate as the center and R as the radius.

[0019] S32. Change the Y coordinate of all vertices screened in step S31 to the Y coordinate of T.

[0020] S33. Reload the Mesh grid and refresh the model of the workpiece to be milled.

[0021] The algorithm principle for realizing real-time material removal during the milling process simulation is as follows: In the Unity engine, 3D models such as workpieces and tools are all rendered in the form of triangular patches and presented on the computer screen. Therefore, the Mesh grid information of the workpiece is stored in the twin model, and the position coordinates of each vertex are recorded in the vertex coordinate array;

[0022] On the other hand, during milling, the tool is a rigid body in high-speed rotation and can be regarded as forming a cylindrical area with R as the bottom radius at the T position. Therefore, during the actual milling process, once the workpiece comes into contact with this cylindrical range, part of the material will be milled off.

[0023] Correspondingly, analyzing the milling process from the perspective of the workpiece's Mesh grid, it can be regarded as: once a certain mesh vertex is within the cylindrical range, it means that the vertex is milled and should collapse inward to the bottom surface of the tool, that is, the Y coordinate of the vertex is changed to the Y coordinate of T.

[0024] For example, for a certain mesh vertex A of the workpiece with coordinates (x1, y1, z1), and the coordinates of T are (x2, y2, z2), when performing milling simulation to remove material, when y1 > y2 and x1² + z1² < R², it means that vertex A is within the cylindrical range to be milled, and its coordinates are changed to (x1, y2, z1).

[0025] Therefore, during each frame update of Unity, the coordinates of all vertices of the workpiece can be traversed, the vertices within the above cylindrical range can be screened out, and their coordinate values can be modified to achieve real-time dynamic simulation of the material removal process.

[0026] Moreover, since the coordinate information of the vertex array is of numerical type and the quantity is limited, the calculation process of judgment and comparison will not bring an operation load to the computer.

[0027] Compared with the prior art, the present invention has the following advantages or technical effects:

[0028] In the traditional material removal method, the material removal during the milling process is achieved by performing Boolean interactive operations between the tool swept body and the workpiece. However, considering that the Unity 3D engine refreshes, renders and generates objects in the twin scene on the computer screen in each frame at a certain frame rate; therefore, the tool swept body can only be generated after waiting for several frame updates to be completed, that is, a certain response time is required to complete the swept body construction and then perform Boolean operations, so the real-time performance is insufficient.

[0029] Compared with the traditional method, the present invention takes into account the characteristic that the tool rotates at high speed to form a cylindrical rigid body in actual milling processing. By traversing, comparing and modifying the vertex coordinate array of the workpiece twin model Mesh in each frame update, the dynamic mesh reconstruction of the workpiece twin model is realized, which meets the real-time requirement of material removal in the milling simulation process.

[0030] The present invention can realize the real-time material removal process in the digital twin milling simulation platform built by Unity. In addition to being computationally efficient, it is also universal for different workpiece models.

[0031] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0033] Figure 1 is a flow chart of the present invention;

[0034] Figure 2 It is a workpiece model diagram dynamically generated internally, where Figure (a) is a square workpiece model diagram, and Figure (b) is a cylindrical workpiece model diagram;

[0035] Figure 3 It is the model diagram of the externally imported artifact;

[0036] Figure 4 It is a picture of the externally imported model processed by 3DMAX software, and also shows the number of its vertices and triangles;

[0037] Figure 5The figure is a simulation effect diagram of milling of a square workpiece using the method proposed by the present invention, wherein figure (a) is a display diagram of the tool milling to be performed, and figure (b) is a rendering of the real-time material removal during the milling process;

[0038] Figure 6 The figure is a rendering of the milling simulation of a cylindrical workpiece using the method proposed in the present invention. Figure (a) is a display of the tool milling to be performed, and Figure (b) is a rendering of the real-time material removal during the milling process. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] like Figure 1 As shown, the present invention provides a real-time material removal method for digital twin milling simulation based on Unity, including step S1 to establish a twin model of the workpiece to be milled, step S2 to establish a twin model of the tool, and step S3 to establish a cutting algorithm. The specific steps are:

[0041] S1. Use the three-dimensional rendering method of triangular faces to establish a twin model of the workpiece to be milled in the digital twin milling processing simulation platform built by Unity. The main steps are divided into S11, which builds twin models of workpieces to be milled of different sources and appearance shapes according to the degree of refinement required for the simulation effect, and S12, which adds Mesh components to the workpiece twin model, and obtains mesh information while rendering the model, including vertex coordinate arrays and triangle face index arrays.

[0042] S11. Build a twin model of the workpiece. According to the different sources of the three-dimensional model, the main steps are further subdivided into steps S111. For the workpiece dynamically generated internally, manually set the appearance size and refinement level in the twin platform, S112. Calculate the vertex coordinates and triangle index sequence and store them in the corresponding array, S113. Use 3DMAX software to refine the externally imported model and export it to the twin platform in FBX format.

[0043] Step S111. Manually set the three-dimensional size of the internally generated workpiece model in the Inspector panel through a C# script, and determine the specific value of the refinement degree parameter.

[0044] Step S112. Generate the required vertex coordinate array A according to the degree of refinement, calculate the coordinates of each vertex in turn according to the size and generate the vertices, and store them in array A after assignment; similarly, generate index array B according to Unity triangle patch rendering rules, calculate the vertex index order in turn and store them in array B.

[0045] Step S113. Use 3DMAX software to refine the external imported model according to the required simulation effect, and export the refinement result to the twin platform in FBX format.

[0046] Step S12. Add a Mesh component to the workpiece twin model. The Mesh component is responsible for three-dimensional rendering of the model and can obtain mesh information, including vertex coordinate arrays and triangle face index arrays.

[0047] Among them, for the internally generated workpiece twin model, its core mesh information is the autonomously generated array A and array B; for the externally imported workpiece twin model, its mesh information is automatically captured by the Mesh component.

[0048] S2. Establish a tool twin model. The main steps are S21 importing the tool model from the outside, S22 setting the tool radius R, and S23 creating an empty object named T as a cutting range comparison point in the material removal algorithm.

[0049] S21. Import the 3D model of the tool into the digital twin milling simulation platform in FBX format.

[0050] S22. Set the twin tool radius R according to the tool used in the actual milling process; accordingly, scale the twin model in the horizontal direction to ensure that the cutting area in the digital space is consistent with the physical space.

[0051] S23. Create an empty object named T as a child object of the tool twin model; the coordinates of the T object are set to the lowest center of the tool model to implement the core functions of the material removal algorithm.

[0052] S3. Call the cutting algorithm in Unity's frame update to realize the simulation function of real-time material removal during milling. The main steps are S31 to screen the workpiece Mesh grid vertices that meet the conditions, S32 to modify the Y coordinates of the vertices that meet the conditions, and S33 to re-render the workpiece model.

[0053] like Figure 2 and Figure 4 As shown, the Unity engine uses a triangular face rendering method in the computer to generate a three-dimensional model and present it on the screen.

[0054] Therefore, the twin model of the workpiece stores all the Mesh information used for rendering. Whether the workpiece twin model is generated internally or imported externally, its vertex coordinate array can be obtained through the Mesh component. The array contains the coordinate information of all mesh vertices required to render the model.

[0055] On the other hand, analysis of the actual milling process shows that the tool can be regarded as a cylindrical rigid body during high-speed rotation, and the part of the workpiece material that overlaps with the rigid body will be removed by milling.

[0056] Correspondingly, in the twin platform, the tool forms a cylindrical area with R as the bottom radius at position T.

[0057] Therefore, analyzing the milling process from the perspective of the mesh of the workpiece, it can be considered that: once a mesh vertex is in the cylindrical area, it means that the vertex will be milled, so the vertex should collapse toward the inside of the workpiece along the Y direction until the workpiece contacts the bottom surface of the tool model. During the cutting process, the bottom surface of the tool and the contact surface can be regarded as the same plane, and changing the Y coordinate of the vertex to the Y coordinate of T can represent the change process.

[0058] S31. Traverse the vertex coordinate array of the Mesh grid of the workpiece twin model, and filter out the vertices that meet the following conditions: the Y coordinate of the vertex is greater than T, and the horizontal coordinate is within the circular range with T coordinate as the center and R as the radius.

[0059] From the analysis of the above cutting simulation process, it can be seen that these vertices will be milled by the tool.

[0060] S32. The Y coordinates of the selected vertices are changed to the Y coordinates of T, and the changes in the coordinates of the vertices are used to represent the changes in the appearance of the workpiece caused by the removal of the workpiece material by milling.

[0061] S33. Reload the mesh information of the workpiece twin Mesh component and render and refresh the workpiece model to be milled.

[0062] The digital twin platform built based on Unity will automatically update frames, and the real-time rendering of the workpiece model will be performed according to the above algorithm process during each frame update, which can fully reflect the real-time material removal process of milling machining simulation.

[0063] The above method is applicable to the material removal process of milling simulation of simple blank parts and components with complex geometric appearance.

[0064] like Figure 5 and Figure 6As shown in the figure, the material removal algorithm proposed above is verified. The milling simulation is carried out by taking the internally generated square and cylindrical parts as examples, setting their three-dimensional dimensions to 80*30*3 and 30*50, and the refinement degree parameter to 200. The vertex coordinate array A containing 41209 vertex elements and the corresponding triangle patch index array B are generated; after importing the tool model, the radius R is set to 1.0, and the Figure 5 (b) and Figure 6 (b) It can be seen that the algorithm proposed in the present invention can simulate the material removal process accurately, efficiently and in real time. While ensuring the computational efficiency and simulation visualization, it can also meet the needs of different workpiece models and has high versatility.

[0065] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A real-time material removal method for digital twin milling simulation based on Unity, characterized in that: The following steps are involved: S1. Establishing a twin model of the workpiece to be milled: Using a three-dimensional rendering method of triangular facets to establish a twin model of the workpiece to be milled in the digital twin milling processing simulation platform built by Unity; It includes the following sub-steps: S11. For workpieces to be milled of different sources and different appearance shapes, build a twin model according to the degree of refinement required for the simulation effect; S12. Add a Mesh component to the twin model of the workpiece to be milled, and obtain its mesh information while rendering the model; the mesh information includes a vertex coordinate array and a triangle face index array; S2. Establishing a twin model of the tool: importing the three-dimensional model of the tool into the digital twin milling processing simulation platform in FBX format to establish a twin model of the tool; It includes the following sub-steps: S21. Importing tool model from outside; S22. Set tool radius R; S23. Create an empty object named T as a child object of the twin of the tool model; wherein the coordinate of T is set to the bottom center of the tool model, representing the actual cutting position of the tool; S3. Cutting algorithm: Call the cutting algorithm in Unity's frame update to dynamically reconstruct the workpiece Mesh and realize real-time dynamic simulation of the material removal process; It includes the following sub-steps: S31. Screening the mesh vertices of the workpiece to be milled that meet the conditions: all vertices whose Y coordinates are greater than T and whose horizontal coordinates are within a circular range with T coordinate as the center and R as the radius; S32. Change the Y coordinates of all vertices filtered out in step S31 to the Y coordinates of T; S33. Reload the Mesh grid and refresh the model of the workpiece to be milled.

2. According to a Unity-based digital twin milling simulation real-time material removal method according to claim 1, it is characterized in that: In step S11, the workpiece to be milled is divided into two types: internal dynamic establishment and external import: For the workpiece model dynamically generated internally, the appearance size and refinement level are manually set in the digital twin milling simulation platform, and the coordinates of each vertex and the index order of the triangle face are calculated based on the appearance size and refinement level and stored in the corresponding array; For the externally imported workpiece model, 3DMAX software is used to refine it, and then exported to the digital twin milling processing simulation platform in FBX format.

Citation Information

Patent Citations

  • Digital control processing real-time cutting simulation method of products

    CN101537585A

  • Real-time simulation method and system for milling of digital twin-driven thin-walled workpiece

    CN113714539A

  • Bearing milling monitoring method and system based on digital twinning

    CN117161454A

Cited By

  • Complex curved surface efficient cutting simulation method based on mixed geometric architecture

    CN121543228A

  • High-efficiency cutting simulation method for complex curved surface based on hybrid geometric architecture

    CN121543228B