raysect / source

The main source repository for the Raysect project.
http://www.raysect.org
BSD 3-Clause "New" or "Revised" License
88 stars 23 forks source link

Tetrahedra mesh demo does not work with the newer version of Py3DViewer #374

Closed vsnever closed 3 years ago

vsnever commented 3 years ago

After recent refactoring of Py3DViewer module, the tets and num_tets attributes of Tetmesh class were renamed to polys and num_polys, so the tetrahedra_mesh_emission.py demo now throws an AttributeError at:

tetra = Discrete3DMesh(mesh.vertices, mesh.tets, np.ones((mesh.num_tets)), False, 0)

For backward compatibility, this should be modified to:

try:
    tetra = Discrete3DMesh(mesh.vertices, mesh.polys, np.ones((mesh.num_polys)), False, 0)
except AttributeError:
    tetra = Discrete3DMesh(mesh.vertices, mesh.tets, np.ones((mesh.num_tets)), False, 0)
CnlPepper commented 3 years ago

Please open a PR with the relevant changes.

vsnever commented 3 years ago

Fixed in #377.