1.0.3 • Published 4 years ago
bimgl v1.0.3
bimgl.js 
JavaScript 3D library
The project is a web GL rendering library, with BIM life cycle related functions and operations
Installation
npm install bimgl
or
yarn add bimglExample
docs address 演示地址
<div id='viewer'></div>import BIMGL from "bimgl";
const bimgl = new BIMGL();
bimgl.init(document.getElementById('viewer'),{
uri: `modelURL`,
})init
import BIMGL from "BIMGL";
const bimgl = new BIMGL();
bimgl.init(element,options);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 | 帧循环 |
Event
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给模型加标签