VTK.js - electron

Hello everyone,
Newbie here so go easy on me :grin:

I’m trying to run the planesource (vtk.js) example in an electron app. After 2 days of trying out different boilerplates and following different guides I still can’t get vtk to run the example within electron.

Does anyone here have and/or is willing to share a very basic template where vtk is correctly imported and running into an electron app? (GitHub - pijaginw/electron-vtk-app: Simple app for visualisation of 3D objects made with JavaScript, Electron and vtk.js. this one doesn’t compile)

Any advice is greatly appreciated

Hi, I threw together a planesource + electron demo, as can be found here: GitHub - floryst/vtk-js-electron: Electron sample running vtk.js PlaneSource

This repo uses the new @kitware/vtk.js ESM build, so FYI there are no docs on it (yet). In addition, I’ve left out the control panel that you typically see with that example, since I was being hasty and didn’t want to bring in the html-loader rules.

The general gist of this is that you need to import and use vtk.js inside the renderer process. In addition, be sure to tell webpack to use source-map devtool, otherwise you encounter a CSP error.

Thank you so much!
This is exactly what I was looking for