LineFitFromPoints

Returns a line that was fit through an array of 3-D points.

Syntax

rhinoscriptsyntax.LineFitFromPoints ( points )

rhinoscript.curve.LineFitFromPoints ( points )

Parameters

points

Required.  List.  A list of 3-D points. The list must contain at least two 3-D points.

Returns

List

A list containing the starting and ending points of the fit line if successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

points = rs.GetPoints()

if points and len(points)>1:

    line=rs.LineFitFromPoints(points)

    if line: rs.AddLine(line.From, line.To)

Also See

AddLine

CurveEndPoint

CurveStartPoint