Click or drag to resize

PlaneSurface Constructor (Plane, Interval, Interval)

Constructs a plane surface with x and y extents.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax
public PlaneSurface(
	Plane plane,
	Interval xExtents,
	Interval yExtents
)

Parameters

plane
Type: Rhino.GeometryPlane
The plane.
xExtents
Type: Rhino.GeometryInterval
The increasing 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.GeometryInterval
The increasing y interval of the plane that defines the rectangle. The corresponding evaluation interval domain is set so that it matches the extents interval.
Examples
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()
See Also