地下管線標準不一?ThingJS 3D可視化方案直擊痛點

從管理角度來看,地下管線比起樓宇建設難度大得多,標準就可能存在不一致。如何使用thingjs迅速生成管線可視化demo,我來爲你解答。app

在物聯網中,對於管線的檢測始終存在難度,如何用可視化的方式來解決這個管線監管問題呢?不管是城市管線仍是社區,商場、大廈裏的管線,想要實時檢測到管線的狀態都是比較困難的。咱們又該如何經過現現在的技術來實現管線的可視化管理呢?dom

智慧電力可視化系統構建發電、輸電、變電、配電、用電、調度、通訊信息各個環節逐級可視。具有電站環境可視化、電力設備可視化、電力安防可視化標準功能,同時展現輸電網、變電站及其內部的設備位置分佈。動畫

ThingJS-面向物聯網的3D可視化開發平臺
管線.jsui

/**
* 說明:管線應用
*/
var app = new THING.App({});

// 隨機管線鏈接點
function randomPoints() {
    var points = [[0, 0, 0]];
    var oldType = 2;
    for (var i = 0; i < 50; i++) {
        var old = points[points.length - 1];
        var type = Math.floor(Math.random() * 100) % 3;
        while (oldType == type) {
            type = Math.floor(Math.random() * 100) % 3;
        }
        oldType = type;
        var offset = (Math.random() * 2 + 1) * (Math.random() > 0.5 ? 1 : -1);
        points.push([
            type === 0 ? (old[0] + offset) : old[0],
            type === 1 ? (old[1] + offset) : old[1],
            type === 2 ? (old[2] + offset) : old[2],
        ]);
    }
    return points;
}

// 佈置管線
var line = null;
var lineIdx = 1;
function build() {
    // 刪除原管線
    if (line) { line.destroy(); }

    // 建立管線
    line = app.create({
        type: 'PolygonLine',
        points: randomPoints(),
        width: 0.2,
        style: {
            image: 'https://thingjs.com/static/images/poly_line_0' + lineIdx + '.png', // 管線中的紋理資源
        }
    });

    // 切換線貼圖
    if (lineIdx < 4) { lineIdx++; }
    else { lineIdx = 1; }

    // 開啓 UV 動畫
    line.scrollUV = true;

    // 設置最適合的攝像機觀察位置
    app.camera.fit();
}
build();
new THING.widget.Button('從新佈置', build);

將這個腳本放入到thingjs在線開發平臺中,點擊運行便可造成如圖的管線案例。code

現在管線的空間數據可視化成了迫切需求,3D動畫擴展了更多可能性,具備不錯的發展前景。blog

相關文章
相關標籤/搜索