Can patch mesh be created with Rhino Common?

@Helvetosaur, @nathanletwory,

I could not get your example to work right off the bat but the error message led me to a fix: I need to use a .NET compatible IEnumerable list to talk to CreatePatch and not just a standard Python list.

	# I had to add this to my imports:
	from System.Collections.Generic import List
	#
	# Then this worked:
	#
	# Create pts list in .NET compatible IEnumerable format.
	pts = List[Point3d]()
	# Add Point3d's to pts list.
	for ptg in Xvertices[i][j]: pts.Add(ptg)
	# Create boundary polyline from boundary curve entered by user.
	boundary = Polyline(boundary_geo)
	tol=doc.ModelAngleToleranceRadians
	# Create patch mesh that stays inside boundary polyline using pts list in .NET IEnumerable format.
	patchGeo = Mesh.CreatePatch(boundary,tol,None,None,None,pts,False,10)
	patch_mesh = doc.Objects.AddMesh(patchGeo)

The impact of moving from using rs.Command(‘NoEcho -MeshPatch EnterEnd’) to Mesh.CreatePatch on my Python script is profound, dropping the time from 35 sec to only 16 sec. This is because (1) I no longer have to remove mesh faces outside the boundary curve. MeshPatch will not allow concave sections in the boundary curve, it fills them with very long faces while CreatePatch does not let any faces be created outside the boundary curve. And (2) I got to eliminate the creation of 600,000 visible points in the document needed to drive MeshPatch.

Joy, joy, joy. So happy.

Regards,
Terry.