A three-dimensional real-time rapid display method and system for digital factories

By establishing a key framework for real-time display in the digital factory, lightweighting the mechanical CAD model and eliminating invisible parts, and optimizing the rendering with batch processing and GPU instantiation, the problem of poor 3D real-time display in the digital factory was solved and achieved. More smooth and efficient virtual and real linkage display.

CN117496065BActive Publication Date: 2025-01-21GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311531485.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-01-21
Estimated Expiration
2043-11-16

AI Technical Summary

Technical Problem

The three-dimensional real-time display effect of existing digital factories is poor, resulting in poor linkage and display effects, and the scope of application is small.

Method used

By establishing a key framework for real-time display of digital factories, the mechanical CAD model is lightweighted, invisible parts are removed in real time, rendering calls are optimized using batch processing and GPU instantiation, and the optimized image data is displayed in real time.

Benefits of technology

It improves the three-dimensional real-time rapid display effect of the digital factory, expands the scope of application, and achieves a smoother and more efficient virtual-real linkage display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117496065B_ABST
    Figure CN117496065B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of digital factories, and provides a three-dimensional real-time rapid display method and system for digital factories, comprising the following steps: S1, establishing a real-time display key framework for digital factories; S2, performing lightweight processing on the mechanical CAD model of the digital factory according to the real-time display key framework; S3, real-time culling and visibility set generation of the mechanical CAD model of the digital factory through a three-dimensional rendering model; S4, rendering call optimization based on batch processing and GPU instantiation; S5, traversing and submitting the optimized image data and displaying it in real time. The present invention can improve the three-dimensional real-time rapid display effect of digital factories, and has a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital factories, and in particular to a three-dimensional real-time rapid display method and system for digital factories. Background Art

[0002] my country is moving from a manufacturing power to a manufacturing powerhouse. In recent years, my country has been actively transforming and upgrading its traditional manufacturing industry. The transformation of traditional factories into smart factories must go through the digital transformation path, and factory digitization is also an important part of it. The digital factory (DF) is based on the relevant data of the entire life cycle of the product. In a computer virtual environment, it simulates, evaluates and optimizes the entire production process, and further expands to a new production organization method for the entire product life cycle. In order to reflect the real physical factory, the digital factory model needs to correspond one-to-one with the physical factory equipment, which leads to a large number of mechanical CAD models in the digital factory, which makes the amount of data in the three-dimensional scene increase sharply, which in turn affects the virtual-real linkage and smooth display of the digital factory.

[0003] Although some existing optimization methods have certain effects on their respective three-dimensional scenes, they cannot cooperate well with each other to improve the fluency of scenes such as digital factories, which are highly complex and have certain mechanical characteristics. In the optimization process, they even fail to consider the characteristics of digital factory scenes, resulting in program errors or poor operation results, and fail to meet the basic requirements of digital factory scenes.

[0004] At the same time, since the domestic open source community is still in its infancy in terms of technical exchanges and resource sharing in this field, the overall programming technology is relatively backward. In terms of rendering optimization algorithms, most domestic 3D visualization software has not been deeply studied and often relies only on high-configuration hardware to achieve better rendering efficiency, which is not friendly to lower-configuration computer devices.

[0005] In addition, cutting-edge technologies for real-time smooth rendering are often concentrated in the gaming field. In comparison, the industrial field shows a certain degree of lag in the development of such optimization technologies. Summary of the invention

[0006] The present invention provides a three-dimensional real-time rapid display method for a digital factory, aiming to solve the problems of poor linkage and display effects, poor rendering effects and small application scope of existing digital factories.

[0007] In a first aspect, an embodiment of the present invention provides a three-dimensional real-time rapid display method for a digital factory, comprising the following steps:

[0008] S1. Establish a key framework for real-time display of digital factories;

[0009] S2. Lightweighting the digital factory mechanical CAD model according to the real-time display key framework;

[0010] S3, real-time culling and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model;

[0011] S4, rendering call optimization based on batch processing and GPU instantiation;

[0012] S5. The optimized image data is traversed, submitted and displayed in real time.

[0013] Preferably, the S1 specifically includes the following sub-steps:

[0014] Analyze and summarize the characteristics of mechanical CAD models;

[0015] Based on the mechanical CAD model characteristics, the key framework of real-time display of digital factory is explained.

[0016] Preferably, S2 specifically includes the following sub-steps:

