Skip to content

feat: add interactive Plotly 3D view to GUI#147

Merged
ccaprani merged 6 commits intomainfrom
claude/relaxed-gates
Mar 19, 2026
Merged

feat: add interactive Plotly 3D view to GUI#147
ccaprani merged 6 commits intomainfrom
claude/relaxed-gates

Conversation

@ccaprani
Copy link
Copy Markdown
Member

@ccaprani ccaprani commented Mar 19, 2026

Summary

  • Add interactive 3D model visualization to the GUI using Plotly + QWebEngineView
  • After clicking Create Geometry, the model renders in a rotatable/zoomable 3D view
  • Falls back gracefully to a help message if PyQtWebEngine is not installed
  • Add PyQtWebEngine to the gui optional dependency
  • Rename docs sidebar entry from "GUI — ospgui" to "GUI"

Test plan

  • Install with pip install -e ".[gui]" and launch ospgui
  • Click Create Geometry and verify 3D model appears in the "3D View" tab
  • Verify rotation, zoom, and pan work in the 3D view
  • Verify Code View tab still shows generated Python code
  • Verify docs build passes

🤖 Generated with Claude Code

ccaprani and others added 6 commits March 19, 2026 20:54
- Replace commented-out QLabel viz tab with QWebEngineView that renders
  an interactive Plotly 3D model after Create Geometry is clicked
- Add PyQtWebEngine to gui optional dependency
- Graceful fallback if PyQtWebEngine is not installed
- Rename docs menu entry from "GUI — ospgui" to "GUI"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Strip og.plot_model() line from exec'd code when QWebEngineView is
  available, preventing the matplotlib window from popping up
- Position plotly legends outside the plot area with right margin

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Left/Right skew angles: 0 -> 5 degrees
- Longitudinal beams: 5 -> 7
- Mesh type: Ortho -> Oblique (listed first)
- Material grade: 32MPa -> 65MPa

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… browser

Patch plt.show() as a no-op during exec so the matplotlib window
doesn't pop up, but keep og.plot_model() in the generated code so
saved scripts work standalone. When QWebEngineView is unavailable,
fall back to opening the plotly 3D view in the system browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lback

- Add GUI screenshot to docs page
- Move Code View tab to the left of 3D View tab
- Suppress plt.show() during GUI exec to prevent matplotlib popup
- Fall back to opening plotly 3D view in system browser when
  QWebEngineView is unavailable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ccaprani ccaprani merged commit c9b22f0 into main Mar 19, 2026
9 checks passed
@ccaprani ccaprani deleted the claude/relaxed-gates branch March 19, 2026 10:28
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.

1 participant