[vtkusers] Set up vtk.js
Sebastien Jourdain
sebastien.jourdain at kitware.com
Wed Feb 21 09:16:01 EST 2018
Did you follow that guide?
https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html
I think the file vtk.js/Utilities/config/dependency.js is missing the rule
for the workers which was added yesterday night.
You can see the missing rule here:
https://github.com/Kitware/vtk-js/blob/master/Utilities/config/rules-vtk.js#L40-L45
I'll fix it later today.
Thanks,
Seb
On Wed, Feb 21, 2018 at 6:56 AM, YONE MORENO JIMÉNEZ <
yone.moreno101 at alu.ulpgc.es> wrote:
> *Hello I would like some help or link to resources, because I have
> followed the introduction guide: *https://kitware.github.io/vtk-
> js/docs/develop_requirement.html to install vtk, node and git.
>
>
> I have been trying to integrate into a React aplication, and it outputs:
>
>
> Failed to compile
>
> ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js
> 1126:25-47 "export 'default' (imported as 'ComputeGradientsWorker') was not found in './ComputeGradients.worker'
>
>
> I just have used the code in: https://kitware.github.io/vtk-
> js/examples/PolyDataReader.html
>
>
> In addition if I go to the previous file and deep into
> ./ComputedGradients.worker, I navigate well to ComputeGradients.worker.js.
>
>
>
> Do I need other requirement to execute the aplication? I am using a node
> server.
>
>
> In addition I have written the code as React code:
>
>
> import React from 'react';
>
>
> import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
> import vtkFullScreenRenderWindow from 'vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow/index';
> import vtkMapper from 'vtk.js/Sources/Rendering/Core/Mapper';
> import vtkPolyDataReader from 'vtk.js/Sources/IO/Legacy/PolyDataReader';
>
> class LoadVTK extends React.Component() {
> render() {
> const fullScreenRenderer = vtkFullScreenRenderWindow.newInstance();
> const renderer = fullScreenRenderer.getRenderer();
> const renderWindow = fullScreenRenderer.getRenderWindow();
>
> const resetCamera = renderer.resetCamera;
> const render = renderWindow.render;
>
> const reader = vtkPolyDataReader.newInstance();
> reader.setUrl(`C:\Users\YonePC\WebstormProjects\prototipo\src\components\animals\cabezasegmentado02.vtk`).then(() => {
> const polydata = reader.getOutputData(0);
> const mapper = vtkMapper.newInstance();
> const actor = vtkActor.newInstance();
>
> actor.setMapper(mapper);
> mapper.setInputData(polydata);
>
> renderer.addActor(actor);
>
> resetCamera();
> render();
>
> });
>
> return (
> <div></div>
> );
>
> }
> }
>
> export default LoadVTK;
>
>
> And I have used it from the main page as:
>
> <LoadVTK/>
>
>
> *Could you help me please?*
>
> Antes de imprimir este correo electrónico, piense bien si es necesario
> hacerlo: el medio ambiente es una cuestión de todos.
>
> Please consider the environment before printing this email.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/e08dab4e/attachment.html>
More information about the vtkusers
mailing list