Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stl_find_ball-0.1.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

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

Hashes for stl_find_ball-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8e9c0d7370d15c0ada6073f0694745aae39cebcb5fe7fff0c248c659f996ccf7
MD5 8299f784092476ebb4971ec849d21659
BLAKE2b-256 399178b23a8f04e63f2c96df21eb8aa667763bc24d62f3175f7c3d53593e7dbf

See more details on using hashes here.

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

Hashes for stl_find_ball-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2940b6536ecc9fa49b2bed671b8ebe281fea4607e325215bad60c6941bad5379
MD5 c94eb9eaca34fcb8eb5d436e52ce43cc
BLAKE2b-256 98d3684ebb86b8c5774ef59251ba7143376d5877f213d59f9d997cc1aa4ed248

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page