Skip to end of metadata
Go to start of metadata

Introduction to Bimplus Renderer

bim+ renderer is a javascript renderer core based on three js.

Installation

Bimplus WebSDK library is distributed via npm repository.

npm registry

https://www.npmjs.com/package/bimplus-renderer

npm installation

To install package via npm you need to install nodejs and npm . Then in command line run :

npm install bimplus-renderer

Github

Public github repository with latest bundle is here :

https://github.com/Bimplus/bimplus-renderer 

Usage

In the next sections you can find some basic tutorials how to initialize and use Bimplus Renderer.

Bimplus WebSdk initialization example

import Renderer from 'npm:bimplus-renderer';

var defaultViewportSettings = {
        "defaultOpacity": 0.5,
        "disciplineOpacity": 0.1,
        "pinSizeScaleFactor": 2,
        "maxWebGLBufferSize": 350e12,
        "mixedModelMode": true,
        "pinFlyToDistance": 20000,
        "nearClippingPlane": 0.01,

        "slideThmbSize": [
          180,
          112
        ],
        "units": {
          "mm": {
            "weight": {
              "multiplicator": 0.001,
              "unit": "kg"
            },
            "length": {
              "multiplicator": 0.001,
              "unit": "m"
            },
            "width": {
              "multiplicator": 0.001,
              "unit": "m"
            },
            "height": {
              "multiplicator": 0.001,
              "unit": "m"
            },
            "area": {
              "multiplicator": 0.000001,
              "unit": "m²"
            },
            "volume": {
              "multiplicator": 1e-9,
              "unit": "m³"
            }
          },
          "inch": {}
        },
    } // END defaultViewportSettings

    
//  init viewport with json object
//  canvasElementId - it's the canvas element id in html which renderer will use for rendering
var viewport = new Renderer.Viewport3D({

      settings: defaultViewportSettings,
      domElementId: 'canvasElementId',
      GPUPick: false

    });

    
// object selection handling    
$(viewport.domElement).on('select3DObject', () => {
  viewport.highlightObject(n.id);
});
  • No labels