A modern OpenGL STL mesh viewer using ModernGL and ImGui
Project description
MeshViewer
A modern 3D mesh viewer built with ModernGL and GLFW for visualizing STL and OBJ files.
Features
- Load and visualize STL and OBJ 3D mesh files
- Interactive camera controls:
- Left-click drag: Rotate view (arcball rotation)
- Right-click drag: Pan view
- Scroll wheel: Zoom in/out
- Ctrl+Left-click: Pick point on mesh (prints coordinates to console)
- Shader-based rendering with proper lighting
- 3D axis visualization
- Support for multiple meshes with different colors
Installation
Prerequisites
- Python 3.8+
- OpenGL 3.3+ compatible graphics hardware and drivers
Install from source
# Clone the repository
git clone https://github.com/yourusername/meshviewer.git
cd meshviewer
# Install the package and dependencies
pip install -e .
Or install directly using pip:
pip install meshviewer
Usage
Command Line
# View a single mesh file
meshviewer path/to/your/mesh.stl
# View multiple mesh files at once
meshviewer path/to/mesh1.stl path/to/mesh2.obj
As a Python Module
from meshviewer.viewer import MeshViewer
# Create a viewer instance
viewer = MeshViewer()
# Load one or more mesh files
viewer.load_mesh("path/to/mesh.stl", color=(0.7, 0.7, 0.7))
viewer.load_mesh("path/to/another_mesh.obj", color=(0.3, 0.6, 0.9))
# Start the viewer
viewer.run()
Controls
- Left Mouse Button: Rotate the view
- Right Mouse Button: Pan the view
- Mouse Wheel: Zoom in/out
- Ctrl + Left Click: Pick a point on the mesh (coordinates printed to console)
- ESC: Exit the viewer
Dependencies
- moderngl: OpenGL wrapper
- glfw: Window and input management
- numpy: Numerical operations
- pyglm: Math library for 3D operations
- trimesh: Mesh processing
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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
meshviewer-0.1.4.tar.gz
(13.2 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 meshviewer-0.1.4.tar.gz.
File metadata
- Download URL: meshviewer-0.1.4.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3a8e653b8b995a1f5471d08c08c6b7c3cf415014541bd1dd5bcbdb411de4b11
|
|
| MD5 |
ff5947e56d489306e21bd5d5955fa0d2
|
|
| BLAKE2b-256 |
6d395636ced438166ee8ff160de73ba572c445008cad170f5477bb90ced862ed
|
File details
Details for the file meshviewer-0.1.4-py3-none-any.whl.
File metadata
- Download URL: meshviewer-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4045a259cfb0186c951014c6e393da731968e1917d9374a56f255f9be298ae74
|
|
| MD5 |
b6727ce9da5d610ccb088b900ed9aeba
|
|
| BLAKE2b-256 |
0843d7a47458c5705528092add14485eb1c527adc055c3a55de3b7798559ed2f
|