Fix PyVista n_faces deprecation
Summary
The codebase is using geometry.n_faces from PyVista.
In recent versions of PyVista, the non-strict behavior of n_faces has been removed, which now raises an AttributeError.
Steps to reproduce
- Install the latest version of PyVista (>0.44.1).
- Run
example.py. - The code fails inside
light.pywhen callinggeometry.n_faces.
What is the current bug behavior?
Execution stops with: AttributeError: The non-strict behavior of pv.PolyData.n_faces has been removed. Use pv.PolyData.n_cells or pv.PolyData.n_faces_strict instead.
What is the expected correct behavior?
Geometry should be checked using n_cells or n_faces_strict depending on the intended behavior.
Relevant logs and/or screenshots
File "ENVIRONMENT/light.py", line 452, in diffuse_map if geometry.n_faces == 0 : AttributeError: The non-strict behavior of pv.PolyData.n_faces has been removed.
Possible fixe
File "ENVIRONMENT/light.py", line 452
Replace:
if geometry.n_faces == 0:
with:
if geometry.n_cells == 0:
or:
if geometry.n_faces_strict == 0:
Edited by Grote Selim