fry-qt6-3d-widget
fry-qt6-3d-widget 是一个可复用的 PyQt6 3D 模型显示控件。它把 PyVista / VTK 的 3D 渲染能力封装成一个独立 QWidget,可以直接嵌入你的 PyQt6 应用。
组件本身不封装成 QDockWidget。如果业务应用需要 dock,只要把 FryCore3DViewer 放进 QDockWidget 即可,见 examples/dock_viewer.py。
安装
从 PyPI 安装:
pip install fry-qt6-3d-widget
本仓库开发安装:
python -m pip install -e ".[dev]"
最小使用
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow
from fry_qt6_3d_widget import FryCore3DViewer
app = QApplication(sys.argv)
window = QMainWindow()
viewer = FryCore3DViewer()
window.setCentralWidget(viewer)
viewer.load_model("path/to/model.stl")
window.resize(1200, 800)
window.show()
sys.exit(app.exec())
也可以直接运行安装后的 demo:
fry-qt6-3d-viewer path/to/model.stl
支持格式
.glb/.gltf.ply.obj.stl.vtk/.vtp/.vtu.xyz/.pts文本点云
.xyz / .pts 至少包含 X Y Z 三列;如果包含 R G B 三列,会按点颜色显示。
常用能力
- 拖拽加载模型文件
- 视角切换:等轴、正面、背面、左面、右面、顶部、底部
- 渲染模式:表面、线框、点云、表面+边
- 坐标轴、网格、地面参考开关
- 深色/浅色背景
- Y-up 输入到 Z-up 业务坐标系转换
- 点云体素 glyph 显示
- Qt 信号:加载成功、加载失败、视角变化、渲染模式变化
更多设计细节见 docs/CORE_CONCEPTS.md。
示例
python examples/basic_viewer.py path/to/model.stl
python examples/dock_viewer.py path/to/model.stl
python examples/load_xyz_points.py
测试
python -m pytest
构建与发布
python -m build
python -m twine check dist/*
python -m twine upload dist/*
第一次发布建议先用 TestPyPI:
python -m twine upload --repository testpypi dist/*
Metadata
Release files for fry-qt6-3d-widget 0.1.0
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 | Actions |
|---|---|---|---|---|
| fry_qt6_3d_widget-0.1.0.tar.gz | 20.5 kB | Without provenance | Details for fry_qt6_3d_widget-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fry_qt6_3d_widget-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fry_qt6_3d_widget-0.1.0-py3-none-any.whl |
Total release size: 36.5 kB
Release files / fry_qt6_3d_widget-0.1.0.tar.gz
| Download URL | fry_qt6_3d_widget-0.1.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05aee88dc3ca3b002e0ce9dba9c88136b479869c51334ef978f37c5ca1d4ba26
|
|
BLAKE2b-256 checksum How to use checksums |
ca1072ee2fd56b6a46b94fe53b6e290da528bc3fb8276fde41d5f13393ea64d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / fry_qt6_3d_widget-0.1.0-py3-none-any.whl
| Download URL | fry_qt6_3d_widget-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d94aaee85d9eff9d4b0259e724e1813dfe6eaa7dc42981235df1d9de363465c
|
|
BLAKE2b-256 checksum How to use checksums |
419829d6f5323b217a4f735df2a9bbc53405677df0c87b52b5fc5274e972a04e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for fry-qt6-3d-widget 0.1.0
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.