Skip to main content

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))

Metadata

Release files for stl-find-ball 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stl-find-ball 0.1.4
File Size Uploaded
stl_find_ball-0.1.4.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stl-find-ball 0.1.4
File Interpreter ABI Platform
stl_find_ball-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / stl_find_ball-0.1.4.tar.gz

Download URL stl_find_ball-0.1.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2150e06a2b56957652e2fedda3fa769e4d372e9a7f675e583ddf307fdd2d1d54
BLAKE2b-256 checksum
How to use checksums
106e08dd173ee2fe46d7641d0c0a6065b0313ffcc48cee7d94bacfb9fcea0382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Windows/10

Release files / stl_find_ball-0.1.4-py3-none-any.whl

Download URL stl_find_ball-0.1.4-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c983a027d0de7c4519cf4ba9dd9c7bfb554b2ce0aea4db2477175329fdbeaf09
BLAKE2b-256 checksum
How to use checksums
f98b136f2222d0ca515099c5acea8a4cf17b381edc1c9d3f60c368939d973329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Windows/10

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page