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 keyword mapper='gpu' (is there any good reason to prefer vtkFixedPointVolumeRayCastMapper over vtkOpenGLGPUVolumeRayCastMapper?) Screenshot from 2019-07-09 16-23-09

  • 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 like opacity=[0,0.2,0.9,0.2,0.1] (see here).

  • in 01-filter/glyphs.py, when one uses keyword subset=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: Screenshot from 2019-07-09 15-34-50 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

Most upvoted comments

One of these methods on vtkMapper should fix it:

 'SetResolveCoincidentTopology',
 'SetResolveCoincidentTopologyLineOffsetParameters',
 'SetResolveCoincidentTopologyPointOffsetParameter',
 'SetResolveCoincidentTopologyPolygonOffsetFaces',
 'SetResolveCoincidentTopologyPolygonOffsetParameters',
 'SetResolveCoincidentTopologyToDefault',
 'SetResolveCoincidentTopologyToOff',
 'SetResolveCoincidentTopologyToPolygonOffset',
 'SetResolveCoincidentTopologyToShiftZBuffer',
 'SetResolveCoincidentTopologyZShift'

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, the vtkGPUVolumeRayCastMapper, vtkOpenGLGPUVolumeRayCastMapper, and vtkSmartVolumeMapper all work perfectly.

I just changed the default volume rendering parameters to use the vtkSmartVolumeMapper and the “composite” blending mode (implemented in 959ba5e7b8718e5ef9f5fe9fef9c1a3910c03481)