Skip to content

feat: Add Python-based chamfered View Cube for 3D CAD navigation#435

Open
PredictiveManish wants to merge 2 commits intoosdag-admin:devfrom
PredictiveManish:dev
Open

feat: Add Python-based chamfered View Cube for 3D CAD navigation#435
PredictiveManish wants to merge 2 commits intoosdag-admin:devfrom
PredictiveManish:dev

Conversation

@PredictiveManish
Copy link
Copy Markdown

Task-1: Develop a Python-based view cube for Osdag.

Summary

Replaced the crash-prone C++ AIS_ViewCube with a pure Python implementation using PySide6 and OpenCascade geometry. This resolves stability issues, especially on Linux machines.

Changes Made

New file: view_cube.py

  • Created ChamferedViewCube class using OCC's BRepFillet_MakeChamfer
  • Supports 26 interactive regions (6 faces, 8 corners, 12 edges)
  • Provides smooth view transitions to standard orientations

New file: view_cube_widget.py

  • PySide6-based overlay widget for rendering the view cube
  • Interactive drag-to-rotate functionality
  • Click-to-set-view with visual feedback
  • Highlighted faces based on current view orientation

Modified: custom_3dviewer.py

  • Integrated Python View Cube widget as primary navigation
  • Added signal/slot connection for view change events
  • Smooth 3D camera rotation on view selection

Key Features

  • Chamfered edges: Beveled cube edges for better clickability
  • Rotatable: Users can drag to rotate and see different sides
  • 26 view options: All standard views + isometric corners + edge views
  • Cross-platform stable: Pure Python - no C++ crashes
  • Hover highlights: Visual feedback on interactive regions
  • Qt integration: Uses PySide6 signals for clean event handling

Testing

  • View cube displays correctly in CAD window
  • Click on any face/corner/edge changes 3D view orientation
  • Drag rotation works smoothly
  • No crashes on Linux (tested on Ubuntu)

Related Issue

Fixes stability issues with C++ AIS_ViewCube causing crashes

Addresses: "C++ based cube has been enabled, which is leading to crashes (especially on Linux machines)"

  • This PR is to make sure the issue gets solve under FOSSHack 2026.

Note: Copyright to be transferred to Osdag Team at IIT Bombay as per task requirements.

@parthckaria
Copy link
Copy Markdown
Collaborator

Dear Manish
Thank you for your contribution. Are there any additional instructions to follow? I am encountering an error and have attached the log.
Crash-2026-03-16_12-03-26.log

@PredictiveManish
Copy link
Copy Markdown
Author

I have made some changes according to logs given by you

@parthckaria
Copy link
Copy Markdown
Collaborator

Dear Manish
This issue got resolved. I am getting another crash when I am opening any module (currently opening Fin Plate Connection). We request that you sufficiently test this before raising a PR.
Crash-2026-03-17_10-39-35.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants