Skip to content

Sketch overlap merge, status toasts, curve segment angle, and Add bone options - #264

Merged
trailcode merged 12 commits into
mainfrom
Trailcode/sketch-topo-fixes
Sep 15, 2026
Merged

trailcode merged 12 commits into
mainfrom
Trailcode/sketch-topo-fixes

Conversation

@trailcode

@trailcode trailcode commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Closes overlapping / duplicate sketch edges: the sketch splits at overlap ends and keeps each atomic piece once. Fixes a TKGeomBase access violation when a new circle coincided with an existing arc (for example a bone end-cap).
  • Status toasts are colored by kind (success, info, constraint, warning, error). Scripts: ezy.msg(text [, kind]). Add bone uses info for the next click, amber for rejected input, green on commit, and red if create fails.
  • Settings -> View presentation -> Curve segment angle (gui.curve_deviation_angle_deg, 2-20, default 6) controls AIS curve tessellation. Shared face-mesh polygons are force-cleaned so sketch arcs actually follow the slider.
  • Add bone follow-ups: live length dim and Tab-able measure segments, axis-tangent snap to match radius 2, Options for radius and total-length nodes, then exit to Sketch inspection.

Fixes #263

Test plan

  • Build Debug EzyCad / EzyCad_tests.
  • Run EzyCad_tests (overlap cases in skt_topo_tests).
  • Draw the same line or circle twice; add a collinear / same-circle overlap; add a circle on an existing bone end-cap arc (no crash, no stacked copy).
  • Drag Curve segment angle between 2 and 20 on a sketch circle (faces on).
  • Add bone: info toasts through the clicks, amber on reject, green on commit; radius snap on the second circle; Options persist.
  • Review docs/usage-sketch.md, docs/usage-settings.md, docs/usage-occt-view.md, docs/scripting.md, CHANGELOG [Unreleased].

Note

Medium Risk
Sketch edge add/merge and undo recording touch core planar graph behavior; OCCT tessellation redisplay is broad but display-only. Add-bone flow changes are localized to sketch tools.

Overview
This PR tightens 2D sketch topology so collinear and same-circle overlaps no longer duplicate edges: existing geometry splits at overlap ends, only new atomic pieces are added, and undo records stored arc/line pieces so undo does not drop untouched spans or no-op redraws. That also fixes a TKGeomBase crash when a new circle sat on an existing arc (e.g. bone end-cap).

Status toasts are no longer always red: Status_msg kinds drive color, GUI::show_status maps Result_status (user errors → amber constraint), and ezy.msg(text [, kind]) is wired through Lua/Python. Many call sites switch from plain show_message to typed toasts.

View presentation adds gui.curve_deviation_angle_deg (2–20°, default 6): Occt_view::apply_curve_deviation pushes AIS tessellation to the context and shapes, with extra cleanup so sketch wireframe arcs follow the slider instead of stale face polygons.

Add bone gains persisted radius and total-length node options, temporary measure segments for Tab entry, axis-tangent snap on the second circle while placing radius 1, Holes → None after the waist commits the outline (and hole handlers are skipped when holes are off), and kind-aware progress toasts.

Reviewed by Cursor Bugbot for commit d5a1ce6. 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/skt_edges.cpp
Comment thread src/skt.cpp
Comment thread src/gui_occt_view.cpp
Comment thread src/gui_mode.cpp Outdated

@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.

There are 4 total unresolved issues (including 3 from previous reviews).

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 0c2c222. Configure here.

Comment thread src/skt_edges.cpp
@trailcode
trailcode merged commit cbed453 into main Sep 15, 2026
4 checks passed
@trailcode
trailcode deleted the Trailcode/sketch-topo-fixes branch September 15, 2026 00:54
@trailcode
trailcode restored the Trailcode/sketch-topo-fixes branch September 15, 2026 23:30
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.

Sketch overlap merge, status toasts, curve segment angle, and Add bone options

1 participant