Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile with mathtext support #79

Closed
banesullivan opened this issue Mar 18, 2019 · 7 comments
Closed

compile with mathtext support #79

banesullivan opened this issue Mar 18, 2019 · 7 comments

Comments

@banesullivan
Copy link
Contributor

banesullivan commented Mar 18, 2019

Would it be possible to build vtk with mathtext support?

Please see pyvista/pyvista#83 (and pyvista/pyvista#127 because we've added pyvista to conda-forge)

@banesullivan
Copy link
Contributor Author

banesullivan commented Jan 6, 2023

What concerns me is that after install matplotlib, VTK thinks it is supported with this build even though it isn't:

conda install vtk
>>> import vtk
>>> vtk.vtkMathTextFreeTypeTextRenderer().MathTextIsSupported()
False
conda install matplotlib
>>> import vtk
>>> vtk.vtkMathTextFreeTypeTextRenderer().MathTextIsSupported()
True

but it still doesn't work?

$ conda install pyvista
$ python
>>> import pyvista
>>> plotter = pyvista.Plotter()
>>> plotter.add_text(r'$\rho$', position='upper_left', font_size=150, color='blue')
>>> plotter.show()

Screen Shot 2023-01-06 at 9 06 15 AM

@Tobias-Fischer
Copy link
Contributor

-DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib:STRING=YES \
- matplotlib support is already set to ON. Which version of vtk are you installing? And is there some way to check whether matplotlib rendering works without using pyvista?

@banesullivan
Copy link
Contributor Author

banesullivan commented Jan 9, 2023

matplotlib support is already set to ON.

@mathstuf, is this all that is needed?

Which version of vtk are you installing?

Latest from this feedstock. Not only locally, but also with PyVista's CI, ref pyvista/pyvista#3781

Locally: vtk 9.2.2 qt_py310h032bd38_204 conda-forge

And is there some way to check whether matplotlib rendering works without using pyvista?

Here is a pure VTK example to check for math text symbols (effectively equivalent to what PyVista is doing above):

import vtk

actor = vtk.vtkTextActor()
actor.SetInput(r'$\rho$')
actor.GetTextProperty().SetFontSize(75)
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren.AddActor(actor)
iren.Initialize()
renWin.Render()
iren.Start()

Screen Shot 2023-01-08 at 7 31 35 PM

@banesullivan
Copy link
Contributor Author

FWIW, I noticed this error from VTK this time:

2023-01-08 19:35:30.642 (  27.136s) [        162395FE]vtkMatplotlibMathTextUt:1084   ERR| vtkMatplotlibMathTextUtilities (0x600001908000): MaskParser is not initialized!
2023-01-08 19:35:30.643 (  27.137s) [        162395FE]vtkMatplotlibMathTextUt:515    ERR| vtkMatplotlibMathTextUtilities (0x600001908000): MaskParser is not initialized!

@mathstuf
Copy link

mathstuf commented Jan 9, 2023

Yes, that will need 9.2.5; it added support for matplotlib 3.6.

@banesullivan
Copy link
Contributor Author

Aahh, right. I just checked and this feedstock works for matplotlib<3.6.

I doubt we'd want to limit matplotlib in this recipe, so I'm happy to close this issue knowing that VTK_MODULE_ENABLE_VTK_RenderingMatplotlib is enabled

@Tobias-Fischer
Copy link
Contributor

9.2.5 just landed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants