If the geometry is indexed, all you have to do in this step may be to reorder/rebuild the index and make two renderGroups.
Problem 1: Raycasting upon mouse move by default iterates over all triangles of the mesh. Possible solution: Optimized raycast for your object.
Problem 2: If the mouse moves past multiple triangles before the
mousemove event is fired and handled, you don’t know where to connect. This is made worse by problem 1. Possible solution: Searching for shortest path.
Problem 3: Using triangle centers will require you to split triangles, which complicates the work further. Possible solution: select nearest vertex instead.
@pailhead is right that this is far from trivial. It is doable, but will require a significant effort. If you can pull this off, I am sure the community will be happy to se something useful shared.