Closed zhuyuanxiang closed 2 months ago
Pinging @Louis-Pujol
Hi @zhuyuanxiang,
During the decimation, there is indeed two operations :
collapse_index
If you look at the replay function implementation, after the collapses are redone, we clean the mesh by removing isolated points.
Then, collapse_len
is not exactly the difference between number of points before and after decimation but rather a minorant of that number, so having collapse_len <(vertices_num-vertices_out_num)
does not sound wrong to me.
I have written higher-level interface around fast-simplification
for another project (scikit-shapes), the possibility are illustrated in the Multiscaling
section of the gallery of examples.
You can have a look at the code for the Decimation and Multiscaling classes to figure out how fast-simplification
is used there.
Hi, @Louis-Pujol
Thks for your help!
Now, I know the reason about collapse_len <(vertices_num-vertices_out_num)
, but I need the isolated_points
in the _map_isolated_points()
for collapse the labels in the pointdata. I hope how to do it.
If I could get a new simplify()
to get the isolated_points
, or I could use the replay_simplification()
to simpily the mesh and modify it for return the isolated_points
?
Maybe I know how to do it! I found the test_relay.py
in the project and get the method to obtain indice_mapping
which can map the all vertices to the decimated mesh, so I will try to use this function and reply the result ASAP.
BTW: I have not found isolated_points
in another project scikit-shapes too.
Hi @zhuyuanxiang,
replay_simplification()
has been designed to perform both operations: concatenation and cleaning of isolated points. The output consists of three arrays:
indice_mapping
with the following description: indice_mapping[i] = j
means that vertex i
of the original mesh was mapped to vertex j
of the decimated mesh.So, if you use replay_simplification()
, you don't need to worry about isolated points, as they are just an intermediate step in the global decimation process. I think indice_mapping
is the output you will need to collapse the labels. In scikit-shapes, we use it to transfer data (landmarks or signals) from fine meshes to coarse meshes.
Hi, @Louis-Pujol :
Thks for your conduct. Now I known what to do and how to do. I will follow your step to implement my algorithm. It's my luck to have your help. Wish you health and happiness.
Yours sincerely friend ZhuYuanxiang.Tom
You're welcome ! I wish you all the best too
Environmental: python=3.8.19, vedo=2024.5.1, vtk=9.3.1, fast-simplication=0.1.7 os=Windows11 mesh's vertices number > 50000, cells number > 100000 Code:
Then, it is a error that
collapse_len <(vertices_num-vertices_out_num)
, becausecollapse_len
's meaning is how many points is collapsed, andcollapse_len
should greater than(vertices_num-vertices_out_num)
.Now, I need use this index for collapse the labels, please give me some help! Thanks!