Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting of texture coordinates #317

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

banesullivan
Copy link
Contributor

@banesullivan banesullivan commented Nov 23, 2023

Description

This should resolve #316 and close pyvista/pyvista#5209

Checklist

  • My code follows the PEP 8 style guidelines.
  • My code uses type hinting for function and method arguments and return values.
  • My code contains descriptive and helpful docstrings
    which are formatted per the Google Python Style Guidelines.
  • I have created tests which entirely cover my code.
  • The test code either 1. demonstrates at least one valuable use case (e.g. integration tests)
    or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).
  • New and existing tests pass locally with my changes.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Thanks for opening your first pull request in GemGIS! 🚀 Please make sure you read the Contributing Guide and follow the Code of Conduct. A few things to keep in mind:

  • Remember to run the tests locally to make debugging issues easier.
  • If you need help writing tests, take a look at the existing ones for inspiration. If you do not know where to start, let us know and we will walk you through it.
  • All new features should be documented. It helps to write the docstrings for your functions/classes before writing the code. This will help you think about your code design and results in better code.
  • No matter what, we are really grateful that you put in the effort to open this PR!

Comment on lines +511 to +514
if pv._version.version_info < (0, 43):
surface.active_t_coords = uv
else:
surface.active_texture_coordinates = uv
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to add a third condition if the version is whenever t_coords was supported, but honestly that version of PyVista is not supported these days and this should use the modern API

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@banesullivan thanks for looking into that. I did not realize that the error was on my side during the mesh generation! I would actually keep it to the latest version of PyVista! If you don't mind just changing the old line 509 to what you have written in the new line 514 now (surface.active_texture_coordinates = uv), then I would be happy to merge it :)

Within the framework of the PyOpenSci Review, I will also have to extend and complete my tests.....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that 0.43 isn't out yet, I recommend keeping this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, should have read it more carefully. So it will be renamed in 0.43 again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely get this though and make sure this change is what you need. I did not run this code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked and your changes fix the issue! The texture is shown correctly again.

@AlexanderJuestel AlexanderJuestel merged commit f982be3 into cgre-aachen:main Nov 24, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants