# bimgl

> webgl bim model

Latest version **1.0.3** (published 2021-07-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install bimgl
pnpm add bimgl
yarn add bimgl
bun add bimgl
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-07-13 |
| First published | 2021-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 81.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | caine.luo |
| Maintainers | caine.luo |
| Keywords | bim, webgl |

## Links

- npm: https://www.npmjs.com/package/bimgl
- Repository: https://github.com/luojiong/bimgl
- Homepage: https://github.com/luojiong/bimgl#readme
- Issues: https://github.com/luojiong/bimgl/issues
- npm.io page: https://npm.io/package/bimgl

## Dependencies (2)

- [the-answer](https://npm.io/package/the-answer.md) ^1.0.0
- [concurrently](https://npm.io/package/concurrently.md) ^6.0.2

## Recent versions

- 1.0.3 (latest) — 2021-07-13
- 1.0.2 — 2021-07-09
- 1.0.1 — 2021-07-01
- 1.0.0 — 2021-07-01

## README

# bimgl.js  [![npm version](https://img.shields.io/npm/v/bimgl.svg?sanitize=true)](https://www.npmjs.com/package/bimgl)

### JavaScript 3D library ##

The project is a web GL rendering library, with BIM life cycle related functions and operations

### Installation
```javascript
 npm install bimgl
      or
 yarn add bimgl
```

### Example

### docs address [演示地址](https://luojiong.github.io/bimgl-docs/)
```html
<div id='viewer'></div>
```
```javascript
import BIMGL from "bimgl";
const bimgl = new BIMGL();
bimgl.init(document.getElementById('viewer'),{
    uri: `modelURL`,
})
```
### init
```javascript
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给模型加标签

---
_Source: https://npm.io/package/bimgl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
