Metadata-Version: 2.1
Name: circle-fitting-3d
Version: 1.0.0
Summary: This package allows to compute the best fit circle given points in three-dimensional space.
Author-email: Cristiano Pizzamiglio <cristianopizzamiglio@gmail.com>
License: 
        
        BSD 2-Clause License
        
        Copyright (c) 2022, Cristiano Pizzamiglio
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: Homepage, https://github.com/CristianoPizzamiglio/circle-fitting-3d
Keywords: circle,best-fit,3D
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE

Introduction
------------

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


Installation
------------

The package can be installed with pip.

.. code-block:: bash

   $ pip install circle-fitting-3d
   

Example Usage
-------------

>>> from circle_fitting_3d import Circle3D

>>> circle_3d = Circle3D([[3, 0, 0], [0, 3, 0], [0, 0, 3]])

>>> circle_3d.center
Point([1., 1., 1.])

>>> circle_3d.radius
2.449489742783178

The circle and points can be plotted as follows (plot created using the `example_1.py` script located in the `examples` folder):

>>> import matplotlib.pyplot as plt
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111, projection="3d")
>>> circle_3d.plot(ax)

.. figure:: examples/example_1.svg



Acknowledgment
--------------
This package is based on the scikit-spatial_ library by Andrew Hynes and the algorithm is based on the algorithm provided by the MESHLOGIC_ webiste.

.. _scikit-spatial: https://github.com/ajhynes7/scikit-spatial
.. _MESHLOGIC: https://meshlogic.github.io/posts/jupyter/curve-fitting/fitting-a-circle-to-cluster-of-3d-points/
