Search code examples
pythonipythonjupyter-notebookvpython

VPython Jupyter - export image


VPython Jupyter now seems to be the standard and updated version. However, I did not find any way to save the output as an image:

  • ImageGrab can be used to do screenshots, but the scene is in a browser in Jupyter, which needs scrolling if the scene size is too large. It is difficult to get the whole scene on the screen, find the coordinates of where the scene is on the screen, and do the screenshot
  • povexport does not seem to be compatible with the new version of VPython

Is there another option? I cannot believe that a tool for producing graphics cannot export a scene as vector or even raster.


Solution

  • There is now a version of povexport that works with VPython 7:

    https://github.com/BruceSherwood/vpython-jupyter/blob/master/Demos_no_notebook/povexport.py

    And here is an example of its use:

    https://github.com/BruceSherwood/vpython-jupyter/blob/master/Demos_no_notebook/povexport_example.py