Skip to content

feat: implement Feature 2 — 3D Viewport#5

Merged
kraulerson merged 10 commits intomainfrom
feature/3d-viewport
Apr 6, 2026
Merged

feat: implement Feature 2 — 3D Viewport#5
kraulerson merged 10 commits intomainfrom
feature/3d-viewport

Conversation

@kraulerson
Copy link
Copy Markdown
Owner

Summary

Implements the 3D Viewport (Feature 2 of 10) with full main window shell. The application is now end-to-end usable: open a mesh file and interact with it in 3D.

What's included

  • VtkMeshAdapter — vectorized MeshData → vtkPolyData conversion using numpy bridge (~800x faster than naive loops)
  • SceneManager (B-lite pattern) — owns mesh actor, wireframe overlay actor, headlight + ambient fill lighting, camera fit-to-view, flat/smooth shading toggle
  • ViewportWidget — QVTKRenderWindowInteractor subclass with empty/error state overlays
  • MainWindow — full rewrite with File/View/Help menus, vertical left toolbar (icon+text per accessibility), status bar, state management (empty/loading/success/error)
  • File loading integration — file dialog (Ctrl+O), drag-drop, CLI argument (meshscope model.stl)
  • Keyboard shortcuts — W (wireframe overlay), S (flat/smooth shading), F (fit to view), Ctrl+O (open), Ctrl+Q (exit)
  • Accessibility — all toolbar buttons have text labels, all actions have tooltips for screen readers, keyboard navigation for all functions
  • 60 new tests (121 total) — unit tests for adapter + scene manager, UI tests for viewport + main window + file loading integration

Architecture decision

B-lite SceneManager establishes the seam for Features 5, 9, 10 (print bed, measurements, clipping plane) to add actors without refactoring ViewportWidget. Minimal API now, extensible later.

Test plan

  • 121 tests pass (QT_QPA_PLATFORM=offscreen pytest tests/ -v)
  • All pre-commit hooks pass (ruff, semgrep, gitleaks)
  • STL/OBJ/PLY/3MF all load through full pipeline (integration tests)
  • Error states tested (corrupt files, missing files, error-after-success)
  • Manual visual verification (mesh renders, rotates, wireframe overlays)
  • Verify CI passes

🤖 Generated with Claude Code

Karl Raulerson and others added 10 commits April 6, 2026 16:00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ading

Replace the placeholder MainWindow with a full implementation that integrates
the VTK viewport, mesh loader, and scene manager. Adds File/View/Help menus,
a vertical left toolbar with Open/Wire/Shade/Fit actions, status bar with
state management, drag-and-drop support, and keyboard shortcuts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kraulerson kraulerson force-pushed the feature/3d-viewport branch from be45ad1 to d1ddc97 Compare April 6, 2026 23:28
@kraulerson kraulerson merged commit 875d81a into main Apr 6, 2026
2 of 5 checks passed
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