M_Rhino_Geometry_PlaneSurface__ctor - mcneel/rhinocommon-api-docs GitHub Wiki

PlaneSurface Constructor (Plane, Interval, Interval)

Initializes a plane surface with x and y intervals.

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

Syntax

C#

public PlaneSurface(
	Plane plane,
	Interval xExtents,
	Interval yExtents
)

VB

Public Sub New ( 
	plane As Plane,
	xExtents As Interval,
	yExtents As Interval
)

Parameters

 

plane
Type: Rhino.Geometry.Plane
The plane.
xExtents
Type: Rhino.Geometry.Interval
The x interval of the plane that defines the rectangle. The corresponding evaluation interval domain is set so that it matches the extents interval.
yExtents
Type: Rhino.Geometry.Interval
The y interval of the plane that defines the rectangle. The corresponding evaluation interval domain is set so that it matches the extents interval.

Examples

VB

Imports Rhino
Imports Rhino.Geometry
Imports Rhino.Commands

Namespace examples_vb
  Public Class PlaneSurfaceCommand
    Inherits Command
    Public Overrides ReadOnly Property EnglishName() As String
      Get
        Return "vbPlaneSurface"
      End Get
    End Property

    Protected Overrides Function RunCommand(doc As RhinoDoc, mode As RunMode) As Result
      Dim corners As Point3d() = Nothing
      Dim rc = Input.RhinoGet.GetRectangle(corners)
      If rc <> Result.Success Then
        Return rc
      End If

      Dim plane = New Plane(corners(0), corners(1), corners(2))
      Dim plane_surface = New PlaneSurface(plane, New Interval(0, corners(0).DistanceTo(corners(1))), New Interval(0, corners(1).DistanceTo(corners(2))))
      doc.Objects.Add(plane_surface)
      doc.Views.Redraw()
      Return Result.Success
    End Function
  End Class
End Namespace

C#

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

namespace examples_cs
{
  public class PlaneSurfaceCommand : Command
  {
    public override string EnglishName { get { return "csPlaneSurface"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      Point3d[] corners;
      var rc = Rhino.Input.RhinoGet.GetRectangle(out corners);
      if (rc != Result.Success)
        return rc;

      var plane = new Plane(corners[0], corners[1], corners[2]);

      var plane_surface = new PlaneSurface(plane, 
        new Interval(0, corners[0].DistanceTo(corners[1])), 
        new Interval(0, corners[1].DistanceTo(corners[2])));

      doc.Objects.Add(plane_surface);
      doc.Views.Redraw();
      return Result.Success;
    }
  }
}

Python

import Rhino;
import rhinoscriptsyntax as rs

def RunCommand():
  rc, corners = Rhino.Input.RhinoGet.GetRectangle()
  if rc <> Rhino.Commands.Result.Success:
      return rc

  plane = Rhino.Geometry.Plane(corners[0], corners[1], corners[2])
  u_dir = rs.Distance(corners[0], corners[1])
  v_dir = rs.Distance(corners[1], corners[2])
  rs.AddPlaneSurface(plane, u_dir, v_dir)

if __name__ == "__main__":
    RunCommand()

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

PlaneSurface Class
PlaneSurface Overload
Rhino.Geometry Namespace

⚠️ **GitHub.com Fallback** ⚠️