Skip to content

Compute the best fit cylinder given points in three-dimensional space.

License

Notifications You must be signed in to change notification settings

CristianoPizzamiglio/py-cylinder-fitting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This package allows to compute the best fit cylinder given points in three-dimensional space.

Object-oriented implementation of the cylinder_fitting repo by xingjiepan with input validation and type hints.

Algorithm by David Eberly.

As stated by David Eberly, the main assumption is that the underlying data is modelled by a cylinder and that errors have caused the points not to be exactly on the cylinder.

Installation

The package can be installed with pip.

$ pip install py-cylinder-fitting

Example Usage

>>> from py_cylinder_fitting import BestFitCylinder
>>> from skspatial.objects import Points
>>> points = [[2, 0, 0], [0, 2, 0], [0, -2, 0], [2, 0, 4], [0, 2, 4], [0, -2, 4]]
>>> best_fit_cylinder = BestFitCylinder(Points(points))
>>> best_fit_cylinder.point
[0., 0., 0.]
>>> best_fit_cylinder.vector
[0.  0.  4.]
>>> best_fit_cylinder.radius
2.0

Acknowledgment

This package is based on the cylinder_fitting repo by xingjiepan and the scikit-spatial library by Andrew Hynes.

About

Compute the best fit cylinder given points in three-dimensional space.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages