1
头图

foreword

In the process of digital twin and simulation research, a large amount of numerical information related to three-dimensional space will be generated, such as scanning data of equipment appearance, terrain scanning data, temperature field/pressure field of production equipment, fluid velocity field, fluid diffusion, and various Simulation data: velocity, pressure, stress, temperature, etc.

The characteristics of these data are large in quantity, and it is not intuitive to use two-dimensional charts to present them, and it is impossible to visually present the three-dimensional distribution of data and the changes of data over time.


Tupu software is a 3D visualization engine based on WebGL, which encapsulates the basic API for 3D model creation and presentation on the basis of WebGL. At the same time, it also encapsulates a rich mathematical operation library, covering multi-dimensional transformation, geometric calculation, etc.

The open and flexible architecture of Tupu SDK also makes it very convenient for users to develop extended functions, such as heat map (body) plug-ins, flow field particle display plug-ins, volume rendering plug-ins, etc. The powerful and flexible 3D engine allows users to easily realize the rendering and editing functions of 3D models. Users don't need to care about complicated and complicated WebGL operations, they can focus on the business layer of the application, save development costs, speed up the development process, and explore hidden information content through 3D dynamic and intuitive display to enhance application value.

This article discusses the methods implemented using the Tupu SDK for the following 6 rendering methods:

  • Model Surface Mapping
  • Model 3D mesh
  • Particle Flow Map
  • particle fluid
  • volume rendering
  • point cloud

In the methods described below, in order to improve front-end performance and user experience, operations involving a large amount of data processing can be implemented on the server. The front end is only responsible for a small amount of operations and effect display.

The following figure is the architecture to realize the whole system:

Model Surface Mapping

For applications that need to display surface data, such as device surface temperature, pressure, etc., the input data is a collection of point coordinates and data values on the model surface, such as x, y, z, value. Implementation method: Calculate the UV value of this point map according to the value of each point on the model.

The implementation schematic is as follows:

There are two situations in which it is necessary to regenerate the data with an interpolation algorithm:

  • Model Surface Mapping
  • Model 3D mesh

The following figure is the principle of implementation. The main increase is to use the inverse distance weighting method to regenerate the data. Due to the large amount of calculation in this step, it needs to be placed on the server as a data preprocessing function.


Model 3D mesh

The properties of a 3D mesh displayed on a 2D surface were described in the previous section "Model Surface Mapping". Here we mainly introduce 3D grids to display 3D information, such as 3D velocity field, 3D temperature field, etc.

Because it is a three-dimensional body, the color information of the mesh cannot be given by means of texture. At this time, the field information of the regular space grid needs to be calculated by interpolation algorithm. For example, interpolate samples at points with integer values of x, y, and z. Pass the spatial field information obtained by sampling to the Tupu SDK in the form of materials. When the SDK renders each point, it interpolates and fits four points in the space around the point to obtain the attribute value, and calculates the rendered color according to the attribute value range. Refer to the following figure for the specific process:

The top is the visualization of the 3D geological model based on the drilling data (click the text to jump to view the past review of the smart coal mine). The digital management, intelligent analysis and visual display of all kinds of static and dynamic information involved in the engineering activities of mineral resources, so as to reduce costs and increase efficiency and maximize the interests of enterprises.

Particle Flow Map

For the fluid field that needs to be displayed on one surface, such as wind field, water flow field, pressure field, etc., it needs to be presented in a dynamic way, which can be realized by using the Tupu particle plugin.

The basic principle of the system is as follows: The two-dimensional fluid field information is passed to the Tupu SDK as a texture resource. The SDK uses textures to save the position information of particles, and uses the fluid field and particle position to calculate the particle position in the next frame. Then fuse the output of the previous frame and the current output to achieve the effect of the particle's moving trail.

The Tupu particle plug-in can realize the following parameter adjustment:

  • particle size
  • particle shape
  • particle velocity
  • Number of particles
  • Displayed Threshold
  • Simulation accuracy, etc.

particle fluid

For vector fields that need to display three-dimensional space, such as wind field, velocity field, etc., it needs to be presented in a dynamic way. This can be achieved using the Tupu particle plugin. The main input data for the plugin is a three-dimensional vector field. It is obtained on the server side by sampling and fitting the vector field at regular intervals.

The Tupu 3D particle plug-in can implement parameter adjustment similar to the 2D particle flow:

  • particle size
  • particle shape
  • particle velocity
  • Number of particles
  • Displayed thresholds, etc.

volume rendering

Volume rendering is a technology that renders volume data in three-dimensional space to two-dimensional graphics. Volume rendering can display data in three-dimensional space on a two-dimensional plane, and can intuitively spy on the internal details of objects, so it can be applied to various simulations of electricity, heat, and magnetic fields, simulation of water pollution diffusion, 3D visualization of ocean remote sensing, medical imaging ( CT) display, etc.

In the power industry, the transformer is an important equipment. The temperature distribution of the transformer winding, especially the hot spot temperature, is an important factor restricting the operation safety and service life of the transformer. In this case, the transformer winding temperature field is displayed by volume rendering. Firstly, through finite element simulation, the heat conduction process inside the transformer is simulated, and finally the temperature distribution law inside the transformer is obtained. The temperature data simulated by the finite element is used to obtain the temperature slice of the entire winding by means of interpolation. There are various interpolation algorithms, such as inverse distance weighting method, kriging method, natural neighborhood method, spline function method, etc. The inverse distance weighting algorithm is used here.

There are many kinds of volume rendering algorithms: ray casting algorithm, snowball throwing algorithm, and staggered deformation algorithm. Compared with the three algorithms, the ray casting algorithm has a relatively large amount of calculation, but the quality of the drawn image is high, which is conducive to retaining image details. Here we use the ray casting algorithm. In order to ensure the rendering speed, we have to optimize the ray casting algorithm to reduce unnecessary computation. Through optimization, finite element analysis results with millions of points or more can be easily rendered in real time on ordinary PCs with non-integrated graphics cards.

In addition, the rendering can be cropped to show the temperature distribution of any slice of the winding.

The following cases are the application of volume rendering in the field of CT visualization:

point cloud

The graph flutter engine has built-in support for point clouds. The number of supported points can reach tens of millions. The texture/shape of each point in the point cloud is configurable.

Point clouds can be used to display properties of the model itself or the surface of the model, such as pressure and temperature.

For laser point cloud data, usually the information of a point contains three-dimensional coordinates and color values, such as six fields of x, y, z, r, g, b. The model can be displayed directly by passing 3D coordinates and color information to the Tupu point cloud. For large scenes or high-precision point cloud models, due to the huge amount of point data, it is impossible to display all of them. Spatial division and LOD technology can be used to generate point cloud models of different resolutions and load them on demand. When the local high-precision model needs to be displayed, only the local high-precision model information is loaded.

For the need to display the change process requirements, the Tupu engine supports custom plug-ins (shaders). By passing the color information of multiple time points to the shader, the shader calculates the color at a certain time t according to the time progress information for rendering. The JavaScript main program loops to update the runtime t. The advantage of this is that the main calculation amount is placed on the graphics card, the simulation progress (time) can be flexibly adjusted, and the entire display process is smooth and not stuck. Refer to the following figure for the process:

More application scenarios

The application scope of simulation analysis technology covers many aspects of society. In this paper, we also make some introductions to the application of Tupu visualization engine in the field of numerical simulation analysis.

The significance and effect of simulation analysis lies in that simulation is a particularly effective research method when the researched system is expensive, the experiment is dangerous, or it takes a long time to understand the consequences of system parameter changes.

Combined with the Web visualization engine of Tupu software, it has played a role in promoting the development of engineering simulation, weather forecasting, life science, scientific research and education, power system, transportation, industrial manufacturing and other fields, and injected new impetus into the development of different industries.

The powerful and flexible front-end visualization engine of Tupu software is independently developed and designed, and is not implemented using third-party open source libraries. Friendly API and flexible extensibility enable the products developed by Tupu engine to have high performance and high extensibility, and users can flexibly and easily realize various display effects.

Tupu software has been widely used in smart cities, parks, buildings, factories, intelligent manufacturing, water affairs, energy, photovoltaics, wind power, electricity, new infrastructure, operation and maintenance, government affairs, transportation, medical care, finance, scientific research and other industries. It has provided professional digital services for many domestic and foreign enterprises including Sany, Baoxin, NARI, Huawei, Tencent, Siemens, Schneider, Honeywell, etc., and provided enterprises with real-time monitoring, operation and maintenance, security warning and simulation of equipment. analysis and other related requirements.

For more industry application examples, please refer to the case link on the official website of Tupu Software: https://www.hightopo.com/demos/index.html


hightopo
5.5k 声望3k 粉丝

Everything you need to create cutting-edge 2D and 3D visualization