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>
  • 相关阅读:
    php7 & lua 压测对比
    .NET CORE——Console中使用依赖注入
    EntityFramework Core 自动绑定模型映射
    月末总结与推书
    Dapper连接与事务的简单封装
    EntityFramework Core 学习扫盲
    从输入url到页面返回到底发生了什么
    [译]C#和.NET中的字符串
    利用C#迭代器的一个杨辉三角示例
    用 dotTrace 进行性能分析时,各种不同性能分析选项的含义和用途
  • 原文地址:https://www.cnblogs.com/defineconst/p/12371833.html
Copyright © 2011-2022 走看看