[0017] S21, extracting the vertex information of the redundant information of the digital factory mechanical CAD model, comparing the sizes of the X, Y, and Z coordinate axes of the vertex information in turn and sorting them, discarding vertices with the same position information, and updating their corresponding index information, and finally welding the vertices to generate a new vertex set; wherein the redundant information also includes normal size, texture coordinates, and index value;

[0018] S22, processing the specific detail features according to the vertex set;

[0019] S23, simplifying the unique detail features based on the edge collapse model;

[0020] S24, generating a detail level of the edge-collapsed model;

[0021] S25. GPU-based level of detail selection.

[0022] Preferably, the S22 specifically includes the following sub-steps:

[0023] S221, randomly select a point set that has the least number of model features from the point set in the region;

[0024] S222, fitting the selected vertices to generate geometric features;

[0025] S223, selecting an unprocessed vertex and comparing its position with the generated geometric feature. If the vertex is on the geometric feature, it indicates that the vertex is on the geometric feature and can be added. Otherwise, it is just marked as processed.

[0026] S224, if the number of vertices in the fitted geometric feature is greater than a preset threshold, it can be considered that the correct geometric feature is obtained, otherwise iterate steps S222-S223;

[0027] S225. If the correct geometric feature is still not found after a certain number of processing times, the area is divided into other features.

[0028] Preferably, the S23 specifically includes the following sub-steps:

[0029] S231, establishing a basic relationship through the edge collapse model;

[0030] S232, calculating the optimal candidate folding point;

[0031] S233, iterative edge collapse simplification operation.

[0032] Preferably, the S25 specifically includes the following steps:

[0033] S251, creating a buffer object for the model data to be rendered;

[0034] S252, performing geometric shading on the buffer object to generate multiple storage streams;

[0035] S253, outputting a plurality of buffer objects respectively for the plurality of storage streams;

[0036] S254, determining whether the outputted plurality of buffer objects are empty, if yes, returning to execute S251; if no, completing the actual rendering of the model.

[0037] Preferably, the S3 specifically includes the following sub-steps:

[0038] S31, octree-based frustum culling;

[0039] S32, culling based on pixel size;

[0040] S33, occlusion culling based on occlusion query.

[0041] Preferably, the S4 specifically comprises the following steps:

[0042] S41, batch processing the static models in the scene, and extracting valid vertex information for mesh models with the same material;

[0043] S42, batch processing is performed on dynamic models with simple rendering effects and small data volumes;

[0044] S43. For those complex and numerous dynamic models in the scene, GPU instantiation is used for processing and the instantiated objects are stored.

[0045] Preferably, in S41, the batch processing includes static batch processing and dynamic batch processing.

[0046] In a second aspect, the present invention provides a three-dimensional real-time rapid display system for a digital factory, comprising:

[0047] Establish a framework module to build a real-time display key framework for digital factories;

[0048] A processing module, used for performing lightweight processing on the digital factory mechanical CAD model according to the real-time display key framework;

[0049] A culling and generation module, for real-time culling and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model;

[0050] Optimization module for optimizing rendering calls based on batch processing and GPU instancing;

[0051] The display module is used to traverse, submit and display the optimized image data in real time.

[0052] Compared with the prior art, the beneficial effect of the present invention is that, by establishing a key framework for real-time display of digital factories; performing lightweight processing on the mechanical CAD model of digital factories according to the key framework for real-time display; real-time elimination and visibility set generation of the mechanical CAD model of digital factories through a three-dimensional rendering model; optimization of rendering calls based on batch processing and GPU instantiation; traversal submission of the optimized image data and real-time display. In this way, the characteristics of mechanical CAD models are analyzed and summarized, and a key technical framework for real-time display of digital factories is proposed in combination with the characteristics of digital factories; the detailed features of the grid model are simplified using a simplification algorithm to achieve the purpose of reducing the amount of data, and the relevant algorithm is used to automatically generate a detailed level that meets the requirements of real-time display of digital factories, and can be processed in real time and quickly; then the digital factory is divided into scene spaces, a certain degree of data structure is established, and the visibility analysis and classification of the three-dimensional models in the scene are performed using the divided spatial structure, invisible models are eliminated, and visible models are retained; finally, according to the different grid models in the digital factory, static / dynamic batch processing technology and instantiation technology are used in a classified manner, and invisible models in the batch queue are eliminated, and the rendering queue is optimized and designed; the three-dimensional real-time and fast display effect of the digital factory is improved, and the scope of application is wide. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The present invention will be described in detail below in conjunction with the accompanying drawings. The above and other aspects of the present invention will become clearer and easier to understand through the detailed description made in conjunction with the following drawings. In the accompanying drawings:

[0054] Figure 1 is a flow chart of a three-dimensional real-time rapid display method for a digital factory provided by an embodiment of the present invention;

[0055] Figure 2 is a specific flow chart of S2 provided in an embodiment of the present invention;

[0056] Figure 3 is a simplified processing schematic diagram of a circular hole feature provided by an embodiment of the present invention;

[0057] Figure 4 is a schematic diagram of edge collapse provided by an embodiment of the present invention;

[0058] Figure 5 is a schematic diagram of real-time calculation of LOD based on GPU provided by an embodiment of the present invention;

[0059] Figure 6 is a schematic diagram of time delay caused by GPU occlusion query provided by an embodiment of the present invention;

[0060] Figure 7 is a schematic diagram of a memory storage method of instantiated objects provided by an embodiment of the present invention;

[0061] Figure 8 It is a module diagram of a three-dimensional real-time rapid display system for digital factories provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] 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 accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0063] Embodiment 1

[0064] Combined with Figure 1-Figure 7 As shown, an embodiment of the present invention provides a three-dimensional real-time rapid display method for a digital factory, comprising the following steps:

[0065] S1. Establish a key framework for real-time display of digital factories.

[0066] S2. Lightweight processing is performed on the digital factory mechanical CAD model according to the real-time display key framework.

[0067] S3. Real-time elimination and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model.

[0068] S4. Rendering call optimization based on batch processing and GPU instancing.

[0069] S5. The optimized image data is traversed, submitted and displayed in real time.

[0070] Specifically, by analyzing and summarizing the characteristics of mechanical CAD models and combining them with the characteristics of digital factories, a key technical framework for real-time display of digital factories is proposed; a simplification algorithm is used to simplify the detailed features of the grid model to reduce the amount of data, and related algorithms are used to automatically generate detailed levels that meet the requirements of real-time display of digital factories, and to process them in real time and quickly; then the digital factory is divided into scene spaces, a certain degree of data structure is established, and the three-dimensional models in the scene are analyzed and classified using the divided spatial structure, invisible models are eliminated, and visible models are retained; finally, according to the different grid models in the digital factory, static / dynamic batch processing technology and instantiation technology are classified, and invisible models in the batch queue are eliminated, and the rendering queue is optimized; the three-dimensional real-time and fast display effect of the digital factory is improved, and the application range is wide.

[0071] In this embodiment, S1 specifically includes the following sub-steps:

[0072] Analyze and summarize the characteristics of mechanical CAD models;

[0073] Based on the mechanical CAD model characteristics, the key framework of real-time display of digital factory is explained.

[0074] In this embodiment, S2 specifically includes the following sub-steps:

[0075] S21. Extract the vertex information of the redundant information of the digital factory mechanical CAD model, compare the sizes of the X, Y, and Z coordinate axes of the vertex information in turn and sort them, discard the vertices with the same position information, and update their corresponding index information, and finally weld the vertices to generate a new vertex set; wherein the redundant information also includes normal size, texture coordinates and index value.

[0076] Among them, the redundant information of CAD models in digital factories mainly includes vertex positions, normal sizes, texture coordinates, and index values. Normal and texture information are bound to vertex position information, and index values ​​indicate vertex position information. Therefore, to remove redundant data from the model, we only need to focus on vertex positions and index information.

[0077] The present invention adopts the idea of ​​sorting and deduplication to perform vertex welding. Its main idea is: extract the vertex information of the model to be processed, then compare the sizes of the X, Y, and Z coordinate axes of the vertex positions in turn and sort them, discard vertices with the same position information, and update their corresponding index information. For this, the present invention uses an auxiliary array to process, adds vertices with different positions to the result set, and finally generates a new vertex set.

[0078] S22. Processing the specific detail features according to the vertex set.

[0079] Specifically, first, establish the model topological relationship of regions, clusters, edges, etc., use the edges as the boundaries between regions, and divide them into two categories: sharp feature edges and non-sharp feature edges. Sharp feature edges and non-sharp feature edges are distinguished by whether they reach a threshold, that is, whether the angle formed by the triangular facets around the edge is greater than the set threshold. If the angle is greater than the set threshold, the edge is identified as a sharp feature edge, which serves as the boundary for subsequent regional division. Otherwise, it is identified as a non-sharp feature edge; secondly, use the regional growing algorithm to divide the grid into different regions. The main steps of the algorithm are as follows: first, traverse the unmerged clusters in the grid, select one of them as the initial cluster, and then traverse the non-sharp clusters around the cluster, and divide the traversed non-sharp clusters and the initial clusters into the same region, and iterate continuously to finally complete the division of the entire grid model; then, use the RANSAC algorithm for the segmented area to achieve the effect of feature recognition. Preferably, the threshold of the angle is set to 25°.

