{"id":49221967,"url":"https://github.com/cfd-dev/pygui","last_synced_at":"2026-04-24T04:06:09.236Z","repository":{"id":329946916,"uuid":"1121092831","full_name":"cfd-dev/PyGUI","owner":"cfd-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-22T12:46:23.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T23:46:42.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfd-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-22T12:28:44.000Z","updated_at":"2025-12-22T12:46:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cfd-dev/PyGUI","commit_stats":null,"previous_names":["cfd-dev/pygui"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cfd-dev/PyGUI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfd-dev%2FPyGUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfd-dev%2FPyGUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfd-dev%2FPyGUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfd-dev%2FPyGUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfd-dev","download_url":"https://codeload.github.com/cfd-dev/PyGUI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfd-dev%2FPyGUI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32208501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-24T04:06:02.286Z","updated_at":"2026-04-24T04:06:09.231Z","avatar_url":"https://github.com/cfd-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VTK 3D模型查看器\n\n一个基于VTK的3D模型查看器，支持多种GUI框架，用于读取和可视化VTK文件。\n\n## 功能特性\n\n1. **核心功能**：读取并可视化显示vtk文件的3D模型数据\n2. **菜单栏**：包含文件操作相关选项，实现文件浏览和导入功能\n3. **主视图区**：用于显示VTK渲染的3D模型，支持基本的交互操作（旋转、缩放、平移）\n4. **左侧模型树**：以层级结构展示导入模型的组成部分和属性信息\n5. **选项卡面板**：集成文件浏览和导入功能，提供直观的文件选择界面\n6. **显示模式切换**：支持线框模式、实体模式和实体-线框模式\n7. **背景颜色设置**：支持预设颜色和自定义颜色\n8. **用户设置持久化**：支持保存和加载显示模式及背景颜色设置\n\n## 支持的文件格式\n\n- .vtk（包括polydata、unstructured_grid和structured_grid类型）\n\n*注意：虽然项目目录中包含.cgns文件，但当前代码不支持CGNS格式。*\n\n## 技术实现\n\n- 使用Python作为开发语言\n- 使用VTK库进行3D渲染\n- 提供两种GUI框架选项：Tkinter 和 PyQt5\n- 支持conda PyMeshGen虚拟环境\n\n## 环境配置\n\n### 前提条件\n\n- 已安装conda\n- 已创建PyMeshGen虚拟环境\n\n### 安装依赖\n\n```bash\nconda activate pymeshgen\npip install vtk\npip install pyqt5  # For PyQt5 versions (if needed)\n```\n\n## 运行应用程序\n\n### Tkinter版本（推荐）\n\n```bash\nconda activate pymeshgen\npython main_tk_simple.py    # 推荐的精简Tkinter版本\n```\n\n或者运行其他版本：\n\n```bash\nconda activate pymeshgen\npython main_tk.py           # 完整Tkinter版本\n```\n\n### PyQt5版本\n\n```bash\nconda activate pymeshgen\npython main_simple.py       # 精简PyQt5版本\npython main.py              # 完整PyQt5版本\n```\n\n### 使用conda run\n\n```bash\nconda run -n pymeshgen python main_tk_simple.py\n```\n\n## 使用说明\n\n1. **打开文件**：\n   - 点击菜单栏的「文件」→「打开」\n   - 或点击左侧面板的「浏览文件」按钮\n   - 选择.vtk文件进行打开\n\n2. **查看模型**：\n   - 在主视图区使用鼠标进行旋转、缩放和平移操作\n   - 旋转：按住鼠标左键拖动\n   - 缩放：滚动鼠标滚轮\n   - 平移：按住鼠标右键拖动\n\n3. **查看模型信息**：\n   - 左侧模型树显示模型的详细信息，包括：\n     - 数据类型\n     - 点数量\n     - 单元数量\n     - 网格类型\n     - 文件路径\n\n4. **导入模型**：\n   - 在左侧面板的「文件导入」选项卡中，点击「浏览文件」选择文件\n   - 点击「导入模型」按钮导入模型\n\n5. **切换显示模式**：\n   - 通过菜单栏「视图」→「显示模式」选择\n   - 或通过左侧面板的「设置」选项卡选择\n\n6. **更改背景颜色**：\n   - 通过菜单栏「视图」→「背景颜色」选择\n   - 或通过左侧面板的「设置」选项卡选择预设颜色或自定义颜色\n\n## 错误处理\n\n- 如果文件不存在，会显示「文件不存在」错误\n- 如果文件格式不支持，会显示「不支持的文件格式，仅支持.vtk文件」错误\n- 如果VTK文件无效，会显示「无效的VTK文件，无法读取模型数据或数据为空」错误\n\n## 质量标准\n\n- 应用程序启动正常，无明显卡顿\n- 功能按钮响应及时\n- 错误提示信息清晰易懂\n- VTK渲染性能流畅，模型显示准确\n- 窗口大小调整时视图保持正常\n\n## 文件结构\n\n```\nPyGUI/\n├── main.py               # 完整PyQt5版本主应用程序文件\n├── main_simple.py        # 精简PyQt5版本主应用程序文件\n├── main_tk.py            # 完整Tkinter版本主应用程序文件\n├── main_tk_simple.py     # 推荐的精简Tkinter版本主应用程序文件\n├── README.md             # 说明文档\n├── viewer_settings.json  # 用户设置保存文件\n├── tmp_mesh_opt.vtk      # 示例VTK文件\n├── 30p30n.cgns           # 示例CGNS文件（当前不支持）\n└── 30p30n.vtk            # 示例VTK文件\n```\n\n## 开发说明\n\n- 代码结构清晰、模块化\n- 实现了文件路径选择、文件格式验证和错误处理机制\n- 界面布局合理、响应式，各组件间交互流畅\n- 提供多个版本以适应不同GUI框架偏好\n- 包含设置持久化功能，提升用户体验\n\n## 许可证\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfd-dev%2Fpygui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfd-dev%2Fpygui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfd-dev%2Fpygui/lists"}