I’m today very glad I made main mechanism for editing mesh. Of course many things I have to fix, for example transformControls must be in the centre of triangle, and triangle must change color and else a lot of
Perhaps my approach can serve as a suggestion? It inserts points into lines, moves them or deletes them. This can certainly be modified for the desired result.
If you click somewhere, a new point comes up there. It is connected to the previous point. If you move the mouse over a point, the crosshairs become large and red. Now press the i key and click on the point. In the middle to the next point there is a new point. Of course this does not work for the last point.
Have you created several points on top of each other? Or very close together? Then you won’t see the new point, of course. Then pull them apart with the m key or delete them with the d key.
I made that TransformControls are in the barycenter of triangle.
But my solution is very resource-intensive. It can be seen when there are a lot of triangles in the object. The reason for this is that I create an auxiliary triangle for each triangle of the object, and when the triangle moves, I delete them all and create them again.
As a solution, I decided to make an auxiliary triangle only for the triangle that I am going to move. Now for this I realized the creation of such a triangle with the movement of the mouse. This will highlight the triangle that you can select