bim

bimgl

🔥🔥🔥 这是一个针对于BIM应用开发的3d模型库 支持构件选中 着色 虚化等操作 有新的问题或需求可以提 Issues

Showing:

Popularity

Downloads/wk

2

GitHub Stars

10

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

2

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

bimgl.js npm version

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 bimgl

Example

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

KeyTypeDefaultDescription
* uristring模型加载地址
antialiasbooleanfalse抗锯齿
widthnumberel.width场景宽度
heightnumberel.height场景高度
selectColor十六进制0x5cadff构件选中颜色
loadingImagestring加载图片地址
clearColor十六进制0xb9d3ff场景背景色
animationFunctionnull帧循环

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给模型加标签

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100