A method and system for real-time three-dimensional grain rotation visualization of face-centered cubic materials

By combining the Tkinter and Matplotlib libraries, real-time 3D grain rotation visualization of face-centered cubic materials was achieved, solving the problems of lack of real-time performance and operational complexity in existing technologies. It provides an efficient and concise method for displaying grain rotation, which is suitable for materials science research and engineering applications.

CN119170155BActive Publication Date: 2026-01-09HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411139036.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2026-01-09
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

Existing visualization techniques for the microstructure of materials lack real-time performance and dynamism. In particular, methods for visualizing the grain rotation of face-centered cubic materials cannot achieve real-time dynamic display and are complex to operate, making it difficult to meet the needs of materials science research and engineering applications.

Method used

Using the graphical user interface tool library Tkinter and the 3D plotting library Matplotlib, combined with Euler angle calculation and event listening technology, we can realize real-time 3D grain rotation visualization of face-centered cubic materials. The real-time rotation of grains can be displayed by Euler angle input, sliders and mouse dragging, and data input, storage and image saving are supported.

Benefits of technology

It enables real-time dynamic visualization of face-centered cubic material grains, improving the efficiency and accuracy of materials science research, reducing operational complexity, and making it suitable for non-professional users in fields such as aerospace, automotive, and electronics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119170155B_ABST
    Figure CN119170155B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of materials, and discloses a face-centered cubic material real-time three-dimensional grain rotation visualization method and system, which comprises the following steps: inputting specific Euler angle data and arbitrary Euler angle data by calling a Pandas library to read file data and a tool library Tkinter through a graphical user interface tool library Tkinter; drawing a face-centered cubic grain and a coordinate axis by adopting a three-dimensional drawing library matplotlib; confirming the rotation state conversion of the grain in a three-dimensional space according to a calculated rotation matrix of the grain according to the input Euler angle; confirming the crystal face or crystal direction distribution of the grain in the three-dimensional space according to a Miller index of the grain according to the input Euler angle; and realizing real-time updating of the Euler angle, the rotation matrix and the Miller index by adopting an event listening technology. The application has significant advantages in real-time performance, operation convenience, system performance and cost control, can effectively make up for the shortcomings of the prior art, and significantly improves the efficiency and effect of face-centered cubic material grain rotation visualization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of materials, and in particular relates to a real-time three-dimensional grain rotation visualization method and system for face-centered cubic materials. BACKGROUND

[0002] With the continuous development of material science and engineering technology, the study of the microstructure of materials has been increasingly valued. In particular, in the study of crystalline materials, understanding the orientation and rotation of the grains is crucial for optimizing the performance of the materials. The orientation and rotation of the grains can directly affect the mechanical, electrical, and thermal properties of the materials. Therefore, developing a system that can visualize and analyze the grain rotation in real time is of great significance for material 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), have been 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 the grain rotation in real-time three-dimensions not only makes up for the shortcomings of existing technologies, but also provides a more convenient and efficient tool for material science research.

[0004] In the prior art, some software tools can visualize the microstructure of crystalline materials in three dimensions, but these tools often lack real-time capability and cannot achieve dynamic grain rotation visualization. In addition, these tools are mostly aimed at general crystal structures, and there is no specific method for visualizing the grain rotation of 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 is of great significance for improving material performance. Currently, some existing technologies and methods, such as three-dimensional plotting 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, existing visualization methods are mostly static images, which cannot dynamically display the rotation process of the grains, 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 rotation process of the grains to meet the needs of material science research and engineering applications. SUMMARY

[0006] In view of the problems in the prior art, the application provides a face-centered cubic material real-time three-dimensional grain rotation visualization method and system.

[0007] The application is implemented by a face-centered cubic material real-time three-dimensional grain rotation visualization method, which comprises the following steps:

[0008] S1: A three-dimensional grain rotation visualization method and system using a graphical user interface tool library Tkinter library is used to establish an Euler angle data input box through the graphical user interface tool library Tkinter, call a Pandas library to read file data, and create an Euler angle sliding bar using the tool library Tkinter, so as to realize input of specific Euler angle data and arbitrary Euler angle data;

[0009] S2: A three-dimensional drawing library matplotlib is used to realize drawing of an FCC face-centered cubic grain and a coordinate axis;

[0010] S3: A rotation matrix of the grain is calculated according to formula (1) based on the input Euler angle, and the rotation state of the grain in the three-dimensional space is confirmed; the calculation formula of the rotation matrix is as follows:

[0011]

[0012] Wherein g represents the rotation matrix, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle.

[0013] S4: The Miller index of the grain is calculated according to formula (1) based on the input Euler angle, and the crystal face or crystal direction distribution of the grain in the three-dimensional space is confirmed;

[0014]

[0015] Wherein (u, v, w) is the component of the crystal orientation vector before rotation, (r, s, t) is the component of the crystal orientation vector in the intermediate step during rotation, and (h, k, l) is the component of the crystal orientation vector after rotation.

[0016] S5: An event listening technology is used to realize real-time updating of the Euler angle, the rotation matrix and the Miller index;

[0017] S6: The rotation matrix obtained through real-time calculation of S3 and S5 is multiplied with the vertex coordinates through formula (3), new vertex coordinates after rotation are calculated, the instant rendering function of the matplotlib library is called, the grain is redrawn in the millisecond level of the rotation angle, and real-time updating of the grain rotation is realized;

[0018] rotated_vertices=g·vertices (3)

[0019] wherein g represents a rotation matrix calculated from 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 after transformation by the rotation matrix g.

[0020] S7: By inputting the Miller indices describing the crystallographic direction, the corresponding Euler angles are calculated using formula (4) so that the spatial direction of the grain is consistent with the Miller indices; at the same time, the receiving function is called to receive the Euler angles calculated from the Miller indices, the rotation angle of the grain is updated through S3S6, and the rotated grain is drawn;

[0021]

[0022] Φ = arccos(l)

[0023]

[0024] wherein φ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 Tkinter Entry widget, and store it in the Pandas DataFrame object; use the asksaveasfilename method of Tkinter to open the file save dialog box, and call 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, 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 graphics as an image file in the specified format.

[0026] Further, the Tkinter library three-dimensional grain rotation visualization method and system mainly includes a main window and various controls;

[0027] The main window is instantiated by the Tk() method of Tkinter, and the window title and size are set; the main window contains multiple frames (Frame), each frame is responsible for a different functional area, mainly including Euler angle input, real-time data information update, grain angle real-time rotation, Miller index input, etc.

[0028] Further, the S2 specifically comprises:

[0029] First, define the coordinates of the eight vertices of the cube:

[0030]

[0031] Then, define the six faces of the cube, each face 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, using the plot function of matplotlib combined with the three-dimensional axis object Axes3D, the cube and coordinate axes are drawn in three-dimensional space; in order to display the rotation effect, the rotation matrix is applied to each vertex coordinate to obtain the rotated vertex coordinate, and then the cube is redrawn.

[0034] Further, the S5 specifically comprises:

[0035] Mainly through capturing the movement of the slider and the change event of numerical input, the change of Euler angle is monitored, when the value of 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 application 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, which specifically comprises:

[0037] The data input module adopts the three-dimensional grain rotation visualization method and system of the graphical user interface tool library Tkinter, establishes an Euler angle data input box through the graphical user interface tool library Tkinter, calls the Pandas library to read file data, and creates an Euler angle slider using the tool library Tkinter, 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 realize the drawing of the FCC face-centered cubic grain and the coordinate axes;

[0039] The rotation matrix calculation module is connected with the data input module and the drawing module, and the rotation matrix of the grain is calculated according to formula (1) through 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:

[0040]

[0041] where 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 with the rotation matrix calculation module, and confirms the crystal face or crystal direction distribution of the grain in the three-dimensional space according to the formula (1) Miller index of the grain through the input Euler angle;

[0043]

