Neverending Package Mountain

    TypeScript icon, indicating that this package has built-in type declarations

    0.2.1 • Public • Published


    gemini-viewer is a WebGL based JS SDK, it is built on top of three.js. It provides following viewers:

    1. BimViewer

    Used to view 3d BIM models. It supports formats including gltf, obj, fbx, ifc, dae, etc. Its features including measurement, section, display outline, orthographic camera, selection, etc.

    2. DxfViewer

    Used to view 2d drawings. Only dxf format is supported, so user needs to convert dwg files to dxf. It supports most common entity types, it supports OLE and region via dwg2dxf; It supports common line types; It supports common hatch styles; It doesn't support line width;

    3. VRViewer

    Used to view panoramas. It supports viewing a panorama with 1 image, 6 images, or 24 images; It supports viewing a serials of panoramas; It supports hotpoints;


    To install from npm:

    npm install @pattern-x/gemini-viewer-threejs

    Examples for DxfViewer

    import { DxfViewer, DxfViewerConfig, ModelConfig } from "@pattern-x/gemini-viewer-threejs";
    const viewerCfg: DxfViewerConfig = {
        containerId: "myCanvas",
        enableToolbar: true,
        enableSpinner: true,
        enableLayoutBar: true,
    const modelCfg: ModelConfig = {
        modelId: "id_0",
        name: "sample",
        src: "",
    const fontFiles = ["", ""];
    const viewer = new DxfViewer(viewerCfg);
    await viewer.setFont(fontFiles);
    await viewer.loadModelAsync(modelCfg, (event) => {
        const progress = (event.loaded * 100) /;
        console.log(`${event.type}: ${progress}%`);

    Project setup

    npm install

    Compiles and hot-reloads for development

    npm start

    Compiles and minifies for production

    npm run build

    Lints and fixes files

    npm run lint


    npm run docs

    Documents will be generated into "./docs" folder.


    • three.js version: v0.144.0

    Upgrade draco

    • Once three.js is upgraded, we'll also need to update draco source files.
      • draco is configed in BimViewer.ts, const decoderPath = 'three/js/libs/draco/gltf/', which is a path that must be available from network. We'll need to:
      • Copy node_modules/three/examples/js/libs/draco folder to public/three/js/libs/draco
      • This is important because there can be error if the code doesn't match.

    Upgrade web-ifc.wasm

    wasm is required in order to load ifc file, we'll need to copy: node_modules/three/examples/jsm/loaders/ifc/web-ifc.wasm to /public/three/js/libs/ifc/



    npm i @pattern-x/gemini-viewer-threejs

    DownloadsWeekly Downloads






    Unpacked Size

    4.26 MB

    Total Files


    Last publish


    • dengzer
    • patternx