Skip to content

Add Twist option to sketch extrude - #228

Merged
trailcode merged 5 commits into
mainfrom
Trailcode/extrude-twist
Jul 25, 2026
Merged

Add Twist option to sketch extrude#228
trailcode merged 5 commits into
mainfrom
Trailcode/extrude-twist

Conversation

@trailcode

@trailcode trailcode commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Twist option to the sketch face Extrude tool. When enabled, the extruded profile rotates about the extrude axis as it is pulled, producing twisted solids while preserving face holes.

Closes #227.

Changes

  • Interaction: new Twist checkbox in Extrude Options; two-phase flow (drag/Tab to lock height, then drag to set twist angle about the face centroid; Shift+Tab types exact degrees). With Both sides, the mid-plane stays fixed and each end twists +/- half the angle.
  • Geometry: twisted bodies use ruled BRepOffsetAPI_ThruSections with CheckCompatibility(false) and intermediate sections (~45 deg spacing); hole wires are lofted and cut so face bores survive the twist. Straight MakePrism is retained when twist is ~0.
  • Preview + annotation: dense-face fast preview also rotates face copies during the Twist phase; the height length dimension is cleared once height is locked and replaced with an angle annotation (degrees) centered on the extruded front face.

Files Changed

  • src/shp_extrude.cpp / src/shp_extrude.h
  • src/gui_mode.cpp, src/gui_occt_view.cpp, src/gui.cpp
  • src/utl_geom.cpp / src/utl_geom.h, src/utl_types.h
  • tests/skt_tests.cpp, tests/skt_test_fixture.cpp / .h
  • docs/usage.md, docs/usage-settings.md, src/doc/{gui,shape,sketch,utility}.md, CHANGELOG.md

Related

Test Plan

  • Build EzyCad_lib and EzyCad_tests.
  • EzyCad_tests --gtest_filter=Sketch_test.ExtrudeSketchFace* (includes new ExtrudeSketchFace_Twist_solid and ExtrudeSketchFace_Twist_both_sides_solid).
  • Manual: twist a sprocket-like face; verify teeth and holes are preserved, both-sides is symmetric, and the angle annotation reads correctly.
  • Docs build and review rendered pages.

Made with Cursor

@trailcode trailcode added enhancement New feature or request sketch labels Jul 25, 2026

@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 f214ae9. Configure here.

Comment thread src/shp_extrude.cpp
@trailcode
trailcode merged commit d440ed5 into main Jul 25, 2026
4 checks passed
@trailcode
trailcode deleted the Trailcode/extrude-twist branch July 25, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sketch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sketch extrude: add Twist option

1 participant