pyvista / pymeshfix

Python Wrapper for MeshFix: easily repair holes in surface meshes
http://pymeshfix.pyvista.org
GNU General Public License v3.0
293 stars 29 forks source link

Better error message on instantiation #6

Closed banesullivan closed 5 years ago

banesullivan commented 5 years ago

https://github.com/pyvista/pymeshfix/blob/1c13b0525bb5c789714ab8ba8dd555d0aade1ed4/pymeshfix/meshfix.py#L22-L36

Should we include a more user-friendly error message here?

Because if we pass a PyVista mesh that isn't PolyData, then this error gets thrown... this could be very confusing for a new user.

Also, what if we added a catch to automatically cast things like UnstructuredGrids to PolyData and use a .tri_filter to ensure it is a triangular mesh?

.extract_geometry().tri_filter()

Thoughts, @akaszynski?

akaszynski commented 5 years ago

Agreed and addressed in 72c1479b8009ea48568f01e815741c2de48af53f. I don't think it makes sense to allow the user to load in solid UnstructuredGrids as those are already manifold, but I did improve the messaging, allowed vtk surfaces, and implemented a tri_filter for non-triangular meshes.