Original Post
I'm working on an application that will allow users to digitally sculpt into a triangle mesh. Rendering is done in OpenGL. The basic concept is that users can sculpt into a mesh with a pillbox-shaped tool (a pillbox is a cylinder with half-spheres at the ends - it can also be thought of as a line segment with thickness radius r). The way the user moves this virtual tool around in space is irrelevant. But any time the tool intersects with the mesh, it should basically "subtract" away that intersecting portion. What is the best way to do this? My first approach was to simply move the vertices until they are no longer intersecting the mesh, but this doesn't account for when the tool goes all the way through the mesh to make a "hole" in the solid. How do I handle this? I was thinking of some method that never moves vertices around, but instead deletes the intersecting triangles/vertices and generates new ones around the boundary region. Is this a good approach? Thanks!