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 = "./test_data/Bone-1.new.stl"
# detected_spheres is a list of tuple
# tuple: ((center_x, center_y, center_z), radius, point_per_area)
detected_spheres = locate_sphere_in_stl(stl_path=STL_FILE, max_ball_cnt=4)
# visualize the balls with stl model with VTK
vtk_visualization(
stl_path=STL_FILE,
spheres=detected_spheres
)
# Output json form data
detected_spheres = [item[:2] for item in detected_spheres]
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.4.tar.gz
(6.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.4.tar.gz.
File metadata
- Download URL: stl_find_ball-0.1.4.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.10.20 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2150e06a2b56957652e2fedda3fa769e4d372e9a7f675e583ddf307fdd2d1d54
|
|
| MD5 |
e8f10f2df0c9c362a88acbbead16c6ce
|
|
| BLAKE2b-256 |
106e08dd173ee2fe46d7641d0c0a6065b0313ffcc48cee7d94bacfb9fcea0382
|
File details
Details for the file stl_find_ball-0.1.4-py3-none-any.whl.
File metadata
- Download URL: stl_find_ball-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.10.20 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c983a027d0de7c4519cf4ba9dd9c7bfb554b2ce0aea4db2477175329fdbeaf09
|
|
| MD5 |
ea981cc515fc019560d842515d84ddf8
|
|
| BLAKE2b-256 |
f98b136f2222d0ca515099c5acea8a4cf17b381edc1c9d3f60c368939d973329
|