Skip to content

Add temporary shape cross-section preview tool - #219

Merged
trailcode merged 17 commits into
mainfrom
Trailcode/cross-section
Jul 23, 2026
Merged

Add temporary shape cross-section preview tool#219
trailcode merged 17 commits into
mainfrom
Trailcode/cross-section

Conversation

@trailcode

@trailcode trailcode commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a temporary Shape cross-section tool for selected solids (cyan section wires + yellow plane/normal annotation; not committed to the document).
  • Shared multi-select plane: first-selected local axes, selection bbox center, local XY/XZ/YZ + bbox-ranged offset; Invert normal; Hide back side (AIS clip, on by default); Clip (undoable half-space BREP cut).
  • Auto-updates preview on mode enter (pre-selection), selection changes, and plane/offset changes; bold Options prompt when nothing is selected. Offset/plane dragging updates the yellow plane immediately and computes section wires asynchronously so the slider stays responsive.
  • Desktop: parallel per-solid section preview; WASM stays serial for that pool. Plan notes for future WASM pthreads: agents/plans/wasm-multithreading.md.
  • Adds shape local frames (gp_Ax3) persisted with shapes / undo, updated on move/rotate/scale finalize.

Closes #218

Test plan

  • Desktop Release build (EzyCad + EzyCad_tests)
  • EzyCad_tests --gtest_filter=Shp_cross_section.*:Shp_test.Cross_section*
  • Manual: select solid(s) then click cross-section — preview appears
  • Manual: change Local XY/XZ/YZ, Invert normal, Offset — preview updates; Hide back side clips display
  • Manual: Clip — originals replaced with half-space result; undo works
  • Manual: clear selection — preview clears; bold "Select one or more shapes."
  • Manual: Esc / leave mode — temporary AIS cleared
  • Docs: usage.md / usage-settings.md / CHANGELOG match behavior

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@trailcode
trailcode merged commit 3c423f3 into main Jul 23, 2026
3 checks passed
@trailcode
trailcode deleted the Trailcode/cross-section branch July 23, 2026 02:10
trailcode added a commit that referenced this pull request Jul 24, 2026
… log (#222)

## Summary
- Optional **Show section outline** (default off); toast messages also go to the Log.
- **Clip** removes solids fully on the discarded side instead of erroring; survivors stay clipped replacements (undoable).
- **Cross section sketch** imports cached section line/circle edges into a new sketch on the cutting plane (undoable).
- Docs, CHANGELOG, and focused tests updated.

## Test plan
- [x] Desktop Release build
- [x] `EzyCad_tests --gtest_filter=Shp_cross_section.*:Shp_test.Cross_section*`
- [x] Manual: enter tool / plane / offset / Hide back / Show section outline / Clip multi-select with a fully discarded solid / Cross section sketch / Esc
- [x] Confirm toast text appears in Log; `ezy.msg` too
- [x] Docs sync checklist (`usage.md`, `usage-settings.md`, CHANGELOG)

Closes #221

Related: #218 #219

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes touch modeling (Clip deletes geometry, sketch import from OCCT section) and global status logging; behavior is covered by new tests but Clip/sketch paths affect user documents.
> 
> **Overview**
> Follow-ups on the **Shape cross-section** tool and status messaging.
> 
> **Cross-section:** **Show section outline** (default off) toggles cyan intersection wires from a cached compound without recomputing. **Clip** no longer errors when a solid is fully on the discarded side—it deletes those inputs with no replacement and reports counts; survivors still become clipped replacements (undoable). **Cross section sketch** waits for section work if needed, builds a sketch on the cutting plane, imports **line** and **circle** edges (full circles split into two semicircles), runs `rebuild_faces()`, commits undo, and switches to sketch inspection; other curve types are skipped.
> 
> **Status / Log:** `GUI::show_message` and `ezy.msg` now append the same text to the **Log** window. `show_error_dialog` logs `title: message` once and shows only the title in the toast to avoid duplicate log lines.
> 
> Docs, CHANGELOG, agent plan status, and unit tests cover outline toggle, full discard on clip, and box midplane sketch import.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 18b5c0d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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 temporary shape cross-section preview tool

1 participant