# cbim-render-sdk

> 渲染SDK

Latest version **1.5.85** (published 2024-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install cbim-render-sdk
pnpm add cbim-render-sdk
yarn add cbim-render-sdk
bun add cbim-render-sdk
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.85 |
| Published | 2024-03-29 |
| First published | 2021-11-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 686.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | meng885234 |
| Maintainers | jimmylo, tianjian, meng885234 |
| Keywords | cbim, cbim-render-sdk |

## Links

- npm: https://www.npmjs.com/package/cbim-render-sdk
- Repository: https://meng885234.github.io/cbim-render-sdk-doc
- npm.io page: https://npm.io/package/cbim-render-sdk

## Recent versions

- 1.5.85 (latest) — 2024-03-29
- 1.5.75-patch (1.5.75.2) — 2023-11-28
- 1.5.73-patch (1.5.73.2) — 2023-11-14
- 1.5.62-patch (1.5.62.2) — 2023-10-16
- 1.5.36-patch (1.5.36.2) — 2023-07-13
- 1.5.28-patch (1.5.28.2) — 2023-06-27
- 1.5.19-patch3 (1.5.19.4) — 2023-06-25
- 1.5.19-patch2 (1.5.19.3) — 2023-06-13
- 1.5.19-patch (1.5.19.2) — 2023-06-13
- 1.5.9-patch2 (1.5.9.2) — 2023-06-09
- 1.5.84 — 2024-02-20
- 1.5.83 — 2024-02-05
- 1.5.82 — 2024-02-04
- 1.5.81 — 2024-01-25
- 1.5.80 — 2024-01-11
- … 235 more at https://npm.io/package/cbim-render-sdk/versions

## README

## 渲染SDK
```shell
npm i cbim-render-sdk -S
```

```javascript
import RenderViewer from 'cbim-render-sdk'

const renderViewer = new RenderViewer('container', {
    api: '/raas',
    itemVersionId: '5253'
}, (responseData) => {
    // recive data from engine
})
```
## 参数说明

### OptionConfig 引擎参数

| 属性 | 说明 | 类型 | 默认值 | 备注 | 必填 |
| :--- | :--- | :---: | :---: | :--- | :---: |
|itemVersionId|模型id|Number|-|-|是|
|api|引擎服务接口前缀|String|"/raas"|若为内网环境，则此处为内网后端服务地址|否|
|env|图形服务分支|String|"/data/autoDeploy/bin/Release/test"|若为内网环境，则此处为内网后端服务地址|否|
|webrtc|是否使用webrtc模式|Boolean|true|webrtc开启为视频流模式，关闭则为图片流模式。私有化部署需要关闭|否|
|innerNet|内网环境|Boolean|false|-|否|
|host|服务器IP|String|-|用于指定服务器|否|
|webSocketUrl|固定websocket地址|String|-|用于测试或固定展示模型|否|
|configPath|指定配置文件地址|String|-|用于指定图形引擎配置文件|否|
|iceServers|RTC ice服务器列表|Array|-|-|否|
|exclusive|RTC独占模式|Boolean|false|独占模式，引导到专用服务器|否|
|touristTicket|游客令牌|String|-|用于游客免登录访问|否|
|customLoading|自定义加载动画|Boolean|false|-|否|
|loadingSrc|加载动画(图片)地址|String|"/static/image/loading.png"|-|否|
|headers|可用于同一浏览器开启同一模型多个实例|Object|-|设置如下：{'ANO-SID': '区分连接不同实例，值为：数字或者小写字母以及组合。eg: 123'}|否|
|measure|设置测量参数|MeasureConfig|-|例： { drawMethod: 'svg', adsorbentRadius: 20}|否|
|wasmDecode|是否开启前端解码|wasmDecode|-|例： { enable: true, wasmUrl: 'http://localhost.ren.cbim.org.cn/render_static/lib/Broadway/avc.wasm' }。开启时需要在wasmUrl字段传入sdk提供的解码器wasm文件访问全路径。此文件位于在sdk程序包/lib/wasmDecoder/avc.wasm。使用前请确保将其放置在客户端服务器静态文件夹下，|否|
### MeasureConfig 测量参数

| 属性 | 说明 | 类型 | 默认值 | 备注 | 必填 |
| :--- | :--- | :---: | :---: | :--- | :---: |
|drawMethod|设置测量绘制方式|String|'svg'|可选值: 'svg'、'canvas'|否|
|adsorbentRadius|设置测量吸附半径|Number|-|-|否|

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