PyVista

(pyvista.org)

58 points | by belter 5 hours ago ago

6 comments

  • JTyQZSnP3cQGa8B 5 hours ago

    And the official Python API (https://docs.vtk.org/en/latest/api/python.html) which is closer to the C++ version, and may be better for learning if you have the desire to move to that C++ version later.

    Anyway, don't forget to use uv (https://docs.astral.sh/uv/) because it's nice. Have fun.

  • lgtx 2 hours ago

    It is worth mentioning that while not as friendly as Pyvista, VTK recently got a new "pythonnic" API with the 9.4 release, that aims to be nicer to use than the direct C++ classes wrapping

    https://www.kitware.com/vtk-9-4-a-step-closer-to-the-ways-of...

  • sevensor 2 hours ago

    Vtk is fine as long as you’re trying to build a visualization that looks like the ones Vtk anticipates you wanting. It becomes a pain when you want to draw things Vtk doesn’t expect. I do not recommend trying to embed it with complex Qt widgets, for instance, and it’s much better for surfaces and volumes than it is for abstract data.

  • pbronez 4 hours ago

    Awesome that this includes a mesh repair project: https://pymeshfix.pyvista.org/

    Some slicers only offer Mesh Repair on Windows because they depend on the Printing3DModel API [1]. MeshLab is OSS and powerful, but hard to use [2]

    [1] https://learn.microsoft.com/en-us/uwp/api/windows.graphics.p...

    [2] https://www.meshlab.net/

    • pbronez 4 hours ago

      Looks like PyVista is just one of many similar projects [0] maintained by Kitware[1], a private company focused on scientific computing. Lots of medical domain stuff.

      [0] https://www.kitware.com/open-source/

      [1] https://www.kitware.com/about/

      • aannex 3 hours ago

        https://github.com/banesullivan started pyvista as a grad student (IIRC) before he ended up working at kitware.

        I've used PyVista extensively for making figures for papers and other projects, but at times one must delve into the lower level VTK api to do things not at all or well exposed at the level of the PyVista API. Overall its a good project and I hope it continues to improve and expand access to powerful stuff in VTK minus the segfaults I occasionally run into when attempting to do so from python...