1.0.79 • Published 3 years ago

canwinbim-viewer3d v1.0.79

Weekly downloads
5
License
ISC
Repository
gitlab
Last release
3 years ago

canwin-viewer3d

擎云 BIM 可视化 webgl 三维引擎

使用方法

  • npm 安装 import 导入
  1. npm 安装

    npm install --save canwinbim-viewer3d
  2. import 导入

    import Canwin from 'canwinbim-viewer3d'
  3. viewer 初始化

     let viewerApp = null;
        //配置参数
        let options = {
            webApi:"120.197.17.151:40007",//webpath
            webLocal:"120.197.17.151:40007",//socket
            noLoadDocList:true,
            clientId:
                "366c6088-34e1-4738-b517-649d5575ff58",
            clientSecret:
                "c2c434b5-60d0-44dd-ab33-6352b5c0998f"
        };
    
        //1.通过全局Initializer()初始化(不推荐直接创建Viewer3D)
        Canwin.Viewing.Globals.Graphics3DConfig.setGraphicsLib(Canwin.Viewing.Globals.Graphics3DConfig.LIB_XEOKIT_FRAME_JS);
        Canwin.Viewing.Initializer(options, function onInitialized() {
            //2.通过viewerApp(viewerApp包装了viewer3D)创建一个app
            viewerApp = new Canwin.Viewing.ViewingApplication("rendererElement");
            //3.注册一个viewer3D
            viewerApp.registerViewer(viewerApp.k3d, Canwin.Viewing.Private.BaseViewer3D);
            Canwin.Viewing.theExtensionManager.registerExtension(Canwin.Viewing.ExtensionManager.S_NAVIGATION_VIEW_TOOL_EXTENSION, Canwin.Viewing.Globals.NavigationViewToolExtension);
            viewerApp.getCurrentViewer().loadExtension(Canwin.Viewing.ExtensionManager.S_NAVIGATION_VIEW_TOOL_EXTENSION);
            Canwin.Viewing.theExtensionManager.registerExtension(Canwin.Viewing.ExtensionManager.S_LABEL_MARKER_EXTENSION, Canwin.Viewing.Globals.LabelMarkerExtension);
            viewerApp.getCurrentViewer().loadExtension(Canwin.Viewing.ExtensionManager.S_LABEL_MARKER_EXTENSION);
            let baseExtension = Canwin.Viewing.theExtensionManager.getExtensionAtId(Canwin.Viewing.ExtensionManager.S_BASE_CONTROL_EXTENSION);
            baseExtension.setRotateViewAndScene(1, 0);
            baseExtension.enableMoving(false);
          
        });
  • script 标签引入
  1. html 标签引入本地,远程,cdn viewer3d

    <script src="xxxxx/viewer3D.umd.js"></script>
  2. 初始化

     let viewerApp = null;
        //配置参数
        let options = {
            webApi:"120.197.17.151:40007",//webpath
            webLocal:"120.197.17.151:40007",//socket
            noLoadDocList:true,
            clientId:
                "366c6088-34e1-4738-b517-649d5575ff58",
            clientSecret:
                "c2c434b5-60d0-44dd-ab33-6352b5c0998f"
        };
    
        //1.通过全局Initializer()初始化(不推荐直接创建Viewer3D)
        Canwin.Viewing.Globals.Graphics3DConfig.setGraphicsLib(Canwin.Viewing.Globals.Graphics3DConfig.LIB_XEOKIT_FRAME_JS);
        Canwin.Viewing.Initializer(options, function onInitialized() {
            //2.通过viewerApp(viewerApp包装了viewer3D)创建一个app
            viewerApp = new Canwin.Viewing.ViewingApplication("rendererElement");
            //3.注册一个viewer3D
            viewerApp.registerViewer(viewerApp.k3d, Canwin.Viewing.Private.BaseViewer3D);
            Canwin.Viewing.theExtensionManager.registerExtension(Canwin.Viewing.ExtensionManager.S_NAVIGATION_VIEW_TOOL_EXTENSION, Canwin.Viewing.Globals.NavigationViewToolExtension);
            viewerApp.getCurrentViewer().loadExtension(Canwin.Viewing.ExtensionManager.S_NAVIGATION_VIEW_TOOL_EXTENSION);
            Canwin.Viewing.theExtensionManager.registerExtension(Canwin.Viewing.ExtensionManager.S_LABEL_MARKER_EXTENSION, Canwin.Viewing.Globals.LabelMarkerExtension);
            viewerApp.getCurrentViewer().loadExtension(Canwin.Viewing.ExtensionManager.S_LABEL_MARKER_EXTENSION);
            let baseExtension = Canwin.Viewing.theExtensionManager.getExtensionAtId(Canwin.Viewing.ExtensionManager.S_BASE_CONTROL_EXTENSION);
            baseExtension.setRotateViewAndScene(1, 0);
            baseExtension.enableMoving(false);
          
        });
  • script type=‘’module’ 标签内模块化引用

  });
  • 包发布到公网 npm
    npm publish
1.0.77

3 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.73

4 years ago

1.0.75

4 years ago

1.0.74

3 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.69

4 years ago

1.0.66

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.49

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.33

4 years ago

1.0.34

4 years ago

1.0.32

4 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago