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
File details
Details for the file py-cylinder-fitting-1.0.0.tar.gz
.
File metadata
- Download URL: py-cylinder-fitting-1.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788fb1f17f439159e4c9c4f552294fbffa0b6ada655592a7cc5f3f3e6fc2d6b0 |
|
MD5 | 1a57b374cbb0e16f3ec972edede3fbcb |
|
BLAKE2b-256 | 9573e24b5d5a15682edae6b22a6bda64fa46dbca0915aea222b1e57be653e563 |
File details
Details for the file py_cylinder_fitting-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: py_cylinder_fitting-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ac53e8b19406c37bb61018ba015c91a76b0df92fbe5a7a7339b8c2a0af1e94 |
|
MD5 | 76c1dfe90d76161bc4b2438af9eca213 |
|
BLAKE2b-256 | 7109484ed56c7110efc5506351d5d97f3ec04d09399f24ac71f36fd99170d3d5 |