How to achieve the effect in the gif, fit the curve on the model, and move the selection point?

Hello, everyone.
I have seen on other forums that people have implemented the effect in the gif, but there is no mention of any way to achieve it, and I think this effect is very good and fast.
At present, I don’t know how to implement it, I feel that drawing lines on the surface of the model is more complicated, do you have any ideas?
65e4522a9be54fe5a3c861194cd19762

At present, I have implemented marking points on the model and can move existing points. But how do I use these points to do curve fitting on the surface?

Reference:
vtkjournal.org/browse/publication/891
You Can Find Geodesic Paths in Triangle Meshes by Just Flipping Edges (nmwsharp.com)

Hello,

Please, take a look at this example: https://examples.vtk.org/site/Cxx/PolyData/DijkstraGraphGeodesicPath/ . The vtkDijkstraGraphGeodesicPath class takes a starting and ending vertexes as inputs. You can easily extend it to implement a multiple vertex path.

best,

PC

I am using the vtkDijkstraGraphGeodesicPath class, but it is searching for paths on the edges of the model.Generating fitted paths on the surface of the model seems to be difficult, I’m looking into papers and code on the subject.

Finally, thanks for your reply!Thanks PC

If you can afford adding another dependency to your software and making copies of the objects for two APIs, you can try CGAL’s implementation which does what you want: CGAL 5.6.1 - Triangulated Surface Mesh Shortest Paths: User Manual .

Thanks, I will try to implement it using CGAL. During my search, I found a similar VTK class in Paraview, but I’m not sure if I can use it in my VTK version.
VtkFastMarchingGeodesicPath class:
(ParaView/Plugins/GeodesicMeasurement/Filters/vtkFastMarchingGeodesicPath.h at master · Kitware/ParaView · GitHub)

If that is the case, just upgrade VTK. Other than that, you may just copy the sources over to your project (e.g. to the thirdparty sub-directory) and obviously giving credit to Paraview authors if you decide to do so.