Video thumbnail
C# Supplement
This is a supplementary video that covers some issues that might arise related to the Rhino 8 scripting component and/or some issues you might encounter if you’re unfamiliar with C# in Grasshopper. Some of these issues may have been fixed (by McNeel/Rhino) by the time you watch this. Some issues, like the cascade of errors that comes with any change to the component, will only every happen to a few users. But, just in case you're experiencing some frustration, hopefully this video will help.

Back to Pasta Mesh
Code
Below is the C# script we used to make a mesh from a DataTree of points. This is all of the code from our scripting component.
    
// Grasshopper Script Instance
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;

using Rhino;
using Rhino.Geometry;

using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
using Grasshopper.Kernel.Types;

public class Script_Instance : GH_ScriptInstance
{
  private void RunScript(DataTree<Point3d> inputPts, ref object a)
  {
    // Write your logic here
    a = CreateMeshFromTree(inputPts);
  }

  Mesh CreateMeshFromTree(DataTree<Point3d> inputPts)
  {
    Mesh mesh = new Mesh();

    for (int i = 0; i < inputPts.BranchCount - 1; i++)
    {
      List<Point3d> currentBranch = inputPts.Branch(i);
      List<Point3d> nextBranch = inputPts.Branch(i+1);

      if (currentBranch.Count != nextBranch.Count) continue;

      for (int j = 0; j < currentBranch.Count - 1; j++)
      {
        Point3d pt1 = currentBranch[j];
        Point3d pt2 = currentBranch[j+1];
        Point3d pt3 = nextBranch[j+1];
        Point3d pt4 = nextBranch[j];

        int v1 = mesh.Vertices.Add(pt1);
        int v2 = mesh.Vertices.Add(pt2);
        int v3 = mesh.Vertices.Add(pt3);
        int v4 = mesh.Vertices.Add(pt4);

        mesh.Faces.AddFace(v1, v2, v3, v4);
      }
    }

    mesh.Vertices.CombineIdentical(true, true);

    return mesh;
  }
}
  
And, here is the code for the CreateMeshFromTree function only:
    
  Mesh CreateMeshFromTree(DataTree<Point3d> inputPts)
  {
    Mesh mesh = new Mesh();

    for (int i = 0; i < inputPts.BranchCount - 1; i++)
    {
      List<Point3d> currentBranch = inputPts.Branch(i);
      List<Point3d> nextBranch = inputPts.Branch(i+1);

      if (currentBranch.Count != nextBranch.Count) continue;

      for (int j = 0; j < currentBranch.Count - 1; j++)
      {
        Point3d pt1 = currentBranch[j];
        Point3d pt2 = currentBranch[j+1];
        Point3d pt3 = nextBranch[j+1];
        Point3d pt4 = nextBranch[j];

        int v1 = mesh.Vertices.Add(pt1);
        int v2 = mesh.Vertices.Add(pt2);
        int v3 = mesh.Vertices.Add(pt3);
        int v4 = mesh.Vertices.Add(pt4);

        mesh.Faces.AddFace(v1, v2, v3, v4);
      }
    }

    mesh.Vertices.CombineIdentical(true, true);

    return mesh;
  }
  
Resources
Legendre, G. L. (2011). Pasta by design. Thames & Hudson.