preface

With the rapid development of the network today, people’s communication is no longer limited to face to face, a video call can shorten the distance between each other, and industrial control is not limited to real-time video stream monitoring, HTML itself has a powerful Web component for us to implement some interesting examples. Even with some simple and fun animations and real-time data docking, the effect is more than a step up. Plus the one that’s been around for a long time now
Industrial 4.0A new generation
Industrial InternetAnd not so long ago
5GIn the new era, the collision between data visualization and network bandwidth development has inspired the development of a generation of 3D data visualization supervision. while
Hightopo(hereinafter referred to as HT)
HT for WebOn the product
webConfiguration provides a wealth of
The configuration of 2 dand
The configuration of 3 dEffect, can quickly achieve a complete set of data visualization system according to demand. This article will go through an HT
The configuration of 3 dThe realization of a visual distributed energy station system takes you to the door of rich configuration.


Interface introduction and effect preview

In the scene construction, we present a distributed energy station system of polygeneration system in the main form of heat, electricity and cold combined power supply. According to the flow and transfer process of pipeline, the display effect of cascade utilization of energy is effectively realized:



Code implementation

In the construction of energy stations, distributed energy stations refer to clean and environmentally friendly power generation facilities with small scale, using heat, electricity and cold combined power supply as the main form and distributed near the load, which is a relatively reliable and efficient power generation form.
3D scenes are realized by creating
ht.graph3d.Graph3dViewTo present 3D content, 3D view component deserialize() deserialize corresponding JSON to present 3D scene content, and then add 3D components under the body to achieve the loading rendering effect of the scene. You can also customize some interaction or perspective restrictions, such as modifying the interaction mode of the left and right keys or setting the maximum elevation Angle of the scene, so that users can have a smoother interaction experience.
// Create a 3d topology view
this.g3d = new ht.graph3d.Graph3dView();
this.g3dDm = this.g3d.dm();
// Add the 3D component under the body
this.g3d.addToDOM();
// Change the left and right keys interaction mode
let mapInteractor = new ht.graph3d.MapInteractor(this.g3d);
this.g3d.setInteractors([mapInteractor]);
// Change the maximum elevation Angle to PI / 2
mapInteractor.maxPhi = Math.PI / 2;Copy the code

In order to have visual interactive experience when suspending the building model, highlight mode of the model is set here.



// Set hover highlighting mode
this.g3d.setHighlightMode('mouseover');
// Set the highlight color
ht.Style['highlight.color'] = '#FEB64D';Copy the code

After the scene rendering is loaded, we can animate the industrial process of the distributed power station through the pipeline. Ht. Shape is an extremely powerful graphic type, which can display a variety of 2d and 3D Shape effects on GraphView and Graph3dView components. The extension of HT. PolyLine can realize the function of 3d space pipe. We can use HT.polyline to draw the path of the flow, and use the hT.default.startanim () animation function to perform the call to change the offset value of the UV map on the pipe to achieve the flow effect.



The code is as follows:

animflow() {
    // Animation executes the function
    ht.Default.startAnim({
        duration: 2000.easing: (t) = > { return  t },
        action: (v, t) = > {
            // Get the pipeline node setting UV offset flow animation by obtaining the unique identification tag from the data model
            this.g3dDm.getDataByTag('flow1').setStyle('top.uv.offset', [ v, 0 ]); 
            this.g3dDm.getDataByTag('flow2').setStyle('top.uv.offset', [ v, 0.5 ]);
            this,g3dDm.getDataByTag('flow3').setStyle('top.uv.offset', [ -v, 0.5]); . },finishFunc:  (a)= >{ animflow(); }}); }Copy the code

The data presented in the scene can be connected to some mainstream interfaces, such as Ajax, AXIOS or WebSocket. According to our own requirements for docking and interaction, we can determine whether to use polling call interface or two-way docking for data transmission, so as to meet the need of real-time data refresh. The data carrier can be displayed on the 3D Billboard board connected to HT:



Billboard is also a subclass of HT. Shape, which can be used to define the styleMap property for both 2D and 3D configurations. Of course, users can also set some custom properties in attrObject. In distributed energy station, we set some attribute values for billboard to control the attribute information of bulletin board:

let billboard = new ht.Node();
billboard.s({
    // Set the shpe3D type to Billboard
    "shape3d": "billboard".// Set the image of the bulletin board
    "shape3d.image": "symbols/htdesign/box/panel.json".// Set the bulletin board to always automatically rotate to face the screen
    "shape3d.autorotate": true.// Set the transparency of the bulletin board
    "shape3d.transparent": true.// Set the bulletin board to be immovable
    "3d.movable": false.// Set the bulletin board to always be at the top
    "shape3d.alwaysOnTop": true.// Set the bulletin board to be unavailable
    "3d.selectable": false.// The cache is enabled on the bulletin board
    "shape3d.image.cache": true
});Copy the code

If the map is a vector, performance is greatly improved for a bulletin board with caching enabled. Comparing this example, you can see the difference in performance in the caching mechanism. It can be seen that the caching mechanism is crucial to the overall smoothness of the scene. For some panel information that does not need to be refreshed in real time, we can adopt the caching method. And called in the next update Graph3dView. InvalidateShape3dCachedImage (node) to manually refresh this node, thus greatly improve the performance of the scene:

g3d.invalidateShape3dCachedImage(billboard);Copy the code

conclusion

After the first year of the industrial Internet in 2018 and the first year of 5G in 2019, more than the presentation of distributed energy station visualization system, the industrial Internet will usher in a new era in terms of control. To add a splash of color to the wonderful HTML Web configuration, HT
The configuration of 2 dand
The configuration of 3 dWith continuous improvement, we can build interesting visual systems through 2/3D fusion scenes and drawings. As a visual system scene that can present diversified effects in 3D configuration, some data visualization process can also be realized by 2D configuration traditionally:
Remote monitoring system of heat exchange station


2019 we also updated the hundreds of industrial Internet 2 d / 3 d visualization case set, here you can find many novel instance, can also find different industrial Internet: mp.weixin.qq.com/s/ZbhB6LO2k…

At the same time, you can also see more cases and results: www.hightopo.com/demos/index…