Real-time three-dimensional grain rotation visualization method and system for face-centered cubic material
The method addresses the limitations of existing grain rotation visualization by providing a real-time, user-friendly interface for face-centered cubic materials, enhancing the efficiency and accuracy of materials science research and industrial applications.
Patent Information
- Application Number
- CN202411139036.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-19
AI Technical Summary
Existing methods for visualizing grain rotation in face-centered cubic materials lack real-time performance, require complex sample preparation, are not user-friendly, and cannot dynamically display the rotation process, limiting their application in materials science and engineering.
A real-time three-dimensional grain rotation visualization method using the Tkinter graphical user interface and Matplotlib library, which allows for intuitive input of Euler angles, real-time update of rotation matrices and Miller indices, and dynamic display of grain rotation through event monitoring technology.
Enables real-time, high-precision visualization of grain rotation, reducing operational complexity and cost, and improving the efficiency and accuracy of materials science research and industrial applications.
Smart Images

Figure CN119170155A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to but is not limited to the field of material technology, and in particular relates to a method and system for visualizing real-time three-dimensional grain rotation of a face-centered cubic material. Background Art
[0002] With the continuous development of materials science and engineering technology, the study of the microstructure of materials has received more and more attention. Especially in the study of crystalline materials, understanding the orientation and rotation of their grains is crucial for optimizing the performance of the materials. The orientation and rotation of grains can directly affect the mechanical, electrical and thermal properties of the material. Therefore, the development of a system that can visualize and analyze grain rotation in real time is of great significance for materials science research and engineering applications.
[0003] Currently, many advanced material characterization techniques, such as electron backscatter diffraction (EBSD), transmission electron microscopy (TEM) and atomic force microscopy (AFM), are able to provide high-resolution grain orientation information. However, these techniques usually require complex sample preparation and expensive equipment, and cannot achieve real-time observation and dynamic analysis. Therefore, developing a method and system that can visualize grain rotation in real time in three dimensions can not only make up for the shortcomings of existing technologies, but also provide a more convenient and efficient tool for materials science research.
[0004] In the prior art, some software tools can perform three-dimensional visualization of the microstructure of crystalline materials, but these tools often lack real-time performance and cannot achieve dynamic grain rotation visualization. In addition, most of these tools are aimed at general crystal structures, and there is no grain rotation visualization method specifically for face-centered cubic (FCC) materials. Face-centered cubic materials are widely used in aerospace, automotive, electronics and other fields, and the control and optimization of their grain orientation are of great significance to improving material performance. At present, some existing technologies and methods, such as three-dimensional drawing tools based on Python and Matplotlib, can achieve simple grain rotation visualization, but these methods usually require high programming skills and lack user-friendly interfaces, which is not conducive to the use of non-professional users. In addition, the existing visualization methods are mostly static images, which cannot dynamically display the rotation process of grains in real time, limiting their application in dynamic material characterization and analysis.
[0005] Therefore, there is an urgent need for a real-time three-dimensional grain rotation visualization method and system specifically for face-centered cubic materials, which can provide a user-friendly interface, be easy to operate, and dynamically display the grain rotation process to meet the needs of materials science research and engineering applications. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a method and system for real-time three-dimensional grain rotation visualization of face-centered cubic materials.
[0007] The present invention is implemented as follows: a real-time three-dimensional grain rotation visualization method for face-centered cubic materials, the method comprising:
[0008] S1: A three-dimensional grain rotation visualization method and system is used using the graphical user interface tool library Tkinter library. The Euler angle data input box is established through the graphical user interface tool library Tkinter, the Pandas library is called to read file data, and the tool library Tkinter is used to create an Euler angle slider to realize the input of specific Euler angle data and arbitrary Euler angle data.
[0009] S2: Use the 3D drawing library matplotlib to draw FCC face-centered cubic grains and coordinate axes;
[0010] S3: Calculate the rotation matrix of the grain according to formula (1) using the input Euler angle to confirm the conversion of the rotation state of the grain in three-dimensional space; the calculation formula of the rotation matrix is as follows:
[0011]
[0012] Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle.
[0013] S4: confirming the crystal plane or crystal orientation distribution of the grains in three-dimensional space according to the Miller index of the grains using the input Euler angle according to formula (1);
[0014]
[0015] Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation.
[0016] S5: Use event monitoring technology to achieve real-time update of Euler angles, rotation matrices and Miller indices;
[0017] S6: The rotation matrix calculated in real time by S3 and S5 is multiplied by these vertex coordinates and the rotation matrix through formula (3) to calculate the coordinates of the new vertices after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to achieve real-time update of grain rotation;
[0018] rotated_vertices=g·vertices (3)
[0019] Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g.
[0020] S7: By inputting the Miller index describing the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4), so that the spatial direction of the grain is consistent with the Miller index; at the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn;
[0021]
[0022] Φ=arccos(l)
[0023]
[0024] Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction.
[0025] S8: Traverse the Euler angle input box, extract the Euler angle data of each grain through the get() method of the Entry widget of Tkinter, and store it in the DataFrame object of Pandas; use the asksaveasfilename method of Tkinter to open the file save dialog box, call the to_csv or to_excel method of Pandas to save the DataFrame object as a file of the corresponding format; at the same time, use the asksaveasfilename method of Tkinter to open the file save dialog box, and use the savefig method of the Matplotlib library to save the currently drawn figure as an image file of the specified format.
[0026] Furthermore, the graphical user interface tool library Tkinter library three-dimensional grain rotation visualization method and system mainly include a main window and various controls;
[0027] The main window is instantiated through the Tk() method of Tkinter, and the window title and size are set; the main window contains multiple frames, each of which is responsible for different functional areas, mainly including Euler angle input, real-time update of data information, real-time rotation of grain angle, Miller index input and other functional areas.
[0028] Further, the S2 specifically includes:
[0029] First, define the coordinates of the eight vertices of the cube:
[0030]
[0031] Then, define the six faces of the cube, each consisting of four vertices:
[0032] faces=[[0,1,2,3],[4,5,6,7],[0,1,5,4],[2,3,7,6],[1,2,6,5],[4,7,3,0]]
[0033] By traversing each face and drawing the edges on the face, the plot function of matplotlib is used in combination with the three-dimensional axis object Axes3D to draw the cube and coordinate axes in three-dimensional space; in order to show the rotation effect, the rotation matrix is applied to each vertex coordinate to obtain the rotated vertex coordinates, and then the cube is redrawn.
[0034] Further, the S5 specifically includes:
[0035] It mainly monitors the changes of Euler angles by capturing the movement of the slider and the change events of the numerical input. When the value of the Euler angle changes, the event listener captures the change and immediately calls the NumPy database to recalculate the rotation matrix and Miller index within milliseconds.
[0036] Another object of the present invention is to provide a face-centered cubic material real-time three-dimensional grain rotation visualization system based on the face-centered cubic material real-time three-dimensional grain rotation visualization method, the system specifically comprising:
[0037] The data input module uses the three-dimensional grain rotation visualization method and system of the graphical user interface tool library Tkinter library, establishes the Euler angle data input box through the graphical user interface tool library Tkinter, calls the Pandas library to read file data and the tool library Tkinter to create the Euler angle slider, so as to realize the input of specific Euler angle data and arbitrary Euler angle data;
[0038] The drawing module uses the three-dimensional drawing library matplotlib to draw FCC face-centered cubic grains and coordinate axes;
[0039] The rotation matrix calculation module is connected to the data input module and the drawing module, and calculates the rotation matrix of the grain according to the input Euler angle according to formula (1) to confirm the conversion of the rotation state of the grain in the three-dimensional space; the calculation formula of the rotation matrix is as follows:
[0040]
[0041] Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle.
[0042] The confirmation module is connected to the rotation matrix calculation module, and confirms the crystal plane or crystal orientation distribution of the crystal grain in the three-dimensional space according to the Miller index of the crystal grain using the input Euler angle according to formula (1);
[0043]
[0044] Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation.
[0045] The real-time update module is connected with the data input module and the rotation matrix calculation module, and uses event monitoring technology to realize the real-time update of the Euler angle, the rotation matrix and the Miller index; the rotation matrix obtained by real-time calculation is used to multiply the vertex coordinates with the rotation matrix through formula (3) to calculate the new vertex coordinates after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to realize the real-time update of the grain rotation;
[0046] rotated_vertices=g·vertices (3)
[0047] Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g.
[0048] The grain drawing module is connected to the confirmation module. By inputting the Miller index describing the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4) so that the spatial direction of the grain is consistent with the Miller index. At the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn.
[0049]
[0050] Φ=arccos(l)
[0051]
[0052] Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction.
[0053] The image saving module is connected to the grain drawing module, traverses the Euler angle input box, extracts the Euler angle data of each grain through the get() method of the Tkinter Entry widget, and stores it in the Pandas DataFrame object; uses the asksaveasfilename method of Tkinter to open the file save dialog box, and calls the to_csv or to_excel method of Pandas to save the DataFrame object as a file in the corresponding format; at the same time, uses the asksaveasfilename method of Tkinter to open the file save dialog box, and uses the savefig method of the Matplotlib library to save the currently drawn figure as an image file in the specified format.
[0054] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic material.
[0055] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic materials.
[0056] Another object of the present invention is to provide an information data processing terminal, which is used to realize the real-time three-dimensional grain rotation visualization system of the face-centered cubic material.
[0057] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0058] First, in view of the defects and shortcomings of the above-mentioned prior art, the present invention provides a real-time three-dimensional grain rotation visualization method and system for face-centered cubic materials, which has significant advantages. First, the present invention adopts the Python-based Tkinter graphical user interface and Matplotlib three-dimensional drawing library to realize real-time dynamic grain rotation visualization. Through the real-time updated graphical interface, users can intuitively observe the rotation changes of grains in three-dimensional space, which greatly improves the efficiency of experiments and research. In addition, users can control the rotation of grains by inputting Euler angles, dragging the progress bar or directly dragging with the mouse. This diversified interactive method makes the operation more convenient and meets the needs of different users.
[0059] In terms of specific implementation, the present invention converts Euler angles into rotation matrices through efficient mathematical calculation methods, and updates the rotation state of the grains in real time, ensuring the high performance and stability of the system. Compared with the traditional static display method, the present invention can dynamically display the rotation process of the grains, which helps users to understand the movement laws and internal structural changes of the grains more deeply. In addition, the present invention also has the advantages of low cost and simple structure. The implementation of the system mainly relies on the open source Python library, which reduces the development cost and maintenance difficulty. Its user interface design is concise and clear, and the operation is intuitive. It can be used without professional training, which greatly improves the convenience of use.
[0060] In summary, the present invention has significant advantages in real-time performance, ease of operation, system performance and cost control, which can effectively make up for the shortcomings of the existing technology and significantly improve the efficiency and effect of grain rotation visualization of face-centered cubic materials.
[0061] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:
[0062] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:
[0063] The technical solution of the present invention provides a real-time three-dimensional grain rotation visualization method and system for face-centered cubic materials, which can significantly improve the efficiency and accuracy of material science research. By visualizing the rotation of grains in real time, researchers can more intuitively observe and analyze the impact of grain orientation on material properties, thereby accelerating the material development and optimization process.
[0064] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:
[0065] At present, although many material characterization technologies can provide high-resolution grain orientation information, they lack real-time and dynamic analysis capabilities. The real-time three-dimensional grain rotation visualization method and system proposed in the present invention make up for the shortcomings of the existing technology in dynamic observation and real-time analysis, especially the special design for face-centered cubic materials, filling the technical gap in this field at home and abroad, and providing a new solution for material science research.
[0066] (3) The technical solution of the present invention solves the technical problems that people have been eager to solve but have never been able to solve successfully:
[0067] In materials science research, real-time observation and analysis of the effect of grain rotation on material properties has always been a difficult problem. The existing technology is difficult to achieve dynamic and real-time visualization of grain rotation. The present invention successfully achieves real-time dynamic visualization of grain rotation by combining Python's Tkinter graphical user interface and Matplotlib's three-dimensional drawing function, solving this long-standing technical problem and allowing researchers to more conveniently analyze and optimize material properties.
[0068] (4) The technical solution of the present invention overcomes technical prejudice:.
[0069] Traditional methods of visualizing grain rotation are mostly static images and require high programming skills, which limits their application among non-professional users. The present invention adopts a concise and clear user interface design, and realizes the rotation of grains by dragging a slider or directly using a mouse to drag, which lowers the threshold of use and overcomes the high requirements of traditional methods on user skills. In addition, the present invention also provides a more efficient and intuitive observation method by real-time updating and dynamic display of the grain rotation process, overcoming the limitations of traditional static display methods and improving the practicality of the system and user experience.
[0070] Third, the technical solution of the present invention solves many technical problems in the prior art in the visualization of three-dimensional grain rotation of face-centered cubic materials in industrial applications, and has made significant progress in industrial applications in the fields of materials science, metal processing, crystal growth, etc.
[0071] Problems with existing technologies:
[0072] 1) Poor real-time performance: Traditional grain rotation visualization methods usually rely on offline calculations and static displays, making it difficult to achieve real-time updates of grain rotation status. This often fails to meet the real-time monitoring needs of the production process in industrial applications that require dynamic adjustment and rapid feedback.
[0073] 2) Insufficient visualization accuracy: In practical applications, the orientation and rotation state of grains have an important impact on material properties. In the prior art, due to the inaccurate calculation of the rotation matrix and Miller index, the visualization results deviate from the actual situation, affecting the quality control and product consistency in the industrial process.
[0074] 3) Complex operation: The 3D grain visualization system in the prior art is often complex to operate and has an unfriendly interface, which makes it difficult to promote and apply it in industrial production, especially when a large amount of data needs to be processed and analyzed, resulting in low efficiency.
[0075] Technical advances of the present invention:
[0076] 1) Real-time dynamic monitoring: The present invention realizes real-time update and visualization of the grain rotation state by integrating event monitoring technology. This real-time performance is crucial for industrial applications, especially in material processing, metal forming and crystal growth processes, which can provide instant feedback and help operators adjust process parameters in time, thereby improving product quality and production efficiency.
[0077] 2) High-precision visualization: The present invention uses precise Euler angle, rotation matrix and Miller index calculation methods to ensure accurate simulation and visualization of three-dimensional grain rotation. This high-precision display is of great significance for material science research and industrial testing, helping to better understand the changes in the internal structure of materials and improve the accuracy of process control.
[0078] 3) Simplify the operation process: By using the Tkinter library and the matplotlib library, the present invention provides a user-friendly graphical interface, making the complex three-dimensional grain rotation operation simple and intuitive. Industrial users can observe the rotation state of the grain in real time through simple input and adjustment, which greatly reduces the technical threshold and facilitates wide application in production lines.
[0079] 4) Integrated tools: This invention not only realizes the real-time rotation visualization of grains, but also integrates functions such as data input, storage and image preservation. This integrated tool provides an efficient solution for industrial users, which not only improves the data processing efficiency in the production process, but also simplifies the quality control and traceability process, and promotes the development of intelligent manufacturing.
[0080] Through this invention, industrial users have achieved the transition from offline analysis to real-time monitoring, the leap from low precision to high precision, and the optimization from complex operation to simplified operation in the visualization process of grain orientation and rotation. These advances have significantly improved the research and application capabilities in the field of materials science and engineering, while promoting technological innovation and production efficiency improvement in high-end manufacturing, and have broad industrial application prospects and economic value. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 This is a flow chart of a method for visualizing real-time three-dimensional grain rotation of a face-centered cubic material provided by an embodiment of the present invention;
[0082] Figure 2 A three-dimensional grain rotation visualization method and system graphical interface provided by an embodiment of the present invention;
[0083] Figure 3 The Euler angle input provided by the embodiment of the present invention is: (a) specific Euler angle input; (b) sliding bar input;
[0084] Figure 4 is a diagram of FCC face-centered cubic grains and coordinate axes provided by an embodiment of the present invention;
[0085] Figure 5 is a rotation matrix and a Miller index update graph provided by an embodiment of the present invention;
[0086] Figure 6 It is a real-time update diagram of grain rotation provided by an embodiment of the present invention;
[0087] Figure 7 It is the Miller index inverse Euler angle and grain rotation diagram provided by the embodiment of the present invention.
[0088] Figure 8 It is a data storage diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0089] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0090] The following are two specific industrial application examples of the real-time three-dimensional grain rotation visualization method of face-centered cubic materials based on the present invention:
[0091] Example 1: Preparation and testing of high-performance metal materials in the aerospace field
[0092] In the aerospace field, high-performance metal materials such as nickel-based alloys and titanium alloys are widely used in the manufacture of engine turbine blades and fuselage structural parts. The internal grain structure and orientation of these materials directly affect their mechanical properties and fatigue resistance. Therefore, how to monitor and optimize grain orientation in real time is crucial in the material preparation process.
[0093] Application Process:
[0094] 1) Grain orientation optimization: In the material manufacturing process, the visualization method of the present invention is used to monitor the rotation state of metal grains in heat treatment and mechanical processing in real time. By adjusting the process parameters (such as cooling rate, deformation, etc.), the operator can observe the change of grain orientation on the graphical user interface and optimize the process in time to obtain the best grain structure.
[0095] 2) Quality control: After production is completed, the three-dimensional grain visualization technology provided by the present invention is used to inspect the quality of the finished product. By inputting the Miller index and calculating the corresponding Euler angle, it is checked whether the grain orientation inside the material is consistent with the design requirements, thereby ensuring the reliability and performance of the product.
[0096] Industrial benefits:
[0097] Through real-time monitoring and optimization, the microstructural consistency of metal materials is improved and the fatigue resistance of materials is enhanced.
[0098] The response speed and control accuracy in the production process are improved, and the material scrap rate and production costs are reduced.
[0099] Example 2: Crystal orientation detection in semiconductor wafer manufacturing
[0100] In the semiconductor industry, the crystal orientation of single-crystal silicon wafers is crucial to chip performance, especially in various links of wafer manufacturing and processing. Crystal orientation errors lead to poor device performance or failure. Therefore, accurate detection and control of crystal orientation has become a key link in semiconductor manufacturing.
[0101] Application Process:
[0102] 1) Crystal orientation calibration: During the wafer manufacturing process, the visualization method of the present invention is used to monitor the rotation state of the silicon crystal grains during the growth and cutting process in real time. By inputting the Euler angle, the direction of the crystal is adjusted in real time to ensure that the orientation accuracy of each wafer meets the requirements.
[0103] 2) Finished product inspection: After the wafer is cut, the method of the present invention is used to inspect the orientation of the wafer. By calculating the Miller index of the crystal and comparing it with the preset standard, the orientation deviation can be quickly identified, thereby screening out unqualified wafers and reducing the defective rate in subsequent processing.
[0104] Industrial benefits:
[0105] The orientation accuracy of semiconductor wafers is improved, ensuring the yield and performance consistency of chip manufacturing.
[0106] It reduces the detection time and cost, and improves the overall efficiency and product qualification rate of the semiconductor production line.
[0107] These two embodiments demonstrate the wide application of the present invention in high-end manufacturing, especially in the aerospace and semiconductor fields which have extremely high requirements on material and product quality, and significantly improve the accuracy and efficiency of process control and quality inspection.
[0108] like Figure 1 As shown: An embodiment of the present invention provides a method for real-time three-dimensional grain rotation visualization of a face-centered cubic material, the method comprising:
[0109] S1: The graphical user interface tool library Tkinter is used to create the main window and various controls. The main window is instantiated through the Tk() method of Tkinter, and the window title and size are set. The main window contains multiple frames, each of which is responsible for different functional areas, mainly including Euler angle input, real-time data information update, real-time grain rotation, Miller index input and other functional areas, such as Figure 2 shown.
[0110] S2: Use the graphical user interface tool library Tkinter to create an Euler angle data input box, call the Pandas library to read file data, and use the tool library Tkinter to create an Euler angle slider to input specific Euler angle data and arbitrary Euler angle data, such as Figure 3 shown.
[0111] S3: Use the 3D drawing library matplotlib to draw FCC face-centered cube grains and coordinate axes. First, define the coordinates of the eight vertices of the cube:
[0112]
[0113] Then, define the six faces of the cube, each consisting of four vertices:
[0114] faces=[[0,1,2,3],[4,5,6,7],[0,1,5,4],[2,3,7,6],[1,2,6,5],[4,7,3,0]]
[0115] By traversing each face and drawing the edges on the face, use the plot function of matplotlib, combined with the three-dimensional axis object Axes3D, to draw the cube and coordinate axes in three-dimensional space, such as Figure 4 The grain is shown in a rotated view.
[0116] S4: Calculate the rotation matrix of the grain according to formula (1) using the input Euler angle to confirm the rotation angle of the grain in three-dimensional space, such as Figure 5 The data information in the real-time update area is shown.
[0117]
[0118] Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle.
[0119] S5: Calculate the Miller index of the grains according to the input Euler angle according to formula (2) to confirm the crystal plane or crystal orientation distribution of the grains in three-dimensional space, such as Figure 5 The data information in the real-time update area is shown.
[0120]
[0121] Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation.
[0122] S6: Use event monitoring technology to achieve real-time updates of Euler angles, rotation matrices, and Miller indices. Mainly by capturing the movement of the slider and the change events of the value input, the change of Euler angles is monitored. When the value of the Euler angle changes, the event listener captures the change and immediately calls the NumPy database to recalculate the rotation matrix and Miller indices within milliseconds. Figure 5 The data information in the real-time update area is shown.
[0123] S7: The rotation matrix calculated in real time by S4 and S6 is multiplied by these vertex coordinates and the rotation matrix through formula (3) to calculate the coordinates of the new vertex after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to achieve real-time update of grain rotation, such as Figure 7 shown.
[0124] rotated_vertices=g·vertices (3)
[0125] Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g.
[0126] S8: By inputting the Miller index that describes the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4) so that the spatial direction of the grain is consistent with the Miller index. At the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, and the rotation angle of the grain is updated through S47, and the rotated grain is drawn, such as Figure 8 shown.
[0127]
[0128] Φ=arccos(l)
[0129]
[0130] Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction.
[0131] S9: Traverse the Euler angle input box, extract the Euler angle data of each grain through the get() method of the Tkinter Entry widget, and store it in the Pandas DataFrame object. Use the Tkinter asksaveasfilename method to open the file save dialog box, and call the Pandas to_csv or to_excel method to save the DataFrame object as a file in the corresponding format. At the same time, use the Tkinter asksaveasfilename method to open the file save dialog box,
[0132] Use the savefig method of the Matplotlib library to save the currently drawn figure as an image file of a specified format, such as Figure 8 shown.
[0133] In summary: The present invention proposes a real-time three-dimensional grain rotation visualization method and system for face-centered cubic materials, which can accurately describe and simulate the rotation state of face-centered cubic grains in three-dimensional space. In the present invention, the rotation matrix is calculated by Euler angles (phi_1, Phi, phi_2), and the rotated coordinates and Miller indices are updated in real time, so that users can intuitively observe and analyze the characteristics of objects in different rotation states through an interactive interface. The method of the present invention is universal and applicable to various face-centered cubic materials and application scenarios, including but not limited to materials science research, engineering structure analysis, graphics and other fields.
[0134] The embodiment of the present invention provides a face-centered cubic material real-time three-dimensional grain rotation visualization system based on the face-centered cubic material real-time three-dimensional grain rotation visualization method, and the system specifically includes:
[0135] The data input module uses the three-dimensional grain rotation visualization method and system of the graphical user interface tool library Tkinter library, establishes the Euler angle data input box through the graphical user interface tool library Tkinter, calls the Pandas library to read file data and the tool library Tkinter to create the Euler angle slider, so as to realize the input of specific Euler angle data and arbitrary Euler angle data;
[0136] The drawing module uses the three-dimensional drawing library matplotlib to draw FCC face-centered cubic grains and coordinate axes;
[0137] The rotation matrix calculation module is connected to the data input module and the drawing module, and calculates the rotation matrix of the grain according to the input Euler angle according to formula (1) to confirm the conversion of the rotation state of the grain in the three-dimensional space; the calculation formula of the rotation matrix is as follows:
[0138]
[0139] Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle.
[0140] The confirmation module is connected to the rotation matrix calculation module, and confirms the crystal plane or crystal orientation distribution of the crystal grain in the three-dimensional space according to the Miller index of the crystal grain using the input Euler angle according to formula (1);
[0141]
[0142] Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation.
[0143] The real-time update module is connected with the data input module and the rotation matrix calculation module, and uses event monitoring technology to realize the real-time update of the Euler angle, the rotation matrix and the Miller index; the rotation matrix obtained by real-time calculation is used to multiply the vertex coordinates with the rotation matrix through formula (3) to calculate the new vertex coordinates after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to realize the real-time update of the grain rotation;
[0144] rotated_vertices=g·vertices (3)
[0145] Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g.
[0146] The grain drawing module is connected to the confirmation module. By inputting the Miller index describing the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4) so that the spatial direction of the grain is consistent with the Miller index. At the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn.
[0147]
[0148] Φ=arccos(l)
[0149]
[0150] Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction.
[0151] The image saving module is connected to the grain drawing module, traverses the Euler angle input box, extracts the Euler angle data of each grain through the get() method of the Tkinter Entry widget, and stores it in the Pandas DataFrame object; uses the asksaveasfilename method of Tkinter to open the file save dialog box, and calls the to_csv or to_excel method of Pandas to save the DataFrame object as a file in the corresponding format; at the same time, uses the asksaveasfilename method of Tkinter to open the file save dialog box, and uses the savefig method of the Matplotlib library to save the currently drawn figure as an image file in the specified format.
[0152] An embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic material.
[0153] An embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method for real-time three-dimensional grain rotation visualization of face-centered cubic materials.
[0154] An embodiment of the present invention provides an information data processing terminal, which is used to implement the real-time three-dimensional grain rotation visualization system of the face-centered cubic material.
[0155] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. A person of ordinary skill in the art will appreciate that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVDROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0156] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A real-time three-dimensional grain rotation visualization method for face-centered cubic materials, characterized in that: The method includes: S1: A three-dimensional grain rotation visualization method and system is used using the graphical user interface tool library Tkinter library. The Euler angle data input box is established through the graphical user interface tool library Tkinter, the Pandas library is called to read file data, and the tool library Tkinter is used to create an Euler angle slider to realize the input of specific Euler angle data and arbitrary Euler angle data. S2: Use the 3D drawing library matplotlib to draw FCC face-centered cubic grains and coordinate axes; S3: Calculate the rotation matrix of the grain according to formula (1) using the input Euler angle to confirm the conversion of the rotation state of the grain in three-dimensional space; the calculation formula of the rotation matrix is as follows: Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. S4: confirming the crystal plane or crystal orientation distribution of the grains in three-dimensional space according to the Miller index of the grains using the input Euler angle according to formula (1); Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation. S5: Use event monitoring technology to achieve real-time update of Euler angles, rotation matrices and Miller indices; S6: The rotation matrix calculated in real time by S3 and S5 is multiplied by these vertex coordinates and the rotation matrix through formula (3) to calculate the coordinates of the new vertices after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to achieve real-time update of grain rotation; rotated_vertices=g·vertices (3) Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g. S7: By inputting the Miller index describing the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4), so that the spatial direction of the grain is consistent with the Miller index; at the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn; Φ=arccos(l) Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction. S9: Traverse the Euler angle input box, extract the Euler angle data of each grain through the get() method of the Entry widget of Tkinter, and store it in the DataFrame object of Pandas; use the asksaveasfilename method of Tkinter to open the file save dialog box, call the to_csv or to_excel method of Pandas to save the DataFrame object as a file of the corresponding format; at the same time, use the asksaveasfilename method of Tkinter to open the file save dialog box, and use the savefig method of the Matplotlib library to save the currently drawn figure as an image file of the specified format.
2. The real-time three-dimensional grain rotation visualization method of face-centered cubic material according to claim 1, characterized in that: The graphical user interface tool library Tkinter library three-dimensional grain rotation visualization method and system mainly include a main window and various controls; The main window is instantiated through the Tk() method of Tkinter, and the window title and size are set; the main window contains multiple frames, each of which is responsible for different functional areas, mainly including Euler angle input, real-time update of data information, real-time rotation of grain angle, Miller index input and other functional areas.
3. The real-time three-dimensional grain rotation visualization method of face-centered cubic material according to claim 1, characterized in that: The S2 specifically includes: First, define the coordinates of the eight vertices of the cube: Then, define the six faces of the cube, each consisting of four vertices: faces=[[0,1,2,3],[4,5,6,7],[0,1,5,4],[2,3,7,6],[1,2,6,5],[4,7,3,0]] By traversing each face and drawing the edges on the face, the plot function of matplotlib is used in combination with the three-dimensional axis object Axes3D to draw the cube and coordinate axes in three-dimensional space; in order to show the rotation effect, the rotation matrix is applied to each vertex coordinate to obtain the rotated vertex coordinates, and then the cube is redrawn.
4. The real-time three-dimensional grain rotation visualization method of face-centered cubic material according to claim 1, characterized in that: The S5 specifically includes: It mainly monitors the changes of Euler angles by capturing the movement of the slider and the change events of the numerical input. When the value of the Euler angle changes, the event listener captures the change and immediately calls the NumPy database to recalculate the rotation matrix and Miller index within milliseconds.
5. A face-centered cubic material real-time three-dimensional grain rotation visualization system based on the face-centered cubic material real-time three-dimensional grain rotation visualization method as claimed in claim 14, characterized in that: The system specifically includes: The data input module uses the three-dimensional grain rotation visualization method and system of the graphical user interface tool library Tkinter library, establishes the Euler angle data input box through the graphical user interface tool library Tkinter, calls the Pandas library to read file data and the tool library Tkinter to create the Euler angle slider, so as to realize the input of specific Euler angle data and arbitrary Euler angle data; The drawing module uses the three-dimensional drawing library matplotlib to draw FCC face-centered cubic grains and coordinate axes; The rotation matrix calculation module is connected to the data input module and the drawing module, and calculates the rotation matrix of the grain according to the input Euler angle according to formula (1) to confirm the conversion of the rotation state of the grain in the three-dimensional space; the calculation formula of the rotation matrix is as follows: Among them, g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. The confirmation module is connected to the rotation matrix calculation module, and confirms the crystal plane or crystal orientation distribution of the crystal grain in the three-dimensional space according to the Miller index of the crystal grain using the input Euler angle according to formula (1); Among them, (u,v,w) are the components of the crystal orientation vector before rotation, (r,s,t) are the components of the crystal orientation vector at the intermediate steps during the rotation process, and (h,k,l) are the components of the crystal orientation vector after rotation. The real-time update module is connected with the data input module and the rotation matrix calculation module, and uses event monitoring technology to realize the real-time update of the Euler angle, the rotation matrix and the Miller index; the rotation matrix obtained by real-time calculation is used to multiply the vertex coordinates with the rotation matrix through formula (3) to calculate the new vertex coordinates after rotation, and then the instant rendering function of the matplotlib library is called to redraw the grain rotation angle within milliseconds to realize the real-time update of the grain rotation; rotated_vertices=g·vertices (3) Among them, g represents the rotation matrix calculated by the Euler angles φ1, Φ, φ2, which is used to describe the rotation state of the grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, which represents the vertex coordinates after transformation by the rotation matrix g. The grain drawing module is connected to the confirmation module. By inputting the Miller index describing the crystal plane direction in crystallography, the corresponding Euler angle is calculated using formula (4) so that the spatial direction of the grain is consistent with the Miller index. At the same time, the receiving function is called to receive the Euler angle calculated from the Miller index, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn. Φ=arccos(l) Among them, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle. w represents the component of the crystal plane direction vector in the z-axis direction, h represents the component of the crystal plane direction vector in the x-axis direction. k represents the component of the crystal plane direction vector in the y-axis direction. l represents the component of the crystal plane direction vector in the new z-axis direction. The image saving module is connected to the grain drawing module, traverses the Euler angle input box, extracts the Euler angle data of each grain through the get() method of the Tkinter Entry widget, and stores it in the Pandas DataFrame object; uses the asksaveasfilename method of Tkinter to open the file save dialog box, and calls the to_csv or to_excel method of Pandas to save the DataFrame object as a file in the corresponding format; at the same time, uses the asksaveasfilename method of Tkinter to open the file save dialog box, and uses the savefig method of the Matplotlib library to save the currently drawn figure as an image file in the specified format.
6. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic material as claimed in any one of claim 14.
7. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the method for real-time three-dimensional grain rotation visualization of face-centered cubic materials as claimed in any one of claim 14.
8. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the real-time three-dimensional grain rotation visualization system of the face-centered cubic material as described in claim 5.
Citation Information
Patent Citations
Method for calculating crystal plane orientation of bottom of material oxide film through EBSD technology
CN110133022A
Crystallographic metrology and process control
US20060231752A1
Method for rapidly presenting specific crystal plane distribution characteristic of polycrystalline material
WO2020223833A1
