Skip to content
项目

关于

Use VTK for 3D scientific visualization in browsers through WebAssembly

科学与工程

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

@kitware/vtk-wasm

JavaScript bindings for loading and driving VTK compiled to WebAssembly — build 3D visualizations in the browser with no C++ required.

Full documentation, guides, and API reference: https://kitware.github.io/vtk-wasm/

Usage

Install the package:

npm install @kitware/vtk-wasm

Load the runtime, create a session, and use its vtk namespace:

import { loadAsync } from "@kitware/vtk-wasm";
const BUNDLE = "https://raw.githack.com/Kitware/vtk-wasm/dist/latest/vtk-wasm32-emscripten.tar.gz";
const runtime = await loadAsync({url: BUNDLE });
const session = runtime.createStandaloneSession();
const vtk = session.vtk;

const cone = vtk.vtkConeSource();
// ... build and render your scene

No build step? Load the UMD bundle from a CDN and use the global vtkwasm:

<script src="https://unpkg.com/@kitware/vtk-wasm/vtk-umd.js"></script>

See the Loading VTK.wasm guide to get started and the API reference for every export.

Contributing

Requires Node.js (LTS).

npm install        # install dependencies
npm run build      # build the ESM + UMD bundles into dist/
npm run docs:dev   # run the documentation site locally
npm run lint       # lint the source

Repository layout

  • src/ — library source.
  • examples/ — example applications.
  • docs/ — documentation site (VitePress); the API reference is generated from source JSDoc.
  • dist/ — build output.

探索相关项目

加载中…