code: public static Geometry drapeLineString(LineString line, Geometry triangles, STRtree sTRtree) {
          GeometryFactory factory = line.getFactory();
          //Split the triangles in lines to perform all intersections
          Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
          Geometry diffExt = lineMerge(line.difference(triangleLines), factory);
          CoordinateSequenceFilter drapeFilter = new DrapeFilter(sTRtree);
          diffExt.apply(drapeFilter);
          return diffExt;
      }
docs: Drape a linestring to a set of triangles
  @param line
  @param triangles
  @param sTRtree
  @return