text: Constraining a curve to a surface - Basics & Interface - Blender Artists Community
  Constraining a curve to a surface
  manbitesdog (manbitesdog) April 23, 2018, 2:37am #1
  I have a mesh with a subsurf modifier applied that looks a bit like a flat plain with a smooth hill in the middle. What I would like to do is trace a path on this surface (that a characater could walk along for example) by going into the top view, drawing the path in the x-y plane, and then somehow make the path follow the z (height) position of the mesh. That is I'd define the shape of the curve in the x-y plane, but I want the curve to take the meshs z value at each point along the curve.
  Is there an easy way to do this? Cheers.
  Gimble (Gimble) April 24, 2018, 5:40am #2
  Hi manbitesdog
  Going for the footprints in the sand, huh?
  I would use the retopo feature to first transfer a mesh line (or using the paint feature) to your landscape.
  You can find out more about retopo here:
  BlenderNation – 15 Jan 07
  There are a number of exciting features in our upcoming release. One of which is the remake topology tool. See this video tutorial by kattkieru ( Charles Wardlaw) that shows the basic function of the tool including the paint based and mesh based...
  and then with your mesh line path in edit mode, select from the mesh menu in the 3DWindow header, > Scripts > 'Edges to Curves'. That'll give you a PolyLine - you can then convert it to a NURBs curve ( Curve Tools panel).
  The only thing that you may have to watch out for is that you don't make any bends in the path that are too sharp, and that you don't have too high a vertice count (though you can drop the curve resolution if needed).
  manbitesdog (manbitesdog) April 24, 2018, 5:40am #3
  Spot on Gimble, you got it exactly!
  And your suggestion looks like a perfect solution for the problem, just what I was after. Glad to see we've been able to help each other out.