[0080] S23. Simplify the unique detail features based on the edge collapse model.

[0081] The ultimate goal of model simplification is to enable the program to obtain mesh models with different numbers of faces, which requires the implementation of an automatic face reduction method. The present invention reduces the number of triangles in the mesh model by repeatedly using a simple edge collapse operation. The edge collapse operation is as follows: Figure 4 shown.

[0082] In this operation, two vertices A and B (edge ​​AB) are selected and one of the vertices (here A) is "moved" or "collapsed" to the other vertex (in this case B), and the number of triangles after the collapse is reduced by 2. The above operation does not generate new vertices, so it is faster than the algorithm based on quadratic error metrics (QEM) for edge collapse.

[0083] Since there are often some large equipment models in digital factories, these models have larger planes. Although the curvature value on the plane is small, the distance between the vertices on the plane is large. Since the calculation of the collapse cost depends on the length of the edge and the curvature value, the collapse cost becomes larger. If the length value of the edge in the calculation of the collapse cost is completely removed, it will obviously cause the program to ignore the size of the collapse range. The present invention chooses to multiply the collapse cost by a constant, which is the radius of the enclosing sphere of the mesh model, so that it has a certain scalability. In addition, when the edge is at the edge, that is, the edge is only occupied by one triangle, the curvature value cannot be used alone to measure the impact of the edge collapse on the mesh model. The impact of the edge on the edges around it should be calculated. If the collinearity of the two is stronger, it means that the impact is smaller, otherwise the impact is greater. So in summary, the present invention uses the following set of equations to calculate the collapse cost of the edge, where equation a calculates the collapse cost at the non-edge, and equation b calculates the collapse cost at the edge:

[0084]

[0085] Where radius is the radius of the model's enclosing sphere, u and v represent vertices, and T u is the triangular face set on the vertex, T uv is the triangular face set shared by u and v, O u is the edge around the vertex, and collaseEdge is the shared edge between vertex u and vertex v.

[0086] S24, generating a detail level for the edge-collapsed model.

[0087] In the real-time display process of the digital factory, as the camera moves farther and farther away from certain models, the pixel area of ​​these models projected onto the computer screen will also decrease, and many details on the models are not easy to be found. At this time, simplified versions of these models can be provided to the rendering queue to reduce the amount of data transmitted from the CPU to the GPU and the number of vertices that the GPU needs to process. The detail level management program of the present invention simplifies all mesh models imported into the digital factory to varying degrees, thereby generating different detail levels, and there are obvious dividing lines between the detail levels, that is, the number of pixels. In order to balance performance and display effects, the present invention will generate four detail levels to process the model, and the number of pixels at each level is i∈[2,5], i=2 represents the nearest detail level, i=5 represents the farthest detail level, and setting the power of i to 4 helps to increase the boundary of the division level. In addition to generating the model detail level boundary, it is also necessary to generate the corresponding collapse cost. The present invention uses the radius of the bounding sphere of the model as the basic value for calculation. For other coefficients, they need to be associated with each detail level boundary, so the collapse cost of each level is i∈[2,5]. The collapse cost of the corresponding detail level is calculated as follows:

[0088]

[0089] Where radius is the radius of the model's enclosing sphere, it is easy to get For the farthest level of detail, Use for the closest level of detail.

[0090] S25. GPU-based level of detail selection.

[0091] The present invention converts the number of pixels of the model into the distance from the camera, which reduces the amount of calculation and improves the operation efficiency. In the calculation of the selected value, the present invention uses the highly parallelized characteristics of the GPU to accelerate the calculation of the model detail level.

[0092] The overall idea of ​​the algorithm is as follows: for each simplified model, the calculated level limit distance and model-view transformation matrix are passed to its geometry shader, and the distance of the model relative to the camera is obtained by multiplying the model with the transformation matrix. Then it is compared with the set level limit distance to obtain the selected value of the detail level, and the transformation feedback query function of OpenGL is used for output. Finally, OpenGL commands are used to draw different levels according to the output parameters.

[0093] In this embodiment, S22 specifically includes the following sub-steps:

[0094] S221, randomly select a point set that has the least number of model features from the point set in the region;

[0095] S222, fitting the selected vertices to generate geometric features;

[0096] S223, selecting an unprocessed vertex and comparing its position with the generated geometric feature. If the vertex is on the geometric feature, it indicates that the vertex is on the geometric feature and can be added. Otherwise, it is just marked as processed.

[0097] S224, if the number of vertices in the fitted geometric feature is greater than a preset threshold, it can be considered that the correct geometric feature is obtained, otherwise iterate steps S222-S223;

[0098] S225. If the correct geometric feature is still not found after a certain number of processing times, the area is divided into other features.

[0099] Specifically, in a mechanical CAD model, detailed geometric features are generally composed of curved surfaces, so their geometric data is relatively complex, and often there are a large number of vertices and facets. Therefore, when the iterative processing is repeated in the above step Step 4, a long time will be consumed, but the more iterations, the more accurate the generated geometric features, so a certain number of iterations must be determined; but in the RANSAC algorithm, as the number of vertices increases, the number of iterations of the program operation increases accordingly, which greatly increases the time consumption. The present invention reduces the number of vertices processed in the RANSAC algorithm through Gaussian mapping, while ensuring the correctness of the RANSAC algorithm.

[0100] The detailed features of the mechanical model studied in this invention are mainly circular holes, cones, etc. The Gaussian mappings of these features are often circular, so the vertices after Gaussian mapping can be fitted by the RANSAC algorithm, and then the features can be judged by the fitted information. The circular hole features in the mechanical CAD model mainly have two forms: cylinder and cone. The recognition of circular hole features is essentially the recognition of cylinders and cones. The recognition process of cylinder and cone features is as follows:

[0101] In the first step, the normals of all clusters in the area to be identified are Gaussian mapped to obtain a processed point set.

[0102] The second step is to use the RANSAC algorithm to fit the point set after Gaussian mapping. If the radius of the fitted circle is approximately 1 or within the interval (0, 1), it is considered to be a correct result, otherwise it is considered a failure.

[0103] The third step is to perform multiple RANSAC fitting circles on all the vertices in the area, mark the vertices that have been fitted, and these vertices will not participate in the subsequent fitting to ensure that each fitting is a new vertex. The center coordinates and radius of each fitting can be obtained from the above circular fitting, and the fitting circles with the lowest and highest relative positions are obtained respectively, which are used as the bottom and top surfaces. If the radius of the circle after each fitting is approximately equal, the feature is considered to be a cylindrical feature, otherwise it is considered to be a column feature.

[0104] The fourth step is to simplify the typical detail features. The present invention takes the circular hole feature as an example. It is easy to know that the sharp feature edges are concentrated at the top or bottom of the circular hole. The present invention sets the vertices on the sharp feature edges as sharp feature points and the rest as non-sharp feature points. When simplification is required, the non-sharp feature points in the circular hole are often invisible, so the present invention directly removes the non-sharp feature points in the circular hole feature to reduce the data information in the mesh model, that is, removes all vertex information in the middle of the circular hole. As for the top circle and bottom circle of the circular hole, the present invention will stitch them to prevent the problem of holes in the mesh model. The stitching process is as follows: Figure 3As shown, the blue line is the edge after stitching, the green point is the non-sharp feature point, and the blue point is the sharp feature point. A vertex is added at the center of the circle and connected with the surrounding sharp feature points to generate a plane.

[0105] In this embodiment, S23 specifically includes the following sub-steps:

[0106] S231, establishing a basic relationship through the edge collapse model;

[0107] S232, calculating the optimal candidate folding point;

[0108] S233, iterative edge collapse simplification operation.

[0109] In this embodiment, Figure 5 As shown, the S25 specifically includes the following steps:

[0110] S251, creating a buffer object for the model data to be rendered;

[0111] S252, performing geometric shading on the buffer object to generate multiple storage streams;

[0112] S253, outputting a plurality of buffer objects respectively for the plurality of storage streams;

[0113] S254, determining whether the outputted plurality of buffer objects are empty, if yes, returning to execute S251; if no, completing the actual rendering of the model.

[0114] Specifically, some mesh models in the digital factory are too large or too small to generate four levels of detail for them, so four storage streams cannot be generated in the geometry shader (one or more storage streams must be empty). Therefore, the present invention adds a controller to the model to monitor the changes in the distance between it and the camera in real time and adjust the level of detail value.

[0115] In this embodiment, S3 specifically includes the following sub-steps:

[0116] S31. Octree-based frustum culling.

[0117] Among them, the bounding box established in the previous section is selected to replace the model for conservative detection. The bounding box is tested according to the six planes that define the view cone. For each plane of the cone, the bounding box is tested whether it is outside, inside, or intersecting the plane. If the bounding box is outside a plane of the view cone, it ends immediately and indicates that the bounding box is outside the view cone; if the bounding box is inside all planes of the view cone or intersects with a plane, it indicates that the bounding box is inside the view cone. By projecting the normal of each face of the view cone onto the coordinate system of the bounding box, the positive and negative signs of the X, Y, and Z components of the projection are tested. The whole process performs a total of 9 calculations and 3 comparisons. In order to simplify the projection operation and reduce calculations, the plane equation of the view cone (mainly the plane normal and offset) can be converted to the world coordinate system at the beginning of each frame. This makes the AABB bounding box and the view cone plane in the same coordinate system, and the signs of the X, Y, and Z components of the view cone plane normal can be used quickly, with only 3 comparisons required.

[0118] S32. Culling based on pixel size.

[0119] Among them, by setting a certain pixel threshold, when the pixel area projected onto the screen after model rendering does not reach the threshold, it does not need to be submitted to the rendering queue, thereby reducing the number of Draw Calls. This pixel culling can eliminate a large number of smaller mechanical parts models in digital factories. Compared with the use of bounding boxes, the shape projected onto the screen is a rectangle, and its area calculation has two unknown quantities: length and height. When using bounding spheres, the shape projected onto the screen is always circular, and its area calculation only requires one unknown quantity. Therefore, the bounding sphere of the node is chosen to conservatively calculate the pixel value of the screen it occupies.

[0120] S33, occlusion culling based on occlusion query.

[0121] Among them, there are a large number of mutually occluding models in the digital factory scene. These models may cause serious over-drawing, and these over-drawings will waste the workload of the vertex and pixel processing stages in the rendering pipeline. Therefore, occlusion culling is needed to cull the occluded models to reduce the number of drawing times. The current OpenGL has a certain delay between the time when the query command is issued and the time when it is processed in the rendering pipeline. This is mainly because the computing efficiency of the CPU and GPU is not fully utilized, which causes the CPU to wait for the GPU's calculation results or the GPU to wait for the CPU's data transmission at some point. In order to reduce the waiting time between them, when the CPU transfers data to the GPU for calculation, the CPU should continue with subsequent calculations instead of waiting for the GPU to complete the calculation; once the GPU completes the calculation, the CPU should immediately transfer data to the GPU to reduce the GPU's waiting time. These methods can make the original occlusion query operation more efficient, such as Figure 6 shown.

[0122] The operation of occlusion query instructions will also increase performance consumption. In order to reduce the number of occlusion query instructions issued, the nodes are divided into groups, and an occlusion query is issued for each such group. If the query result shows that the pixel value is still 0, it means that all nodes in the group are still in an invisible state. Otherwise, this continuity is broken and the program issues queries for all nodes in the group separately. In the case that this continuity is not broken, the number of occlusion query instructions decreases with the increase of the number of nodes in the group; in the case that the continuity is broken, the number of occlusion query instructions is only one more than when the group is not used for batch query, so this can greatly reduce the number of occlusion query instructions; in addition to using groups to reduce the number of occlusion query instructions issued, the issuance of instructions is also reduced by using time continuity: if a node is visible through occlusion query at time t, it is considered that it still maintains this state within time t+n, which reduces the average query number of the node by n times. In order to balance the smoothness and correctness of rendering, a random number is used to assign n, ranging from 5 to 10.

[0123] In this embodiment, S4 specifically includes the following steps:

[0124] S41, batch processing the static models in the scene, and extracting valid vertex information for mesh models with the same material;

[0125] S42, batch processing is performed on dynamic models with simple rendering effects and small data volumes;

[0126] S43. For those complex and numerous dynamic models in the scene, GPU instantiation is used for processing and the instantiated objects are stored.

[0127] Among them, GPU instancing obtains dynamic models at different locations, classifies and groups the same network models, submits the instance groups to the rendering queue, updates each group of information in real time, and submits them to the rendering queue.

