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.
Metadata
Release files for py-cylinder-fitting 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py-cylinder-fitting-1.0.0.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_cylinder_fitting-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / py-cylinder-fitting-1.0.0.tar.gz
| Download URL | py-cylinder-fitting-1.0.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
788fb1f17f439159e4c9c4f552294fbffa0b6ada655592a7cc5f3f3e6fc2d6b0
|
|
BLAKE2b-256 checksum How to use checksums |
9573e24b5d5a15682edae6b22a6bda64fa46dbca0915aea222b1e57be653e563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / py_cylinder_fitting-1.0.0-py3-none-any.whl
| Download URL | py_cylinder_fitting-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32ac53e8b19406c37bb61018ba015c91a76b0df92fbe5a7a7339b8c2a0af1e94
|
|
BLAKE2b-256 checksum How to use checksums |
7109484ed56c7110efc5506351d5d97f3ec04d09399f24ac71f36fd99170d3d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|