Re: Equation Rendering Using Python
Allie Vacanti via vtkusers <[email protected]> Tue, 19 Feb 2019 09:05:58 -0500
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <CA+=e1ou9F8bX330==7c0=R8ek3N7E03Nq1S7+cZB5ozTiRJi0w@mail.gmail.com> |
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 <[email protected]> wrote: > Not that I am aware of. I would look at how TestMathTextActor.cxx is > implemented. > > @Allison Vacanti <[email protected]> might give you better > pointers. > > On Tue, Feb 19, 2019 at 5:52 AM akaszynski <[email protected]> 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