[0044] where (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 step during rotation, and (h, k, l) are the components of the crystal orientation vector after rotation.

[0045] The real-time updating module is connected with the data input module and the rotation matrix calculation module, and realizes real-time updating of the Euler angle, the rotation matrix and the Miller index by using event listening technology; through the rotation matrix calculated in real time, the vertex coordinates are multiplied by the rotation matrix through formula (3) to calculate the new vertex coordinates after rotation, and the real-time rendering function of the matplotlib library is called to redraw the grain within milliseconds of the rotation angle, so as to realize real-time updating of the grain rotation.

[0046] rotated_vertices = g · vertices (3)

[0047] where g represents the rotation matrix calculated from the Euler angle φ1, Φ and φ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, representing the vertex coordinates after transformation by the rotation matrix g.

[0048] The grain drawing module is connected with the confirmation module, and calculates the corresponding Euler angle through formula (4) by inputting the Miller index describing the crystal plane direction in crystallography, 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 grain after rotation is drawn.

[0049]

[0050] Φ = arccos (l)

[0051]

[0052] wherein, φ1 is a nutation angle, Φ is a precession angle, and φ2 is a rotation angle. w represents a component of a crystal plane direction vector in the z-axis direction, h represents a component of the crystal plane direction vector in the x-axis direction. k represents a component of the crystal plane direction vector in the y-axis direction. l represents a component of the crystal plane direction vector in the new z-axis direction.

[0053] The image saving module is connected with the grain drawing module, traverses the Euler angle input box, extracts the Euler angle data of each grain through the get() method of the Entry widget of Tkinter, and stores the data into a DataFrame object of Pandas; the asksaveasfilename method of Tkinter is used to open a file saving dialog box, and the to_csv or to_excel method of Pandas is called to save the DataFrame object as a file in a corresponding format; meanwhile, the asksaveasfilename method of Tkinter is used to open a file saving dialog box, and the savefig method of the Matplotlib library is used to save the currently drawn graph as an image file in a specified format.

[0054] Another object of the present application is to provide a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to enable the processor to perform the steps of the real-time three-dimensional grain rotation visualization method for face-centered cubic materials.

[0055] Another object of the present application is to provide a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to enable the processor to perform the steps of the real-time three-dimensional grain rotation visualization method for face-centered cubic materials.

[0056] Another object of the present application is to provide an information data processing terminal for realizing the real-time three-dimensional grain rotation visualization system for face-centered cubic materials.

[0057] In combination with the above technical solutions and the technical problems solved, the technical solution of the present application has the following advantages and positive effects:

[0058] First, to overcome the defects and deficiencies of the prior art, the application provides a face-centered cubic material real-time three-dimensional grain rotation visualization method and system, which has remarkable advantages. First, the application uses a Python-based Tkinter graphical user interface and a Matplotlib three-dimensional plotting library to achieve real-time dynamic grain rotation visualization. Through the real-time updated graphical interface, users can intuitively observe the rotation changes of the grains in three-dimensional space, which greatly improves the efficiency of experiments and research. In addition, users can control the rotation of the grains by inputting Euler angles, dragging the progress bar, or directly using the mouse to drag, and this diversified interaction makes the operation more convenient and meets the needs of different users.

[0059] In specific implementation, the application converts Euler angles into rotation matrices through an efficient mathematical calculation method and updates the rotation state of the grains in real time, ensuring the high performance and stability of the system. Compared with traditional static display methods, the application can dynamically display the rotation process of the grains, which helps users better understand the motion rules and internal structure changes of the grains. In addition, the application has the advantages of low cost and simple structure. The implementation of the system mainly relies on open-source Python libraries, reducing development costs and maintenance difficulty. The user interface design is simple and intuitive, and users can use it without professional training, greatly improving the convenience of use.

[0060] In summary, the application has significant advantages in real-time performance, operation convenience, system performance, and cost control, and can effectively make up for the deficiencies of the prior art, significantly improving the efficiency and effectiveness of face-centered cubic material grain rotation visualization.

[0061] Second, as the creative auxiliary evidence of the claims of the application, it is also reflected in the following important aspects:

[0062] (1) The expected income and commercial value of the technical solution of the application after transformation are:

[0063] The technical solution of the application provides a face-centered cubic material real-time three-dimensional grain rotation visualization method and system, which can significantly improve the efficiency and accuracy of materials science research. By visualizing the rotation of the grains in real time, researchers can more intuitively observe and analyze the influence of grain orientation on material performance, thereby accelerating the material development and optimization process.

[0064] (2) The technical solution of the application fills the technical gap in the industry at home and abroad:

[0065] Currently, many material characterization techniques can provide high-resolution grain orientation information, but lack real-time and dynamic analysis capabilities. The real-time three-dimensional grain rotation visualization method and system proposed by the present invention makes up for the shortcomings of existing technologies in dynamic observation and real-time analysis, especially for face-centered cubic materials, filling the technical gap in this field at home and abroad, 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 failed to succeed:

[0067] In material science research, real-time observation and analysis of grain rotation on material performance has always been a difficult problem. Existing technologies are difficult to achieve dynamic and real-time grain rotation visualization. The present invention successfully realizes real-time dynamic grain rotation visualization by combining Python's Tkinter graphical user interface and Matplotlib three-dimensional plotting function, solving this long-standing technical problem, making it easier for researchers to analyze and optimize material performance.

[0068] (4) The technical solution of the present invention overcomes technical bias:

[0069] Traditional grain rotation visualization methods are mostly static images and require high programming skills, limiting their application to non-professional users. The present invention uses a simple and clear user interface design, which realizes grain rotation by dragging the slider or directly using the mouse to drag, reducing the threshold for use, overcoming the high skill requirements of traditional methods. In addition, the present invention also provides a more efficient and intuitive observation method by updating and dynamically displaying the grain rotation process, overcoming the limitations of traditional static display methods, improving the practicality and user experience of the system.

[0070] Third, the technical solution of the present invention solves many technical problems of existing technologies in the field of three-dimensional grain rotation visualization of face-centered cubic materials, especially in the industrial applications of material science, metal processing, and crystal growth.

[0071] Problems of existing technologies:

[0072] 1) Poor real-time performance: Traditional grain rotation visualization methods usually rely on offline calculation and static display, making it difficult to update the grain rotation state in real time. This often fails to meet the real-time monitoring needs of the production process in industrial applications that require dynamic adjustment and quick feedback.

[0073] 2) Visualization accuracy is insufficient: In practical applications, the orientation and rotation state of the crystal grains have a significant impact on material properties. Due to the insufficient accuracy of the rotation matrix and Miller index calculation in existing technologies, the visualization results deviate from the actual situation, affecting the quality control and product consistency in industrial processes.

[0074] 3) Complex operation: The existing three-dimensional grain visualization system is often complex to operate, with an unfriendly interface, making it difficult to promote and apply in industrial production, especially when a large amount of data needs to be processed and analyzed, resulting in low efficiency.

[0075] Technical progress of the present application:

[0076] 1) Real-time dynamic monitoring: The present application realizes real-time updating and visualization of the grain rotation state by integrating event listening technology. This real-time nature is crucial for industrial applications, especially in material processing, metal forming, and crystal growth processes, providing immediate feedback to help operators adjust process parameters in a timely manner, thereby improving product quality and production efficiency.

[0077] 2) High-precision visualization: The present application uses accurate Euler angles, rotation matrices, 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 detection, helping to better understand the changes in the internal structure of materials and improve the precision of process control.

[0078] 3) Simplify the operation process: By using Tkinter and matplotlib libraries, the present application provides a user-friendly graphical interface, making complex three-dimensional grain rotation operations simple and intuitive. Industrial users can observe the grain rotation state in real time through simple input and adjustment, greatly reducing the technical threshold and facilitating widespread application on production lines.

[0079] 4) Integrated tool: The present application not only realizes real-time rotation visualization of grains, but also integrates data input, storage, and image saving functions. This integrated tool provides an efficient solution for industrial users, improving data processing efficiency in the production process, simplifying quality control and traceability processes, and contributing to the development of intelligent manufacturing.

[0080] Through the present application, industrial users have achieved a transition from offline analysis to real-time monitoring, a leap from low precision to high precision, and an optimization from complex operation to simplified operation in the process of visualizing grain orientation and rotation. These advances significantly improve research and application capabilities in the field of materials science and engineering, while promoting technological innovation and production efficiency in high-end manufacturing, with broad industrial application prospects and economic value. BRIEF DESCRIPTION OF DRAWINGS

[0081] Figure 1 is a flow chart of a real-time three-dimensional grain rotation visualization method for face-centered cubic materials provided by an embodiment of the present application;

[0082] Figure 2 is a graphical interface of a three-dimensional grain rotation visualization method and system provided by an embodiment of the present application;

[0083] Figure 3 is an Euler angle input provided by an embodiment of the present application: (a) specific Euler angle input; (b) slider bar input;

[0084] Figure 4 is a FCC face-centered cubic grain and coordinate axis diagram provided by an embodiment of the present application;

[0085] Figure 5 is a rotation matrix and Miller index update diagram provided by an embodiment of the present application;

[0086] Figure 6 is a grain rotation real-time update diagram provided by an embodiment of the present application;

[0087] Figure 7 is a Miller index back-solving Euler angle and grain rotation diagram provided by an embodiment of the present application.

[0088] Figure 8 is a data storage diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0089] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0090] The following are two specific industrial application embodiments of a real-time three-dimensional grain rotation visualization method for face-centered cubic materials based on the present application:

[0091] Embodiment 1: High-performance metal material preparation and detection in the field of aerospace

[0092] In the field of aerospace, high-performance metal materials such as nickel-based alloys and titanium alloys are widely used in the manufacture of engine turbine blades and airframe structural components. 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 during material preparation is crucial.

[0093] Application process:

[0094] 1) Grain orientation optimization: During the material manufacturing process, the visualization method of the invention is used to monitor the rotation state of metal grains in heat treatment and mechanical processing in real time. By adjusting process parameters (such as cooling rate, deformation amount, 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 invention is used for quality detection of finished products. By inputting Miller indices, the corresponding Euler angles are calculated to check 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 consistency of the microstructure of metal materials is improved, and the fatigue resistance of the materials is enhanced.

[0098] The response speed and control accuracy in the production process are improved, and the material scrap rate and production cost 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 aspects of wafer manufacturing and processing. Crystal orientation errors lead to poor device performance or failure. Therefore, accurate detection and control of crystal orientation have become a key link in semiconductor manufacturing.

[0101] Application process:

[0102] 1) Crystal orientation calibration: During wafer manufacturing, the visualization method of the invention is used to monitor the rotation state of silicon grains during growth and cutting in real time. By inputting Euler angles, 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 detection: After wafer cutting is completed, the wafer orientation is detected using the method of the invention. By calculating the Miller indices of the crystal and comparing them with the preset standard, the existing orientation deviation is quickly identified, and unqualified wafers are screened out to reduce the failure rate in subsequent processing.

[0104] Industrial benefits:

[0105] The orientation accuracy of semiconductor wafers is improved, ensuring the yield rate and performance consistency of chip manufacturing.

[0106] The detection time and cost are reduced, and the overall efficiency and product qualification rate of the semiconductor production line are improved.

[0107] These two embodiments demonstrate the wide application of the present application in high-end manufacturing industry, especially in the aerospace and semiconductor fields with extremely high requirements for material and product quality, significantly improving the precision and efficiency of process control and quality detection.

[0108] As shown in Figure 1 , the embodiment of the present application provides a real-time three-dimensional grain rotation visualization method for face-centered cubic materials, which comprises the following steps:

[0109] S1: Use the graphical user interface tool library Tkinter library to create the main window and various controls. The main window is instantiated by the Tk() method of Tkinter, and the window title and size are set. The main window contains multiple frames, each responsible for a different functional area, including Euler angle input, real-time data information update, grain real-time rotation, Miller index input, etc., as shown in Figure 2 .

[0110] S2: Establish an Euler angle data input box through the graphical user interface tool library Tkinter, call the Pandas library to read file data, and use the tool library Tkinter to create an Euler angle slider bar to input specific Euler angle data and arbitrary Euler angle data, as shown in Figure 3 .

[0111] S3: Use the three-dimensional drawing library matplotlib to realize the drawing of FCC face-centered cubic 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 face 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 iterating through each face and drawing the edges on the face, using the plot function of matplotlib combined with the three-dimensional axis object Axes3D, the cube and coordinate axes are drawn in three-dimensional space, as shown in Figure 4 the grain rotation view.

[0116] S4: Calculate the rotation matrix of the grain according to formula (1) based on the input Euler angles to confirm the rotation angle of the grain in three-dimensional space, as shown in the data information real-time update area in Figure 5 .

[0117]

[0118] where 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 indices of the grain according to formula (2) through the input Euler angles, and confirm the distribution of the crystal face or crystal direction of the grain in the three-dimensional space, as shown in the data information real-time updating area in Figure 5 .

[0120]

[0121] where (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 step during rotation, and (h, k, l) are the components of the crystal orientation vector after rotation.

[0122] S6: Realize real-time updating of Euler angles, rotation matrix, and Miller indices by using event listening technology. Mainly through capturing the movement of the slider and the change event of numerical input, realize the listening of the change of Euler angles, when the value of Euler angles changes, the event listener captures the change and immediately calls the NumPy database, recalculates the rotation matrix and Miller indices within milliseconds, as shown in the data information real-time updating area in Figure 5 .

[0123] S7: Multiply the vertex coordinates by the rotation matrix through the real-time calculation of S4 and S6 by formula (3), calculate the new vertex coordinates after rotation, and call the real-time rendering function of the matplotlib library to redraw the grain within milliseconds of the rotation angle, realize the real-time updating of the grain rotation, as shown in Figure 7 .

[0124] rotated_vertices = g · vertices (3)

[0125] where g represents the rotation matrix calculated from Euler angles φ1, Φ, and φ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, representing the vertex coordinates after transformation by the rotation matrix g.

[0126] S8: Calculate the corresponding Euler angles by formula (4) through the input Miller indices describing the direction of the crystal face in crystallography, so that the spatial direction of the grain is consistent with the Miller indices. At the same time, call the receiving function to receive the Euler angles calculated from the Miller indices, update the rotation angle of the grain through S47, and draw the grain after rotation, as shown in Figure 8 .

[0127]

[0128] Phi = arccos(l)

[0129]

[0130] where phi_1 is the nutation angle, Phi is the precession angle, and phi_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 corresponding format file. 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 graph as a specified format image file, as shown in Figure 8 .

[0133] In summary: the present application proposes a face-centered cubic material real-time three-dimensional grain rotation visualization method and system, which can accurately describe and simulate the rotation state of face-centered cubic grains in three-dimensional space. In the present application, the rotation matrix is calculated through Euler angles (phi_1, Phi, phi_2), and the coordinates and Miller indices after rotation are updated in real time, so that users can intuitively observe and analyze the characteristics of the object in different rotation states through the interactive interface. The method of the present application has universality and is suitable for various face-centered cubic materials and application scenarios, including but not limited to material science research, engineering structure analysis, graphics, etc.

[0134] The embodiment of the present application 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, which specifically comprises:

[0135] A data input module, which adopts the Tkinter library three-dimensional grain rotation visualization method and system, establishes an Euler angle data input box through the Tkinter graphical user interface tool library, calls the Pandas library to read file data, and creates an Euler angle slider through the Tkinter tool library, 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 realize drawing of the FCC face-centered cubic grain and the coordinate axis;

[0137] The rotation matrix calculation module is connected with the data input module and the drawing module, and calculates the rotation matrix of the grain according to formula (1) through the input Euler angle, 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] wherein 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 with the rotation matrix calculation module, and confirms the crystal face or crystal direction distribution of the grain in the three-dimensional space through the Miller index of the grain according to formula (1) through the input Euler angle;

[0141]

[0142] wherein (u, v, w) is the component of the crystal orientation vector before rotation, (r, s, t) is the component of the crystal orientation vector in the intermediate step during rotation, and (h, k, l) is the component of the crystal orientation vector after rotation.

[0143] The real-time updating module is connected with the data input module and the rotation matrix calculation module, and realizes real-time updating of the Euler angle, the rotation matrix and the Miller index by using the event listening technology; through the rotation matrix obtained by real-time calculation, the vertex coordinates are multiplied by the rotation matrix through formula (3), the new vertex coordinates after rotation are calculated, the real-time rendering function of the matplotlib library is called again, the grain is redrawn within milliseconds of the rotation angle, and real-time updating of the grain rotation is realized.

[0144] rotated_vertices = g · vertices (3)

[0145] wherein g represents the rotation matrix calculated from the Euler angle φ1, Φ and φ2, and 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, representing the vertex coordinates after transformation by the rotation matrix g.

[0146] The grain drawing module is connected with the confirmation module, and by inputting Miller indices describing the crystal plane direction in crystallography, the corresponding Euler angles are calculated by formula (4) to make the spatial direction of the grain consistent with the Miller indices; at the same time, the receiving function is called to receive the Euler angles calculated from the Miller indices, the rotation angle of the grain is updated through S3S6, and the grain after rotation is drawn;

[0147]

[0148] Phi = arccos (l)

[0149]

[0150] Where phi1 is the nutation angle, Phi is the precession angle, and phi2 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 with the grain drawing module, and the Euler angle data of each grain is extracted by the get() method of the Entry widget of Tkinter through traversing the Euler angle input box and stored in the DataFrame object of Pandas; the asksaveasfilename method of Tkinter is used to open the file saving dialog box, and the to_csv or to_excel method of Pandas is called to save the DataFrame object as a file in the corresponding format; at the same time, the asksaveasfilename method of Tkinter is used to open the file saving dialog box, and the savefig method of the Matplotlib library is used to save the currently drawn graphics as an image file in the specified format.

