Equation Rendering Using Python

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Equation Rendering Using Python

akaszynski
Hello,

I'm a developer of  vtki <https://github.com/akaszynski/vtki>  , a Python
module that tries to make interfacing with vtk through Python even easier
than the existing Python module vtk.  We're working on adding features and
one that we're missing is Equation Rendering.

There's clearly support for equation rendering within vtk (see  Equation
Rendering <https://www.paraview.org/Wiki/ParaView/Equation_Rendering>  ),
but I've been unable to find any examples, and the python module vtk lacks
support for /vtkMathTextUtilities/.  Is there a way to due this in Python
with or without /matplotlib/?

Thanks!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Equation Rendering Using Python

VTK - Users mailing list

Hi,

You'll need to enable vtkRenderingMatplotlib module. For an example for rendering math text look at
TestMathTextActor.cxx

Dan


On Tue, Feb 12, 2019 at 3:13 AM akaszynski <[hidden email]> wrote:
Hello,

I'm a developer of  vtki <https://github.com/akaszynski/vtki>  , a Python
module that tries to make interfacing with vtk through Python even easier
than the existing Python module vtk.  We're working on adding features and
one that we're missing is Equation Rendering.

There's clearly support for equation rendering within vtk (see  Equation
Rendering <https://www.paraview.org/Wiki/ParaView/Equation_Rendering>  ),
but I've been unable to find any examples, and the python module vtk lacks
support for /vtkMathTextUtilities/.  Is there a way to due this in Python
with or without /matplotlib/?

Thanks!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Equation Rendering Using Python

akaszynski
While I could rebuild vtk locally, I’m building a python module that assumes
the user only has access to the python wheel built for vtk on PyPi, which
hasn’t included support for equation rendering.

Regardless, I can still generate rendered equations and even feed it into a
vtkImageData object.  Is there an example of how I can connect this object
to an existing text label or text property?  This appears to be the approach
that’s used internally by vtk to take externally rendered images and place
them where plain text would normally be.

Examples in Python or C++ (really any language) would be great.

Thanks in advance for your help!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Equation Rendering Using Python

VTK - Users mailing list
Not that I am aware of. I would look at how TestMathTextActor.cxx is implemented.

 [hidden email] might give you better pointers.

On Tue, Feb 19, 2019 at 5:52 AM akaszynski <[hidden email]> wrote:
While I could rebuild vtk locally, I’m building a python module that assumes
the user only has access to the python wheel built for vtk on PyPi, which
hasn’t included support for equation rendering.

Regardless, I can still generate rendered equations and even feed it into a
vtkImageData object.  Is there an example of how I can connect this object
to an existing text label or text property?  This appears to be the approach
that’s used internally by vtk to take externally rendered images and place
them where plain text would normally be.

Examples in Python or C++ (really any language) would be great.

Thanks in advance for your help!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Equation Rendering Using Python

VTK - Users mailing list
Internally, VTK renders text using vtkTextRenderer, which automatically supports equation rendering when vtkRenderingMatplotlib is enabled. Any code using vtkTextRenderer to generate a texture/path from a string gets this capability, including vtkTextActor, vtkTextActor3D, vtkTextMapper, and vtkBillboardTextActor3D.

If you have your own image data that you've been rendering yourself and want to display it as text, you can built a rectangular polydata and apply the image data as a texture. Take a look at the implementation of vtkBillboardTextActor3D for a good example of this:

https://github.com/Kitware/VTK/blob/master/Rendering/Core/vtkBillboardTextActor3D.cxx

HTH,
Allie

On Tue, Feb 19, 2019 at 8:48 AM Dan Lipsa <[hidden email]> wrote:
Not that I am aware of. I would look at how TestMathTextActor.cxx is implemented.

 [hidden email] might give you better pointers.

On Tue, Feb 19, 2019 at 5:52 AM akaszynski <[hidden email]> wrote:
While I could rebuild vtk locally, I’m building a python module that assumes
the user only has access to the python wheel built for vtk on PyPi, which
hasn’t included support for equation rendering.

Regardless, I can still generate rendered equations and even feed it into a
vtkImageData object.  Is there an example of how I can connect this object
to an existing text label or text property?  This appears to be the approach
that’s used internally by vtk to take externally rendered images and place
them where plain text would normally be.

Examples in Python or C++ (really any language) would be great.

Thanks in advance for your help!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

_______________________________________________
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