 # How to create a plane surface that is more that 5 points?

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.Views.Redraw();

This seems to work only up to 5 points only. How can I do more than that? Or create a plane from lines works too, but what I found only script that makes user to pick curves to generate the plane. How to automate the selection without interruption?

Thanks.

Well, if you want the surface border to have more than 4 corner points, you will need to create the planar curve(s) which represent the edges first. Then you will need to use Brep.CreatePlanarBreps() and feed it one or more planar curves. If you are starting with points and want linear edges, you can create a PolylineCurve from your point list and use that for the curve argument in CreatePlanarBreps().

``````import Rhino
import Rhino.Geometry.Point3d as P3
import scriptcontext as sc

ptA=P3(0,0,0)
ptB=P3(10,0,0)
ptC=P3(10,10,0)
ptD=P3(0,20,0)
ptE=P3(-10,10,0)
ptF=P3(-10,0,0)

pl_crv=Rhino.Geometry.PolylineCurve([ptA,ptB,ptC,ptD,ptE,ptF,ptA])
breps=Rhino.Geometry.Brep.CreatePlanarBreps(pl_crv)