1.0.79 • Published 2 years ago

canwinbim-viewer3d v1.0.79

Weekly downloads
5
License
ISC
Repository
gitlab
Last release
2 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

2 years ago

1.0.79

2 years ago

1.0.78

2 years ago

1.0.73

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.69

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.33

3 years ago

1.0.34

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago