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

make packer optional in atlas maker and do not destroy the charts #31

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

cdcseacave
Copy link
Contributor

No description provided.

@BrunoLevy BrunoLevy merged commit 67379d8 into BrunoLevy:main Nov 7, 2022
@BrunoLevy
Copy link
Owner

Changed a couple of things:

  • replaced PACK_NA with PACK_NONE (to match other names in the library)
  • re-activated code to destroy the charts attribute (client code expects API functions to clean temporary attributes, and all the information is present in the texture coordinates)
  • added a function get_chart() to re-create it from the texture coordinates if needed

@cdcseacave
Copy link
Contributor Author

Thank you for these changes. However I'm not sure I follow the reasons here: why texture coordinates are not considered temporary attributes while the charts are? Of course we can recompute them, but using this logic we can recompute the texture coordinates too, so the function could output nothing, right?

@BrunoLevy
Copy link
Owner

Different reasons:

  • texture coordinates are standard, and can be saved in standard file formats, even the simplest ones (.obj)
  • texture coordinates contain all the relevant information
  • the chart attribute can be trivially obtained with an O(n) algorithm (runs in no time), whereas texture coordinates are much more complicated to obtain (need to solve a series of linear systems)

Geogram is designed like that: there is this Mesh data structure, and a set of functions that read/modify or produce meshes. These functions can internally create a set of temporary attributes, and they destroy them on exit, because they are just a temporary state of the algorithm, not an output. It also makes it possible to change the implementation of an algorithm without breaking the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants