A leaf rendering method and system based on OPENGL
Through the OPENGL-based blade rendering method, the blade design data is divided into surface data lists, and the polygonal element construction and merging process is used to solve the problem that the impeller CAD software cannot be effectively modeled in the existing technology, and the blade is realized Fast and accurate rendering and modeling.
Patent Information
- Application Number
- CN202310142571.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-02-21
AI Technical Summary
The existing impeller CAD software cannot effectively implement computer-assisted modeling of blades, especially the lack of specific methods in the process of blade data processing, resulting in the inability to quickly and accurately complete blade modeling.
Using the OPENGL-based blade rendering method, the blade design data is divided into each surface data list, and the OPENGL polygon construction program is used to combine each four adjacent points into polygon primitives, and the surface rendering is achieved.
The surface rendering of blades is realized, the rendering effect and accuracy is improved, the gap in domestic impeller CAD software is filled, and the blade modeling can be completed quickly and accurately.
Smart Images

Figure CN116433814B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer trusted computing, and in particular relates to a leaf rendering method and system based on an open graphics library OPENGL. Background Art
[0002] Rotating machinery is widely used in aviation, electricity, machinery, chemical industry and other fields, and the impeller, as the core component of rotating machinery, works under high speed and heavy load for a long time. Its performance directly determines the performance and working efficiency of the whole machine, so it is very necessary to carry out computer modeling, analysis and design of the impeller, which has been widely valued by experts and scholars at home and abroad, and a lot of improvements and innovations have been made in modeling.
[0003] Although there are many existing modeling and rendering methods, such as the Chinese patent application with publication number CN 114241160 A, which discloses a single-view blade 3D reconstruction method based on deep learning, including steps S1. making a blade data set; S2. inputting the blade data set into the neural network model for network training to obtain a trained reconstruction network model; S3. inputting the target blade image into the reconstruction network model, outputting the grid rendering contour information of the target blade, adjusting the parameter values in the reconstruction network model, so that the difference between the output grid rendering contour information and the contour information of the target blade image is minimized, and the reconstruction network model set when the difference is minimized is used as the optimal reconstruction network model; S4. inputting the image of the blade to be measured into the optimal reconstruction network model, and outputting the 3D shape of the blade to be measured. However, it does not specifically explain the actual data processing process from blade data to blade modeling, and those skilled in the art cannot realize computer-aided modeling of blades according to this method, that is, this type of rendering method is not suitable for rendering impeller blades.
[0004] In order to quickly and accurately complete the blade modeling, the present invention proposes a system of blade rendering method based on OPENGL to fill the gap of domestic impeller CAD software. Summary of the invention
[0005] In view of the gap in impeller CAD software, the purpose of the present invention is to provide a blade rendering method and system based on OPENGL to achieve blade surface rendering.
[0006] The technical solution of the present invention is:
[0007] A leaf rendering method based on OPENGL, the steps comprising:
[0008] 1) Divide the impeller blade design data according to the blade surface to which it belongs, and obtain a data list of each blade surface; then process the data of each surface in steps 2) to 3) to complete the rendering of the blade;
[0009] 2) Get all the points on a surface, combine every four adjacent points into a polygon primitive and render it;
[0010] 3) The rendering of all polygonal primitives on the surface is merged to realize the rendering of the surface.
[0011] Furthermore, the blade design data is L blade cross-sectional curve data along the radial direction R of the blade, each blade cross-sectional curve data includes leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data; the total number of data points of the leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data are P1, P2, P3, and P4, respectively, and each data point includes position coordinate information; the surfaces of the blade are six surfaces, namely, leading edge, pressure surface, trailing edge, suction surface, upper cover surface, and lower cover surface.
[0012] Furthermore, the method for obtaining the data list of the six surfaces of the blade is:
[0013] 11) The blade cross-sectional curve data is divided into the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface. The points in each row of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the extension direction Z of the blade surface, and the points in each column of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the radial direction R of the blade surface. The number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface of the four blade surfaces is L, and the number of columns is P1, P2, P3 and P4 in the order of leading edge, pressure surface, trailing edge and suction surface respectively.
[0014] 12) interpolating the rows and columns of the cross-sectional curve data matrix of the blade surface respectively to obtain a new cross-sectional curve data matrix of the corresponding blade surface; the number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge, and suction surface of the four blade surfaces after interpolation is M, and the number of columns is N1, N2, N3, and N4 in the order of leading edge, pressure surface, trailing edge, and suction surface;
[0015] 13) fitting the cross-sectional curve data matrices of the four blade surfaces, namely, the leading edge, the pressure surface, the trailing edge, and the suction surface, after interpolation processing, into curves in the radial direction of the four blade surfaces along the R direction, and obtaining a curve list of the leading edge, a curve list of the pressure surface, a curve list of the trailing edge, and a curve list of the suction surface;
[0016] 14) The first blade cross-section curve data in the R direction is used as the blade upper cover data; the last blade cross-section curve data in the R direction is used as the blade lower cover data.
[0017] Furthermore, the direction of the line connecting the first and last data points on the blade surface is taken as the extension direction Z of the corresponding blade surface; the radial direction R is the direction perpendicular to the rotation axis of the blade.
[0018] Furthermore, the OPENGL polygon construction program is called to combine every four adjacent points into a polygon primitive.
[0019] Furthermore, the OPENGL surface construction program is called to merge the renderings of all polygonal primitives on the surface to realize the rendering of the surface.
[0020] A leaf rendering system based on OPENGL, characterized by comprising:
[0021] The blade geometry generation module is used to divide the impeller blade design data according to the blade surfaces to which they belong, and obtain a data list of each blade surface;
[0022] The surface rendering module is used to obtain all points on each surface, combine every four adjacent points on the surface into a polygonal primitive and render it, and then merge the renderings of all polygonal primitives on the surface to complete the rendering of the surface;
[0023] The data storage module is used to store the impeller blade design data, the data list of each surface and the rendering results of each blade surface.
[0024] A server, characterized in that it includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing each step in the above method.
[0025] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.
[0026] The advantages of the present invention are as follows:
[0027] Selecting different data will produce very different primitive generation results and accuracy; the present invention discretizes the blade design data into a curve data matrix according to a certain rule, disperses the data of each surface into multiple polygonal primitives, and then constructs all the polygonal primitives of each surface through OPENGL, and then merges all the polygonal primitives on the surface to achieve rendering of the entire surface, thereby achieving a good rendering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a schematic diagram of the front view of the blade.
[0029] Figure 2 This is a schematic diagram of the reverse side of the blade.
[0030] Figure 3 Schematic diagram of data points for blade design.
[0031] Figure 4 It is a schematic diagram of the pressure surface curve data matrix.
[0032] Figure 5 This is a schematic diagram of the pressure surface curve list.
[0033] Figure 6 Schematic diagram of the process of dispersing the pressure surface into polygonal primitives.
[0034] Figure 7 Schematic diagram of the process of dispersing the upper cover surface into polygonal primitives.
[0035] Among them: 1-leading edge, 2-pressure surface, 3-trailing edge, 4-suction surface. DETAILED DESCRIPTION
[0036] The present invention is further described in detail below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention but not to limit the scope of the present invention.
[0037] A leaf rendering method based on OPENGL, characterized by comprising the following steps:
[0038] S1 processes the blade design data of the impeller and processes the blade design data of the impeller into a data list of six surfaces of the blade;
[0039] S2 obtains all points on a surface, combines every four adjacent points into a polygonal primitive, and decomposes the surface into a data list of multiple polygonal primitives;
[0040] S3 calls the OPENGL polygon construction program for each polygon primitive data list in turn to generate a corresponding polygon primitive;
[0041] S4 completes the rendering of all polygonal primitives on a surface;
[0042] S5 calls the OPENGL surface construction program to merge the rendering of all polygonal primitives on a surface to achieve the rendering of the entire surface;
[0043] S6 executes steps S2 to S5 on the six surfaces of the blade in sequence to complete rendering of all surfaces of the blade.
[0044] Specifically in S1, the six surfaces of the blade can be divided into two parts for processing: the first part is the leading edge, the pressure surface, the trailing edge, and the suction surface; the second part is the upper cover surface and the lower cover surface.
[0045] Specifically, the blade design data processing for the four surfaces of the leading edge, pressure surface, trailing edge, and suction surface includes the following steps:
[0046] S1A.1 obtains blade design data. The blade design data is L blade cross-sectional curve data along the radial direction of the blade (i.e., R direction). Each blade cross-sectional curve data includes leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data. L is related to the numerical values of R, generally 3≤L. The total number of data points of each blade cross-sectional curve data is P, and the data points of the leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data are P1, P2, P3, and P4, respectively. Each data point of each curve data includes its position coordinate information.
[0047] S1A.2 divides the initial blade cross-sectional curve data into the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge, and suction surface. The points in each row of the data matrix represent the finite number of points that make up the cross-sectional curve of the blade surface in the Z direction, and the points in each column of the data matrix represent the finite number of points that make up a certain curve in the R direction of the blade surface. The number of rows in the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge, and suction surface are all L, and the number of columns is P1, P2, P3, and P4 in the order of the leading edge, pressure surface, trailing edge, and suction surface. The Z direction is the direction that changes according to the change of the independent surface. For the leading edge, pressure surface, trailing edge, and suction surface, the Z direction is determined according to the extension direction of their data points. Preferably, the direction of the line connecting the first and last data points on the blade surface can be used as the extension direction Z of the corresponding blade surface. The radial direction R is on the meridian plane, perpendicular to the direction of the blade rotation axis.
[0048] S1A.3 interpolates the rows and columns of the cross-sectional curve data matrix from two directions, R and Z, respectively, to obtain a new cross-sectional curve data matrix. The number of rows of the cross-sectional curve data matrix of the four blade surfaces, namely, the leading edge, pressure surface, trailing edge, and suction surface, are all M after interpolation, and the number of columns are N1, N2, N3, and N4 in the order of leading edge, pressure surface, trailing edge, and suction surface, respectively.
[0049] S1A.4 respectively fits the cross-sectional curve data matrix of the four blade surfaces, namely the leading edge, pressure surface, trailing edge and suction surface, along the blade radial direction (R direction) into the curves of the blade radial direction of the four blade surfaces, and obtains the curve list composed of the curves of the blade radial direction of the four blade surfaces, which are respectively:
[0050] List of curves for the leading edge;
[0051] List of curves for pressure surface;
[0052] List of curves for the trailing edge;
[0053] List of curves for the suction surface.
[0054] Specifically, the blade design data processing of the upper cover surface and the lower cover surface includes the following steps:
[0055] S1B.1 obtains blade design data, which is L blade cross-sectional curve data along the radial direction of the blade (i.e., R direction), and each blade cross-sectional curve data includes leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data; the total number of data points of each blade cross-sectional curve data is P, and the data points of the leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data are P1, P2, P3, and P4, respectively, and each data point of each curve data includes its position coordinate information.
[0056] S1B.2 extracts the first blade section curve data in the R direction as blade upper cover data;
[0057] S1B.3 extracts the last blade section curve data in the R direction as the blade lower cover surface data.
[0058] Specifically, in step S2, the following operations need to be performed when decomposing polygonal primitives for any of the four surfaces: the leading edge, the pressure surface, the trailing edge, and the suction surface:
[0059] S2A.1 Take the first and second points in the first row, the first and second points in the second row, P(1,1), P(1,2), P(2,1), P(2,2) to form the first polygon primitive;
[0060] S2A.2 Take the second and third points in the first row, the second and third points in the second row, P(1,2), P(1,3), P(2,2), P(2,2) to form the second polygon primitive;
[0061] S2A.3 In the above order, until the N-1th and Nth points in the first row and the N-1th and Nth points in the second row are obtained, P(1,N-1), P(1,N), P(2,N-1), and P(2,N) constitute the N-1th polygon primitive;
[0062] S2A.4 processes the 2nd and 3rd rows, the 3rd and 4th rows, and so on in the order of S2A.1 to S2A.3 above, until the M-1th and Mth rows are processed, and a total of (M-1)×(N-1) polygonal primitives are obtained.
[0063] Specifically, in step S2, the following operations need to be performed when decomposing polygonal primitives on any one of the upper cover surface and the lower cover surface of the blade:
[0064] S2B.1 Obtain surface data, starting from the midpoint of the leading edge and going clockwise to the midpoint of the trailing edge, which is recorded as the first set of data points; starting from the midpoint of the leading edge and going counterclockwise to the midpoint of the trailing edge, which is recorded as the second set of data points;
[0065] S2B.2 Take the first and second points of the first set of data points and the first and second points of the second set of data points to form the first polygonal primitive of the surface;
[0066] S2B.3 Take the second and third points of the first set of data points and the second and third points of the second set of data points to form the second polygonal primitive of the surface;
[0067] S2B.4 follows the above order until the second to last and the first to last points of the first set of data points and the second to last and the first to last points of the second set of data points are obtained, thus forming the last polygonal primitive of the surface.
[0068] A leaf rendering system based on OPENGL, characterized in that it includes:
[0069] A data storage module, which is configured to: store all data including external design data, intermediate data and result data;
[0070] The blade geometry generation module is configured to: transform the external design data through a series of processing to form data types and forms that meet the requirements of the three-dimensional geometry engine and can be used for direct solid modeling;
[0071] The surface rendering module is configured to use OPENGL to perform surface rendering on the data processed in the blade geometry data generation module, and finally complete the blade rendering.
[0072] An electronic device, characterized in that it comprises:
[0073] a memory for non-transitory storage of computer readable instructions;
[0074] And a processor, used for running the computer-readable instructions, wherein when the computer-readable instructions are run by the processor, any step of the leaf rendering method based on OPENGL is executed.
[0075] A storage medium, characterized in that it non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, any step of the above-mentioned OPENGL-based leaf rendering method is executed.
[0076] Although the specific embodiments of the present invention are disclosed for the purpose of illustration, the purpose is to help understand the content of the present invention and implement it accordingly, those skilled in the art will understand that various substitutions, changes and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the content disclosed in the best embodiment, and the scope of the present invention is subject to the scope defined in the claims.
Claims
1. A leaf rendering method based on OPENGL, the steps comprising: 1) Divide the impeller blade design data according to the blade surface to which it belongs, and obtain a data list of each blade surface, wherein the blade design data is L blade cross-sectional curve data along the blade radial direction R, and each blade cross-sectional curve data includes leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data; the total number of data points of the leading edge curve data, the pressure surface curve data, the trailing edge curve data, and the suction surface curve data are P1, P2, P3, and P4, respectively, and each data point includes position coordinate information; the surfaces of the blade are six surfaces, namely, the leading edge, the pressure surface, the trailing edge, the suction surface, the upper cover surface, and the lower cover surface; then, the data of each surface is processed in steps 2) to 3) to complete the rendering of the blade; 2) Get all the points on a surface, combine every four adjacent points into a polygon primitive and render it; 3) merging the renderings of all polygonal primitives on the surface to achieve the rendering of the surface; Among them, the method for obtaining the data list of the six surfaces of the blade is: 11) The blade cross-sectional curve data is divided into the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface. The points in each row of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the extension direction Z of the blade surface, and the points in each column of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the radial direction R of the blade surface. The number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface of the four blade surfaces is L, and the number of columns is P1, P2, P3 and P4 in the order of leading edge, pressure surface, trailing edge and suction surface respectively. 12) interpolating the rows and columns of the cross-sectional curve data matrix of the blade surface respectively to obtain a new cross-sectional curve data matrix of the corresponding blade surface; the number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge, and suction surface of the four blade surfaces after interpolation is M, and the number of columns is N1, N2, N3, and N4 in the order of leading edge, pressure surface, trailing edge, and suction surface; 13) fitting the cross-sectional curve data matrices of the four blade surfaces, namely, the leading edge, the pressure surface, the trailing edge, and the suction surface, after interpolation processing, into curves in the radial direction of the four blade surfaces along the R direction, and obtaining a curve list of the leading edge, a curve list of the pressure surface, a curve list of the trailing edge, and a curve list of the suction surface; 14) The first blade cross-section curve data in the R direction is used as the blade upper cover data; the last blade cross-section curve data in the R direction is used as the blade lower cover data.
2. The method according to claim 1, characterized in that The direction of the line connecting the first and last data points on the blade surface is taken as the extension direction Z of the corresponding blade surface; the radial direction R is the direction perpendicular to the blade rotation axis.
3. The method according to claim 1, characterized in that Call the OPENGL polygon construction program to combine every four adjacent points into a polygon primitive.
4. The method according to claim 1, characterized in that: Call the OPENGL surface construction program to merge the rendering of all polygonal primitives on the surface to achieve the rendering of the surface.
5. A leaf rendering system based on OPENGL, characterized in that: It includes a blade geometry generation module, which is used to divide the blade design data of the impeller according to the blade surfaces to which it belongs, and obtain a data list of each blade surface, wherein the blade design data is L blade cross-sectional curve data along the blade radial direction R, and each blade cross-sectional curve data includes leading edge curve data, pressure surface curve data, trailing edge curve data, and suction surface curve data; the total number of data points of the leading edge curve data, the pressure surface curve data, the trailing edge curve data, and the suction surface curve data are P1, P2, P3, and P4, respectively, and each data point includes position coordinate information; the surfaces of the blade are six surfaces, namely, the leading edge, the pressure surface, the trailing edge, the suction surface, the upper cover surface, and the lower cover surface; The surface rendering module is used to obtain all points on each surface, combine every four adjacent points on the surface into a polygonal primitive and render it, and then merge the renderings of all polygonal primitives on the surface to complete the rendering of the surface; A data storage module, used to store the impeller blade design data, the data list of each surface and the rendering results of each surface of the blade; Among them, the method for obtaining the data list of the six surfaces of the blade is: 11) The blade cross-sectional curve data is divided into the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface. The points in each row of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the extension direction Z of the blade surface, and the points in each column of the cross-sectional curve data matrix of the blade surface are the finite number of points constituting a curve in the radial direction R of the blade surface. The number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge and suction surface of the four blade surfaces is L, and the number of columns is P1, P2, P3 and P4 in the order of leading edge, pressure surface, trailing edge and suction surface respectively. 12) interpolating the rows and columns of the cross-sectional curve data matrix of the blade surface respectively to obtain a new cross-sectional curve data matrix of the corresponding blade surface; the number of rows of the cross-sectional curve data matrix of the leading edge, pressure surface, trailing edge, and suction surface of the four blade surfaces after interpolation is M, and the number of columns is N1, N2, N3, and N4 in the order of leading edge, pressure surface, trailing edge, and suction surface; 13) The cross-sectional curve data matrices after interpolation processing of the four blade surfaces, namely, the leading edge, the pressure surface, the trailing edge, and the suction surface, are respectively fitted along the R direction into curves in the radial direction of the blade of the four blade surfaces, and a curve list of the leading edge, a curve list of the pressure surface, a curve list of the trailing edge, and a curve list of the suction surface are obtained; 14) The first blade cross-section curve data in the R direction is used as the blade upper cover data; the last blade cross-section curve data in the R direction is used as the blade lower cover data.
6. A server, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
