find ball structure in a certain .stl model.
Project description
stl_find_ball
find ball structure in a certain .stl model.
Installation
pip install stl_find_ball
Usage
from stl_find_ball import locate_sphere_in_stl, vtk_visualization
import json
# input your stl filepath
STL_FILE = "BONE-1.stl"
# the max search range of balls
# the best ALPHA is 2 * (radius of ball)
ALPHA = 0.01
# 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,
alpha=ALPHA
)
# 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))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stl_find_ball-0.1.2.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stl_find_ball-0.1.2.tar.gz.
File metadata
- Download URL: stl_find_ball-0.1.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.3 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e9c0d7370d15c0ada6073f0694745aae39cebcb5fe7fff0c248c659f996ccf7
|
|
| MD5 |
8299f784092476ebb4971ec849d21659
|
|
| BLAKE2b-256 |
399178b23a8f04e63f2c96df21eb8aa667763bc24d62f3175f7c3d53593e7dbf
|
File details
Details for the file stl_find_ball-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stl_find_ball-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.3 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2940b6536ecc9fa49b2bed671b8ebe281fea4607e325215bad60c6941bad5379
|
|
| MD5 |
c94eb9eaca34fcb8eb5d436e52ce43cc
|
|
| BLAKE2b-256 |
98d3684ebb86b8c5774ef59251ba7143376d5877f213d59f9d997cc1aa4ed248
|