Skip to content

M_Rhino_Geometry_NurbsSurface_CreateFromCorners_1

Will Pearson edited this page Aug 12, 2016 · 2 revisions

NurbsSurface.CreateFromCorners Method (Point3d, Point3d, Point3d, Point3d)

Makes a surface from 4 corner points. This is the same as calling CreateFromCorners(Point3d, Point3d, Point3d, Point3d, Double) with tolerance 0.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: Rhino 6.0

Syntax

C#

public static NurbsSurface CreateFromCorners(
	Point3d corner1,
	Point3d corner2,
	Point3d corner3,
	Point3d corner4
)

VB

Public Shared Function CreateFromCorners ( 
	corner1 As Point3d,
	corner2 As Point3d,
	corner3 As Point3d,
	corner4 As Point3d
) As NurbsSurface

Parameters

 

corner1
Type: Rhino.Geometry.Point3d
The first corner.
corner2
Type: Rhino.Geometry.Point3d
The second corner.
corner3
Type: Rhino.Geometry.Point3d
The third corner.
corner4
Type: Rhino.Geometry.Point3d
The fourth corner.

Return Value

Type: NurbsSurface
the resulting surface or null on error.

Examples

VB

Imports Rhino
Imports Rhino.Geometry
Imports Rhino.Commands

Namespace examples_vb
  Public Class SurfaceFromCornersCommand
    Inherits Rhino.Commands.Command
    Public Overrides ReadOnly Property EnglishName() As String
      Get
        Return "vbSurfaceFromCorners"
      End Get
    End Property

    Protected Overrides Function RunCommand(doc As RhinoDoc, mode As RunMode) 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
End Namespace

C#

using Rhino;
using Rhino.Geometry;
using Rhino.Commands;

namespace examples_cs
{
  public class SurfaceFromCornersCommand : Rhino.Commands.Command
  {
    public override string EnglishName
    {
      get { return "csSurfaceFromCorners"; }
    }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      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;
    }
  }
}

Python

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();

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

NurbsSurface Class
CreateFromCorners Overload
Rhino.Geometry Namespace

Clone this wiki locally