I am trying to develop sculpting tools. My current plan is the following. I’m looking for some constructive comments on my finding and proposal for a design.
vtkCellLocator
is to slow for updating on every interaction.
vtkPointLocator
I use this for selecting points withing a radius. Next, I get a unique list of cells using GetPointCells
.
Next I move points in a normal direction
Next I refine the mesh, new cells are added to the end and I use a Visibility array to hide cell (triangles) that are no longer used
The refinement is made dividing edges and interpolating normals. The new interpolated normals, I insert into the normals array (for vertices). New points are likewise added and old points are marked as invalid.
Finally, I update the links.
I store all previous locations of points (for undo) and can use the marks for undoing cells.
I can achieve 60 Hz for a mesh with 500.000 cells. I have not yet implemented collapsing of triangles.
My dream is to make it a filter with temporal output, such that undoing corresponds to moving back in time.
Any thoughts?