bestfit_plane
- compas.geometry.bestfit_plane(points)[source]
Fit a plane to a list of (more than three) points.
- Parameters
points (sequence[point]) – A list of points represented by their XYZ coordinates.
- Returns
[float, float, float] – Base point.
[float, float, float] – Normal vector (normalized).
Notes
This method will minimize the squares of the residuals as perpendicular to the main axis, not the residuals perpendicular to the plane. If the residuals are small (i.e. your points all lie close to the resulting plane), then this method will probably suffice. However, if your points are more spread then this method may not be the best fit. For more information see [ernerfeldt2015]
References
- ernerfeldt2015
Ernerfeldt, E. Fitting a plane to many points in 3D. Available at: http://www.ilikebigbits.com/blog/2015/3/2/plane-from-points
Examples
>>>