Click or drag to resize

BrepCreateFromLoft Method (IEnumerableCurve, Point3d, Point3d, LoftType, Boolean)

Constructs one or more Breps by lofting through a set of curves.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
public static Brep[] CreateFromLoft(
	IEnumerable<Curve> curves,
	Point3d start,
	Point3d end,
	LoftType loftType,
	bool closed


Type: System.Collections.GenericIEnumerableCurve
The curves to loft through. This function will not perform any curve sorting. You must pass in curves in the order you want them lofted. This function will not adjust the directions of open curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves. This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to adjust the seam of closed curves.
Type: Rhino.GeometryPoint3d
Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
Type: Rhino.GeometryPoint3d
Optional ending point of loft. Use Point3d.Unset if you do not want to include an end point.
Type: Rhino.GeometryLoftType
type of loft to perform.
Type: SystemBoolean
true if the last curve in this loft should be connected back to the first one.

Return Value

Type: Brep
Constructs a closed surface, continuing the surface past the last curve around to the first curve. Available when you have selected three shape curves.
using System.Linq;
using Rhino;
using Rhino.Input.Custom;
using Rhino.DocObjects;
using Rhino.Commands;
using Rhino.Geometry;

namespace examples_cs
  public class LoftCommand : Command
    public override string EnglishName { get { return "csLoft"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
      // select curves to loft
      var gs = new GetObject();
      gs.SetCommandPrompt("select curves to loft");
      gs.GeometryFilter = ObjectType.Curve;
      gs.SubObjectSelect = false;
      gs.GetMultiple(2, 0);
      if (gs.CommandResult() != Result.Success)
        return gs.CommandResult();

      var curves = gs.Objects().Select(obj => obj.Curve()).ToList();

      var breps = Brep.CreateFromLoft(curves, Point3d.Unset, Point3d.Unset, LoftType.Tight, false);
      foreach (var brep in breps)

      return Result.Success;
import rhinoscriptsyntax as rs

def RunCommand():
  crvids = rs.GetObjects(message="select curves to loft", filter=rs.filter.curve, minimum_count=2)
  if not crvids: return

  rs.AddLoftSrf(object_ids=crvids, loft_type = 3) #3 = tight

if __name__ == "__main__":
See Also