Skip to content

feat: add Measurement Tool (Feature 9)#19

Merged
kraulerson merged 20 commits intomainfrom
feat/measurement-tool
Apr 9, 2026
Merged

feat: add Measurement Tool (Feature 9)#19
kraulerson merged 20 commits intomainfrom
feat/measurement-tool

Conversation

@kraulerson
Copy link
Copy Markdown
Owner

Summary

  • Point-to-point distance measurement on mesh surfaces with dedicated measure mode (M key)
  • 3-measurement max with FIFO replacement, crosshair cursor, click-vs-drag detection
  • Measurements displayed in InfoPanel with color-coded entries; invalidated on mesh geometry changes

Implementation

  • Measurement frozen dataclass + compute_distance in mesh_data.py
  • MeshDocument extended with measurements list, FIFO add, gap-filling index
  • MeasurementManager creates VTK line + numbered endpoint actors (3 colorblind-safe colors)
  • SceneManager gains pick_surface_point (vtkCellPicker), show/hide measurements, pending point
  • InfoPanel gains Measurements collapsible section with distance + coordinates
  • MainWindow gains measure mode toggle, QEvent filter on VTK interactor, Clear Measurements action, invalidation on transform/repair/undo/redo/load

Test plan

  • 72 new tests (491 total), all passing
  • Manual test: load mesh, press M, click two points, verify distance in info panel
  • Manual test: place 4th measurement, verify oldest replaced (FIFO)
  • Manual test: transform mesh, verify measurements cleared
  • Manual test: orbit while in measure mode (left-drag should rotate, not place point)

🤖 Generated with Claude Code

Karl Raulerson and others added 20 commits April 8, 2026 15:50
Framework upgrade artifact — living index of features built during
Phase 2 construction, populated from design specs and git history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ase 2

Framework upgrade artifact — covers all 8 features, 4 UAT sessions,
security mitigations, and infrastructure established during construction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Framework upgrade artifact — all 7 bugs from UAT session 4 documented
with severity, status (all Fixed), and session summary table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ADR-0001: Architecture selection (Python + PySide6 + VTK stack)
ADR-0002: Python 3.13 version selection (3.14 compatibility chain failure)
ADR-0003: Nuitka packaging with targeted --include-module for VTK
ADR-0004: STL as primary mesh format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 7 init steps verified: remote repo, branch protection, CI pipeline,
project scaffolding, data model, pre-commit hooks, final verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two documents covering the full public API:
- mesh-operations.md: data types, loader, exporter, analysis, repair, transform
- viewport.md: main window, viewport, info panel, transform dialog, VTK adapter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added: Engineering Principles (priority hierarchy + best practices),
Artifact Locations, Process enforcement commands, Context Health Check,
Phase 2 Completion Checkpoint, Phase 3-4 Documentation, UAT HTML template
reference, Qdrant Persistent Memory section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added <!-- Last Updated --> freshness markers to all 16 sections,
ADR cross-references in Section 3, UAT Plan table format, and
revision history entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Records approval date, key architecture decisions, scope, risk
assessment, and Phase 2 progress at time of snapshot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documentation artifact remediation: 10 new templates in templates/generated/,
UAT HTML template in templates/uat/, new artifact directories.

Process enforcement: process-checklist.sh state machine, pre-commit-gate.sh
commit gating, track-tool-usage.sh, updated session hooks and scripts.

Updated framework reference docs (builders-guide, governance, user-guide).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dedicated measure mode (M key), point-to-point surface distance,
3-measurement FIFO cap, info panel display, vtkCellPicker ray-cast.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vtkImplicitPlaneWidget2 for direct manipulation, floating overlay
with X/Y/Z presets and Reset, vtkClipClosedSurface for interior
fill with terracotta cap color, C key toggle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Feature 9 (Measurement Tool): 8 tasks covering Measurement dataclass,
MeasurementManager, vtkCellPicker ray-cast, info panel section,
measure mode with event filter, FIFO replacement, invalidation.

Feature 10 (Cross-Section Slice Plane): 8 tasks covering
SlicePlaneManager with vtkClipClosedSurface, SliceOverlayWidget,
vtkImplicitPlaneWidget2 interaction, preset positioning, Nuitka config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…MeasurementManager

Task 1: Measurement frozen dataclass + compute_distance function
Task 2: MeshDocument.measurements list with add_measurement (3-max FIFO),
        clear_measurements, and next_measurement_index (gap-filling)
Task 3: MeasurementManager creates VTK line + endpoint marker actors
        with 3 colorblind-safe colors (amber, sky blue, light green)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tasks 4-6:
- pick_surface_point using vtkCellPicker for ray-mesh intersection
- show/hide measurements + pending point actor lifecycle in SceneManager
- Measurements collapsible section in InfoPanel with color indicators,
  distance, and coordinates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…o MainWindow

Tasks 7-8:
- M key toggle for dedicated measurement mode with crosshair cursor
- Event filter on VTK interactor: click (not drag) places points
- Qt-to-VTK Y-flip for correct ray-cast coordinates
- Clear Measurements action in Edit menu
- _invalidate_measurements called from transform, repair, undo, redo, load
- 30 UI tests covering actions, mode toggle, clear, and invalidation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes mypy attr-defined errors — QEvent doesn't have button() or
position(), but QMouseEvent does. isinstance check narrows the type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that non-QMouseEvent events (e.g., FocusIn) pass through
the measure mode event filter without error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers the fix: sort imports commit — verifies Measurement and
MeshData are both importable from mesh_data module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kraulerson kraulerson merged commit 4ca8196 into main Apr 9, 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