Skip to content

Local/World transform space, rotate about assigned axis, and Shape List row context menu - #266

Merged
trailcode merged 9 commits into
mainfrom
Trailcode/shp-axis-improve
Sep 16, 2026
Merged

trailcode merged 9 commits into
mainfrom
Trailcode/shp-axis-improve

Conversation

@trailcode

@trailcode trailcode commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Move / rotate / scale share Local (default: first selected solid's frame) or World (global XYZ at that solid's bbox center), persisted as gui.transform_space.
  • Rotate keeps X/Y/Z or view-to-object chosen before the first drag and rotates about the assigned axis; when the view faces that axis, the drag uses the perpendicular plane.
  • Shape List right-click opens the row menu from the whole entry (checkboxes, M, tree arrow, name field, padding), not only some widgets.
  • Shape List and Shape info move to gui_shp_pane.cpp; row drawing is gui_shp_detail::Shape_list_row_drawer instead of a recursive lambda in gui.cpp.

Test plan

  • Build Release EzyCad and EzyCad_tests
  • Run EzyCad_tests filters covering Transform_axes, Transform_translation, Rotate_axis, Set_frame
  • Assign a cylinder frame (Set from cylindrical face, Show axes on): Rotate Local + Z spins about the cylinder axis, not world Z through bbox
  • Choose X/Y/Z in Options before moving the mouse; first drag uses that axis
  • Face the constrained axis and drag: rotation stays about that axis (axis-plane gesture)
  • Move and Scale: Local uses frame origin/axes; World uses bbox center + global XYZ; setting survives restart
  • Shape List: right-click vis checkbox, M, tree arrow, name field, and gaps between widgets — same menu
  • Spot-check docs/usage.md Move/Rotate/Scale + Shape List, usage-settings.md transform_space, CHANGELOG

Notes


Note

Medium Risk
Changes interactive transform math and pivot behavior for core modeling tools; incorrect rebasing or axis capture could mis-apply geometry until undo.

Overview
Adds Local vs World transform space for Move, Rotate, and Scale (Options + persisted gui.transform_space). Local uses the first selected solid’s assigned frame; World uses global XYZ at that solid’s bbox center. Shared logic lives in shp_transform, and move/rotate/scale pivots and constrained axes follow the chosen space.

Rotate is reworked: X/Y/Z and view-to-object can be set before the first drag; the drag plane and view-to-object axis are frozen on the first sample so orbit/pan does not retarget the gesture; constrained axes rotate about the assigned frame axis with a perpendicular plane when the view faces the axis; switching Local/World mid-drag re-baselines the mouse anchor while keeping the current angle. Scale similarly re-baselines mid-drag so the factor does not jump.

The Shape List moves to gui_shp_pane.cpp (Shape_list_row_drawer); right-click opens the row context menu anywhere on the row (not only name/M). Docs, default settings, scripting JSON, and tests cover transform space and the new rotate/scale behavior.

Reviewed by Cursor Bugbot for commit 2cf74f3. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/shp_rotate.cpp Resolved
Comment thread src/shp_scale.cpp Resolved
Comment thread src/shp_rotate.cpp Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2cf74f3. Configure here.

Comment thread src/shp_rotate.cpp
return;

// Drop the world-space mouse anchor; update_rotate_from_world_ recaptures so the angle stays.
clear_all(m_initial_mouse_pos, m_rotate_pln, m_captured_axis_dir);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space switch drops captured view axis

Medium Severity

A mid-drag Local/World switch clears m_captured_axis_dir and m_rotate_pln for every rotate mode, including View-to-object. That axis does not depend on transform space, so after an orbit the preview immediately reapplies the kept angle around the live camera direction instead of the frozen first-sample axis.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2cf74f3. Configure here.

@trailcode
trailcode merged commit 1599d0f into main Sep 16, 2026
4 checks passed
@trailcode
trailcode deleted the Trailcode/shp-axis-improve branch September 16, 2026 23:41
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.

Local/World transform space, rotate about assigned axis, and Shape List row context menu

1 participant