[0128] Specifically, first, batch process the static models in the scene, and extract valid vertex information from mesh models with the same material, such as index information, vertex position, normal information, and texture information. The vertex positions need to be converted into coordinates in the world space, and then they are combined in the corresponding cache area, that is, the mesh models with the same material are combined into a larger mesh model. When these mesh models are to be rendered, the program only needs to submit the combined mesh model, which can greatly reduce the number of submissions; secondly, batch process the dynamic models with simple rendering effects and small data volumes. The world space position information of each sub-mesh model is stored in the batch object unit. The position information of the dynamic models to be batched is constantly changing, that is, the vertex position information in the composed mesh model is constantly changing, and needs to be updated accordingly; finally, for those more complex and numerous dynamic models in the scene, GPU instantiation is used for processing, and the instantiated objects are processed as follows: Figure 7 Storage method shown.

[0129] In this embodiment, in S41, the batch processing includes static batch processing and dynamic batch processing.

[0130] Among them, static batch processing includes obtaining static models with the same material, merging the same models, and submitting them to the rendering queue.

[0131] Dynamic batch processing includes obtaining dynamic models of different materials, excluding models that do not meet the conditions, merging the same models, updating the model information in real time, and submitting them to the rendering queue.

[0132] In this embodiment, first, vertex welding and other technologies are used to remove redundant information from the mesh model data, thereby reducing the storage load and providing a data basis for subsequent operations. Mesh segmentation and feature recognition algorithms are used to identify the unique detail features of each mechanical CAD model in the scene. At the same time, mesh simplification is performed iteratively on more complex mesh models. The appropriate number of detail levels is generated through simplified data and detail features, and the parallel computing of the GPU is used to control the selection of model detail levels.

[0133] Secondly, through the support of software and hardware such as CPU multi-threading, the model data is calculated and merged to improve the real-time data calculation speed and reduce the number of Draw Calls.

[0134] Finally, because some models are blocked relative to the camera or outside the camera's viewing frustum during the real-time display of the digital factory, real-time dynamic and low-cost visibility analysis and culling are performed on the models in the scene.

[0135] In addition, because the data of mechanical CAD models is essentially discretized, that is, composed of discrete point information or point information forming a topological relationship, after the redundant information of the model is processed, it is necessary to establish a certain regular basic relationship for its data for subsequent simplified processing and other operations. Secondly, for the needs of visibility analysis elimination, scene traversal, etc., it is necessary to establish a certain data structure to accelerate its calculation. In order to meet the requirements of time and accuracy, the present invention adopts a combination of three data structures: octree, hierarchical bounding volume and scene graph.

[0136] Embodiment 2

[0137] like Figure 8 As shown, the present invention provides a three-dimensional real-time rapid display system 200 for a digital factory, comprising:

[0138] Establishing a framework module 201, for establishing a real-time display key framework for a digital factory;

[0139] A processing module 202 is used to perform lightweight processing on the digital factory mechanical CAD model according to the real-time display key framework;

[0140] A culling and generating module 203, for real-time culling and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model;

[0141] An optimization module 204, for optimizing rendering calls based on batch processing and GPU instantiation;

[0142] The display module 205 is used to traverse, submit and display the optimized image data in real time.

[0143] Specifically, a real-time display key framework for digital factories is established by establishing a framework module 201; a processing module 202 performs lightweight processing on the mechanical CAD model of the digital factory according to the real-time display key framework; a culling and generation module 203 is used for real-time culling and visibility set generation of the mechanical CAD model of the digital factory through a three-dimensional rendering model; an optimization module 204 optimizes rendering calls based on batch processing and GPU instantiation; and a display module 205 traverses and submits the optimized image data and displays it in real time.

[0144] In this way, the characteristics of mechanical CAD models are analyzed and summarized, and combined with the characteristics of digital factories, a key technical framework for real-time display of digital factories is proposed; the detailed features of the grid model are simplified using a simplification algorithm to reduce the amount of data, and related algorithms are used to automatically generate detailed levels that meet the requirements of real-time display of digital factories, and can be processed in real time and quickly; then the digital factory is divided into scene spaces, a certain degree of data structure is established, and the three-dimensional models in the scene are analyzed and classified using the divided spatial structure, invisible models are eliminated, and visible models are retained; finally, according to the different grid models in the digital factory, static / dynamic batch processing technology and instantiation technology are used in a classified manner, and invisible models in the batch queue are eliminated, and the rendering queue is optimized; the three-dimensional real-time and fast display effect of the digital factory is improved, and it has a wide range of applications.

[0145] The three-dimensional real-time rapid display system 200 for digital factories can implement the steps in the three-dimensional real-time rapid display method for digital factories in the above-mentioned embodiment, and can achieve the same technical effects. Please refer to the description in the above-mentioned embodiment and will not be repeated here.

