I open this PR to propose a new feature for fast-simplification: the ability to track the history of successive collapses that occur during the decimation process, as mentioned here
The collapses history is encoded as a (n_collapses, 2) integer array. If collapses[j] = [i0, i1], it indicates that the (j+1)th collapsed edge was (i0, i1), with the convention that the index of the point resulting from the collapse is i0.
In the Python interface within simplify.py, I have made modifications to facilitate access to collapses. In the simplify() function, I have added an argument called return_collapses (defaulting to False). When return_collapses is set to True, the output of simplify will be (points, triangles, collapses)instead of just (points, triangles). Additionally, in simplify_mesh(), collapses are integrated into the output mesh as a field_data.
I have also included tests in test_simplify.py to ensure the correctness of this feature. Specifically, we are verifying that the number of points before decimation equals the number of points after decimation plus the number of collapses.
I open this PR to propose a new feature for fast-simplification: the ability to track the history of successive collapses that occur during the decimation process, as mentioned here
The collapses history is encoded as a
(n_collapses, 2)
integer array. Ifcollapses[j] = [i0, i1],
it indicates that the (j+1)th collapsed edge was(i0, i1)
, with the convention that the index of the point resulting from the collapse isi0
.In the Python interface within
simplify.py
, I have made modifications to facilitate access to collapses. In thesimplify()
function, I have added an argument calledreturn_collapses
(defaulting toFalse
). Whenreturn_collapses
is set toTrue
, the output of simplify will be(points, triangles, collapses)
instead of just(points, triangles)
. Additionally, insimplify_mesh()
, collapses are integrated into the output mesh as a field_data.I have also included tests in
test_simplify.py
to ensure the correctness of this feature. Specifically, we are verifying that the number of points before decimation equals the number of points after decimation plus the number of collapses.