code: public static Geometry drapeMultiLineString(MultiLineString lines, Geometry triangles, STRtree sTRtree) {
          GeometryFactory factory = lines.getFactory();         
          //Split the triangles in lines to perform all intersections
          Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
          int nbLines = lines.getNumGeometries();
          LineString[] lineStrings = new LineString[nbLines];
          for (int i = 0; i < nbLines; i++) {
              lineStrings[i] = (LineString) lineMerge(lines.getGeometryN(i).difference(triangleLines), factory);
          }
          Geometry diffExt = factory.createMultiLineString(lineStrings);
          CoordinateSequenceFilter drapeFilter = new DrapeFilter(sTRtree);
          diffExt.apply(drapeFilter);
          return diffExt;
      }
docs: Drape a multilinestring to a set of triangles
  @param lines
  @param triangles
  @param sTRtree
  @return