pyvista: possible bug in examples and feedback
Hi, while playing with the examples i’ve run into an error message
- in
examples/02-plot/cmap.py
Traceback (most recent call last):
File "cmap.py", line 54, in <module>
p.add_mesh(mesh, cmap="fire", lighting=True, stitle="Colorcet Fire")
File "/home/musy/soft/anaconda3/lib/python3.6/site-packages/pyvista/plotting/plotting.py", line 752, in add_mesh
cmap = get_cmap_safe(cmap)
File "/home/musy/soft/anaconda3/lib/python3.6/site-packages/pyvista/plotting/colors.py", line 391, in get_cmap_safe
cmap = get_cmap(cmap)
File "/home/musy/soft/anaconda3/lib/python3.6/site-packages/matplotlib/cm.py", line 182, in get_cmap
% (name, ', '.join(sorted(cmap_d))))
ValueError: Colormap fire is not recognized. Possible values are: Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu, BuPu_r, CMRmap, CMRmap_r ...
i’m maybe missing some package?
-
i also get a seg fault from
examples/02-plot/scalar-bars.py
, right after the script ends (?!). -
in
examples/02-plot/volume.py
I get a blank image when using keywordmapper='gpu'
(is there any good reason to prefer vtkFixedPointVolumeRayCastMapper over vtkOpenGLGPUVolumeRayCastMapper?) -
also, in addition to
opacity='linear'
, you might allow the user to define a transfer function for opacities by explicitly setting their values along the scalar range, e.g. something likeopacity=[0,0.2,0.9,0.2,0.1]
(see here). -
in
01-filter/glyphs.py
, when one uses keywordsubset=0.05
the resulting sampling looks non-uniform… one possible way out is to use the vtkCleanPolydata filter setting a non-zero tolerance (see here) -
in
00-load/create-geometric-objects.py
i see some feature (which i also get in vtkplotter btw) where the edge lines look awkward:not sure if this can relate to this mapper method… I never tried it…
Cheers, Marco
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Update cmaps example per https://github.com/pyvista/pyvista/issues/301 — committed to pyvista/pyvista by banesullivan 5 years ago
- Implement tolerance subsetting for glyph filter from suggestion in #301 — committed to pyvista/pyvista by banesullivan 5 years ago
- Change defualts for volume rendering per #301 — committed to pyvista/pyvista by banesullivan 5 years ago
- tolerance subsetting for glyph filter (#302) * Implement tolerance subsetting for glyph filter from suggestion in #301 * Update glyph example description * Fix glyph test — committed to pyvista/pyvista by banesullivan 5 years ago
- Fix interactive scalar bar cleanup (ref #301) — committed to pyvista/pyvista by banesullivan 5 years ago
One of these methods on
vtkMapper
should fix it:yep, that could be an idea although the problem is quite minor
Got the opacity request implemented in #297
Figured out the volume rednering issue - it has to do with the blending mode choice. Right now our default is “additive” and
vtkplotter
’s is “composite”. With the “composite” mode, thevtkGPUVolumeRayCastMapper
,vtkOpenGLGPUVolumeRayCastMapper
, andvtkSmartVolumeMapper
all work perfectly.I just changed the default volume rendering parameters to use the
vtkSmartVolumeMapper
and the “composite” blending mode (implemented in 959ba5e7b8718e5ef9f5fe9fef9c1a3910c03481)