Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **Delete shortcut**: remappable **Delete** defaults to <kbd>Ctrl</kbd>+<kbd>D</kbd> (`edit.delete`). <kbd>Shift</kbd>+<kbd>D</kbd> is now **Duplicate**. <kbd>Delete</kbd> and <kbd>Backspace</kbd> still always delete the selection. A saved `gui.hotkeys` entry that still has **Delete** on <kbd>Shift</kbd>+<kbd>D</kbd> moves **Delete** back to <kbd>Ctrl</kbd>+<kbd>D</kbd> so **Duplicate** can take <kbd>Shift</kbd>+<kbd>D</kbd>.
- **Task toolbar**: Sketch / Design / Workbench switcher; the tools row shows only the current task. Design has its own Move / Rotate / Scale / Align shafts (bake bodies for CSG). Workbench has Move / Rotate / Align shafts (instance pose). <kbd>G</kbd> / <kbd>R</kbd> / <kbd>J</kbd> stay on the current task; <kbd>S</kbd> enters Design Scale.
- **Mode names**: Design idle is `Design_inspection` (was `Normal`); Sketch idle is `Sketch_inspection` (was `Sketch_inspection_mode`). `ezy.get_mode()` / `ezy.set_mode` use the new names; `Normal` and `Sketch_inspection_mode` still parse.
- **Move / rotate / scale space**: Options **Local** (default) or **World**. Local uses the first selected solid's frame (origin and X/Y/Z from **Show axes**). World keeps global XYZ at that solid's bounding-box center. Persisted as **`gui.transform_space`**.
Expand All @@ -17,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Shape and Workbench copy names**: duplicating `Box.001` takes the next free `Box` / `Box.NNN` slot. It no longer stacks another `.001` (`Box.001.001`).
- **Workbench task icon**: `res/icons/Workbench_Assembly.png` is included so the task button and the usage guide can load it (Sphinx `-W` failed on the missing image).
- **Workbench toolbar**: the tools row no longer repeats the Workbench task icon; idle is the task button only.
- **Workbench Align shafts**: cylindrical face picking uses Face selection on Workbench instances (same as Design). Insert position uses the instance placement (axis direction was already correct).
Expand All @@ -34,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **Duplicate shapes** (<kbd>Shift</kbd>+<kbd>D</kbd>, `edit.duplicate`): in **Design**, clones selected solids (or the current group's subtree) as independent bodies at the same pose. In **Workbench**, adds another link to the same Design body at the same pose. Copies stay under the original parent, then the tool switches to **Move** on the current task. One undo step. Leaves the copy/paste clipboard unchanged.

- **Workbench List**: separate pane of geometry **links** to Shape List solids (own location/rotation). **Add to Workbench** from the Shape List (button, context menu, or drag). Design geometry edits update links; Design move/rotate/scale do not move instances. Workbench Move / Rotate / Align shafts edit the instance frame only. `.ezy` stores `workbench[]` (no BREP). Settings: **`gui.show_workbench_list`**.

- **Status toast kinds**: the bottom-right toast is colored by kind (**success**, **info**, **constraint**, **warning**, **error**) instead of always red. Failed `Status` toasts follow `Result_status` (`User_error` is amber constraint). 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.
Expand Down
1 change: 1 addition & 0 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Pointer for AI coding assistants. Details live in [agents/README.md](agents/READ

- [agents/conventions/ascii-source.md](agents/conventions/ascii-source.md) for `src/` and `tests/`
- [docs/ezycad_code_style.md](docs/ezycad_code_style.md) for C++ style
- When a `for` or `while` body is only `Type name = init;` plus an `if` that tests `name`, write `for`/`while (...) if (Type name = init; condition)` and omit the loop braces. Keep those braces when the loop is the unbraced then-branch of an `if` that has an `else`.
- After creating or editing C++ (`src/`, `tests/`) or Markdown tables: `python scripts/agent_check.py <touched paths>` (ASCII; table alignment for `.md`). Optional local style: `python scripts/code_style_check.py`. Do not run the individual ASCII scripts unless that one failed.

## When needed
Expand Down
38 changes: 19 additions & 19 deletions agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ Root markers: [AGENTS.md](../AGENTS.md) / [agents.md](../agents.md).

## Quick index

| Need | File |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ASCII / `src/` edits | [conventions/ascii-source.md](conventions/ascii-source.md) — after edits: `python scripts/agent_check.py <paths>` |
| C++ style (full) | [docs/ezycad_code_style.md](../docs/ezycad_code_style.md) — Vertical rhythm includes a blank line after an early-return `if`; optional local: `python scripts/code_style_check.py` (not CI) |
| User docs when UI changes | [conventions/user-docs-sync.md](conventions/user-docs-sync.md) |
| Sketch module (dev doc) | [src/doc/sketch.md](../src/doc/sketch.md) — read when editing sketch code; update if API/architecture changes |
| Shape module (dev doc) | [src/doc/shape.md](../src/doc/shape.md) — read when editing `shp_*` code; update if API/operations change |
| GUI module (dev doc) | [src/doc/gui.md](../src/doc/gui.md) — read when editing `gui_*` / viewer shell; update if routing or settings change; **new Mode/Command → hotkeys checklist**; **sketch Options: tool Options above Sketch options** |
| Script module (dev doc) | [src/doc/script.md](../src/doc/script.md) — read when editing `scr_*`; update if bindings change |
| Utility module (dev doc) | [src/doc/utility.md](../src/doc/utility.md) — read when editing `utl_*`; update if shared helpers or I/O change |
| Build / test / wasm | [workflows/local-dev.md](workflows/local-dev.md) |
| OCCT desktop 8 vs wasm 7.9.3 | [conventions/occt-wasm-dual-version.md](conventions/occt-wasm-dual-version.md) — until wasm works on OCCT 8 |
| OCCT handles (`*_ptr`) | [conventions/occt-handles.md](conventions/occt-handles.md) — prefer aliases over `Handle()` for clang-format |
| Release | [workflows/release.md](workflows/release.md) |
| Issue/PR drafts | [drafts/](drafts/) — [github-drafts.md](conventions/github-drafts.md) |
| Feature plans (opt-in) | [plans/](plans/) — load **only** when the prompt matches that feature ([token-lean](conventions/token-lean.md)) |
| Token-saving rules | [conventions/token-lean.md](conventions/token-lean.md) |
| Markdown tables | [conventions/markdown-tables.md](conventions/markdown-tables.md) — align GFM pipes for source + preview |
| Outreach (optional) | [outreach/discoverability.md](outreach/discoverability.md) |
| Need | File |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ASCII / `src/` edits | [conventions/ascii-source.md](conventions/ascii-source.md) — after edits: `python scripts/agent_check.py <paths>` |
| C++ style (full) | [docs/ezycad_code_style.md](../docs/ezycad_code_style.md) — blank line after an early-return `if`; fold a decl-then-if loop into `if (Type name = init; cond)` with no loop braces. Optional local: `python scripts/code_style_check.py` (not CI) |
| User docs when UI changes | [conventions/user-docs-sync.md](conventions/user-docs-sync.md) |
| Sketch module (dev doc) | [src/doc/sketch.md](../src/doc/sketch.md) — read when editing sketch code; update if API/architecture changes |
| Shape module (dev doc) | [src/doc/shape.md](../src/doc/shape.md) — read when editing `shp_*` code; update if API/operations change |
| GUI module (dev doc) | [src/doc/gui.md](../src/doc/gui.md) — read when editing `gui_*` / viewer shell; update if routing or settings change; **new Mode/Command → hotkeys checklist**; **sketch Options: tool Options above Sketch options** |
| Script module (dev doc) | [src/doc/script.md](../src/doc/script.md) — read when editing `scr_*`; update if bindings change |
| Utility module (dev doc) | [src/doc/utility.md](../src/doc/utility.md) — read when editing `utl_*`; update if shared helpers or I/O change |
| Build / test / wasm | [workflows/local-dev.md](workflows/local-dev.md) |
| OCCT desktop 8 vs wasm 7.9.3 | [conventions/occt-wasm-dual-version.md](conventions/occt-wasm-dual-version.md) — until wasm works on OCCT 8 |
| OCCT handles (`*_ptr`) | [conventions/occt-handles.md](conventions/occt-handles.md) — prefer aliases over `Handle()` for clang-format |
| Release | [workflows/release.md](workflows/release.md) |
| Issue/PR drafts | [drafts/](drafts/) — [github-drafts.md](conventions/github-drafts.md) |
| Feature plans (opt-in) | [plans/](plans/) — load **only** when the prompt matches that feature ([token-lean](conventions/token-lean.md)) |
| Token-saving rules | [conventions/token-lean.md](conventions/token-lean.md) |
| Markdown tables | [conventions/markdown-tables.md](conventions/markdown-tables.md) — align GFM pipes for source + preview |
| Outreach (optional) | [outreach/discoverability.md](outreach/discoverability.md) |

Full user-doc style: [docs/ezycad_doc_style.md](../docs/ezycad_doc_style.md). OCCT build: [docs/building-occt.md](../docs/building-occt.md).
14 changes: 14 additions & 0 deletions docs/ezycad_code_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ rather than leading with the failure `if` and putting the main work in `else`, u
- Initialize members and locals with `=` (`bool ok = false;`), not brace-init (`bool ok {false};`), so clang-format can align consecutive declarations and assignments.
- Declare locals close to first use.
- Omit braces on single-statement `if`/`for`/`while` bodies when clear.
- When a `for` or `while` body is only a declaration and an `if` that tests that name, fold it into an if-with-initializer and drop the loop braces:

```cpp
for (Shape_geom_delta::Geom_change& ch : changes)
if (Shp_ptr shp = view().find_shape_by_id(ch.id); !shp.IsNull())
{
ch.after_geom = shp->Shape();
ch.after_frame = shp->get_frame();
}
```

Keep the loop braces when the loop is the unbraced then-branch of an `if` that has an `else`: dropping them would bind `else` to the inner `if`.

Optional local check: `python scripts/code_style_check.py --rule if-initializer`.

## Documentation

Expand Down
Loading
Loading