ANYtk3D
Fast dependency-free 3D drawing on a Tkinter Canvas.
ANYtk3D is the standalone 3D viewport extracted from
ANYstructure. It renders
stiffened plates, cylinders and general 3D geometry directly on a
tkinter.Canvas — no OpenGL, no matplotlib, only numpy and the
standard library.
Features
- Camera orbit, zoom and pan with cached static geometry and throttled redraws for smooth interaction
- Painter-order occlusion with back-face culling and adaptive subdivision around ring girder elevations
- Stiffened cylinders (longitudinal and ring stiffeners, inside or outside the shell) and stiffened flat plates with girders
- Open-ended cylinders and stippled semi-transparent shells for viewing internal structure; two-sided shell rendering
- Plate colour-coding by thickness (or any scalar) with a fixed legend
- Global X/Y/Z axis-orientation overlay and optional axis rulers
- Simple animation caching / playback
Installation
pip install ANYtk3D
Tkinter ships with the standard CPython installers.
Quick start
import tkinter as tk
from anytk3d import Point3D, Tkinter3DCanvas
root = tk.Tk()
canvas = Tkinter3DCanvas(root, width=900, height=600, bg='white')
canvas.pack(fill='both', expand=True)
canvas.add_cylinder(radius=6.5, height=20.0, center=Point3D(0, 0, 10.0),
color='lightsteelblue', opacity=0.6)
canvas.add_ring_stiffener(radius=6.5, z_position=5.0,
web_height=0.5, web_thickness=0.015)
canvas.add_rectangular_plate(x_start=-3, x_end=3, y_start=-2, y_end=2)
canvas.redraw()
root.mainloop()
Higher-level primitives: add_cylinder, add_longitudinal_stiffener,
add_ring_stiffener, add_rectangular_plate, add_flat_stiffener,
add_flat_girder, add_polygon, add_line, add_text.
Demo
Four viewports showing a stiffened cylinder and a stiffened plate in two rendering styles:
python -m anytk3d
or embed the demo in an existing Tk application with
anytk3d.create_stiffened_cylinder_demo(root).
Relation to ANYstructure
ANYstructure uses this package for its 3D previews. The module keeps
its original API (Tkinter3DCanvas, Point3D, Camera3D) so it can
be consumed as a drop-in dependency.
Development
pip install -e .[dev]
pytest
License
GPL-3.0-or-later. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 anytk3d-0.1.0.tar.gz.
File metadata
- Download URL: anytk3d-0.1.0.tar.gz
- Upload date:
- Size: 37.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8edf6f6a2c79a4db643bf4d009a114c616f866d441a572a79cda22d98a182e52
|
|
| MD5 |
c00ae1edbc7265475f12f9f365fc2b27
|
|
| BLAKE2b-256 |
9a07e3fb83f743b9f1a3eddbdf7f22aa944627c1bfc9ebe58ddf9d77e9bfd081
|
File details
Details for the file anytk3d-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anytk3d-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11815b36f3c09e31caa76eb7f79e636a58b78235999b83688b3602ea9abb3e81
|
|
| MD5 |
f8e7b880bce497db9c4106566ce44cc9
|
|
| BLAKE2b-256 |
1473ae078a67666acb5471610a5f4b18afd52498e28cf8bf6720d057604b724e
|