Creating a new surface from curve

This is probably a simple question, but i´m new to RhinoCommon.
I want to create a new surface from points or curves. I know there is a method NurbsSurface.CreateFromPoints() but only accepts 4 points, what if the shape have more than 4 points?
And other thing, ¿is there a paper or whitepaper with an explanation of the internal geometry structure in Rhino, that would be really helpffull for newcomers to not waste time trying and error…

Hi @Francisco_Contreras, there are two methods for creating a surface from an ordered grid of points:

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.nurbssurface/createfrompoints

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.nurbssurface/createthroughpoints

the one for using 4 points should be this:

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/createfromcornerpoints

of course you can create surface from border curves using sweep, loft etc.

Here is an overview of the brep structure:

_
c.

I tried the methods and they create a matrix like surface, this is what i need to achieve (image), it´s just a surface that follows a given perimeter in that order.

Hi @Francisco_Contreras, if this is a planar curve boundary you can build a polyline from it and use this to create a planar brep:

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/createplanarbreps

Here is some quick example code:

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

def DoSomething():
    
    p0 = Rhino.Geometry.Point3d(0,0,0)
    p1 = Rhino.Geometry.Point3d(5,0,0)
    p2 = Rhino.Geometry.Point3d(5,5,0)
    p3 = Rhino.Geometry.Point3d(0,5,0)
    
    polyline = Rhino.Geometry.Polyline([p0, p1, p2, p3, p0])
    curve = polyline.ToNurbsCurve()
    tolerance = scriptcontext.doc.ModelAbsoluteTolerance
    breps = Rhino.Geometry.Brep.CreatePlanarBreps(curve, tolerance)
    scriptcontext.doc.Objects.AddBrep(breps[0])
    scriptcontext.doc.Views.Redraw()
    
DoSomething()

_
c.