[0152] The embodiment of the application provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the face-centered cubic material real-time three-dimensional grain rotation visualization method.

[0153] The embodiment of the application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to make the processor execute the steps of the face-centered cubic material real-time three-dimensional grain rotation visualization method.

[0154] The embodiment of the application provides an information data processing terminal for realizing the face-centered cubic material real-time three-dimensional grain rotation visualization system.

[0155] It should be noted that embodiments of the present application can be realized by hardware, software, or a combination of software and hardware. The hardware portion can be realized by a special logic; the software portion can be stored in a memory and executed by a proper instruction execution system, such as a microprocessor or a specially designed hardware. A person of ordinary skill in the art can understand that the above-mentioned apparatus and method can be realized by computer executable instructions and / or included in processor control codes, such as a carrier medium, such as a magnetic disk, CD or DVD ROM, programmable memory, such as a read-only memory (firmware), or a data carrier, such as an optical or electronic signal carrier. The apparatus of the present application and its modules can be realized by a hardware circuit, such as a very large scale integrated circuit or a gate array, a semiconductor, such as a logic chip, transistor, or a programmable hardware device, such as a field programmable gate array, programmable logic device, or the like, by software executed by various types of processors, or by a combination of the above-mentioned hardware circuit and software, such as firmware.

[0156] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any modification, equivalent replacement, and improvement within the technical range disclosed by the present application, and within the spirit and principle of the present application, should be included in the protection scope of the present application.

Claims

1. A method for real-time three-dimensional visualization of grain rotation in a face-centered cubic material, comprising: The method comprises: S1: a three-dimensional grain rotation visualization method and system using the graphical user interface tool library Tkinter library, establishes an Euler angle data input box through the graphical user interface tool library Tkinter, calls the Pandas library to read file data, and creates an Euler angle slider using the tool library Tkinter, so as to realize input of specific Euler angle data and arbitrary Euler angle data; S2: a three-dimensional drawing library matplotlib is used to realize drawing of an FCC face-centered cubic grain and a coordinate axis; S3: a rotation matrix of the grain is calculated according to formula (1) based on the input Euler angle, and the rotation state of the grain in the three-dimensional space is confirmed; the calculation formula of the rotation matrix is as follows: Wherein, g represents the rotation matrix, φ1 is the nutation angle, Φ is the spin angle, and φ2 is the rotation angle; S4: the Miller index of the grain is confirmed according to formula (1) based on the input Euler angle, and the crystal face or crystal direction distribution of the grain in the three-dimensional space is confirmed; Wherein, (u, v, w) is the component of the crystal orientation vector before rotation, (r, s, t) is the component of the crystal orientation vector in the intermediate step during rotation, and (h, k, l) is the component of the crystal orientation vector after rotation; S5: an event listening technology is used to realize real-time updating of the Euler angle, the rotation matrix and the Miller index; S6: the rotation matrix calculated in real time through S3 and S5 is multiplied with the vertex coordinates through formula (3), the new vertex coordinates after rotation are calculated, the instant rendering function of the matplotlib library is called, the grain is redrawn within milliseconds of the rotation angle, and real-time updating of the grain rotation is realized; rotated_vertices=g·vertices (3) Wherein, g represents the rotation matrix calculated from the Euler angle φ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, representing the vertex coordinates after transformation by the rotation matrix g; S7: the Miller index describing the crystal plane direction in crystallography is input, formula (4) is used to calculate the corresponding Euler angle, 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 grain after rotation is drawn; Φ=arccos(l) Wherein, φ1 is the nutation angle, Φ is the spin 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, and 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, and call 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, 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 graph as an image file in the specified format.

2. The method of claim 1, wherein the face-centered cubic material is selected from the group consisting of gold, silver, copper, platinum, palladium, rhodium, ruthenium, iridium, and alloys thereof. The Tkinter library three-dimensional grain rotation visualization method and system includes a main window and various controls; The main window is instantiated by the Tk() method of Tkinter, and the window title and size are set; the main window contains multiple frames (Frame), each responsible for a different functional area, including Euler angle input, real-time data information update, grain angle real-time rotation, and Miller index input functional area.