[0146] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0147] The embodiments of the present invention are described above in conjunction with the accompanying drawings. What is disclosed is only the preferred embodiment of the present invention. However, the present invention is not limited to the above-mentioned specific implementation manner. The above-mentioned specific implementation manner is only illustrative rather than restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms and equivalent changes without departing from the scope of protection of the purpose of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A three-dimensional real-time rapid display method for digital factories, characterized in that: The following steps are involved: S1. Establish a key framework for real-time display of digital factories; S2. Lightweighting the digital factory mechanical CAD model according to the real-time display key framework; S3, real-time culling and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model; S4, rendering call optimization based on batch processing and GPU instantiation; S5, submitting the optimized image data and displaying it in real time; The S2 specifically includes the following sub-steps: S21, extracting the vertex information of the redundant information of the digital factory mechanical CAD model, comparing the sizes of the X, Y, and Z coordinate axes of the vertex information in turn and sorting them, discarding vertices with the same position information, and updating their corresponding index information, and finally welding the vertices to generate a new vertex set; wherein the redundant information also includes normal size, texture coordinates, and index value; S22, processing the specific detail features according to the vertex set; S23, simplifying the unique detail features based on the edge collapse model; S24, generating a detail level of the edge-collapsed model; S25. GPU-based level of detail selection.

2. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S1 specifically includes the following sub-steps: Analyze and summarize the characteristics of mechanical CAD models; Based on the mechanical CAD model characteristics, the key framework of real-time display of digital factory is explained.

3. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S22 specifically includes the following sub-steps: S221, randomly select a point set that has the least number of model features from the point set in the region; S222, fitting the selected vertices to generate geometric features; S223, selecting an unprocessed vertex and comparing its position with the generated geometric feature. If the vertex is on the geometric feature, it indicates that the vertex is on the geometric feature and is added. Otherwise, it is just marked as processed. S224, if the number of vertices in the fitted geometric feature is greater than a preset threshold, it can be considered that the correct geometric feature is obtained, otherwise iterate steps S222-S223; S225. If the correct geometric feature is still not found after completing the preset number of processing times, the area is divided into other features.

4. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S23 specifically includes the following sub-steps: S231, establishing a basic relationship through the edge collapse model; S232, calculating the optimal candidate folding point; S233, iterative edge collapse simplification operation.

5. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S25 specifically includes the following steps: S251, creating a buffer object for the model data to be rendered; S252, performing geometric shading on the buffer object to generate multiple storage streams; S253, outputting a plurality of buffer objects respectively for the plurality of storage streams; S254, determining whether the outputted plurality of buffer objects are empty, if yes, returning to execute S251; if no, completing the actual rendering of the model.

6. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S3 specifically includes the following sub-steps: S31, octree-based frustum culling; S32, culling based on pixel size; S33, occlusion culling based on occlusion query.

7. The three-dimensional real-time rapid display method for digital factories according to claim 1, characterized in that: The S4 specifically comprises the following steps: S41, batch processing the static models in the scene, and extracting valid vertex information for mesh models with the same material; S42, batch processing is performed on dynamic models with simple rendering effects and small data volumes; S43. For those complex and numerous dynamic models in the scene, GPU instantiation is used for processing and the instantiated objects are stored.

8. The three-dimensional real-time rapid display method for digital factories according to claim 7, characterized in that: In S41, the batch processing includes static batch processing and dynamic batch processing.

9. A three-dimensional real-time rapid display system for digital factories, characterized in that: include: Establish a framework module to build a real-time display key framework for digital factories; A processing module, used for performing lightweight processing on the digital factory mechanical CAD model according to the real-time display key framework; A culling and generation module, for real-time culling and visibility set generation of the digital factory machinery CAD model through a three-dimensional rendering model; Optimization module for optimizing rendering calls based on batch processing and GPU instancing; A display module is used to traverse and submit the optimized image data and display it in real time; The processing module is also used to extract the vertex information of the redundant information of the digital factory mechanical CAD model, compare the sizes of the X, Y, and Z coordinate axes of the vertex information in turn and sort them, discard the vertices with the same position information, and update their corresponding index information, and finally weld the vertices to generate a new vertex set; wherein the redundant information also includes the normal size, texture coordinates and index value; Processing the specific detail features according to the vertex set; Simplifying the unique detail features based on the edge collapse model; generating a level of detail for the edge-collapsed model; GPU-based level of detail selection.