Skip to content

Use vtk.js for visualization #24

Description

@nikoscham

This issue has been added to the FEAScript roadmap for the upcoming 0.2.0 release (https://github.com/orgs/FEAScript/discussions/17). With vtk.js we can visualize both the results and the computational mesh. Additionally, we could export a .vtk file to allow users to download the results.

Activity

  1. added theissue type on May 21, 2025
  2. sridhar-mani commented on May 21, 2025

    @sridhar-mani
    Contributor

    VTK format is very messy and is for advanced meshes i think our current gmsh is good for visualization. I will see if i could ways to visualize it for future 3d cases too somehow.

    Edit - Considering maybe we can use it for exporting capabilities to export our result in some way.

  3. nikoscham commented on May 21, 2025

    @nikoscham
    MemberAuthor

    VTK format is very messy and is for advanced meshes i think our current gmsh is good for visualization. I will see if i could ways to visualize it for future 3d cases too somehow.

    Edit - Considering maybe we can use it for exporting capabilities to export our result in some way.

    Yes, Gmsh also offers visualization capabilities. However, vtk.js is written in pure JavaScript, making it potentially easier to integrate into our tutorials or in the FEAScript platform. It provides (at least from what I know from ParaView) advanced features such as domain slicing, contour plots, stream tracing, mesh visualization, etc..

    I'm not sure how difficult or messy integrating the vtk.js library would be, as I only have limited experience with the .vtk file format. In the past, I have exported Fortran FEM results to a .vtk file and visualized them in ParaView (take a look of the Fortran code here). I think adding .vtk export functionality, as you mentioned, would be a great starting point, with vtk.js integration potentially coming later. Alternatively, there is a vtk loader for Three.js (example here), but I believe it is no longer actively supported or maintained.

  4. self-assigned this
    on May 21, 2025
  5. sridhar-mani commented on May 21, 2025

    @sridhar-mani
    Contributor

    The tricky thing is that volume rendering that is normally possible in paraview for the vtk or vtu format is not possible in vtk.js. It is only possible with the integration of vtk.wasm for js approach.

  6. nikoscham commented on May 21, 2025

    @nikoscham
    MemberAuthor

    I see your point. I doubt however if FEAScript would support 3D computations in the near future. We are staying at 2D, at least for the next release. Thus the lack of volume rendering is not a significant concern for now. Furthermore, when we finally go to 3D we could use 2D slices, contour surfaces, streamlines, etc, for visualization (at least this is what I use in ParaView).

    I couldn't' find any alternatives for visualizing results on real-time, apart from vtk.js. The plotly.js library we use now is, according to my opinion, very limited and I think we should abandon it until the next release. We need something specialized for FEM results.

  7. sridhar-mani commented on May 21, 2025

    @sridhar-mani
    Contributor

    I have worked extensively with vtk.js so i can integrate it.

  8. changed the issue type fromtoon Sep 23, 2025
  9. added this to the 0.3.0 milestone on Mar 16, 2026
  10. linked a pull request that will close this issueFeature/vtkjs #73on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions