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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Add bone Holes**: switching **Holes** to **None** after the waist is set commits the outline. Clicks and finalize no longer run hole handlers when holes are off (those handlers reject `None` and left the tool stuck).
- **Sketch overlapping edges**: Drawing the same line or circle twice, or adding a collinear / same-circle overlap, no longer stacks a second copy. The sketch splits at overlap ends and keeps each atomic piece once. Undo records only the new atomic pieces (for arcs, each leftover start/bulge/end, not the input triple), so extending a line past an existing collinear edge no longer deletes the original on undo, and a circle over an existing same-circle cap reverses fully. A no-op redraw of an already-covered span does not push undo. Fixes an access violation in `TKGeomBase` when a new circle coincided with an existing arc (for example a bone end-cap).
- **Wasm configure/link**: Detect Emscripten via `EMSCRIPTEN` / `CMAKE_SYSTEM_NAME` (modern emsdk reports Clang). Link the FreeType package from the OCCT wasm install so `wasm-ld` finds `libfreetype.a` instead of bare `-lfreetype`.

### Added

- **Add bone** sketch tool (<kbd>Shift</kbd>+<kbd>U</kbd>): click the two circle centers, then radius at the second center, radius at the first center, and waist width (like other sketch tools). Waist is the minimum neck thickness (offset from mid when end radii differ). Live length dim only for center-to-center; radii / holes / waist use the geometry preview (<kbd>Tab</kbd> still enters exact values). Options: **Add center nodes** (default on) and **Holes** (**None** / **One radius** / **Two radii**). Waist cutters are tangent to both end circles. Commits the trimmed outline (outer end arcs and inner waist arcs), optional hole circles, and optional permanent **Bone A** / **Bone B** center nodes, then exits to **Sketch inspection** (does not stay in Add bone for another). Remappable as **`mode.add_bone`**.
- **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.

- **Curve segment angle**: **Settings -> View presentation** slider (**2** to **20** degrees, default **6**) sets Open CASCADE AIS curve tessellation. Smaller draws smoother arcs and fillets (display only). Persisted as **`gui.curve_deviation_angle_deg`**.

- **Add bone** sketch tool (<kbd>Shift</kbd>+<kbd>U</kbd>): click the two circle centers, then radius at the second center, radius at the first center, and waist width (like other sketch tools). Waist is the minimum neck thickness (offset from mid when end radii differ). Live length dim and a tmp segment for center-to-center, then for each radius, waist, and hole so <kbd>Tab</kbd> can enter exact values (measure segments are not committed). While placing radius 1, snap targets sit on the second circle at the bone-axis-parallel tangents (match radius 2). Options: **Add center nodes**, **Add radius nodes**, and **Add total length nodes** (all default on) plus **Holes** (**None** / **One radius** / **Two radii**). Radius nodes are **Bone A+** / **A-** / **B+** / **B-**; total-length nodes are **Bone A tip** / **Bone B tip**. Waist cutters are tangent to both end circles. Commits the trimmed outline (outer end arcs and inner waist arcs), optional hole circles, and optional permanent **Bone A** / **Bone B** center nodes, then exits to **Sketch inspection** (does not stay in Add bone for another). Remappable as **`mode.add_bone`**.

- **Shape local frame**: Shape List right-click on a solid toggles **Show axes** / **Show plane** / **Show up**, **Reset frame to bbox**, **Set from planar/cylindrical face**, and **Flip up** / **Flip axis (Z)**. Frame display flags persist in `.ezy` as `frameDisplay`. Face picks use `Mode::Shape_set_frame` (no toolbar hotkey).

Expand Down
2 changes: 1 addition & 1 deletion docs/ezycad_code_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if (!content.empty())
// apply / succeed
}
else
show_message("Failed...");
show_message("Failed...", Status_msg::Error);
```

rather than leading with the failure `if` and putting the main work in `else`, unless an early-return failure keeps the success path flatter.
Expand Down
20 changes: 11 additions & 9 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ ezy.Shp

### `ezy`

| Method | Purpose |
| ------------------------------- | ------------------------------------------------ |
| `ezy.log(msg)` | Print to the console and the main **Log** pane |
| `ezy.msg(text)` | Status toast and append to the main **Log** pane |
| `ezy.get_mode()` | Current application mode name (string) |
| `ezy.set_mode(name)` | Switch mode by name |
| `ezy.save_occt_view_settings()` | Write settings JSON (including view colors) |
| `ezy.occt_view_settings_json()` | Settings JSON string |
| `ezy.help()` | Print binding summary |
| Method | Purpose |
| ------------------------------- | ----------------------------------------------- |
| `ezy.log(msg)` | Print to the console and the main **Log** pane |
| `ezy.msg(text [, kind])` | Status toast and Log; optional kind (see below) |
| `ezy.get_mode()` | Current application mode name (string) |
| `ezy.set_mode(name)` | Switch mode by name |
| `ezy.save_occt_view_settings()` | Write settings JSON (including view colors) |
| `ezy.occt_view_settings_json()` | Settings JSON string |
| `ezy.help()` | Print binding summary |

Optional `kind` for `ezy.msg` is `success`, `info` (default), `constraint`, `warning`, or `error`. Unknown names use info. Toast color follows the kind.

### `ezy.view`

Expand Down
6 changes: 5 additions & 1 deletion docs/usage-occt-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ EzyCad's 3D viewport uses **Open CASCADE Technology (OCCT)** for displaying soli

The **coordinate axes** (small triedron) and optional **view cube** are part of the OCCT-based viewer and help you stay oriented.

## Curve display

Sketch arcs, circles, and rounded 3D edges are true curves. The viewer draws them as polylines. **Settings -> View presentation -> Curve segment angle** (`gui.curve_deviation_angle_deg`, **2** to **20** degrees, default **6**) is the maximum angle between consecutive segments. Smaller values look smoother and use more segments. This does not change stored geometry or mesh export deflection.

## Settings file

Background gradient, grid lines, and related **3D appearance** are stored under **`occt_view`** in your settings JSON. **View rotation step**, **zoom scroll scale**, **default 2D view width/height** (New Project framing), and **element hover color** are stored under **`gui`**. Full lists of keys: **[usage-settings.md — Settings file reference](usage-settings.md#settings-file-reference)**.
Background gradient, grid lines, and related **3D appearance** are stored under **`occt_view`** in your settings JSON. **View rotation step**, **zoom scroll scale**, **default 2D view width/height** (New Project framing), **element hover color**, **shape selection color**, and **curve segment angle** are stored under **`gui`**. Full lists of keys: **[usage-settings.md — Settings file reference](usage-settings.md#settings-file-reference)**.

If you use scripts, **`ezy.occt_view_settings_json()`** returns a small JSON snapshot of some of these values — see **[scripting.md](scripting.md)**.

Expand Down
Loading
Loading