3. The method of claim 1, wherein the face-centered cubic material is selected from the group consisting of gold, silver, copper, aluminum, platinum, palladium, nickel, rhodium, ruthenium, and combinations thereof. The S2 specifically includes: First, define the coordinates of the eight vertices of the cube: Then, define the six faces of the cube, each face 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, 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; in order to display the rotation effect, apply the rotation matrix to each vertex coordinate to obtain the rotated vertex coordinate, and then redraw the cube.

4. The method of claim 1, wherein the face-centered cubic material is selected from the group consisting of gold, silver, copper, aluminum, platinum, palladium, nickel, rhodium, ruthenium, and combinations thereof. The S5 specifically includes: By capturing the movement of the slider bar and the change of the numerical input event, the change of the Euler angle is monitored, and 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 according to any one of claims 1 to 4, characterized by The system specifically includes: A data input module, which uses the Tkinter library three-dimensional grain rotation visualization method and system to establish an Euler angle data input box through the Tkinter library, calls the Pandas library to read file data, and creates an Euler angle slider bar using the Tkinter library to input specific Euler angle data and arbitrary Euler angle data; A drawing module that uses the three-dimensional drawing library matplotlib to draw the FCC face-centered cubic grain and coordinate axes; A rotation matrix calculation module connected to the data input module and the drawing module, which calculates the rotation matrix of the grain according to formula (1) based on 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: Wherein, 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 with the rotation matrix calculation module, and confirms the crystal face or crystal direction distribution of the crystal grain in the three-dimensional space according to the formula (1) Miller index of the crystal grain through the input Euler angle; Wherein, (u, v, w) is the component of the crystal orientation vector before rotation, (r, s, t) is the component of the crystal orientation vector in the intermediate step during rotation, and (h, k, l) is the component of the crystal orientation vector after rotation; The real-time updating module is connected with the data input module and the rotation matrix calculation module, and realizes real-time updating of the Euler angle, the rotation matrix and the Miller index by using event listening technology; through the rotation matrix calculated in real time, the vertex coordinates are multiplied by the rotation matrix through formula (3), the new vertex coordinates after rotation are calculated, the matplotlib library is called for real-time rendering function, the crystal grain is redrawn within milliseconds of the rotation angle, and the real-time updating of the crystal grain rotation is realized. Rotated_vertices=g·vertices (3) Wherein, g represents the rotation matrix calculated from the Euler angle φ1, Φ, φ2, which is used to describe the rotation state of the crystal grain, vertices represents the initial vertex coordinates of the crystal, and rotated_vertices is a matrix or array containing all vertex coordinates, representing the vertex coordinates after transformation by the rotation matrix g. The crystal grain drawing module is connected with the confirmation module, the corresponding Euler angle is calculated through formula (4) by inputting the Miller index describing the crystal face direction, so that the spatial direction of the crystal 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 crystal grain is updated through S3S6, and the crystal grain after rotation is drawn. Φ=arccos(l) Wherein, φ1 is the nutation angle, Φ is the precession angle, and φ2 is the rotation angle; w represents the component of the crystal face direction vector in the z-axis direction, h represents the component of the crystal face direction vector in the x-axis direction; k represents the component of the crystal face direction vector in the y-axis direction, and l represents the component of the crystal face direction vector in the new z-axis direction. The image saving module is connected with the crystal grain drawing module, iterates the Euler angle input box, extracts the Euler angle data of each crystal grain through the get() method of the Entry widget of Tkinter, and stores it in the DataFrame object of Pandas; the asksaveasfilename method of Tkinter is used to open the file saving dialog box, and the to_csv or to_excel method of Pandas is called to save the DataFrame object as a file in the corresponding format; at the same time, the asksaveasfilename method of Tkinter is used to open the file saving dialog box, and the savefig method of the Matplotlib library is used to save the currently drawn graphics as an image file in the specified format.

6. A computer device, comprising: The computer device comprises a memory and a processor, the memory stores a computer program, the computer program is executed by the processor, so that the processor executes the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic material according to any one of claims 1-4. 7.A computer readable storage medium, storing a computer program, the computer program is executed by a processor, so that the processor executes the steps of the real-time three-dimensional grain rotation visualization method of face-centered cubic material according to any one of claims 1-4.

8. An information data processing terminal, characterized by The information data processing terminal is used to realize the real-time three-dimensional grain rotation visualization system of face-centered cubic material according to 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