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

Tracking simplification #9

Open
CLemeunier opened this issue Feb 11, 2021 · 5 comments
Open

Tracking simplification #9

CLemeunier opened this issue Feb 11, 2021 · 5 comments

Comments

@CLemeunier
Copy link

Hi !

First, thanks for your work, it works very nicely !

I have a question : what do you think about tracking the simplification ? Could the function to simplify a mesh return like a set of edges and the movement of vertices that were simplified ? With those return infos, it would be possible to apply exactly the same simplification to a mesh that has the same connectivity but that has its vertices other positions.

Thanks !

@jannessm
Copy link
Owner

Hi @CLemeunier,

this would be a nice addon. Currently, I am very busy. But I will add it to my ToDo list. If you want to, you are highly encouraged to give it a try and implement it by yourself. For this, I would recommend to include a flag to the function to make this behavior optional.

@CLemeunier
Copy link
Author

Ok, I can give it a try.

What is the workflow to adopt ? I can see that in the file 'simplify.c' there are two variables 'deleted_positions ' and 'deleted_faces'. Do they indicate by true or false that the vertex / face of the mesh with this index has been deleted ? So I should return those two variables, if a flag is set to true ?

@jannessm
Copy link
Owner

Regrading the workflow: please implement it and create a pull request so that I can do some quality checks.

Regarding the variables:
Yes, exactly. But they do not contain any information about which pairs where contracted. I would suggest to keep track of all contractions. And return a 4 x n array with the following entries for each of the n contracted pairs:

[id of v_1, id of v_2, new vertex id (v_1), influence of old v_1].

And return the deleted_faces array. This will contain almost all information of the simplification process. The movement can be calculated for each pair. But the order matters. Because if v_1 and v_2 are contracted, all references to v_2 will be mapped to the v_1 index. Please reference it in the documentation.

Here some infos regarding the last attribute:
all new vertices lie on a line between v_1 and v_2. The line is split into 11 steps (1*v_1 + 0*v_2, 0.9*v_1 + 0.1*v_2, ..., 0*v_1, 1*v_2). To change vertex features the factor of v_1 should be returned, too. (see targets.c)

Additionally, I would only store these informations if the according flag is set to True. Otherwise, it could produce some exzessive memory overhead which is not needed in some cases.

If you have any questions please ask. And thank you for your effort!

@CLemeunier
Copy link
Author

Great, thanks for the informations ! I have some work to do, I'll give it a try when I can !

I'll keep you in touch

@jannessm
Copy link
Owner

No worries. I am glad for your interest and support!

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

No branches or pull requests

2 participants