How to create curved trenches in terrain?

Straight from the twilight zone of my mind at 2:30am :crazy_face:

  1. Get points of the trench curve
  2. Create an array of Line3 objects from (1)
  3. Find the shortest distance between a point of the terrain geometry and lines in (2)
  4. Do the stuff to make the point lower
  5. Iterate through all the points in the terrain geometry with (3) and (4)

Before:

After:

Demo: https://codepen.io/prisoner849/full/MWPeWEZ

PS This is just an example, not the ultimate solution.

5 Likes