yostlabs-graphics
This package is part of the yostlabs python package system. It provides a simple 3D graphics engine utilizing OpenGL. It is intended for use with YostLabs orientation sensors to visualize data, but simply supports loading basic 3D models into a scene graph, allowing for transform manipulation, and rendering. It alo has support for integrating with DearPyGui, a python library that allows quickly creating GUIs for rapid prototyping.
Features
- Scene Graph: Hierarchical game object system with parent-child transforms
- Core Objects: Camera, Scene, ModelObject (OBJ files), TextMesh(BillBoard), ArrowObject, HudOverlay
- Prefab Objects: TriAxesObject, LabeledTriAxesObject for axis visualization
- Pre-built Scenes: CameraScene, OrientationScene with automatic camera setup
- OpenGL Context: GL_Context for window and OpenGL initialization
- DearPyGui Integration: Render to a DearPyGui window via the texture system
Installation
pip install yostlabs-graphics
Optional dependencies:
pip install yostlabs-graphics[dpg] # DearPyGui backend support
pip install yostlabs-graphics[sensor] # Yost Labs sensor integration
Usage
import glfw
from yostlabs.graphics import GL_Context
from yostlabs.graphics import ModelObject, Font, resources
from yostlabs.graphics.scene_prefabs import OrientationScene
# Initialize the OpenGL context
GL_Context.init(window_width=600,
window_height=600,
window_title="3D Viewer",
visible=True)
# Load resources from the package (fonts and models are bundled)
model_path = resources.get_model_path('DL-3.obj')
font_path = resources.get_font_path('arial.ttf')
# Create objects
model = ModelObject("MyModel", model_path)
font = Font(font_path)
# Create a 3D scene with orientation visualization
scene = OrientationScene(600, 600, model, font=font)
# Main rendering loop
window = GL_Context.get_window()
while not glfw.window_should_close(window):
glfw.poll_events()
scene.render()
glfw.swap_buffers(window)
GL_Context.cleanup()
For additional examples of constructing scenes, integrating with sensors, and DearPyGUI support, please refer to the Examples Folder.
Resource Access
The package bundles fonts and 3D models that can be accessed via the resources module:
from yostlabs.graphics import resources
# Get path to a system or bundled font
font_path = resources.get_font_path('arial.ttf')
# Get path to a bundled model
model_path = resources.get_model_path('DL-3.obj')
# List all available resources
fonts = resources.list_available_fonts() # ['arial.ttf', ...]
models = resources.list_available_models() # {'Camera': ['Camera.obj'], 'DataLogger': [...], ...}
Note: All bundled sensor models (DataLogger, Embedded) are modeled in units of meters.
Sensor Animation Utility
The package includes a ready-to-use tool for visualizing Threespace Sensor orientation in real-time. This utility automatically connects to a Threespace Sensor and displays its 3D orientation with an appropriate sensor model.
Requirements:
pip install yostlabs-graphics[sensor]
Command-line usage:
# Auto-discover sensor and display tared orientation
python -m yostlabs.tools.animate_sensor
# Display untared orientation
python -m yostlabs.tools.animate_sensor --untared
# Custom window size
python -m yostlabs.tools.animate_sensor --width 800 --height 600
Programmatic usage:
from yostlabs.tools.animate_sensor import animate_sensor
# Auto-discover sensor and show tared orientation
animate_sensor()
# Or provide your own sensor instance
from yostlabs.tss3.api import ThreespaceSensor
sensor = ThreespaceSensor()
animate_sensor(sensor=sensor, use_tared=True, window_width=800, window_height=600)
Controls:
- WASD + Space/Shift: Move camera
- Mouse drag (right button): Rotate camera
- ESC or close window: Exit
Package Structure
yostlabs.graphics.core: Core scene graph and rendering objects (GameObject, Scene, Camera, etc.)yostlabs.graphics.prefabs: Specialized visualization objects (TriAxesObject, LabeledTriAxesObject)yostlabs.graphics.scene_prefabs: Pre-configured scene templates (CameraScene, OrientationScene)yostlabs.graphics.context: OpenGL context management (GL_Context)yostlabs.graphics.texture_renderer: Framebuffer/texture renderingyostlabs.graphics.font: Font loading and text renderingyostlabs.graphics.loaders: Resource loaders (OBJ file parser)yostlabs.graphics.resources: Package resource utilities (fonts, models, shaders)yostlabs.graphics.dpg: DearPyGui backend integrationyostlabs.graphics.glfw: GLFW backend specific components
Metadata
Release files for yostlabs-graphics 2026.6.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| yostlabs_graphics-2026.6.8.tar.gz | 888.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yostlabs_graphics-2026.6.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.8 MB
Release files / yostlabs_graphics-2026.6.8.tar.gz
| Download URL | yostlabs_graphics-2026.6.8.tar.gz |
|---|---|
| Size | 888.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bd15067239b6f4aa55655be88817cecdd6956cd0a70ed45bfb9fbc39e6281d6
|
|
BLAKE2b-256 checksum How to use checksums |
7183ce004eeadbb34302b333aa82c338eeebc63cc8317d8ad6c8a3cb5ac95053
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.11
|
Release files / yostlabs_graphics-2026.6.8-py3-none-any.whl
| Download URL | yostlabs_graphics-2026.6.8-py3-none-any.whl |
|---|---|
| Size | 907.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a72ce265c405630bbba05a607d9ecfd7da254264f677f08da0bf37b13752f18f
|
|
BLAKE2b-256 checksum How to use checksums |
ce014cdd494ac61d5910ed0d26a0400ae8413cf522b7c0b3a1a5e33a565b224d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.11
|
Security for yostlabs-graphics 2026.6.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.