[vtkusers] Set up vtk.js

YONE MORENO JIMÉNEZ yone.moreno101 at alu.ulpgc.es
Wed Feb 21 10:01:36 EST 2018


Sebastien I have followed the guide and the previous console error has gone ;=)


However after starting the webpack dev server I only see the directories structure, is not supposed to execute an application?


[cid:38a19d40-c5fb-4b6d-bf36-a72594afcd1b]






It should be like the example: https://kitware.github.io/vtk-js/examples/ConeSource.html


The architecture: [cid:3c04c7b6-fb8e-4019-8a8f-fbe93fda626a]



I saw that in index.html the script being included was called MyWebApp in index.html:


[cid:82e830fe-3cf0-4cd5-8cbf-4ada738da43c]


And I also tried to change it to index.js


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="text/javascript" src="src/index.js"></script>
</body>
</html>


However it also displays the list:


[cid:a2bde8b3-ddcd-478b-9145-ad97107713d8]



Is it the correct output? I ask because I thought it was an unexpected behaviour.


Thank you for your help and time! 😉

________________________________
De: Sebastien Jourdain <sebastien.jourdain at kitware.com>
Enviado: miércoles, 21 de febrero de 2018 14:16:01
Para: YONE MORENO JIMÉNEZ
Cc: vtkusers at vtk.org; Matt McCormick
Asunto: Re: [vtkusers] Set up vtk.js

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<mailto: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<http://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




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.


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/ac49dc59/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 26319 bytes
Desc: pastedImage.png
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/ac49dc59/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 9291 bytes
Desc: pastedImage.png
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/ac49dc59/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 12075 bytes
Desc: pastedImage.png
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/ac49dc59/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 26757 bytes
Desc: pastedImage.png
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180221/ac49dc59/attachment-0007.png>


More information about the vtkusers mailing list