Description
Sorry if this was already addressed somewhere and I simply couldn't find it, but recently while developing a sculpting tool with local tessellation, I encountered a usecase, where, obviously, adding new vertices/triangles to the target mesh was needed, but if I correctly understood the refit.template.js file, any changes to index won't be supported (and I think it was written somewhere in the documentation too).
So I wondered if it would be possible to have a more intricate control over the bvh refitting, if it doesn't contradict the existing architecture somehow/doesn't have significant performance degradation consequences.
Solution
A convenient way to handle this issue would probably be a function like "updateIndex" which would grant us the ability to specify removed and added triangles which could be added as nodes to the bvh tree (while refit() could be used to handle position updates as is now).
Alternatives
The problem seems to be that even with the current refit() function we seemingly can't easily map geometry's attribute indices unto nodes (let's say we want to refit a set of vertex indices, how do we get the corresponding nodeIndices?), so in order to implement these changes, we would probably need to either query the positions against the bvh (seems like an overkill) or keep some correspondence map, so I'm not totally sure if this change is really in the scope of the library.
Additional context
No response
Description
Sorry if this was already addressed somewhere and I simply couldn't find it, but recently while developing a sculpting tool with local tessellation, I encountered a usecase, where, obviously, adding new vertices/triangles to the target mesh was needed, but if I correctly understood the refit.template.js file, any changes to index won't be supported (and I think it was written somewhere in the documentation too).
So I wondered if it would be possible to have a more intricate control over the bvh refitting, if it doesn't contradict the existing architecture somehow/doesn't have significant performance degradation consequences.
Solution
A convenient way to handle this issue would probably be a function like "updateIndex" which would grant us the ability to specify removed and added triangles which could be added as nodes to the bvh tree (while refit() could be used to handle position updates as is now).
Alternatives
The problem seems to be that even with the current refit() function we seemingly can't easily map geometry's attribute indices unto nodes (let's say we want to refit a set of vertex indices, how do we get the corresponding nodeIndices?), so in order to implement these changes, we would probably need to either query the positions against the bvh (seems like an overkill) or keep some correspondence map, so I'm not totally sure if this change is really in the scope of the library.
Additional context
No response