Skip to content

Add bone sketch tool; extrude Both sides default; wasm CMake fixes - #256

Open
trailcode wants to merge 12 commits into
mainfrom
Trailcode/add-bone
Open

Add bone sketch tool; extrude Both sides default; wasm CMake fixes#256
trailcode wants to merge 12 commits into
mainfrom
Trailcode/add-bone

Conversation

@trailcode

@trailcode trailcode commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add bone sketch tool (Shift+U / mode.add_bone): centers, radii, waist, optional holes and Bone A / Bone B nodes; commits outline then exits to Sketch inspection
  • Extrude Options Both sides defaults to on (session sticky)
  • Wasm: reliable Emscripten detect on modern emsdk; link FreeType from the OCCT wasm install

Fixes #255

Test plan

  • Add bone: two centers, r1, r2, waist (Holes None) — outline commits; mode becomes Sketch inspection
  • Holes One radius / Two radii; hole >= outer radius shows toast and ignores click
  • Options Add center nodes off/on; Bone A / Bone B when on; prefs survive restart (gui.bone_*)
  • Extrude: Both sides checked by default on fresh session
  • Hotkey Shift+U / remappable mode.add_bone; toolbar icon present
  • Desktop RelWithDebInfo or Release build; focused skt_tests if available
  • Wasm: emcmake prints * C++ compiler: Emscripten and Using FreeType (wasm); link succeeds (no -lfreetype error)

Note

Medium Risk
New sketch geometry and undo paths add moderate complexity; wasm CMake changes affect all Emscripten link/configure flows but are localized to build scripts.

Overview
Adds an Add bone sketch workflow (Shift+U / mode.add_bone): pick two centers, end radii, waist width, then optional holes. It builds a closed connecting-rod outline (tangent waist arcs), optional Bone A / Bone B center nodes, and returns to Sketch inspection after one commit instead of staying in the tool. Options Add center nodes and Holes persist as gui.bone_add_center_nodes and gui.bone_holes.

Supporting changes include Sketch::add_bone, bone geometry in utl_geom (make_bone_wire / compute_bone_geom), skt_tools_bone.cpp, sketch undo tweaks for promoted center nodes and names, and a documented Options layout (tool-specific block above Sketch options). Extrude sketch face now defaults Both sides to on for the session.

Wasm builds detect Emscripten via EMSCRIPTEN / CMAKE_SYSTEM_NAME (not only em++ in the compiler path), resolve FreeType from the OCCT wasm install, and link freetype so linking no longer fails on bare -lfreetype. Docs, changelog, icon, and default hotkeys/settings are updated accordingly.

Reviewed by Cursor Bugbot for commit 61b156b. 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.

Cursor Bugbot has reviewed your changes using high 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 61b156b. Configure here.

Comment thread src/mode.h
X(Sketch_add_circle) \
X(Sketch_add_circle_3_pts) \
X(Sketch_add_slot) \
X(Sketch_add_bone) /* two centers, then r1, r2, waist clicks */ \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Saved mode values shift

Medium Severity

Sketch_add_bone is inserted in the middle of EZY_MODE_LIST, but projects store mode as that enum’s integer. Files saved before this change reopen Dimension, Cross-section, Align shafts, and Set frame as the next tool (Dimension becomes Add bone). mode.h already notes that reordering needs a migration.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 61b156b. Configure here.

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.

Add bone sketch tool; extrude Both sides default; wasm CMake/link fixes

1 participant