This package allows to compute the best fit cylinder given points in three-dimensional space.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for py-cylinder-fitting-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788fb1f17f439159e4c9c4f552294fbffa0b6ada655592a7cc5f3f3e6fc2d6b0 |
|
MD5 | 1a57b374cbb0e16f3ec972edede3fbcb |
|
BLAKE2b-256 | 9573e24b5d5a15682edae6b22a6bda64fa46dbca0915aea222b1e57be653e563 |
Hashes for py_cylinder_fitting-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ac53e8b19406c37bb61018ba015c91a76b0df92fbe5a7a7339b8c2a0af1e94 |
|
MD5 | 76c1dfe90d76161bc4b2438af9eca213 |
|
BLAKE2b-256 | 7109484ed56c7110efc5506351d5d97f3ec04d09399f24ac71f36fd99170d3d5 |