Coordinate precision - default read vs MeshIO read #5799
derek-kinakin
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Looks like |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe something you've made
I wanted to share some observations around reading meshes and coordinate precision issues (I believe). My hope is to learn more about the internals of PyVista and how to work through these issues in the future.
Links to Documentation, Examples, or Class Definitions.
https://docs.pyvista.org/version/stable/api/utilities/_autosummary/pyvista.read.html#pyvista.read
Pseudocode or Screenshots
Tested PyVista versions: 0.37 and 0.43.3
We often receive meshes created from drone photogrammetry data in variety of file formats and geographic coordinate systems. Once in while we get meshes that appear to have coordinate precision artifacts. For example here's a mesh in CloudCompare at its position in geographic space:
CloudCompare knows that these coordinate issues can occur and provides an option to translate/shift the mesh on loading, resulting in the correct looking product:
Opening the same mesh via PyVista's "read", with no other instructions, results in artifacts again. Translating/shifting the mesh after loading doesn't appear fix the issue. What does make a difference is having MeshIO available and calling "read" with the "file_format" option. This appears to force the reader to use MeshIO. Here's some simple code and a screenshot of the results:
Other than eliminating the visual artifacts, the two read methods appear to return different types of objects. The default "read" returns a PolyData object. The MeshIO read returns an UnstructuredGrid:
In most of my code for these types of applications, I'm moving over to the MeshIO based read to avoid these type of coordinate precision issues. I'm keen to hear about other ways people tackle these types of problems.
Thanks for reading!
Beta Was this translation helpful? Give feedback.
All reactions