zoukankan      html  css  js  c++  java
  • 【VTK】vtkjs编译

    1、下载vtkjs-master.zip

    2、package.json分析

        "size": "size-limit --why --config ./webpack.config.js",
        "validate": "prettier --config ./prettier.config.js --list-different "Sources/**/*.js" "Examples/**/*.js"",
        "reformat": "prettier --config ./prettier.config.js --write "Sources/**/*.js" "Examples/**/*.js"",
        "reformat-only": "prettier --single-quote --trailing-comma es5 --print-width 80 --arrow-parens always --write",
        "doc": "kw-doc -c ./Documentation/config.js",
        "doc:www": "npm t -- --single-run && kw-doc -c ./Documentation/config.js -s",
        "doc:publish": "kw-doc -c ./Documentation/config.js -mp",
        "example": "node ./Utilities/ExampleRunner/example-runner-cli.js -c ./Documentation/config.js",
        "build": "webpack-dev-server --config webpack.dev.js",
        "build:release": "webpack --config webpack.prod.js --progress --hide-modules",
        "test": "karma start ./karma.conf.js",
        "test:travis": "karma start ./karma.conf.js --browsers ChromeHeadlessNoSandbox --single-run",
        "test:debug": "karma start ./karma.conf.js --no-single-run",
        "test:firefox": "karma start ./karma.conf.js --browsers Firefox",
        "test:firefox-debug": "karma start ./karma.conf.js --browsers Firefox --no-single-run",
        "commit": "git cz",
        "semantic-release": "semantic-release"

    3、文件结构分析

    4、编译

    npm run build:release

     

    5、测试vtk.js

    打开dist目录

    双击index.html,浏览器出现

    6、代码分析

    <!DOCTYPE html>
    <html>
    
    <head>
      <title>vtk.js</title>
    </head>
    
    <body>
      <script type="text/javascript" src="https://unpkg.com/@babel/polyfill@7.0.0/dist/polyfill.js"></script>
      <script type="text/javascript" src="vtk.js"></script>
      <script type="text/javascript">
        var fullScreenRenderer = vtk.Rendering.Misc.vtkFullScreenRenderWindow.newInstance();
        var actor = vtk.Rendering.Core.vtkActor.newInstance();
        var mapper = vtk.Rendering.Core.vtkMapper.newInstance();
        var cone = vtk.Filters.Sources.vtkConeSource.newInstance();
    
        actor.setMapper(mapper);
        mapper.setInputConnection(cone.getOutputPort());
    
        var renderer = fullScreenRenderer.getRenderer();
        renderer.addActor(actor);
        renderer.resetCamera();
    
        var renderWindow = fullScreenRenderer.getRenderWindow();
        renderWindow.render();
    
      </script>
    </body>
    
    </html>
  • 相关阅读:
    css3新特性总结
    H5新特性总结
    小程序本地移除有一条数据
    字符串截取(某个指定字符前面和后面的值)(指定前几位后几位)
    uni-app 创建项目
    数组转数组对象及数组对象中的某个属性值拼成一个数组
    VUE 解决单页使用keep-alive页面返回不刷新的问题
    小程序弹窗真机不动
    js 数组去重方法
    VUE 列表页中实现分页(下拉到底部触发下一页 )
  • 原文地址:https://www.cnblogs.com/defineconst/p/12371833.html
Copyright © 2011-2022 走看看