用於3D多塊可視化的開源JavaScript庫
生成3D GIS平台,集成和可視化AEC(建築,工程,建築)區域和傳統的3D空間信息(3D GIS)。將AEC和3D GIS集成到Web瀏覽器中,室內,室外,無法區分。您可以瀏覽和協作進行大規模BIM(建築信息模型),JT(Jupiter Tessellation)和3D GIS文件,而無需在Web瀏覽器上安裝任何程序。
特性
- AEC和3D GIS的集成
- 室內和室外空間的無縫連接
- 在Web瀏覽器上運行,不需要單獨的插件或ActiveX安裝
- 它基於開源(Cesium,Web World Wind)開發,具有出色的開放性和可擴展性
- 高效管理和超高速渲染高容量3-D文件
支持的格式格式
- IFC(工業基礎課程)
- JT(木星鑲嵌)
- OBJ
- 3DS
- COLLADA
入門
1.發展環境
2.來源下載
- 使用git通過git clone https://github.com/Gaia3D/mago3djs.git將源安裝到C:\ git \ repository \ mago3djs 。
- 運行eclipse並導入mago3djs
Project Import File -> import -> General -> Projects from Folder or Archive。 - 如果您不使用git,請單擊“下載ZIP”鏈接進行安裝。
3.節點安裝
- 節點安裝窗口安裝(.msi)64位。
- 安裝完成后,轉到C:\ git \ repository \ mago3djs目錄。
- 使用節點包管理器為mago3DJS安裝node_modules。
C:\git\repository\mago3djs> npm install - gulp在Terminal中全局安裝以使用模塊的模型。
C:\git\repository\mago3djs> npm install -g gulp
4. F4D轉換器安裝
- 安裝程序:F4D轉換器64位(此安裝需要Windows 7或更高版本)
- 安裝路徑:C:\ F4DConverter \
5.數據轉換
- 創建一個目錄來存儲已更改的f4d(outputFolder)
C:\f4d\projectname (Create a directory for each project under the data folder, the root folder) - 保存要轉換為C:\ demo_data(inputFolder)的數據
- 以管理員身份運行命令行提示符(cmd.exe)並移至安裝F4D Converter的目錄
- 運行
※有關F4D Conveter參數F4D Conveter的描述C:\F4DConverter>F4DConverter.exe #inputFolder C:\demo_f4d #outputFolder C:\f4d\projectname #log C:\demo_f4d/logTest.txt #indexing y - 創建符號鏈接以將轉換后的F4D文件用作mago3D JS項目中的Web服務
- 使用管理權限運行命令行提示符(cmd.exe)並轉到mago3D JS項目
C:\mago3djs
C:\mago3djs>mklink /d "C:\git\repository\mago3djs\f4d" "C:\f4d" (delete is rmdir data) - 使用管理權限運行命令行提示符(cmd.exe)並轉到mago3D JS項目
6.編輯配置文件
添加兩個配置文件。(data.json,policy.json)
data.json
- 它分為三個主要領域。存儲屬性值的屬性,存儲子節點信息的子節點,存儲位置信息的其他區域
- - attributes字段的isPhysical屬性是必需屬性
- json的根節點的data_key與f4d文件夾下的項目名稱匹配
{
//attributes area
"attributes" : {
"isPhysical" : false,
"nodeType": "root",
"projectType": "project Type"
},
//Child node area
"children" : [
],
//Location information area
"data_key" : "Project name",
"data_name" : "Project name"
}
C:\f4d\projectname找到要渲染的目錄- 目錄名稱中F4D_之后的字符是唯一標識符
- 將data.json文件中child的data_key值修改為唯一標識符
- 將緯度,經度,高度,航向,俯仰和滾動值修改為適當的值
//Child node area
"children" : [
{
"attributes" : {
"isPhysical" : true,
"nodeType" : "..."
},
"children" : [
],
"data_key" : "Unique identifier",
"data_name" : "Data name",
"latitude" : Enter latitude,
"longitude" : Enter longitude,
"height" : Enter height,
"heading" : Enter heading,
"pitch" : Enter pitch,
"roll" : Enter roll
}
]
policy.json
- 要在初始化時加載的項目,Init Camera Latitude,Longitude,CallBack Function,Geo Server setup
,如果要加載多個項目,請在初始化頁面時輸入要加載的鍵值
"geo_data_default_projects": [
"data.json"
]
- 修復網頁啟動時移動的位置(lattiude,經度)
"geo_init_latitude": "Enter latitude",
"geo_init_longitude": "Enter longitude"
- 銫離子地形訪問令牌設置
- 下載maago3D JS源代碼時,默認使用Cesium World Terrain。
- 在mago3D JS中發布用於銫地形應用的Cesium離子令牌。(https://cesium.com/ion/signin)
"geo_cesium_ion_token": "cesium ion token"
7.運行節點服務器
// If you run the server privately
C:\git\repository\mago3djs>node server.js
// If you run the server as public
C:\git\repository\mago3djs>node server.js --public true
8.瀏覽器驗證
// Cesium
http:localhost/sample/cesium.html
// WorlWind
http:localhost/sample/worldwind.html
