Video thumbnail
Change Pasta
In this video we examine the equations a little. We experiment by changing some of the variables to see what effects they have on the surface of the pasta.

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.