Posted on 2018-08-24 21:12
eryar 阅读(3099)
评论(0) 编辑 收藏 引用 所属分类:
6.Others
CesiumJS - 3D Tiles BIM
eryar@163.com
1. Introduction
CesiumJS is an open-source JavaScript library for world-class 3D globes and maps.

从其官网上可以看到这个库的愿景:成为世界级的三维地图。由于其高性能,对大模型的优化技术,可以用于BIM。支持Cesium的财团里面就有Bentley。Bentley也有工厂CAD软件。
2. Node.js
从nodejs官网https://nodejs.org/en/download/上下载安装包,如果没有安装权限,可以下载免安装的打包文件:

直接解压到d:/nodejs。并在此文件夹中创建两个文件夹:node_global, node_cache,如下图所示:

然后使用CMD窗口,切换到d:/nodejs目录,输入如下命令来设置global和cache:
npm config set prefix “d:/nodejs/node_global”
npm config set cache “d:/nodejs/node_cache”
并修改nodevars.bat中的环境变量:

并运行nodevars.bat。
安装CesiumJS所需要的插件:
npm install compression -g
npm install request -g
npm install yargs -g
3. CesiumJS Hello World
在CMD命令窗口中切换到Cesium文件夹,并输入命令:
出现如下图所示的 Cesium development server running locally.
表示Cesium可以在本地运行了。

在浏览器中输入地址:http://localhost:8080,出现如下图所示页面:

点击HelloWorld链接,出现如下图所示的的一个三维地球就表示Cesium安装成功了。

4. 3D Tiles BIM Demo
在Cesium的官网上有Bentley提供的一个工厂BIM模型例子,可以从如下地址查看:
https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=3D%20Tiles%20BIM.html


从其官方的介绍来看,Cesium使用的3D Tiles技术可以对三维模型数据进行压缩及其他优化技术,使其可以加载很大的模型的情况下,浏览顺畅。且3D Tiles格式也是开源的,可以学习借鉴。
5. Conclusion
本文介绍了CesiumJS这个JavaScript库的安装和配置,并展示了其在BIM中的一个应用例子。可以通过学习CesiumJS来将PDMS模型转换成3D Tiles格式,来测试其对大模型的支持效果。
为了方便大家在移动端也能看到我的博文和讨论交流,现已注册微信公众号,欢迎大家扫描下方二维码关注。
