The project is a web GL rendering library, with BIM life cycle related functions and operations
npm install bimgl
or
yarn add bimgl
docs address 演示地址
<div id='viewer'></div>
import BIMGL from "bimgl";
const bimgl = new BIMGL();
bimgl.init(document.getElementById('viewer'),{
uri: `modelURL`,
})
import BIMGL from "BIMGL";
const bimgl = new BIMGL();
bimgl.init(element,options);
Key | Type | Default | Description |
---|---|---|---|
* uri | string |
模型加载地址 | |
antialias | boolean |
false | 抗锯齿 |
width | number |
el.width | 场景宽度 |
height | number |
el.height | 场景高度 |
selectColor | 十六进制 |
0x5cadff | 构件选中颜色 |
loadingImage | string |
加载图片地址 | |
clearColor | 十六进制 |
0xb9d3ff | 场景背景色 |
animation | Function |
null | 帧循环 |
new Color
( 十六进制 ) - 实例化一个颜色resize
(width,height) - 更改场景的大小render
() - 重新渲染onload
() - 模型加载完成onError
() => error - 模型加载失败onStart
() - 模型加载开始onProgress
(进度百分比) - 模型加载进度destroy
() - 销毁模型onSelect
() => 构件 - 构件选中transparentComponentsById
_( [ componentsId ] , opacity0.0-1.0) 将构件透明化setComponentsColorById
_( [ componentsId ] , Color) 构建着色clearComponentsColorById
_([ componentsId ]) 通过构件id清除构件着色setWorldPosition
_(componentsId, element, position ? ) 通过构件id给模型加标签