Metadata-Version: 2.4
Name: stl-find-ball
Version: 0.1.3
Summary: find ball structure in a certain .stl model.
License: MIT
License-File: LICENSE
Author: GGN_2015
Author-email: neko@jlulug.org
Requires-Python: >=3.10, <3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: tqdm
Requires-Dist: trimesh
Requires-Dist: vtk
Description-Content-Type: text/markdown

# stl_find_ball
find ball structure in a certain .stl model.

## Installation

```bash
pip install stl_find_ball
```

## Usage

```python
from stl_find_ball import locate_sphere_in_stl, vtk_visualization
import json

# input your stl filepath
STL_FILE = "BONE-1.stl"

# detected_spheres is a list of tuple
# tuple: ((center_x, center_y, center_z), radius)
detected_spheres = locate_sphere_in_stl(stl_path=STL_FILE)

# visualize the balls with stl model with VTK
vtk_visualization(
    stl_path=STL_FILE, 
    spheres=detected_spheres
)

# Output json form data
with open(STL_FILE[:-4] + ".json", "w") as fp:
    fp.write(json.dumps(detected_spheres, indent=4))
```

