Add Align cylinders tool for shaft-into-hole placement - #240
Merged
Conversation
added 2 commits
August 1, 2026 17:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mode::Shape_cyl_align, default J /mode.cyl_align): pick two cylindrical faces (first moves), coaxially align, drag insert depth along the shared axis, then bake like Move/Rotate.cylinder_from_faceandcyl_align_trsfinutl_geom; newShp_cyl_alignop with Options Flip direction and radius-mismatch log warning.usage.md,shape.md,gui.md,CHANGELOG[Unreleased]; hotkey default inres/ezycad_settings.json.Closes #239
Test plan
EzyCadNote
Medium Risk
New interactive transform that permanently changes solid geometry and frame/undo state; logic depends on cylindrical face detection and alignment math, but it follows the same patterns as existing move/rotate tools.
Overview
Adds Align cylinders (
Mode::Shape_cyl_align, default J /mode.cyl_align): a one-shot transform for placing a shaft in a hole by picking two cylindrical faces, coaxially aligning the first body to the second, then dragging or Tab-typing insert depth along the shared axis. Flip direction in Options reverses axis sense; mismatched radii log a warning but still allow placement. Finalize bakes geometry like Move/Rotate viaShape_geom_deltaundo.New
Shp_cyl_alignandutl_geomhelpers (cylinder_from_face,cyl_align_trsf) implement face detection and rigid alignment. GUI wiring covers toolbar, hotkeys, face selection mode, LMB pick/finalize, depth drag, Esc cancel, and undo history treats the mode like other interactive transforms.Occt_view::set_dynamic_highlight_enabledis exposed and turned off during depth drag to avoid stale hover highlights.User docs (
usage.md,shape.md,gui.md,CHANGELOG) and defaultgui.hotkeysare updated. Minor unrelated cleanup:main.cppPython queue brace formatting.Reviewed by Cursor Bugbot for commit 2336222. Bugbot is set up for automated code reviews on this repo. Configure here.