grasshopper2 Rhinorhino3d.com
ComponentCurve
Line N Points
00000000-0377-40bb-9f76-46870e164a62
object preview

Create the line which best approximates a collection of points. The line fitter algorithm aims to minimise the fitting error of the resulting line. The error is calculated by summing the squares of the distances from each point to the line.

The less line-like the distribution of the given points, the less predictable the fitted line result will become. In extreme cases, very small changes to the input points may result in very different lines being fitted.

An example of such an unstable system would be points evenly distributed along a circle, where every possible direction through the circle is equally bad, and the final chosen direction is subject to rounding errors and cosmic rays.

1
1
2
3
4
Example file LineNPointsField.ghz.Interactive in Grasshopper 2
Fit a line through a collection of points which are randomised by a vector noise field.
1
2
3
Example file LineNPoints.ghz.Interactive in Grasshopper 2
Fit a line to a collection of random points within a narrow box. The more points, the more the result will be aligned with the central axis of the box.