This is a quickstart tutorial for using vanilla vtk.js.
Initialize your project
Let’s start by initializing a new project.
$ mkdir my-vtkjs-app $ cd my-vtkjs-app $ npm init ...
Now install @kitware/vtk.js as a dependency.
$ npm install @kitware/vtk.js
For this example, we will be using webpack to build our application. If you are using other bundlers (e.g. parcel, rollup, etc.), please refer to the “Getting Started” tutorials there before skipping down to how to use vtk.js.
Additionally, we will add some scripts to make our lives easier for running build commands. Inside package.json, add the following lines in the scripts object.
After adding the source file, run the app with the webpack dev server.
$ npm run start
Navigate to http://localhost:8080, and you should have an interactive 3D visualization of a cone, similar to the SimpleCone example.
Where to go next
Check out the tutorials, or if you know what you want but need API docs, check out the API.