Skip to content

Updating to latest vtk.js version #108

@knopkem

Description

@knopkem

First of all, great work, so far everything works very well. I'm toying with creating a sample viewer that consumes the react-vtkjs-viewport directly (which works now).
My only concern is that updating to the latest vtk.js version isn't currently possible (and how to handle such cases in the future).
When using the latest vtk.js (14.11.4 currently) there is one breaking change that creates an error when using together with this library: in View2D.js Ln 77: handle.rotateFromDirections(handle.getDirection(), normal);
Apparently the api has changed and rotateFromDirections is now in vtkMatrixBuilder.
Unfortunately I also have a problem using the new api, replacing with:
vtkMatrixBuilder.buildfromDegree().matrix.rotateFromDirections(handle.getDirection(), normal);
and including the vtkMatrixBuilder:
import vtkMatrixBuilder from 'vtk.js/Sources/Common/Core/MatrixBuilder';
compiles but I get scope issues with webpack later running the example:
Uncaught TypeError: vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_19__.default.buildfromDegree is not a function
Here is my fork with the changes: https://github.com/knopkem/react-vtkjs-viewport
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions