Surface from Corner Points

Demonstrates how to create a surface from a set of corner points.

partial class Examples
{
  public static Result SurfaceFromCorners(RhinoDoc doc)
  {
    var surface = NurbsSurface.CreateFromCorners(
      new Point3d(5, 0, 0),
      new Point3d(5, 5, 5),
      new Point3d(0, 5, 0),
      new Point3d(0, 0, 0));

    doc.Objects.AddSurface(surface);
    doc.Views.Redraw();

    return Rhino.Commands.Result.Success;
  }
}
Partial Friend Class Examples
  Public Shared Function SurfaceFromCorners(ByVal doc As RhinoDoc) As Result
	Dim surface = NurbsSurface.CreateFromCorners(New Point3d(5, 0, 0), New Point3d(5, 5, 5), New Point3d(0, 5, 0), New Point3d(0, 0, 0))

	doc.Objects.AddSurface(surface)
	doc.Views.Redraw()

	Return Rhino.Commands.Result.Success
  End Function
End Class
from Rhino.Geometry import NurbsSurface, Point3d
from scriptcontext import doc

surface = NurbsSurface.CreateFromCorners(
    Point3d(5, 0, 0),
    Point3d(5, 5, 5),
    Point3d(0, 5, 0),
    Point3d(0, 0, 0));

doc.Objects.AddSurface(surface);
doc.Views.Redraw();