Skip to content
Open
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- **Extrude Both sides**: Options **Both sides** defaults to on (session sticky; not a Settings key).

### Fixed

- **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 1, radius 2, 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`**.

- **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).

- **Shape List Zoom to**: right-click a shape or group name (or the **M** button on a solid) and choose **Zoom to** to frame that solid, or all descendant solids of a group, in the 3D view while keeping the current camera orientation.
Expand Down
32 changes: 27 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Add custom CMake modules path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

# Detect Emscripten early (for optional branching)
if(CMAKE_CXX_COMPILER MATCHES "em\\+\\+")
# Detect Emscripten early (for optional branching).
# Modern emsdk toolchains force CMAKE_CXX_COMPILER_ID to Clang and set EMSCRIPTEN=1 /
# CMAKE_SYSTEM_NAME=Emscripten; do not rely on matching "em++" in the compiler path.
if(EMSCRIPTEN OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR CMAKE_CXX_COMPILER MATCHES "em\\+\\+")
set(EMSCRIPTEN_BUILD TRUE)
endif()

Expand Down Expand Up @@ -84,8 +86,9 @@ target_compile_features(lua PUBLIC c_std_99)
# Combines CMAKE_BINARY_DIR and project-specific binary dir for flexibility
set(BINARY_DIR ${${PROJECT_NAME}_BINARY_DIR})

# Detect if we're using Emscripten compiler (for WebAssembly builds)
if(CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?(\.bat)?$")
# EzyCad branches on CMAKE_CXX_COMPILER_ID STREQUAL "Emscripten" (wasm link flags,
# TKOpenGles, no gtest/GLFW nuget). Override the Clang ID that emsdk forces.
if(EMSCRIPTEN_BUILD)
message(" * C++ compiler: Emscripten")
set(CMAKE_CXX_COMPILER_ID "Emscripten")
else()
Expand Down Expand Up @@ -200,6 +203,24 @@ else()
set(OCCT_BIN_DIR)
endif()

# Wasm OCCT (scripts/build-occt-*-wasm.ps1) installs FreeType under install/freetype.
# OCCT INTERFACE libs use $<LINK_ONLY:freetype>; without this package CMake emits bare -lfreetype.
if(EMSCRIPTEN_BUILD AND OpenCASCADE_FOUND)
get_filename_component(_ezy_occt_cmake "${OpenCASCADE_DIR}" ABSOLUTE)
get_filename_component(_ezy_occt_lib_cmake "${_ezy_occt_cmake}" DIRECTORY)
get_filename_component(_ezy_occt_lib "${_ezy_occt_lib_cmake}" DIRECTORY)
get_filename_component(_ezy_occt_prefix "${_ezy_occt_lib}" DIRECTORY)
set(freetype_DIR "${_ezy_occt_prefix}/freetype/lib/cmake/freetype" CACHE PATH
"FreeType CMake package from OCCT wasm install" FORCE)
if(NOT EXISTS "${freetype_DIR}/freetype-config.cmake")
message(FATAL_ERROR
"Wasm FreeType CMake package not found at ${freetype_DIR}. "
"Build OCCT with scripts/build-occt-793-wasm.ps1 (or build-occt-v8-wasm.ps1).")
endif()
find_package(freetype CONFIG REQUIRED)
message(STATUS "Using FreeType (wasm) from \"${freetype_DIR}\"")
endif()

# OCCT 3rd-party DLL path must not contain backticks — a common mistake is pasting
# -DOCCT_3RD_PARTY_DIR=... from Markdown and including the closing ` of `...`.
if(DEFINED OCCT_3RD_PARTY_DIR)
Expand Down Expand Up @@ -390,7 +411,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Emscripten")
target_link_libraries(
${PROJECT_NAME}
lua
${OpenCASCADE_LIBS})
${OpenCASCADE_LIBS}
freetype)

else()

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Full guide: **[docs/building-occt.md](docs/building-occt.md)** (Windows prebuilt
- **OCCT 7.9.3 for wasm (recommended):** `scripts\build-occt-793-wasm.ps1` (or `.cmd`) after `emsdk_env` — see [docs/building-occt.md](docs/building-occt.md#webassembly-emscripten). OCCT 8.x has a GLES shading regression on wasm (see [docs/bugs.md](docs/bugs.md)).
- **OCCT 8.0.0.p1 for wasm:** `scripts\build-occt-v8-wasm.ps1` for regression testing against upstream.
- Configure the EzyCad project with Emscripten (Ninja recommended):
- `emcmake cmake -S . -B build-em-7-9-3 -Wno-dev -G Ninja -DOpenCASCADE_DIR=C:/Users/you/occt-wasm-build/V7_9_3/install/lib/cmake/opencascade -DCMAKE_BUILD_TYPE=Release`
- Add **-Wno-dev** to suppress any remaining CMake developer warnings.
- `emcmake cmake -S . -B build-em-7-9-3 -Wno-dev -G Ninja "-DOpenCASCADE_DIR=%USERPROFILE%/occt-wasm-build/V7_9_3/install/lib/cmake/opencascade" -DCMAKE_BUILD_TYPE=Release`
- Replace `%USERPROFILE%` with your home if the shell does not expand it (path must contain `OpenCASCADEConfig.cmake`). Add **-Wno-dev** to suppress remaining CMake developer warnings.
- If configure **freezes** after that warning, the hang is often in `find_package(OpenCASCADE)` or Emscripten compiler detection. Run with `--debug-output` to see where it stops.
- Build:
- `ninja -C build-em-7-9-3` (or `emmake cmake --build . --config Release`)
Expand Down
1 change: 1 addition & 0 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Pointer for AI coding assistants. Details live in [agents/README.md](agents/READ

- UI/settings/docs changes: [agents/conventions/user-docs-sync.md](agents/conventions/user-docs-sync.md)
- **New `Mode` / toolbar tool / one-shot `Command`:** update remappable hotkeys — checklist in [src/doc/gui.md](src/doc/gui.md#new-mode-or-toolbar-command-hotkeys)
- **Sketch tool Options pane:** tool-specific **Options** above **Sketch options** — [src/doc/gui.md](src/doc/gui.md#options-panel-layout-sketch-tools)
- Markdown tables (align for source + preview): [agents/conventions/markdown-tables.md](agents/conventions/markdown-tables.md)
- Sketch subsystem: [src/doc/sketch.md](src/doc/sketch.md) (read; update when API or architecture changes)
- Shape module: [src/doc/shape.md](src/doc/shape.md) (read; update when API or operation patterns change)
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) — 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** |
| 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) — 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).
Loading
Loading