SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Rename SolveCraft to SolidCraft everywhere, with compatibility shims (#389)
bherbruck296683229d11
diff --git a/.config/nextest.toml b/.config/nextest.tomlindex ec67145f49..e1070ba4ba 100644--- a/.config/nextest.toml+++ b/.config/nextest.toml@@ -7,15 +7,15 @@# Keep this list in sync with docs/book/src/dev/testing.md and CONTRIBUTING.md.default-filter = """not (- (package(solvecraft-engine) & (+ (package(solidcraft-engine) & (test(=tests::hostile_params_never_panic)| test(/^tests::robustness::/)| test(=pattern_suppress_tests::enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen)| test(=pattern_suppress_tests::enclosure_datums_follow_wall_height_and_board_depth_with_material_proofs)| test(=cmd::plastic::tests::enclosure_snap_fit_follows_resized_front_wall)))- | (package(solvecraft-kernel) & test(=tests::boolean_identity_on_tangent_primitives))- | (package(solvecraft-ui-egui) & binary(scenarios) & test(=acceptance_sensor_enclosure))+ | (package(solidcraft-kernel) & test(=tests::boolean_identity_on_tangent_primitives))+ | (package(solidcraft-ui-egui) & binary(scenarios) & test(=acceptance_sensor_enclosure)))"""fail-fast = falsediff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.mdindex c90084475b..2e36413756 100644--- a/.github/ISSUE_TEMPLATE/bug_report.md+++ b/.github/ISSUE_TEMPLATE/bug_report.md@@ -1,6 +1,6 @@---name: Bug report-about: Help reproduce and fix a SolveCraft problem+about: Help reproduce and fix a SolidCraft problemtitle: ''labels: ''assignees: ''@@ -12,7 +12,7 @@ What did you expect, and what happened instead?## Reproduction-Include steps, SolveCraft version/commit and relevant environment details. Prefer a small example without private design data.+Include steps, SolidCraft version/commit and relevant environment details. Prefer a small example without private design data.## Screenshots of the behavior (when observable)diff --git a/.github/release-notes.md b/.github/release-notes.mdindex 05f01db5ac..f323c73114 100644--- a/.github/release-notes.md+++ b/.github/release-notes.md@@ -5,15 +5,26 @@ parameter to watch the timeline rebuild. [Documentation](https://bherbruck.githu[issues](https://github.com/bherbruck/solidcraft/issues). AI agents can model with it over MCP:`solidcraft-cli mcp` ([how](https://bherbruck.github.io/solidcraft/guide/mcp.html)).-**Renamed to SolidCraft.** Downloads, installers and programs now carry the SolidCraft name:-the desktop app is `solidcraft`, the command line `solidcraft-cli`. `solvecraft-cli` is still-installed as a deprecated alias that forwards to `solidcraft-cli` (it prints a one-line note on-stderr), so scripts and MCP setups such as `claude mcp add solvecraft -- solvecraft-cli mcp`-keep working; new setups use `claude mcp add solidcraft -- solidcraft-cli mcp`. Existing designs-open as before. Upgrades: the `.msi` upgrades an earlier install in place (it now installs to-`Program Files\SolidCraft`); the `solidcraft` `.deb`/`.rpm` replaces the old `solvecraft`-package; the Flatpak app ID `ai.storyteller.solvecraft` is unchanged, so Flatpak updates-continue; earlier AppImages still find updates.+**Renamed to SolidCraft.** Everything now uses the new name: the `solidcraft` and+`solidcraft-cli` programs, `.solidcraft` designs, `SOLIDCRAFT_*` environment variables,+settings folders, package names and the `solidcraft` MCP server. Upgrading from SolveCraft:+- `.solvecraft` designs still open (double-click, Open, drag-drop, the CLI and MCP); new saves+ are `.solidcraft`. Builds older than this one can't open files saved by it.+- Settings, preferences and recovery files are copied to the new folders on first launch; the+ old folders are left in place. `SOLVECRAFT_*` environment variables are still read.+- `solvecraft-cli` remains as a deprecated alias for one release; it forwards to+ `solidcraft-cli` and prints a note. Agents: `claude mcp add solidcraft -- solidcraft-cli mcp`;+ an existing `claude mcp add solvecraft -- solvecraft-cli mcp` setup keeps working.+- Windows: the `.msi` upgrades the existing installation in place (now in+ `Program Files\SolidCraft`). Linux: the `solidcraft` `.deb`/`.rpm` replaces the `solvecraft`+ package. The Flatpak app ID stays `ai.storyteller.solvecraft`, so `flatpak update` just works,+ and existing AppImages find the update.+- macOS: quit the app, move the old `SolveCraft.app` to the Trash (your designs and settings+ stay), then drag `SolidCraft.app` from the DMG onto Applications and pin it in the Dock.+- Details: [compatibility notes](https://github.com/bherbruck/solidcraft/blob/main/docs/compatibility.md).++Documentation, the browser app and the Flatpak feed use the SolidCraft project Pages URLs;+old-name Pages addresses are not permanent aliases.**Which file?**- **Windows:** `SolidCraft-{version}-windows-x64.exe` runs as is. Or install the `.msi`, or unzip the@@ -26,12 +37,6 @@ continue; earlier AppImages still find updates.- **Web:** `solidcraft-web-{version}.zip` is a static site to host yourself.- `SHA256SUMS.txt`: `sha256sum -c SHA256SUMS.txt --ignore-missing`.-**Updating macOS from SolveCraft.app:** quit the app, rename the existing app in-Applications to `SolidCraft.app`, then drag the new app from the DMG onto Applications-and choose **Replace**. If both names are already installed, move the old `SolveCraft.app`-to the Trash. Remove any Dock shortcut with the old name and pin the new app. Designs-and settings are unchanged. The DMG includes these instructions.-For Flatpak feed installation and updates, add Flathub for the required runtime beforeinstalling SolidCraft; keep both remotes in the same user installation:diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.ymlindex 74dae6b509..e67bb54921 100644--- a/.github/workflows/pages.yml+++ b/.github/workflows/pages.yml@@ -48,7 +48,7 @@ jobs:- name: Build the bookrun: cargo xtask book- name: Build the web app- working-directory: apps/solvecraft-web+ working-directory: apps/solidcraft-webrun: trunk build --release --public-url /solidcraft/app/- name: Assemble the siterun: |diff --git a/AGENTS.md b/AGENTS.mdindex cc43f36075..fb6123da05 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -6,13 +6,13 @@ kernel, and a desktop UI that agents can drive. Projects published by[storytold](https://github.com/storytold) can serve as references for implementation conventions.Any code adapted from other projects (MIT OR Apache-2.0) is noted in ATTRIBUTION.md.-## Product name and compatibility-SolidCraft is the displayed product name; `solidcraft` is the repository name. Keep existing-`solvecraft` crate/binary names, `.solvecraft` files, format markers, environment variables,-settings/recovery paths and package IDs compatible. Published SolveCraft release artifacts-and attribution records keep their historical names. Public docs/web/Flatpak deployments-use project Pages `/solidcraft/`; do not add permanent old-name Pages aliases. See README's-compatibility notes.+## Product name+SolidCraft everywhere: crates `solidcraft-*`, binaries `solidcraft` and `solidcraft-cli`,+`.solidcraft` designs, the `solidcraft/N` format tag, `SOLIDCRAFT_*` environment variables,+settings and recovery folders, the MCP server name, docs, CI and packaging. The old name+survives only in the explicit compatibility shims listed in `docs/compatibility.md`; don't add+new uses of it anywhere else. Public docs/web/Flatpak deployments use project Pages+`/solidcraft/`; do not add permanent old-name Pages aliases.## Start every session here1. Read `plan/STATUS.md` (current milestone, next task), then the task in `plan/execution-plan.md`@@ -33,15 +33,15 @@ People trust SolidCraft with their designs; a crash loses their work. **This out- **Input-derived numbers are hostile** (command parameters, design files, control-channelinput): `get()` not `[i]`, finite checks, caps on sizes and loop counts.- **Third-party kernel calls are guarded:** everything that calls `truck` goes through- `solvecraft_kernel::guard`, which turns a panic into `KernelError::Internal`.+ `solidcraft_kernel::guard`, which turns a panic into `KernelError::Internal`.- **Last-resort guard:** `Session::execute` runs every command under `catch_unwind`; an escapedpanic restores the design and reports `EngineError::Internal`.- **Crash reports:** the desktop app writes every panic and every unclean exit to a local crash folder,- with the design and the commands that reproduce it (`solvecraft_engine::crash`, docs/crash-reports.md).+ with the design and the commands that reproduce it (`solidcraft_engine::crash`, docs/crash-reports.md).When someone says the app crashed, look there first: `solidcraft-cli crashes`, `crashes show <id>`,`crashes replay <id>` (or the `diagnostics.crash_reports` command / MCP `crash_reports` tool).- **Prove it:** every crash fix lands with a regression test (see `hostile_params_never_panic`); a- crash report's `design.solvecraft` + `replay.json` is the test's starting point.+ crash report's `design.solidcraft` + `replay.json` is the test's starting point.- Every production crate root carries`#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`.@@ -127,9 +127,9 @@ before the draft is verified.- `{"id":2,"method":"ui.start","params":{"command":"sketch.create"}}` then `ui.click {x, y}`- `{"id":3,"method":"ui.screenshot","params":{"path":"/tmp/shot.png"}}` then read the PNG.- **For UI work, look at the result** (screenshot, read the PNG). Without a window use- `ui.render` or `solvecraft-cli snapshot`.-- Headless: `solvecraft-cli run script.json --out part.step`, `solvecraft-cli eval design.solvecraft`,- `solvecraft-cli snapshot script.json --out shot.png`, `solvecraft-cli commands`.+ `ui.render` or `solidcraft-cli snapshot`.+- Headless: `solidcraft-cli run script.json --out part.step`, `solidcraft-cli eval design.solidcraft`,+ `solidcraft-cli snapshot script.json --out shot.png`, `solidcraft-cli commands`.- Reference tests: `cargo xtask oracle` replays `tests/oracle/*/recipe.json` and compares witheach case's `expected.json` (analytic or FreeCAD values; writes `docs/oracle.md`). Expectedvalues never come from a commercial CAD product.diff --git a/ATTRIBUTION.md b/ATTRIBUTION.mdindex 3e5b445139..30e18bb33d 100644--- a/ATTRIBUTION.md+++ b/ATTRIBUTION.md@@ -4,8 +4,8 @@ Every non-code asset in this repository (images, icons, fonts, example parts) isits author, source and licence. `cargo xtask assets` (part of `cargo xtask ci`) fails if an assetfile is missing from this table.-**Policy (mandatory):** SolveCraft contains **no Autodesk iconography, images, artwork, fonts,-templates, materials or help text.** Every asset is original work by SolveCraft contributors or+**Policy (mandatory):** SolidCraft contains **no Autodesk iconography, images, artwork, fonts,+templates, materials or help text.** Every asset is original work by SolidCraft contributors orthird-party material under an open licence. Screenshots of Autodesk software are never committed.Generated-in-code assets are original and have no file to list:@@ -36,16 +36,16 @@ Generated-in-code assets are original and have no file to list:| assets/icon.iconset/[email protected] | SolidCraft contributors | native sips export from assets/icon.png | MIT OR Apache-2.0 || assets/icon.iconset/icon_512x512.png | SolidCraft contributors | native sips export from assets/icon.png | MIT OR Apache-2.0 || assets/icon.iconset/[email protected] | SolidCraft contributors | native sips export from assets/icon.png | MIT OR Apache-2.0 |-| docs/screenshots/sample-plate.png | SolveCraft contributors | screenshot of SolveCraft itself (`solvecraft --sample`) | MIT OR Apache-2.0 |-| docs/screenshots/enclosure-demo-0.2.1.gif | SolveCraft contributors | original electronics enclosure screen recording of the actual SolveCraft 0.2.1 English desktop UI, generated with examples/demo/record_ui.sh and its original animated pointer overlay (4× playback) | MIT OR Apache-2.0 |-| docs/screenshots/enclosure-demo-0.2.1.mp4 | SolveCraft contributors | original electronics enclosure screen recording of the actual SolveCraft 0.2.1 English desktop UI, generated with examples/demo/record_ui.sh and its original animated pointer overlay (4× playback) | MIT OR Apache-2.0 |-| docs/book/src/generated/sample-plate.png | SolveCraft contributors | copy of docs/screenshots/sample-plate.png made by `cargo xtask book` (gitignored) | MIT OR Apache-2.0 |-| docs/book/src/generated/bracket.png | SolveCraft contributors | rendered by `cargo xtask book` (`solvecraft-cli snapshot examples/bracket.json`; gitignored) | MIT OR Apache-2.0 |-| docs/book/src/generated/enclosure.png | SolveCraft contributors | rendered by `cargo xtask book` (`solvecraft-cli snapshot docs/book/scripts/enclosure.json`; gitignored) | MIT OR Apache-2.0 |-| docs/book/src/generated/revolve.png | SolveCraft contributors | rendered by `cargo xtask book` (`solvecraft-cli snapshot docs/book/scripts/revolve.json`; gitignored) | MIT OR Apache-2.0 |-| docs/book/src/generated/sheet-metal.png | SolveCraft contributors | rendered by `cargo xtask book` (`solvecraft-cli snapshot docs/book/scripts/sheet-metal.json`; gitignored) | MIT OR Apache-2.0 |+| docs/screenshots/sample-plate.png | SolidCraft contributors | screenshot of SolidCraft itself (`solidcraft --sample`) | MIT OR Apache-2.0 |+| docs/screenshots/enclosure-demo-0.2.1.gif | SolidCraft contributors | original electronics enclosure screen recording of the actual SolidCraft 0.2.1 English desktop UI, generated with examples/demo/record_ui.sh and its original animated pointer overlay (4× playback) | MIT OR Apache-2.0 |+| docs/screenshots/enclosure-demo-0.2.1.mp4 | SolidCraft contributors | original electronics enclosure screen recording of the actual SolidCraft 0.2.1 English desktop UI, generated with examples/demo/record_ui.sh and its original animated pointer overlay (4× playback) | MIT OR Apache-2.0 |+| docs/book/src/generated/sample-plate.png | SolidCraft contributors | copy of docs/screenshots/sample-plate.png made by `cargo xtask book` (gitignored) | MIT OR Apache-2.0 |+| docs/book/src/generated/bracket.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot examples/bracket.json`; gitignored) | MIT OR Apache-2.0 |+| docs/book/src/generated/enclosure.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/enclosure.json`; gitignored) | MIT OR Apache-2.0 |+| docs/book/src/generated/revolve.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/revolve.json`; gitignored) | MIT OR Apache-2.0 |+| docs/book/src/generated/sheet-metal.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/sheet-metal.json`; gitignored) | MIT OR Apache-2.0 || crates/sketch/fonts/LiberationSans-Regular.ttf | Red Hat, Inc. (Liberation Fonts 2.x; digitized data Google) | https://github.com/liberationfonts (Debian fonts-liberation), unmodified; licence text in crates/sketch/fonts/OFL.txt; used for sketch Text outlines | SIL OFL 1.1 |-| apps/solvecraft-web/fonts/BIZUDPGothic-Regular.ttf | The BIZ UDGothic Project Authors | https://github.com/googlefonts/morisawa-biz-ud-gothic (Google Fonts), unmodified; licence text in apps/solvecraft-web/fonts/OFL.txt; used for web UI Japanese font | SIL OFL 1.1 |+| apps/solidcraft-web/fonts/BIZUDPGothic-Regular.ttf | The BIZ UDGothic Project Authors | https://github.com/googlefonts/morisawa-biz-ud-gothic (Google Fonts), unmodified; licence text in apps/solidcraft-web/fonts/OFL.txt; used for web UI Japanese font | SIL OFL 1.1 || tests/oracle/17-loft/reference.stl | SolidCraft contributors | triangulation of our own recipe (tests/oracle/17-loft/recipe.json) built with FreeCAD as an external tool by tools/freecad-oracle | MIT OR Apache-2.0 || tests/oracle/23-bracket-multifeature/reference.stl | SolidCraft contributors | triangulation of our own recipe (tests/oracle/23-bracket-multifeature/recipe.json) built with FreeCAD as an external tool by tools/freecad-oracle | MIT OR Apache-2.0 || tests/oracle/28-blind-pocket-fillets/reference.stl | SolidCraft contributors | triangulation of our own recipe (tests/oracle/28-blind-pocket-fillets/recipe.json) built with FreeCAD as an external tool by tools/freecad-oracle | MIT OR Apache-2.0 |@@ -69,25 +69,25 @@ Generated-in-code assets are original and have no file to list:## Code adapted from sibling projects-| SolveCraft file | Adapted from | Licence |+| SolidCraft file | Adapted from | Licence ||---|---|---|| xtask/src/layers.rs | CADCraft `xtask/src/layers.rs` (dependency layering rules and tests) | MIT OR Apache-2.0 |-| apps/solvecraft/src/control_server.rs | CADCraft `apps/cadcraft/src/control_server.rs` (loopback JSON-lines server) | MIT OR Apache-2.0 |+| apps/solidcraft/src/control_server.rs | CADCraft `apps/cadcraft/src/control_server.rs` (loopback JSON-lines server) | MIT OR Apache-2.0 || crates/ui-egui/src/lib.rs (screenshot queue, synthetic input) | CADCraft `crates/ui-egui/src/lib.rs` | MIT OR Apache-2.0 || crates/ui-egui/src/control.rs (method dispatch and screenshot saving) | CADCraft `crates/ui-egui/src/control.rs` | MIT OR Apache-2.0 || crates/ui-egui/src/gpu.rs (paint-callback structure) | CADCraft `crates/ui-egui/src/gpu.rs` | MIT OR Apache-2.0 || crates/mcp/src/server.rs, crates/mcp/src/backend.rs (JSON-RPC framing, MCP lifecycle, control-port bridge) | CADCraft `crates/mcp/src/{server,backend}.rs` | MIT OR Apache-2.0 || crates/mcp/src/tools.rs (tool schema helpers and argument checking) | CADCraft `crates/mcp/src/tools.rs`, GridCraft `crates/mcp/src/tools.rs` | MIT OR Apache-2.0 || crates/io/src/threemf.rs (bounded zip part reading and writing) | GridCraft `crates/xlsx/src/package.rs` | MIT OR Apache-2.0 |-| crates/ui-egui/src/titlebar.rs (title bar drag, caption buttons, resize zones, their tests) and the window setup in apps/solvecraft/src/main.rs | VectorCraft `crates/ui-egui/src/titlebar.rs`, `apps/vectorcraft/src/main.rs` | MIT OR Apache-2.0 |+| crates/ui-egui/src/titlebar.rs (title bar drag, caption buttons, resize zones, their tests) and the window setup in apps/solidcraft/src/main.rs | VectorCraft `crates/ui-egui/src/titlebar.rs`, `apps/vectorcraft/src/main.rs` | MIT OR Apache-2.0 || LICENSE-MIT, LICENSE-APACHE (licence text) | CADCraft | — || .github/workflows/release.yml, .github/workflows/packaging-lint.yml and packaging/ (release pipeline: Linux AppImage/deb/rpm/Flatpak/tar.gz, FreeBSD, macOS dmg, Windows MSI/portable zip, web zip; AppRun, nfpm, Flatpak, WiX and Info.plist templates) | PhotoCraft (https://github.com/storytold/photocraft) `.github/workflows/{release,packaging-lint}.yml`, `packaging/` | Apache-2.0 |## Recovered contributions-| SolveCraft file | Original contribution | Licence |+| SolidCraft file | Original contribution | Licence ||---|---|---|-| crates/ui-egui/src/viewport.rs (`nearest_quarter_turn`, `axis_view_orbit`) | N3MI-DG's [PR #101](https://github.com/bherbruck/solvecraft/pull/101): [minimal TOP/BOTTOM turns](https://github.com/bherbruck/solvecraft/commit/c28e780f52490784ef5886f094b9d3f6d10c3e3f) and [drag-to-orbit](https://github.com/bherbruck/solvecraft/commit/f30b30be6ecc4e2e6544a851243137c01a354934), adapted to the axis gizmo | MIT OR Apache-2.0 |+| crates/ui-egui/src/viewport.rs (`nearest_quarter_turn`, `axis_view_orbit`) | N3MI-DG's [PR #101](https://github.com/bherbruck/solidcraft/pull/101): [minimal TOP/BOTTOM turns](https://github.com/bherbruck/solidcraft/commit/c28e780f52490784ef5886f094b9d3f6d10c3e3f) and [drag-to-orbit](https://github.com/bherbruck/solidcraft/commit/f30b30be6ecc4e2e6544a851243137c01a354934), adapted to the axis gizmo | MIT OR Apache-2.0 |## Vendored third-party codediff --git a/CLAUDE.md b/CLAUDE.mdindex 2e3c6308ba..b2003eeac3 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -6,13 +6,13 @@ kernel, and a desktop UI that agents can drive. Projects published by[storytold](https://github.com/storytold) can serve as references for implementation conventions.Any code adapted from other projects (MIT OR Apache-2.0) is noted in ATTRIBUTION.md.-## Product name and compatibility-SolidCraft is the displayed product name; `solidcraft` is the repository name. Keep existing-`solvecraft` crate/binary names, `.solvecraft` files, format markers, environment variables,-settings/recovery paths and package IDs compatible. Published SolveCraft release artifacts-and attribution records keep their historical names. Public docs/web/Flatpak deployments-use project Pages `/solidcraft/`; do not add permanent old-name Pages aliases. See README's-compatibility notes.+## Product name+SolidCraft everywhere: crates `solidcraft-*`, binaries `solidcraft` and `solidcraft-cli`,+`.solidcraft` designs, the `solidcraft/N` format tag, `SOLIDCRAFT_*` environment variables,+settings and recovery folders, the MCP server name, docs, CI and packaging. The old name+survives only in the explicit compatibility shims listed in `docs/compatibility.md`; don't add+new uses of it anywhere else. Public docs/web/Flatpak deployments use project Pages+`/solidcraft/`; do not add permanent old-name Pages aliases.## Start every session here1. Read `plan/STATUS.md` (current milestone, next task), then the task in `plan/execution-plan.md`@@ -33,15 +33,15 @@ People trust SolidCraft with their designs; a crash loses their work. **This out- **Input-derived numbers are hostile** (command parameters, design files, control-channelinput): `get()` not `[i]`, finite checks, caps on sizes and loop counts.- **Third-party kernel calls are guarded:** everything that calls `truck` goes through- `solvecraft_kernel::guard`, which turns a panic into `KernelError::Internal`.+ `solidcraft_kernel::guard`, which turns a panic into `KernelError::Internal`.- **Last-resort guard:** `Session::execute` runs every command under `catch_unwind`; an escapedpanic restores the design and reports `EngineError::Internal`.- **Crash reports:** the desktop app writes every panic and every unclean exit to a local crash folder,- with the design and the commands that reproduce it (`solvecraft_engine::crash`, docs/crash-reports.md).+ with the design and the commands that reproduce it (`solidcraft_engine::crash`, docs/crash-reports.md).When someone says the app crashed, look there first: `solidcraft-cli crashes`, `crashes show <id>`,`crashes replay <id>` (or the `diagnostics.crash_reports` command / MCP `crash_reports` tool).- **Prove it:** every crash fix lands with a regression test (see `hostile_params_never_panic`); a- crash report's `design.solvecraft` + `replay.json` is the test's starting point.+ crash report's `design.solidcraft` + `replay.json` is the test's starting point.- Every production crate root carries`#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`.@@ -104,9 +104,9 @@ before the draft is verified.- `{"id":2,"method":"ui.start","params":{"command":"sketch.create"}}` then `ui.click {x, y}`- `{"id":3,"method":"ui.screenshot","params":{"path":"/tmp/shot.png"}}` then read the PNG.- **For UI work, look at the result** (screenshot, read the PNG). Without a window use- `ui.render` or `solvecraft-cli snapshot`.-- Headless: `solvecraft-cli run script.json --out part.step`, `solvecraft-cli eval design.solvecraft`,- `solvecraft-cli snapshot script.json --out shot.png`, `solvecraft-cli commands`.+ `ui.render` or `solidcraft-cli snapshot`.+- Headless: `solidcraft-cli run script.json --out part.step`, `solidcraft-cli eval design.solidcraft`,+ `solidcraft-cli snapshot script.json --out shot.png`, `solidcraft-cli commands`.- Reference tests: `cargo xtask oracle` replays `tests/oracle/*/recipe.json` and compares witheach case's `expected.json` (analytic or FreeCAD values; writes `docs/oracle.md`). Expectedvalues never come from a commercial CAD product.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex c345d5a51a..6208a4a599 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -22,14 +22,14 @@ cargo xtask test # unit, engine and UI-scenaricargo xtask ci # everything a PR must pass (see below)```-SolidCraft is the product and repository name. Cargo packages and executables retain-their `solvecraft` names for compatibility with existing scripts and MCP clients.+SolidCraft is the product, repository, Cargo package and executable name.Build the desktop app with `cargo build --release -p solidcraft`, or the CLI with`cargo build --release -p solidcraft-cli`. Run the CLI with`cargo run --release -p solidcraft-cli -- commands` (or `target/release/solidcraft-cli commands`-after building). There is no Cargo package named `solidcraft`.+after building). The old name appears only in the compatibility shims listed in+[docs/compatibility.md](docs/compatibility.md); don't add new uses of it.-Web: `cd apps/solvecraft-web && trunk serve --release`, then open the printed URL (`?sample`+Web: `cd apps/solidcraft-web && trunk serve --release`, then open the printed URL (`?sample`opens the sample part, `?webgl` forces WebGL2). Saving and opening files in the browser needsHTTPS or localhost, because it uses the Origin Private File System.@@ -43,7 +43,7 @@ loader wgpu renders through, and libdbus-1, which rfd's file dialogs reach xdg-dthrough (a dialog then never appears and the pick returns no path):```-ERROR solvecraft: winit EventLoopError: ... The wayland library could not be loaded+ERROR solidcraft: winit EventLoopError: ... The wayland library could not be loadedERROR eframe::native::run: Exiting because of error: WGPU error: Failed to create surface for any enabled backend: {}ERROR rfd::backend::xdg_desktop_portal::portal::libdbus: Can't connect to a portal: libdbus-1.so not found```@@ -59,8 +59,8 @@ The default development shell retains the Rust/C toolchain already on `PATH`;To launch, use `nix run .#solidcraft -- --sample`. To install the app's terminalcommands, desktop entry and generated icons, use `nix profile install .#solidcraft`.`nix build` alone creates a build result; it does not install a launcher in your-desktop menu. The installed `solidcraft` command and compatible `solvecraft`-command run the same wrapped app; `solvecraft-cli` is included as well. See+desktop menu. The installed `solidcraft` command runs the wrapped app; `solidcraft-cli` is included as+well. See[Nix installation and troubleshooting](docs/nix.md) for remote-flake commands,desktop integration and how to distinguish an old executable on `PATH`.@@ -82,7 +82,7 @@ The [README](README.md#architecture) has the layer table. The short version:commands.- `crates/ui-egui`: the desktop/web front end (egui + wgpu). It's swappable; nothing below itdepends on egui.-- `crates/mcp`, `apps/solvecraft`, `apps/solvecraft-cli`, `apps/solvecraft-web`.+- `crates/mcp`, `apps/solidcraft`, `apps/solidcraft-cli`, `apps/solidcraft-web`.`cargo xtask layers` fails the build if a lower layer depends on a higher one.@@ -107,7 +107,7 @@ The [README](README.md#architecture) has the layer table. The short version:- Non-test code never uses `unwrap`, `expect`, `panic!` or indexing on input-derived data.There's no `unsafe`, and clippy denies it.- An unsupported case returns an error ("not supported yet: …"); it never panics.- - Every call into truck goes through `solvecraft_kernel::guard`.+ - Every call into truck goes through `solidcraft_kernel::guard`.- Every crash fix comes with a regression test.5. **Everything is a command, with a test.** A new feature means a `CommandSpec` in`crates/engine/src/cmd/`, engine tests that measure the result (volume, area,@@ -159,12 +159,12 @@ Pull requests skip a few heavy tests (one to four minutes each), which run on ev`main` and nightly; check the `main` run after merging. They are listed in`.config/nextest.toml` and the [testing page](docs/book/src/dev/testing.md):-- `solvecraft-engine`: `tests::hostile_params_never_panic`, everything in `tests::robustness`,+- `solidcraft-engine`: `tests::hostile_params_never_panic`, everything in `tests::robustness`,`pattern_suppress_tests::enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen`,`pattern_suppress_tests::enclosure_datums_follow_wall_height_and_board_depth_with_material_proofs`,`cmd::plastic::tests::enclosure_snap_fit_follows_resized_front_wall`-- `solvecraft-kernel`: `tests::boolean_identity_on_tangent_primitives`-- `solvecraft-ui-egui` scenarios: `acceptance_sensor_enclosure`+- `solidcraft-kernel`: `tests::boolean_identity_on_tangent_primitives`+- `solidcraft-ui-egui` scenarios: `acceptance_sensor_enclosure`**The reference tests** are 76 parts in [`tests/oracle/`](tests/oracle/), each a `recipe.json`in our own format with an `expected.json` beside it. SolidCraft rebuilds the recipe and comparesdiff --git a/Cargo.lock b/Cargo.lockindex bca12999ce..705c9c0042 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -3300,8 +3300,8 @@ dependencies = ["quick-xml 0.38.4","rfd","serde_json",- "solvecraft-engine",- "solvecraft-ui-egui",+ "solidcraft-engine",+ "solidcraft-ui-egui","winit",]@@ -3310,43 +3310,43 @@ name = "solidcraft-cli"version = "0.5.0"dependencies = ["serde_json",- "solvecraft-engine",- "solvecraft-mcp",+ "solidcraft-engine",+ "solidcraft-mcp",][[package]]-name = "solvecraft-doc"+name = "solidcraft-doc"version = "0.5.0"dependencies = ["log","serde","serde_json","sha2",- "solvecraft-geom",- "solvecraft-kernel",- "solvecraft-sketch",+ "solidcraft-geom",+ "solidcraft-kernel",+ "solidcraft-sketch","thiserror 2.0.21","web-time",][[package]]-name = "solvecraft-engine"+name = "solidcraft-engine"version = "0.5.0"dependencies = ["log","serde","serde_json",- "solvecraft-doc",- "solvecraft-geom",- "solvecraft-io",- "solvecraft-kernel",- "solvecraft-render",- "solvecraft-sketch",+ "solidcraft-doc",+ "solidcraft-geom",+ "solidcraft-io",+ "solidcraft-kernel",+ "solidcraft-render",+ "solidcraft-sketch","thiserror 2.0.21",][[package]]-name = "solvecraft-geom"+name = "solidcraft-geom"version = "0.5.0"dependencies = ["serde",@@ -3355,24 +3355,24 @@ dependencies = [][[package]]-name = "solvecraft-io"+name = "solidcraft-io"version = "0.5.0"dependencies = ["quick-xml 0.38.4",- "solvecraft-doc",- "solvecraft-geom",- "solvecraft-kernel",+ "solidcraft-doc",+ "solidcraft-geom",+ "solidcraft-kernel","thiserror 2.0.21","zip",][[package]]-name = "solvecraft-kernel"+name = "solidcraft-kernel"version = "0.5.0"dependencies = ["log","serde",- "solvecraft-geom",+ "solidcraft-geom","thiserror 2.0.21","truck-meshalgo","truck-modeling",@@ -3382,36 +3382,36 @@ dependencies = [][[package]]-name = "solvecraft-mcp"+name = "solidcraft-mcp"version = "0.5.0"dependencies = ["serde_json",- "solvecraft-engine",+ "solidcraft-engine",][[package]]-name = "solvecraft-render"+name = "solidcraft-render"version = "0.5.0"dependencies = ["image","serde","serde_json",- "solvecraft-geom",+ "solidcraft-geom",][[package]]-name = "solvecraft-sketch"+name = "solidcraft-sketch"version = "0.5.0"dependencies = ["serde","serde_json",- "solvecraft-geom",+ "solidcraft-geom","thiserror 2.0.21","ttf-parser",][[package]]-name = "solvecraft-ui-egui"+name = "solidcraft-ui-egui"version = "0.5.0"dependencies = ["egui",@@ -3420,13 +3420,13 @@ dependencies = ["log","serde","serde_json",- "solvecraft-engine",+ "solidcraft-engine","ttf-parser","web-time",][[package]]-name = "solvecraft-web"+name = "solidcraft-web"version = "0.5.0"dependencies = ["eframe",@@ -3434,8 +3434,8 @@ dependencies = ["js-sys","log","serde_json",- "solvecraft-engine",- "solvecraft-ui-egui",+ "solidcraft-engine",+ "solidcraft-ui-egui","wasm-bindgen","wasm-bindgen-futures","web-sys",diff --git a/Cargo.toml b/Cargo.tomlindex 3b7ea3c1d6..ccc24d0f37 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -14,15 +14,15 @@ repository = "https://github.com/bherbruck/solidcraft"[workspace.dependencies]# internal-solvecraft-geom = { path = "crates/geom" }-solvecraft-sketch = { path = "crates/sketch" }-solvecraft-kernel = { path = "crates/kernel" }-solvecraft-render = { path = "crates/render" }-solvecraft-doc = { path = "crates/doc" }-solvecraft-io = { path = "crates/io" }-solvecraft-engine = { path = "crates/engine" }-solvecraft-ui-egui = { path = "crates/ui-egui" }-solvecraft-mcp = { path = "crates/mcp" }+solidcraft-geom = { path = "crates/geom" }+solidcraft-sketch = { path = "crates/sketch" }+solidcraft-kernel = { path = "crates/kernel" }+solidcraft-render = { path = "crates/render" }+solidcraft-doc = { path = "crates/doc" }+solidcraft-io = { path = "crates/io" }+solidcraft-engine = { path = "crates/engine" }+solidcraft-ui-egui = { path = "crates/ui-egui" }+solidcraft-mcp = { path = "crates/mcp" }# foundationthiserror = "2"@@ -96,7 +96,7 @@ codegen-units = 16# binary). See docs/crash-reports.md.debug = "line-tables-only"-# truck-shapeops with SolveCraft fixes (Apache-2.0, see vendor/truck-shapeops and ATTRIBUTION.md).+# truck-shapeops with SolidCraft fixes (Apache-2.0, see vendor/truck-shapeops and ATTRIBUTION.md).[patch.crates-io]truck-shapeops = { path = "vendor/truck-shapeops" }truck-stepio = { path = "vendor/truck-stepio" }diff --git a/LICENSE-MIT b/LICENSE-MITindex d19e8efe7c..bd0e0f2680 100644--- a/LICENSE-MIT+++ b/LICENSE-MIT@@ -1,6 +1,6 @@MIT License-Copyright (c) 2026 SolveCraft contributors+Copyright (c) 2026 SolidCraft contributorsPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealdiff --git a/NOTICE b/NOTICEindex a3067f1302..af0676c19d 100644--- a/NOTICE+++ b/NOTICE@@ -1,5 +1,5 @@-SolveCraft-Copyright (c) 2026 SolveCraft contributors.+SolidCraft+Copyright (c) 2026 SolidCraft contributors.Licensed under the MIT License or the Apache License, Version 2.0, at your option(LICENSE-MIT, LICENSE-APACHE).@@ -7,10 +7,10 @@ Third-party materialSoftware dependencies are listed in Cargo.lock; their licences are in THIRD-PARTY-LICENSES.txt(`cargo xtask licences`), which the programs also carry (Help > About > Licences,-`solvecraft-cli licences`). The geometry kernel builds on the truck crates+`solidcraft-cli licences`). The geometry kernel builds on the truck crates(truck-modeling, truck-shapeops, truck-meshalgo, truck-stepio, truck-topology and theirdependencies, https://github.com/ricosjp/truck), licensed under the Apache License 2.0 and used-as libraries. truck-shapeops 0.4.0 is vendored in vendor/truck-shapeops with SolveCraft+as libraries. truck-shapeops 0.4.0 is vendored in vendor/truck-shapeops with SolidCraftmodifications (listed in vendor/README.md and marked in the source); its licence is invendor/truck-shapeops/LICENSE. Copyright (c) RICOS Co. Ltd.@@ -23,6 +23,6 @@ Most bundled assets are drawn in code or contributed originally; third-party fonfor sketch text, BIZ UDPGothic for web Japanese display) are licensed under SIL OFL 1.1. Theper-file list is in ATTRIBUTION.md.-SolveCraft is an independent project and is not affiliated with, sponsored by or endorsed by+SolidCraft is an independent project and is not affiliated with, sponsored by or endorsed byAutodesk, Inc. Autodesk and Fusion are trademarks of Autodesk, Inc.; they are used here only todescribe compatibility goals.diff --git a/README.md b/README.mdindex 316e8669cf..46d6be2b9b 100644--- a/README.md+++ b/README.md@@ -27,14 +27,12 @@ and help is welcome: see [CONTRIBUTING.md](CONTRIBUTING.md).## Name and compatibility-SolidCraft was previously called SolveCraft. The product display name and repository are-changing; existing identifiers remain compatible: `.solvecraft` designs, `solvecraft-cli`,-Cargo package names, settings/recovery locations and package IDs keep their existing names.-Published 0.2.0 and 0.2.1 packages and demo recordings retain their original SolveCraft branding-and filenames.--On macOS, the DMG contains `SolidCraft.app`. To replace an older `SolveCraft.app`-without installing a second copy, follow the [macOS upgrade instructions](https://bherbruck.github.io/solidcraft/guide/getting-started.html#macos).+SolidCraft was renamed from an earlier working name. Since 0.5.0 everything uses the new+name: the `solidcraft` and `solidcraft-cli` programs, `.solidcraft` designs, `SOLIDCRAFT_*`+environment variables, settings folders and the `solidcraft` MCP server. Upgrading keeps+working: designs, settings, recovery files, environment variables and CLI/MCP setups from+earlier builds carry over. Every compatibility shim is listed in+[docs/compatibility.md](docs/compatibility.md).Use the SolidCraft documentation and web-app URLs above. GitHub redirects links to therenamed repository; old-name Pages and Flatpak URLs are not maintained as permanent aliases.@@ -77,7 +75,7 @@ renamed repository; old-name Pages and Flatpak URLs are not maintained as permanretained shallow prismatic pockets, exact line/arc/circle DXF outlines and bend tables;plastic enclosure features and rules. Pocket depth and side survive unfold/refold and appearseparately from through-hole outlines in the flat preview and DXF.-- **Files**: designs as JSON (`.solvecraft`), export to STEP (AP242 with body names, colours and+- **Files**: designs as JSON (`.solidcraft`), export to STEP (AP242 with body names, colours andcomponents as assemblies; revolved faces as native planes, cylinders, cones, spheres and tori),IGES 5.3 (manifold solid B-reps with names and colours), 3MF, STL (binary/ASCII) and OBJ;3MF, STL and OBJ import as mesh bodies (they render, measure, move and export; solid features@@ -92,9 +90,9 @@ renamed repository; old-name Pages and Flatpak URLs are not maintained as permancontrol channel so agents and tests can drive it.Feature errors and Help can open an editable **Create Issue** draft with relevant contextand an optional reviewed screenshot; opening GitHub does not submit the report.-- **Headless CLI** `solvecraft-cli`: run command scripts, measure (volume, area, centre of mass,+- **Headless CLI** `solidcraft-cli`: run command scripts, measure (volume, area, centre of mass,face/edge/vertex counts), export, render PNG snapshots and replay reference recipes.-- **MCP server** `solvecraft-cli mcp`: AI agents model, measure and look at parts headless or+- **MCP server** `solidcraft-cli mcp`: AI agents model, measure and look at parts headless orin the running app (see below).## Build and run@@ -130,7 +128,7 @@ sandbox does not expose hidraw devices, so the 3D mouse only works with native bDevices that send all six axes in HID report 1 (some homemade ones do) are recognised from theirreport descriptor, so they work as well.-In the browser: `cd apps/solvecraft-web && trunk build --release --public-url ./` (WebGPU, or+In the browser: `cd apps/solidcraft-web && trunk build --release --public-url ./` (WebGPU, orWebGL2 with `?webgl`; `?sample` opens the sample part).## Scripts@@ -148,12 +146,12 @@ A script is a JSON list of commands, the same ones the UI runs:## AI agents (MCP)-`solvecraft-cli mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server on+`solidcraft-cli mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server onstdio. Headless it runs its own design session; with `--connect 127.0.0.1:PORT` it drives the app-started with `solvecraft --control PORT`, so you can watch the agent model. Tools:+started with `solidcraft --control PORT`, so you can watch the agent model. Tools:`list_commands`, `execute`, `batch`, `inspect_design`, `measure`, `body_topology`,`set_parameter`, `screenshot` (returns the image), `export`, `undo`, `redo`, `new_design`, `open`,-`save`. Claude Code: `claude mcp add solvecraft -- solvecraft-cli mcp`. Details, client+`save`. Claude Code: `claude mcp add solidcraft -- solidcraft-cli mcp`. Details, clientconfiguration and an example session: [docs/mcp.md](docs/mcp.md).## Architecture@@ -167,7 +165,7 @@ configuration and an example session: [docs/mcp.md](docs/mcp.md).| L3 | `io` | design files, STL/OBJ/STEP/3MF export, STEP and 3MF/STL import features || L4 | `engine` | the session and the command registry (everything is a command) || L5 | `ui-egui`, `mcp` | the swappable desktop front end; the MCP server (headless or bridged to the app) |-| apps | `solvecraft`, `solvecraft-cli` | desktop app, headless CLI |+| apps | `solidcraft`, `solidcraft-cli` | desktop app, headless CLI |<!-- ANCHOR_END: architecture -->## Contributingdiff --git a/ROADMAP.md b/ROADMAP.mdindex dfc15f91b1..fe54424432 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -57,7 +57,7 @@ PCB / Package, Render, Animation, Simulation, Manufacture/CAM, Drawings.| M11 | 2D drawings | deferred | — || M12 | Release: cross-platform packages, verification and deliberate publication implemented; original current-UI demo refreshed. Trusted distribution signing and broader performance work remain | in progress | 16 || M14 | Configurations: a table of rows (parameter expressions and feature suppressions per row) switched with config.activate (undoable, all or nothing), kept through parameter renames and feature deletes (config.configure, config.table, config.column/row/activate). Per-row body materials and appearances (library looks, custom colour/opacity and clearing overrides), undoable activation and save/reopen: done. Ordered typed configuration rules, atomic validation and structured rule editing: done. Component appearance and certified semantic face style columns, atomic preview/apply and independent-copy remapping: done. Exact constructed sketch-side and immutable imported-face lineage now preserve legacy names and reject retargeting. Left: ambiguous shifted/two-sided caps | in progress | 4 |-| M13 | Never lose work: atomic saves (temporary file, flush, rename; a crash at any moment leaves the old file or the new one) with the replaced version kept as `<file>.bak`; autosave of unsaved changes to the recovery folder every 5 minutes (preference) and after big operations, only when something changed; "Recover unsaved design?" on the next launch (`doc.recovery_list`, `doc.recover`, `doc.recovery_discard`); a kill-mid-save test (process killed while saving a 0.5 MB design 25 times). File format: `"format": "solvecraft/12"`, older formats upgraded step by step (`doc::format`), newer ones refused with a message, out-of-range numbers and broken placements refused; a corpus of designs saved by M0, components-era, joints-era and current builds (apps/solvecraft-cli/tests/corpus) that must open and evaluate as saved; damaged and hostile variants (truncation, bit flips, hostile values, removed keys, repeated features, deep nesting) never panic | done | 6 |+| M13 | Never lose work: atomic saves (temporary file, flush, rename; a crash at any moment leaves the old file or the new one) with the replaced version kept as `<file>.bak`; autosave of unsaved changes to the recovery folder every 5 minutes (preference) and after big operations, only when something changed; "Recover unsaved design?" on the next launch (`doc.recovery_list`, `doc.recover`, `doc.recovery_discard`); a kill-mid-save test (process killed while saving a 0.5 MB design 25 times). File format: `"format": "solidcraft/12"`, older formats upgraded step by step (`doc::format`), newer ones refused with a message, out-of-range numbers and broken placements refused; a corpus of designs saved by M0, components-era, joints-era and current builds (apps/solidcraft-cli/tests/corpus) that must open and evaluate as saved; damaged and hostile variants (truncation, bit flips, hostile values, removed keys, repeated features, deep nesting) never panic | done | 6 |## Dimensioning and error reportingdiff --git a/THIRD-PARTY-LICENSES.txt b/THIRD-PARTY-LICENSES.txtindex 001e828983..b6a2e4c59a 100644--- a/THIRD-PARTY-LICENSES.txt+++ b/THIRD-PARTY-LICENSES.txt@@ -1,6 +1,6 @@Third-party software in SolidCraft-SolidCraft (the desktop app, solvecraft-cli and the web app) is built from the 454 crates below.+SolidCraft (the desktop app, solidcraft-cli and the web app) is built from the 454 crates below.Generated by `cargo xtask licences` from Cargo.lock and the crates' own licence files.SolidCraft's own licence is in LICENSE-MIT and LICENSE-APACHE, and NOTICE.@@ -13354,7 +13354,7 @@ Bundled fonts (SIL Open Font License, Version 1.1)Copyright 2012 Red Hat, Inc. (Liberation Fonts 2.x; digitized data Google)Source: https://github.com/liberationfonts-- BIZUDPGothic-Regular.ttf (apps/solvecraft-web/fonts/BIZUDPGothic-Regular.ttf)+- BIZUDPGothic-Regular.ttf (apps/solidcraft-web/fonts/BIZUDPGothic-Regular.ttf)Copyright 2022 The BIZ UDGothic Project Authors (https://github.com/googlefonts/morisawa-biz-ud-mincho)Source: https://github.com/googlefonts/morisawa-biz-ud-gothicdiff --git a/apps/solvecraft-cli/Cargo.toml b/apps/solidcraft-cli/Cargo.tomlsimilarity index 88%rename from apps/solvecraft-cli/Cargo.tomlrename to apps/solidcraft-cli/Cargo.tomlindex aacadb60d4..3e4f01e111 100644--- a/apps/solvecraft-cli/Cargo.toml+++ b/apps/solidcraft-cli/Cargo.toml@@ -20,6 +20,6 @@ name = "solvecraft-cli"path = "src/alias.rs"[dependencies]-solvecraft-engine = { workspace = true }-solvecraft-mcp = { workspace = true }+solidcraft-engine = { workspace = true }+solidcraft-mcp = { workspace = true }serde_json = { workspace = true }diff --git a/apps/solvecraft-cli/src/alias.rs b/apps/solidcraft-cli/src/alias.rssimilarity index 100%rename from apps/solvecraft-cli/src/alias.rsrename to apps/solidcraft-cli/src/alias.rsdiff --git a/apps/solvecraft-cli/src/crashes.rs b/apps/solidcraft-cli/src/crashes.rssimilarity index 98%rename from apps/solvecraft-cli/src/crashes.rsrename to apps/solidcraft-cli/src/crashes.rsindex bae7f60c5e..01288fbfdc 100644--- a/apps/solvecraft-cli/src/crashes.rs+++ b/apps/solidcraft-cli/src/crashes.rs@@ -4,7 +4,7 @@use std::sync::Mutex;use serde_json::{Value, json};-use solvecraft_engine::crash;+use solidcraft_engine::crash;const USAGE: &str = "usage: solidcraft-cli crashes [list [--json] | show <id> | replay <id> | dir | clear [<id>]]";@@ -58,7 +58,7 @@ fn replay(report: &Value) -> Result<(), String> {let commands = script["commands"].as_array().cloned().unwrap_or_default();let mut s = match report["design_path"].as_str() {Some(d) => super::load(d)?,- None => solvecraft_engine::Session::default(),+ None => solidcraft_engine::Session::default(),};std::panic::set_hook(Box::new(|info| {let loc = info.location().map_or_else(|| "(unknown)".to_string(), |l| format!("{}:{}", l.file(), l.line()));diff --git a/apps/solvecraft-cli/src/fuzz.rs b/apps/solidcraft-cli/src/fuzz.rssimilarity index 98%rename from apps/solvecraft-cli/src/fuzz.rsrename to apps/solidcraft-cli/src/fuzz.rsindex 6c76fedefe..fcd5756e1e 100644--- a/apps/solvecraft-cli/src/fuzz.rs+++ b/apps/solidcraft-cli/src/fuzz.rs@@ -9,8 +9,8 @@ use std::process::{Command, Stdio};use std::time::{Duration, Instant};use serde_json::{Value, json};-use solvecraft_engine::fuzz;-use solvecraft_engine::fuzz::boolean_case;+use solidcraft_engine::fuzz;+use solidcraft_engine::fuzz::boolean_case;fn flag<T: std::str::FromStr>(args: &[String], name: &str, default: T) -> T {args.iter().position(|a| a == name).and_then(|i| args.get(i + 1)).and_then(|v| v.parse().ok()).unwrap_or(default)@@ -45,7 +45,7 @@ pub fn one(args: &[String]) -> Result<(), String> {design["minimal"] = json!({"outcome": m.outcome, "steps": m.steps.iter().map(|s| s.kind).collect::<Vec<_>>(), "script": m.script()});}}- let (a, b) = solvecraft_engine::fuzz::boolean_shapes(seed);+ let (a, b) = solidcraft_engine::fuzz::boolean_shapes(seed);eprintln!("boolean {seed} {} {}", serde_json::to_string(&a).unwrap_or_default(), serde_json::to_string(&b).unwrap_or_default());let b = boolean_case(seed);let bp = PANICS.swap(0, std::sync::atomic::Ordering::SeqCst);diff --git a/apps/solvecraft-cli/src/main.rs b/apps/solidcraft-cli/src/main.rssimilarity index 87%rename from apps/solvecraft-cli/src/main.rsrename to apps/solidcraft-cli/src/main.rsindex 82c9ca61fa..a067afb92b 100644--- a/apps/solvecraft-cli/src/main.rs+++ b/apps/solidcraft-cli/src/main.rs@@ -1,16 +1,16 @@-//! SolveCraft headless command line.+//! SolidCraft headless command line.//!//! ```text-//! solidcraft-cli run <script.json|design.solvecraft|part.step|mesh.3mf> [--in design|part.step|mesh.3mf] [--out FILE]... [--save FILE] [--quiet]-//! solidcraft-cli eval <script.json|design.solvecraft|part.step> (alias: inspect) measurements as JSON-//! solidcraft-cli bench-open <design.solvecraft | part.step> [--parse-only] loading timings as JSON lines+//! solidcraft-cli run <script.json|design.solidcraft|part.step|mesh.3mf> [--in design|part.step|mesh.3mf] [--out FILE]... [--save FILE] [--quiet]+//! solidcraft-cli eval <script.json|design.solidcraft|part.step> (alias: inspect) measurements as JSON+//! solidcraft-cli bench-open <design.solidcraft | part.step> [--parse-only] loading timings as JSON lines//! solidcraft-cli snapshot <script|design> --out shot.png [--width W] [--height H] [--view iso|front|top|…]//! solidcraft-cli exec <command> [json-params] run one command on an empty design//! solidcraft-cli commands the command registry as JSON//! solidcraft-cli recipe <recipe.json> translate an oracle recipe to a script//! solidcraft-cli oracle <case-dir>... replay recipes and compare with expected.json//! solidcraft-cli mcp [--in design|script] [--connect HOST:PORT] MCP server on stdio (docs/mcp.md)-//! solidcraft-cli licences SolveCraft's licence and the third-party licences+//! solidcraft-cli licences SolidCraft's licence and the third-party licences//! solidcraft-cli icon --out F.png|F.ico [--size N] the app icon (packaging; drawn, not a file)//! ```#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]@@ -28,21 +28,21 @@ use serde_json::{Value, json};#[path = "../../app_icon.rs"]mod app_icon;-use solvecraft_engine::Session;-use solvecraft_engine::render::{StandardView, render_png};+use solidcraft_engine::Session;+use solidcraft_engine::render::{StandardView, render_png};const USAGE: &str = "usage:- solidcraft-cli run <script.json|design.solvecraft|part.step> [--in design.solvecraft|part.step] [--out FILE]... [--save FILE] [--quiet] [--results]- solidcraft-cli run --in <design.solvecraft|part.step> [--out FILE]...- solidcraft-cli eval <script.json|design.solvecraft|part.step> (alias: inspect; or --in FILE)- solidcraft-cli bench-open <design.solvecraft | part.step> [--parse-only]+ solidcraft-cli run <script.json|design.solidcraft|part.step> [--in design.solidcraft|part.step] [--out FILE]... [--save FILE] [--quiet] [--results]+ solidcraft-cli run --in <design.solidcraft|part.step> [--out FILE]...+ solidcraft-cli eval <script.json|design.solidcraft|part.step> (alias: inspect; or --in FILE)+ solidcraft-cli bench-open <design.solidcraft | part.step> [--parse-only]solidcraft-cli snapshot <script|design> --out shot.png [--width W] [--height H] [--view iso|front|back|top|bottom|left|right]solidcraft-cli exec <command> [json-params]solidcraft-cli commandssolidcraft-cli recipe <recipe.json>solidcraft-cli oracle <case-dir>... [--json]solidcraft-cli fuzz [--from N] [--count N] [--jobs J] [--timeout S] [--steps N] [--minimise] [--out DIR] [--report FILE]- solidcraft-cli mcp [--in design.solvecraft|script.json] [--connect 127.0.0.1:PORT]+ solidcraft-cli mcp [--in design.solidcraft|script.json] [--connect 127.0.0.1:PORT]solidcraft-cli crashes [list [--json] | show <id> | replay <id> | dir | clear [<id>]]solidcraft-cli licencessolidcraft-cli icon --out icon.png [--size 256] | --out icon.ico@@ -81,7 +81,7 @@ fn main() -> ExitCode {Some("licences" | "licenses") => {// Written, not print!ed: a closed pipe (`| head`) is not a crash.use std::io::Write as _;- let _ = std::io::stdout().lock().write_all(solvecraft_engine::licences::all().as_bytes());+ let _ = std::io::stdout().lock().write_all(solidcraft_engine::licences::all().as_bytes());Ok(())}// Hidden, for the kill-mid-save test: save a large design over and over.@@ -111,19 +111,19 @@ fn pretty(v: &Value) -> String {pub fn read_json(path: &str) -> Result<Value, String> {// Through the engine's file access, which refuses anything that is not a regular file and// reads no more than the cap: a character device or a FIFO would otherwise never end.- let s = solvecraft_engine::io::vfs::read_to_string(path, solvecraft_engine::io::MAX_DESIGN_BYTES).map_err(|e| format!("{path}: {e}"))?;+ let s = solidcraft_engine::io::vfs::read_to_string(path, solidcraft_engine::io::MAX_DESIGN_BYTES).map_err(|e| format!("{path}: {e}"))?;serde_json::from_str(&s).map_err(|e| format!("{path}: {e}"))}/// A session from a design file, a STEP/3MF/STL file, a command script, or an oracle recipe.pub fn load(path: &str) -> Result<Session, String> {let mut s = Session::default();- if solvecraft_engine::io::is_step_path(path) || solvecraft_engine::io::is_mesh_path(path) {+ if solidcraft_engine::io::is_step_path(path) || solidcraft_engine::io::is_mesh_path(path) {s.execute("doc.open", &json!({"path": path})).map_err(|e| e.to_string())?;return Ok(s);}let v = read_json(path)?;- if v.get("format").and_then(Value::as_str).is_some_and(|f| f.starts_with("solvecraft")) {+ if v.get("format").and_then(Value::as_str).is_some_and(|f| solidcraft_engine::doc::format::version_of(f).is_some()) {s.execute("doc.open", &json!({"path": path})).map_err(|e| e.to_string())?;} else if v.get("features").is_some() && v.get("commands").is_none() {let script = recipe::to_script(&v)?;@@ -220,11 +220,11 @@ fn cmd_snapshot(args: &[String]) -> Result<(), String> {let w = flag(args, "--width").and_then(|x| x.parse().ok()).unwrap_or(1280usize);let h = flag(args, "--height").and_then(|x| x.parse().ok()).unwrap_or(800usize);let s = load(path)?;- let mut cam = solvecraft_engine::view::home_camera(&s);+ let mut cam = solidcraft_engine::view::home_camera(&s);if let Some(v) = flag(args, "--view") {cam.set_view(StandardView::parse(v).ok_or_else(|| format!("unknown view `{v}`"))?);}- let scene = solvecraft_engine::view::scene(&s, &cam);+ let scene = solidcraft_engine::view::scene(&s, &cam);let png = render_png(&scene, &cam, w, h).ok_or("render failed")?;std::fs::write(out, &png).map_err(|e| format!("{out}: {e}"))?;println!("{}", pretty(&json!({"path": out, "width": w, "height": h, "bytes": png.len()})));@@ -249,7 +249,7 @@ fn cmd_icon(args: &[String]) -> Result<(), String> {}fn icon_png(size: usize) -> Result<Vec<u8>, String> {- solvecraft_engine::render::png(size, size, app_icon::rgba(size)?).ok_or_else(|| "icon: PNG encoding failed".to_string())+ solidcraft_engine::render::png(size, size, app_icon::rgba(size)?).ok_or_else(|| "icon: PNG encoding failed".to_string())}/// A Windows icon file holding PNG images (Vista and later read these).@@ -287,21 +287,21 @@ fn cmd_exec(args: &[String]) -> Result<(), String> {/// MCP server on stdio: headless (optionally starting from a design or script) or bridged to/// a running app's control port. stdout carries only protocol messages.fn cmd_mcp(args: &[String]) -> Result<(), String> {- let backend: Box<dyn solvecraft_mcp::Backend> = match (flag(args, "--connect"), flag(args, "--in")) {+ let backend: Box<dyn solidcraft_mcp::Backend> = match (flag(args, "--connect"), flag(args, "--in")) {(Some(_), Some(_)) => return Err("mcp: use either --connect or --in, not both".into()),- (Some(addr), None) => Box::new(solvecraft_mcp::Remote::connect(addr).map_err(|e| {+ (Some(addr), None) => Box::new(solidcraft_mcp::Remote::connect(addr).map_err(|e| {let port = addr.rsplit(':').next().filter(|p| p.parse::<u16>().is_ok()).unwrap_or("PORT");format!("cannot connect to {addr}: {e}\nno SolidCraft app is listening there; start it with \- `solvecraft --control {port}` (or SOLVECRAFT_CONTROL_PORT={port}) and retry"+ `solidcraft --control {port}` (or SOLIDCRAFT_CONTROL_PORT={port}) and retry")})?),- (None, Some(path)) => Box::new(solvecraft_mcp::Headless::new(load(path)?)),- (None, None) => Box::new(solvecraft_mcp::Headless::default()),+ (None, Some(path)) => Box::new(solidcraft_mcp::Headless::new(load(path)?)),+ (None, None) => Box::new(solidcraft_mcp::Headless::default()),};let stdin = std::io::stdin();let stdout = std::io::stdout();- solvecraft_mcp::Server::new(backend).serve(stdin.lock(), stdout.lock()).map_err(|e| e.to_string())+ solidcraft_mcp::Server::new(backend).serve(stdin.lock(), stdout.lock()).map_err(|e| e.to_string())}/// `save-stress <path> <rounds>`: save a design of a few hundred kilobytes `rounds` times, its@@ -311,7 +311,7 @@ fn cmd_save_stress(args: &[String]) -> Result<(), String> {return Err("usage: solidcraft-cli save-stress <path> <rounds>".into());};let mut s = Session::default();- let filler = (0..3000).map(|i| solvecraft_engine::doc::Param {+ let filler = (0..3000).map(|i| solidcraft_engine::doc::Param {name: format!("p{i}"),expr: format!("{i} mm + 0.5 mm"),unit: "mm".into(),@@ -358,21 +358,21 @@ fn cmd_bench_edit(args: &[String]) -> Result<(), String> {/// Separate file reading, JSON decoding/repair, timeline evaluation and display meshing.fn cmd_bench_open(args: &[String]) -> Result<(), String> {- let path = args.first().ok_or("usage: solidcraft-cli bench-open <design.solvecraft | part.step> [--parse-only]")?;+ let path = args.first().ok_or("usage: solidcraft-cli bench-open <design.solidcraft | part.step> [--parse-only]")?;let t = std::time::Instant::now();- let step = solvecraft_engine::io::is_step_path(path);- let limit = if step { solvecraft_engine::io::MAX_STEP_BYTES } else { solvecraft_engine::io::MAX_DESIGN_BYTES };- let bytes = solvecraft_engine::io::vfs::read(path, limit).map_err(|e| format!("{path}: {e}"))?;+ let step = solidcraft_engine::io::is_step_path(path);+ let limit = if step { solidcraft_engine::io::MAX_STEP_BYTES } else { solidcraft_engine::io::MAX_DESIGN_BYTES };+ let bytes = solidcraft_engine::io::vfs::read(path, limit).map_err(|e| format!("{path}: {e}"))?;let read_ms = t.elapsed().as_secs_f64() * 1000.0;println!("{}", json!({"step": "read", "ms": read_ms, "bytes": bytes.len()}));let t = std::time::Instant::now();let doc = if step {- let imported = solvecraft_engine::io::step_import_feature(&bytes, path).map_err(|e| e.to_string())?;- let mut doc = solvecraft_engine::doc::Document::new(&imported.name);+ let imported = solidcraft_engine::io::step_import_feature(&bytes, path).map_err(|e| e.to_string())?;+ let mut doc = solidcraft_engine::doc::Document::new(&imported.name);doc.add_feature(imported.kind, Some(&imported.name)).map_err(|e| e.to_string())?;doc} else {- solvecraft_engine::io::read_design(&bytes).map_err(|e| e.to_string())?+ solidcraft_engine::io::read_design(&bytes).map_err(|e| e.to_string())?};let parse_ms = t.elapsed().as_secs_f64() * 1000.0;println!("{}", json!({"step": "parse", "ms": parse_ms, "features": doc.features.len()}));diff --git a/apps/solvecraft-cli/src/oracle.rs b/apps/solidcraft-cli/src/oracle.rssimilarity index 94%rename from apps/solvecraft-cli/src/oracle.rsrename to apps/solidcraft-cli/src/oracle.rsindex 2d1b1ec84f..37e2853e45 100644--- a/apps/solvecraft-cli/src/oracle.rs+++ b/apps/solidcraft-cli/src/oracle.rs@@ -5,7 +5,7 @@#![allow(clippy::needless_range_loop)]use serde_json::{Value, json};-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::geom::Vec3;use crate::spatial::{self, Tri};use crate::{read_json, recipe};@@ -88,7 +88,7 @@ fn check_case(dir: &str) -> Value {Ok(s) => s,Err(e) => return json!({"case": name, "pass": false, "skipped": true, "error": e}),};- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();if let Err(e) = s.run_script(&script) {return json!({"case": name, "pass": false, "error": e.to_string(), "source": want.as_ref().map(|w| w["source"].clone())});}@@ -148,27 +148,27 @@ fn check_case(dir: &str) -> Value {}/// Export the session's bodies as STEP, validate the file and import it again.-fn step_export_check(s: &solvecraft_engine::Session, volume: f64) -> (bool, String) {+fn step_export_check(s: &solidcraft_engine::Session, volume: f64) -> (bool, String) {let st = s.model.state();- let bytes = match solvecraft_engine::io::export(&st, &[], solvecraft_engine::io::Format::Step, "oracle") {+ let bytes = match solidcraft_engine::io::export(&st, &[], solidcraft_engine::io::Format::Step, "oracle") {Ok(b) => b,Err(e) => return (false, format!("export: {e}")),};let text = String::from_utf8_lossy(&bytes);- if let Err(e) = solvecraft_engine::kernel::step_validate(&text) {+ if let Err(e) = solidcraft_engine::kernel::step_validate(&text) {return (false, format!("invalid: {e}"));}- match solvecraft_engine::kernel::step_orientation_errors(&text) {+ match solidcraft_engine::kernel::step_orientation_errors(&text) {Ok(errs) if !errs.is_empty() => return (false, format!("faces inside out: {}", errs.join("; "))),Err(e) => return (false, format!("orientation check: {e}")),Ok(_) => {}}- match solvecraft_engine::kernel::step_import(&text) {+ match solidcraft_engine::kernel::step_import(&text) {Ok(imp) if !imp.warnings.is_empty() => (false, format!("warnings: {}", imp.warnings.join("; "))),Ok(imp) if imp.bodies.len() != st.bodies.len() => (false, format!("{} bodies back of {}", imp.bodies.len(), st.bodies.len())),Ok(imp) => {- let m: Vec<_> = imp.bodies.iter().filter_map(|b| solvecraft_engine::kernel::measure(&b.body).ok()).collect();- let m0: Vec<_> = st.bodies.iter().filter_map(|b| solvecraft_engine::kernel::measure(&b.body).ok()).collect();+ let m: Vec<_> = imp.bodies.iter().filter_map(|b| solidcraft_engine::kernel::measure(&b.body).ok()).collect();+ let m0: Vec<_> = st.bodies.iter().filter_map(|b| solidcraft_engine::kernel::measure(&b.body).ok()).collect();let v: f64 = m.iter().map(|x| x.volume).sum();let (a, a0): (f64, f64) = (m.iter().map(|x| x.area).sum(), m0.iter().map(|x| x.area).sum());let faces: usize = imp.bodies.iter().map(|b| b.file_faces).sum();@@ -184,7 +184,7 @@ fn step_export_check(s: &solvecraft_engine::Session, volume: f64) -> (bool, Stri}/// Our part as a triangle soup (curved faces refined onto the surface).-fn our_mesh(s: &solvecraft_engine::Session) -> Result<Vec<Tri>, String> {+fn our_mesh(s: &solidcraft_engine::Session) -> Result<Vec<Tri>, String> {let mut ours: Vec<Tri> = Vec::new();for b in &s.world_state().bodies {let m = b.body.tessellate_with(MESH_TOL, true).map_err(|e| e.to_string())?;@@ -201,7 +201,7 @@ fn our_mesh(s: &solvecraft_engine::Session) -> Result<Vec<Tri>, String> {/// Compare our part with the reference triangulation: the symmetric surface distance, and the/// principal second moments of volume of both meshes (the shape's inertia, independent of how it/// sits in space).-fn reference_checks(s: &solvecraft_engine::Session, stl: &str, tol: f64, c: &mut Checks) {+fn reference_checks(s: &solidcraft_engine::Session, stl: &str, tol: f64, c: &mut Checks) {let (ours, reference) = match (our_mesh(s), spatial::read_stl(stl)) {(Ok(o), Ok(r)) if !r.is_empty() => (o, r),(Err(e), _) | (_, Err(e)) => return c.push("surface_distance_mm", json!(e), json!(format!("<= {tol}")), false),diff --git a/apps/solvecraft-cli/src/recipe.rs b/apps/solidcraft-cli/src/recipe.rssimilarity index 100%rename from apps/solvecraft-cli/src/recipe.rsrename to apps/solidcraft-cli/src/recipe.rsdiff --git a/apps/solvecraft-cli/src/spatial.rs b/apps/solidcraft-cli/src/spatial.rssimilarity index 100%rename from apps/solvecraft-cli/src/spatial.rsrename to apps/solidcraft-cli/src/spatial.rsdiff --git a/apps/solvecraft-cli/tests/commands_output.rs b/apps/solidcraft-cli/tests/commands_output.rssimilarity index 100%rename from apps/solvecraft-cli/tests/commands_output.rsrename to apps/solidcraft-cli/tests/commands_output.rsdiff --git a/apps/solvecraft-cli/tests/corpus/README.md b/apps/solidcraft-cli/tests/corpus/README.mdsimilarity index 91%rename from apps/solvecraft-cli/tests/corpus/README.mdrename to apps/solidcraft-cli/tests/corpus/README.mdindex 7e26db035b..8fa2620925 100644--- a/apps/solvecraft-cli/tests/corpus/README.md+++ b/apps/solidcraft-cli/tests/corpus/README.md@@ -1,8 +1,8 @@# Design file corpus-Designs saved by older SolveCraft builds. `tests/design_corpus.rs` opens each one with the+Designs saved by older SolidCraft builds. `tests/design_corpus.rs` opens each one with thecurrent build and checks that it evaluates as it did when saved (the `.expected.json` next to-it is `solvecraft-cli eval` of that file by the build that saved it: bodies, volumes, areas,+it is `solidcraft-cli eval` of that file by the build that saved it: bodies, volumes, areas,world bounding boxes), that it is upgraded to the current file format, and that damaged andhostile variants of it never panic.diff --git a/apps/solvecraft-cli/tests/corpus/components-arm.expected.json b/apps/solidcraft-cli/tests/corpus/components-arm.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/components-arm.expected.jsonrename to apps/solidcraft-cli/tests/corpus/components-arm.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/components-arm.solvecraft b/apps/solidcraft-cli/tests/corpus/components-arm.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/components-arm.solvecraftrename to apps/solidcraft-cli/tests/corpus/components-arm.solidcraftindex 8fb36b0150..0132dd69d8 100644--- a/apps/solvecraft-cli/tests/corpus/components-arm.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/components-arm.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/corpus/joints-hinge.expected.json b/apps/solidcraft-cli/tests/corpus/joints-hinge.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/joints-hinge.expected.jsonrename to apps/solidcraft-cli/tests/corpus/joints-hinge.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/joints-hinge.solvecraft b/apps/solidcraft-cli/tests/corpus/joints-hinge.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/joints-hinge.solvecraftrename to apps/solidcraft-cli/tests/corpus/joints-hinge.solidcraftindex d83f17676e..03c705a4e8 100644--- a/apps/solvecraft-cli/tests/corpus/joints-hinge.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/joints-hinge.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [diff --git a/apps/solvecraft-cli/tests/corpus/m0-box-fillet-hole.expected.json b/apps/solidcraft-cli/tests/corpus/m0-box-fillet-hole.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/m0-box-fillet-hole.expected.jsonrename to apps/solidcraft-cli/tests/corpus/m0-box-fillet-hole.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/m0-box-fillet-hole.solvecraft b/apps/solidcraft-cli/tests/corpus/m0-box-fillet-hole.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/m0-box-fillet-hole.solvecraftrename to apps/solidcraft-cli/tests/corpus/m0-box-fillet-hole.solidcraftindex e917f44531..f49b181771 100644--- a/apps/solvecraft-cli/tests/corpus/m0-box-fillet-hole.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/m0-box-fillet-hole.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [diff --git a/apps/solvecraft-cli/tests/corpus/m0-revolve-primitives.expected.json b/apps/solidcraft-cli/tests/corpus/m0-revolve-primitives.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/m0-revolve-primitives.expected.jsonrename to apps/solidcraft-cli/tests/corpus/m0-revolve-primitives.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/m0-revolve-primitives.solvecraft b/apps/solidcraft-cli/tests/corpus/m0-revolve-primitives.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/m0-revolve-primitives.solvecraftrename to apps/solidcraft-cli/tests/corpus/m0-revolve-primitives.solidcraftindex bcfcc0b4cf..3e1f0c87ef 100644--- a/apps/solvecraft-cli/tests/corpus/m0-revolve-primitives.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/m0-revolve-primitives.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/corpus/modern-path-pattern.expected.json b/apps/solidcraft-cli/tests/corpus/modern-path-pattern.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/modern-path-pattern.expected.jsonrename to apps/solidcraft-cli/tests/corpus/modern-path-pattern.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/modern-path-pattern.solvecraft b/apps/solidcraft-cli/tests/corpus/modern-path-pattern.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/modern-path-pattern.solvecraftrename to apps/solidcraft-cli/tests/corpus/modern-path-pattern.solidcraftindex f7e882f3cb..56decec86f 100644--- a/apps/solvecraft-cli/tests/corpus/modern-path-pattern.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/modern-path-pattern.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/corpus/modern-plastic.expected.json b/apps/solidcraft-cli/tests/corpus/modern-plastic.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/modern-plastic.expected.jsonrename to apps/solidcraft-cli/tests/corpus/modern-plastic.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/modern-plastic.solvecraft b/apps/solidcraft-cli/tests/corpus/modern-plastic.solidcraftsimilarity index 98%rename from apps/solvecraft-cli/tests/corpus/modern-plastic.solvecraftrename to apps/solidcraft-cli/tests/corpus/modern-plastic.solidcraftindex fc8a96c1dc..cca4a9fddd 100644--- a/apps/solvecraft-cli/tests/corpus/modern-plastic.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/modern-plastic.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [diff --git a/apps/solvecraft-cli/tests/corpus/modern-sheet-metal.expected.json b/apps/solidcraft-cli/tests/corpus/modern-sheet-metal.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/modern-sheet-metal.expected.jsonrename to apps/solidcraft-cli/tests/corpus/modern-sheet-metal.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/modern-sheet-metal.solvecraft b/apps/solidcraft-cli/tests/corpus/modern-sheet-metal.solidcraftsimilarity index 98%rename from apps/solvecraft-cli/tests/corpus/modern-sheet-metal.solvecraftrename to apps/solidcraft-cli/tests/corpus/modern-sheet-metal.solidcraftindex b9611c825b..556482f372 100644--- a/apps/solvecraft-cli/tests/corpus/modern-sheet-metal.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/modern-sheet-metal.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/1",+ "format": "solidcraft/1","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/corpus/naming-split-pieces.expected.json b/apps/solidcraft-cli/tests/corpus/naming-split-pieces.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/naming-split-pieces.expected.jsonrename to apps/solidcraft-cli/tests/corpus/naming-split-pieces.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/naming-split-pieces.solvecraft b/apps/solidcraft-cli/tests/corpus/naming-split-pieces.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/naming-split-pieces.solvecraftrename to apps/solidcraft-cli/tests/corpus/naming-split-pieces.solidcraftindex 6cabf4a181..2880ccd84e 100644--- a/apps/solvecraft-cli/tests/corpus/naming-split-pieces.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/naming-split-pieces.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/13",+ "format": "solidcraft/13","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/corpus/scripts/components-arm.json b/apps/solidcraft-cli/tests/corpus/scripts/components-arm.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/components-arm.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/components-arm.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/joints-hinge.json b/apps/solidcraft-cli/tests/corpus/scripts/joints-hinge.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/joints-hinge.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/joints-hinge.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/m0-box-fillet-hole.json b/apps/solidcraft-cli/tests/corpus/scripts/m0-box-fillet-hole.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/m0-box-fillet-hole.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/m0-box-fillet-hole.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/m0-revolve-primitives.json b/apps/solidcraft-cli/tests/corpus/scripts/m0-revolve-primitives.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/m0-revolve-primitives.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/m0-revolve-primitives.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/modern-path-pattern.json b/apps/solidcraft-cli/tests/corpus/scripts/modern-path-pattern.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/modern-path-pattern.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/modern-path-pattern.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/modern-plastic.json b/apps/solidcraft-cli/tests/corpus/scripts/modern-plastic.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/modern-plastic.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/modern-plastic.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/modern-sheet-metal.json b/apps/solidcraft-cli/tests/corpus/scripts/modern-sheet-metal.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/modern-sheet-metal.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/modern-sheet-metal.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/naming-split-pieces.json b/apps/solidcraft-cli/tests/corpus/scripts/naming-split-pieces.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/naming-split-pieces.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/naming-split-pieces.jsondiff --git a/apps/solvecraft-cli/tests/corpus/scripts/split-body-pieces.json b/apps/solidcraft-cli/tests/corpus/scripts/split-body-pieces.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/scripts/split-body-pieces.jsonrename to apps/solidcraft-cli/tests/corpus/scripts/split-body-pieces.jsondiff --git a/apps/solvecraft-cli/tests/corpus/split-body-pieces.expected.json b/apps/solidcraft-cli/tests/corpus/split-body-pieces.expected.jsonsimilarity index 100%rename from apps/solvecraft-cli/tests/corpus/split-body-pieces.expected.jsonrename to apps/solidcraft-cli/tests/corpus/split-body-pieces.expected.jsondiff --git a/apps/solvecraft-cli/tests/corpus/split-body-pieces.solvecraft b/apps/solidcraft-cli/tests/corpus/split-body-pieces.solidcraftsimilarity index 99%rename from apps/solvecraft-cli/tests/corpus/split-body-pieces.solvecraftrename to apps/solidcraft-cli/tests/corpus/split-body-pieces.solidcraftindex ceb585c528..30d4dbf327 100644--- a/apps/solvecraft-cli/tests/corpus/split-body-pieces.solvecraft+++ b/apps/solidcraft-cli/tests/corpus/split-body-pieces.solidcraft@@ -1,5 +1,5 @@{- "format": "solvecraft/13",+ "format": "solidcraft/13","name": "Untitled","units": "mm","params": [],diff --git a/apps/solvecraft-cli/tests/design_corpus.rs b/apps/solidcraft-cli/tests/design_corpus.rssimilarity index 94%rename from apps/solvecraft-cli/tests/design_corpus.rsrename to apps/solidcraft-cli/tests/design_corpus.rsindex 06ab5abce1..ea11cc7f8b 100644--- a/apps/solvecraft-cli/tests/design_corpus.rs+++ b/apps/solidcraft-cli/tests/design_corpus.rs@@ -1,15 +1,15 @@-//! Designs saved by older SolveCraft builds (tests/corpus, see its README) open and evaluate as+//! Designs saved by older SolidCraft builds (tests/corpus, see its README) open and evaluate as//! they did when they were saved; damaged and hostile design files never panic.use std::path::{Path, PathBuf};use serde_json::{Value, json};-use solvecraft_engine::Session;+use solidcraft_engine::Session;fn corpus() -> Vec<PathBuf> {let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/corpus");let mut v: Vec<PathBuf> =- std::fs::read_dir(&dir).unwrap().flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|x| x == "solvecraft")).collect();+ std::fs::read_dir(&dir).unwrap().flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|x| x == "solidcraft")).collect();v.sort();assert!(v.len() >= 7, "corpus files in {}", dir.display());v@@ -56,7 +56,7 @@ fn old_designs_open_and_evaluate_as_saved() {problems.push(format!("{name}: feature {}: {e}", r.id));}}- assert_eq!(s.doc.format, solvecraft_engine::doc::format::format_string(solvecraft_engine::doc::format::FORMAT), "{name}: upgraded");+ assert_eq!(s.doc.format, solidcraft_engine::doc::format::format_string(solidcraft_engine::doc::format::FORMAT), "{name}: upgraded");let got = s.execute("inspect.measure", &json!({})).unwrap();if got["body_count"] != want["body_count"] && !known(&name, "body_count") {problems.push(format!("{name}: {} bodies, saved with {}", got["body_count"], want["body_count"]));@@ -84,7 +84,7 @@ fn old_designs_open_and_evaluate_as_saved() {}}// Saved again, it reads back the same.- let again = solvecraft_engine::doc::Document::from_json(&s.doc.to_json()).unwrap();+ let again = solidcraft_engine::doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(again, *s.doc, "{name}: round trip");}assert!(problems.is_empty(), "{}", problems.join("\n"));@@ -95,7 +95,7 @@ fn old_designs_open_and_evaluate_as_saved() {/// they are found as the build that saved them found them, without new notes.#[test]fn names_saved_before_exact_history_find_the_faces_they_named() {- let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/corpus/naming-split-pieces.solvecraft");+ let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/corpus/naming-split-pieces.solidcraft");let s = open(&path);let feature = |name: &str| s.doc.features.iter().find(|f| f.name == name).unwrap_or_else(|| panic!("{name}"));assert_eq!(feature("Round").edge_names, vec!["?F2:side:l2|F2:top#2".to_string()]);@@ -106,7 +106,7 @@ fn names_saved_before_exact_history_find_the_faces_they_named() {}// The raised piece is the left one, as saved (the stored point is on it).let state = s.model.state();- let solid = |p: [f64; 3]| state.bodies.iter().any(|b| b.body.contains(solvecraft_engine::geom::Vec3::new(p[0], p[1], p[2])));+ let solid = |p: [f64; 3]| state.bodies.iter().any(|b| b.body.contains(solidcraft_engine::geom::Vec3::new(p[0], p[1], p[2])));assert!(solid([7.0, 15.0, 11.0]) && !solid([32.0, 15.0, 11.0]));}@@ -115,7 +115,7 @@ fn names_saved_before_exact_history_find_the_faces_they_named() {/// the far one stays `Body1` (chamfered), the near one `Body1 (1)` (filleted, coloured).#[test]fn body_names_saved_before_exact_history_keep_their_pieces() {- let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/corpus/split-body-pieces.solvecraft");+ let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/corpus/split-body-pieces.solidcraft");let s = open(&path);assert!(s.doc.features.iter().all(|f| f.shell_piece_order), "every saved feature keeps the shell order");for r in &s.model.results {@@ -123,7 +123,7 @@ fn body_names_saved_before_exact_history_keep_their_pieces() {}let state = s.model.state();let piece = |name: &str| state.bodies.iter().find(|b| b.name == name).unwrap_or_else(|| panic!("{name}"));- let solid = |name: &str, p: [f64; 3]| piece(name).body.contains(solvecraft_engine::geom::Vec3::new(p[0], p[1], p[2]));+ let solid = |name: &str, p: [f64; 3]| piece(name).body.contains(solidcraft_engine::geom::Vec3::new(p[0], p[1], p[2]));assert!(solid("Body1", [20.0, 24.0, 5.0]) && solid("Body1 (1)", [20.0, 6.0, 5.0]));assert!(s.doc.appearances.bodies.contains_key("Body1 (1)"));}@@ -181,7 +181,7 @@ fn at_mut<'a>(v: &'a mut Value, path: &[Value]) -> Option<&'a mut Value> {/// Open a file's bytes as File → Open does and evaluate them; any panic is a failure.fn try_bytes(bytes: &[u8]) {- if let Ok(doc) = solvecraft_engine::io::read_design(bytes) {+ if let Ok(doc) = solidcraft_engine::io::read_design(bytes) {let mut s = Session::new(doc);let _ = s.execute("inspect.measure", &json!({}));let _ = s.execute("document.inspect", &json!({}));@@ -197,7 +197,7 @@ fn generated() -> Vec<(String, Vec<u8>)> {"plane": {"type": "midplane", "a": side, "b": {"type": "plane", "plane": {"type": "origin", "name": "XZ"}}}})};let design = |name: &str, features: Value| {- json!({"format": "solvecraft/11", "name": name, "units": "mm", "params": [], "next_id": 9, "features": features}).to_string().into_bytes()+ json!({"format": "solidcraft/11", "name": name, "units": "mm", "params": [], "next_id": 9, "features": features}).to_string().into_bytes()};// A sketch past the caps interactive editing enforces: solving it would size dense matrices// by the point count and abort on the allocation.diff --git a/apps/solvecraft-cli/tests/fuzz_range.rs b/apps/solidcraft-cli/tests/fuzz_range.rssimilarity index 100%rename from apps/solvecraft-cli/tests/fuzz_range.rsrename to apps/solidcraft-cli/tests/fuzz_range.rsdiff --git a/apps/solvecraft-cli/tests/kill_mid_save.rs b/apps/solidcraft-cli/tests/kill_mid_save.rssimilarity index 91%rename from apps/solvecraft-cli/tests/kill_mid_save.rsrename to apps/solidcraft-cli/tests/kill_mid_save.rsindex e63952dc2d..78dd707b69 100644--- a/apps/solvecraft-cli/tests/kill_mid_save.rs+++ b/apps/solidcraft-cli/tests/kill_mid_save.rs@@ -6,17 +6,17 @@ use std::time::Duration;fn round_of(path: &std::path::Path) -> Option<String> {let bytes = std::fs::read(path).ok()?;- let doc = solvecraft_engine::io::read_design(&bytes).ok()?;+ let doc = solidcraft_engine::io::read_design(&bytes).ok()?;doc.params.iter().find(|p| p.name == "save_round").map(|p| p.expr.clone())}#[test]fn killed_mid_save_the_old_file_survives() {let exe = env!("CARGO_BIN_EXE_solidcraft-cli");- let dir = std::env::temp_dir().join(format!("solvecraft-kill-mid-save-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-kill-mid-save-{}", std::process::id()));let _ = std::fs::remove_dir_all(&dir);std::fs::create_dir_all(&dir).unwrap();- let path = dir.join("design.solvecraft");+ let path = dir.join("design.solidcraft");let ok = Command::new(exe).args(["save-stress", &path.to_string_lossy(), "1"]).status().unwrap();assert!(ok.success());assert_eq!(round_of(&path).as_deref(), Some("0"));@@ -44,7 +44,7 @@ fn killed_mid_save_the_old_file_survives() {let round = round_of(&path);assert!(round.is_some(), "after kill {i} the design file is torn or missing");seen.insert(round);- let bak = solvecraft_engine::io::backup_path(&path);+ let bak = solidcraft_engine::io::backup_path(&path);if bak.exists() {assert!(round_of(&bak).is_some(), "after kill {i} the backup is torn");}diff --git a/apps/solvecraft-cli/tests/legacy_alias.rs b/apps/solidcraft-cli/tests/legacy_alias.rssimilarity index 100%rename from apps/solvecraft-cli/tests/legacy_alias.rsrename to apps/solidcraft-cli/tests/legacy_alias.rsdiff --git a/apps/solvecraft-cli/tests/mcp_connect.rs b/apps/solidcraft-cli/tests/mcp_connect.rssimilarity index 100%rename from apps/solvecraft-cli/tests/mcp_connect.rsrename to apps/solidcraft-cli/tests/mcp_connect.rsdiff --git a/apps/solvecraft-cli/tests/run_results.rs b/apps/solidcraft-cli/tests/run_results.rssimilarity index 70%rename from apps/solvecraft-cli/tests/run_results.rsrename to apps/solidcraft-cli/tests/run_results.rsindex 8962e11b01..a74c924b38 100644--- a/apps/solvecraft-cli/tests/run_results.rs+++ b/apps/solidcraft-cli/tests/run_results.rs@@ -12,7 +12,7 @@ struct Scratch(PathBuf);impl Scratch {fn new() -> Self {- let dir = std::env::temp_dir().join(format!("solvecraft-run-results-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed)));+ let dir = std::env::temp_dir().join(format!("solidcraft-run-results-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed)));std::fs::create_dir(&dir).unwrap();Self(dir)}@@ -46,7 +46,7 @@ fn body_count(path: &Path) -> Value {#[test]fn results_still_save_and_export_the_script_once() {let dir = Scratch::new();- let saved = dir.0.join("box.solvecraft");+ let saved = dir.0.join("box.solidcraft");let stl = dir.0.join("box.stl");let obj = dir.0.join("box.obj");let result = json_output(@@ -64,8 +64,8 @@ fn results_still_save_and_export_the_script_once() {fn results_with_base_design_and_quiet_still_report_and_save() {let dir = Scratch::new();let script = dir.script();- let base = dir.0.join("base.solvecraft");- let saved = dir.0.join("combined.solvecraft");+ let base = dir.0.join("base.solidcraft");+ let saved = dir.0.join("combined.solidcraft");json_output(cli().arg("run").arg(&script).arg("--save").arg(&base).output().unwrap());let result = json_output(cli().args(["run", "--results", "--quiet", "--in"]).arg(&base).arg(&script).arg("--save").arg(&saved).output().unwrap());assert_eq!(result.as_array().unwrap().len(), 1);@@ -77,7 +77,7 @@ fn results_with_base_design_and_quiet_still_report_and_save() {fn results_propagate_output_errors() {let dir = Scratch::new();for flag in ["--save", "--out"] {- let path = dir.0.join("missing").join(if flag == "--save" { "box.solvecraft" } else { "box.stl" });+ let path = dir.0.join("missing").join(if flag == "--save" { "box.solidcraft" } else { "box.stl" });let output = cli().arg("run").arg(dir.script()).arg("--results").arg(flag).arg(&path).output().unwrap();assert_eq!(output.status.code(), Some(1));assert!(!output.stderr.is_empty());@@ -89,9 +89,27 @@ fn results_propagate_output_errors() {#[test]fn results_without_script_still_fail() {let dir = Scratch::new();- let base = dir.0.join("base.solvecraft");+ let base = dir.0.join("base.solidcraft");json_output(cli().arg("run").arg(dir.script()).arg("--save").arg(&base).output().unwrap());let output = cli().args(["run", "--results", "--in"]).arg(&base).output().unwrap();assert_eq!(output.status.code(), Some(1));assert!(String::from_utf8_lossy(&output.stderr).contains("--results needs a script"));}++/// Compatibility shim (docs/compatibility.md): a design saved before the rename, with the+/// legacy extension and format tag, still opens; re-saving writes the current tag.+#[test]+fn legacy_extension_and_format_tag_still_open() {+ let dir = Scratch::new();+ let saved = dir.0.join("box.solidcraft");+ json_output(cli().arg("run").arg(dir.script()).arg("--save").arg(&saved).output().unwrap());+ let text = std::fs::read_to_string(&saved).unwrap();+ assert!(text.contains("\"solidcraft/"), "new designs carry the current tag");+ let legacy = dir.0.join("old.solvecraft");+ std::fs::write(&legacy, text.replace("\"solidcraft/", "\"solvecraft/")).unwrap();+ assert_eq!(body_count(&legacy), 1);+ let resaved = dir.0.join("resaved.solidcraft");+ json_output(cli().args(["run", "--in"]).arg(&legacy).arg(dir.script()).arg("--save").arg(&resaved).output().unwrap());+ assert_eq!(body_count(&resaved), 2);+ assert!(std::fs::read_to_string(&resaved).unwrap().contains("\"solidcraft/"));+}diff --git a/apps/solvecraft-web/Cargo.toml b/apps/solidcraft-web/Cargo.tomlsimilarity index 88%rename from apps/solvecraft-web/Cargo.tomlrename to apps/solidcraft-web/Cargo.tomlindex 476758b408..db51d3dc0e 100644--- a/apps/solvecraft-web/Cargo.toml+++ b/apps/solidcraft-web/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-web"+name = "solidcraft-web"description = "SolidCraft in the browser (eframe web runner, WebGPU with WebGL2 fallback)"version.workspace = trueedition.workspace = true@@ -10,12 +10,12 @@ publish = falseworkspace = true[[bin]]-name = "solvecraft-web"+name = "solidcraft-web"path = "src/main.rs"[dependencies]-solvecraft-engine = { workspace = true }-solvecraft-ui-egui = { workspace = true }+solidcraft-engine = { workspace = true }+solidcraft-ui-egui = { workspace = true }egui = { workspace = true }log = { workspace = true }diff --git a/apps/solvecraft-web/Trunk.toml b/apps/solidcraft-web/Trunk.tomlsimilarity index 68%rename from apps/solvecraft-web/Trunk.tomlrename to apps/solidcraft-web/Trunk.tomlindex 4094dea25d..e608607f50 100644--- a/apps/solvecraft-web/Trunk.toml+++ b/apps/solidcraft-web/Trunk.toml@@ -1,4 +1,4 @@-# Build with: trunk build --release (from apps/solvecraft-web)+# Build with: trunk build --release (from apps/solidcraft-web)[build]target = "index.html"dist = "../../dist/web"diff --git a/apps/solvecraft-web/fonts/BIZUDPGothic-Regular.ttf b/apps/solidcraft-web/fonts/BIZUDPGothic-Regular.ttfsimilarity index 100%rename from apps/solvecraft-web/fonts/BIZUDPGothic-Regular.ttfrename to apps/solidcraft-web/fonts/BIZUDPGothic-Regular.ttfdiff --git a/apps/solvecraft-web/fonts/OFL.txt b/apps/solidcraft-web/fonts/OFL.txtsimilarity index 100%rename from apps/solvecraft-web/fonts/OFL.txtrename to apps/solidcraft-web/fonts/OFL.txtdiff --git a/apps/solvecraft-web/index.html b/apps/solidcraft-web/index.htmlsimilarity index 71%rename from apps/solvecraft-web/index.htmlrename to apps/solidcraft-web/index.htmlindex eedf6dc01a..42d371e898 100644--- a/apps/solvecraft-web/index.html+++ b/apps/solidcraft-web/index.html@@ -4,18 +4,18 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><title>SolidCraft</title>- <link data-trunk rel="rust" data-bin="solvecraft-web" data-wasm-opt="z" data-weak-refs />+ <link data-trunk rel="rust" data-bin="solidcraft-web" data-wasm-opt="z" data-weak-refs /><link data-trunk rel="copy-file" href="fonts/BIZUDPGothic-Regular.ttf" data-target-path="fonts" /><link data-trunk rel="copy-file" href="fonts/OFL.txt" data-target-path="fonts" /><style>html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #e8ebf0; }- #solvecraft_canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }- #solvecraft_loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;+ #solidcraft_canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }+ #solidcraft_loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;color: #4a5060; font: 14px system-ui, sans-serif; pointer-events: none; }</style></head><body>- <canvas id="solvecraft_canvas"></canvas>- <div id="solvecraft_loading">Loading SolidCraft…</div>+ <canvas id="solidcraft_canvas"></canvas>+ <div id="solidcraft_loading">Loading SolidCraft…</div></body></html>diff --git a/apps/solvecraft-web/src/files.rs b/apps/solidcraft-web/src/files.rssimilarity index 92%rename from apps/solvecraft-web/src/files.rsrename to apps/solidcraft-web/src/files.rsindex 41106b9981..b384280ccd 100644--- a/apps/solvecraft-web/src/files.rs+++ b/apps/solidcraft-web/src/files.rs@@ -1,5 +1,5 @@//! Files in the browser. Designs are kept in the origin private file system (OPFS): read into-//! the engine's in-memory files (`solvecraft_engine::io::vfs`) at start, written back whenever a+//! the engine's in-memory files (`solidcraft_engine::io::vfs`) at start, written back whenever a//! command writes one. Files come in from the computer through a file picker (the File System//! Access API where the browser has it, an `<input type=file>` otherwise) or a drop on the page,//! and go out as downloads (exports, and "Download design"). An autosave of unsaved work is kept@@ -9,7 +9,7 @@ use std::cell::{Cell, RefCell};use std::rc::Rc;use js_sys::{Array, Function, Object, Reflect, Uint8Array};-use solvecraft_engine::io::vfs;+use solidcraft_engine::io::vfs;use wasm_bindgen::{JsCast as _, JsValue, closure::Closure};use wasm_bindgen_futures::{JsFuture, spawn_local};use web_sys::{FileSystemDirectoryHandle, FileSystemFileHandle, FileSystemGetFileOptions, FileSystemWritableFileStream};@@ -20,8 +20,11 @@ pub const OPFS: &str = "/opfs/";pub const DOWNLOADS: &str = "/downloads/";/// Files brought in from the computer.pub const UPLOAD: &str = "/upload/";-/// The autosave of unsaved work (in OPFS: `recovery.solvecraft` and `recovery.json`).-const RECOVERY: &str = "recovery.solvecraft";+/// The autosave of unsaved work (in OPFS: `recovery.solidcraft` and `recovery.json`).+const RECOVERY: &str = "recovery.solidcraft";+/// The autosave earlier releases kept (compatibility shim, docs/compatibility.md): recovered+/// when there is no current one.+const LEGACY_RECOVERY: &str = "recovery.solvecraft";const RECOVERY_META: &str = "recovery.json";/// What to do with a file brought in from the computer.@@ -87,7 +90,10 @@ thread_local! {}/// Local storage keys of stored files.-const LOCAL_PREFIX: &str = "solvecraft.file.";+const LOCAL_PREFIX: &str = "solidcraft.file.";+/// Local-storage files kept by earlier releases (compatibility shim, docs/compatibility.md):+/// still listed and opened; removing one removes either key.+const LEGACY_LOCAL_PREFIX: &str = "solvecraft.file.";fn local() -> Result<web_sys::Storage, String> {web_sys::window().and_then(|w| w.local_storage().ok().flatten()).ok_or_else(|| "this browser keeps no local storage".to_string())@@ -177,7 +183,9 @@ async fn write_file(name: &str, bytes: &[u8]) -> Result<(), String> {async fn remove_file(name: &str) -> Result<(), String> {if local_only() {- return local()?.remove_item(&format!("{LOCAL_PREFIX}{name}")).map_err(err);+ let st = local()?;+ st.remove_item(&format!("{LEGACY_LOCAL_PREFIX}{name}")).map_err(err)?;+ return st.remove_item(&format!("{LOCAL_PREFIX}{name}")).map_err(err);}let dir = root().await?;JsFuture::from(dir.remove_entry(name)).await.map_err(err)?;@@ -190,7 +198,7 @@ fn read_local() -> Result<Vec<(String, Vec<u8>, f64)>, String> {let mut out = Vec::new();for i in 0..st.length().unwrap_or(0).min(10_000) {let Some(k) = st.key(i).ok().flatten() else { continue };- let Some(name) = k.strip_prefix(LOCAL_PREFIX) else { continue };+ let Some(name) = k.strip_prefix(LOCAL_PREFIX).or_else(|| k.strip_prefix(LEGACY_LOCAL_PREFIX)) else { continue };if let Some(v) = st.get_item(&k).ok().flatten() {out.push((name.to_string(), decode(&v), 0.0));}@@ -251,7 +259,14 @@ pub fn start(files: &Rc<Files>) {files.say("This page can't use the browser's file storage (it needs https or localhost): designs are kept in local storage, a few MB at most.", false);}let mut entries = Vec::new();+ let has_recovery = all.iter().any(|(n, _, _)| n == RECOVERY);for (name, bytes, modified) in all {+ if name == LEGACY_RECOVERY {+ if !has_recovery {+ vfs::insert(&format!("{OPFS}{RECOVERY}"), bytes);+ }+ continue;+ }if name == RECOVERY_META {let meta: serde_json::Value = serde_json::from_slice(&bytes).unwrap_or_default();let n = meta["name"].as_str().unwrap_or("Untitled").to_string();@@ -349,7 +364,7 @@ pub fn rename(files: &Rc<Files>, from: &str, to: &str) -> Result<(), String> {if files.entries.borrow().iter().any(|e| e.name == to) {return Err(format!("there is already a file named {to}"));}- let bytes = vfs::read(&format!("{OPFS}{from}"), solvecraft_engine::io::MAX_DESIGN_BYTES).map_err(|e| e.to_string())?;+ let bytes = vfs::read(&format!("{OPFS}{from}"), solidcraft_engine::io::MAX_DESIGN_BYTES).map_err(|e| e.to_string())?;vfs::write(&format!("{OPFS}{to}"), &bytes).map_err(|e| e.to_string())?;delete(files, from);flush(files);@@ -357,11 +372,11 @@ pub fn rename(files: &Rc<Files>, from: &str, to: &str) -> Result<(), String> {}/// Keep (or drop) the autosave of the open design.-pub fn autosave(files: &Rc<Files>, doc: Option<(&solvecraft_engine::doc::Document, Option<&str>)>) {+pub fn autosave(files: &Rc<Files>, doc: Option<(&solidcraft_engine::doc::Document, Option<&str>)>) {let files = files.clone();match doc {Some((d, path)) => {- let bytes = solvecraft_engine::io::write_design(d);+ let bytes = solidcraft_engine::io::write_design(d);let meta = serde_json::json!({"name": d.name, "path": path, "saved_at": js_sys::Date::now()}).to_string();spawn_local(async move {let r = async {@@ -375,6 +390,7 @@ pub fn autosave(files: &Rc<Files>, doc: Option<(&solvecraft_engine::doc::Documen}None => spawn_local(async move {let _ = remove_file(RECOVERY).await;+ let _ = remove_file(LEGACY_RECOVERY).await;let _ = remove_file(RECOVERY_META).await;}),}@@ -436,7 +452,7 @@ fn input_picker(files: &Rc<Files>, intent: Intent) {let Some(doc) = web_sys::window().and_then(|w| w.document()) else { return };let Ok(input) = doc.create_element("input").map(|e| e.unchecked_into::<web_sys::HtmlInputElement>()) else { return };input.set_type("file");- input.set_accept(".solvecraft,.step,.stp,.3mf,.stl");+ input.set_accept(".solidcraft,.solvecraft,.step,.stp,.3mf,.stl");// Attached (hidden) while it is open: some browsers ignore a click on a detached input.let _ = input.set_attribute("style", "display:none");if let Some(body) = doc.body() {diff --git a/apps/solvecraft-web/src/main.rs b/apps/solidcraft-web/src/main.rssimilarity index 93%rename from apps/solvecraft-web/src/main.rsrename to apps/solidcraft-web/src/main.rsindex 20bee57f08..b2b50c74ac 100644--- a/apps/solvecraft-web/src/main.rs+++ b/apps/solidcraft-web/src/main.rs@@ -1,6 +1,6 @@-//! SolveCraft in the browser.+//! SolidCraft in the browser.//!-//! Runs the same [`solvecraft_ui_egui::SolveApp`] as the desktop app through eframe's web runner+//! Runs the same [`solidcraft_ui_egui::SolveApp`] as the desktop app through eframe's web runner//! (wgpu: WebGPU where available, WebGL2 otherwise). Build with `trunk build --release` from this//! directory (output in `dist/web`). URL flags: `?webgl` forces WebGL2, `?sample` opens the//! sample part.@@ -13,15 +13,15 @@ mod files;mod web {use std::rc::Rc;- use solvecraft_engine::Session;- use solvecraft_engine::io::vfs;- use solvecraft_ui_egui::{Services, SolveApp};+ use solidcraft_engine::Session;+ use solidcraft_engine::io::vfs;+ use solidcraft_ui_egui::{Services, SolveApp};use wasm_bindgen::JsCast as _;use crate::files::{self, Files, Intent};- const CANVAS_ID: &str = "solvecraft_canvas";- const LOADING_ID: &str = "solvecraft_loading";+ const CANVAS_ID: &str = "solidcraft_canvas";+ const LOADING_ID: &str = "solidcraft_loading";const DEPTH_BITS: u8 = 24;/// Seconds between autosaves of unsaved work.@@ -63,7 +63,7 @@ mod web {/// The start page's recent designs were filled from the stored ones.recents_synced: bool,/// On-demand CJK font: fetched only when a CJK language is selected.- font: solvecraft_ui_egui::fonts::CjkFontLoader,+ font: solidcraft_ui_egui::fonts::CjkFontLoader,font_result: FontLoadResult,}@@ -79,7 +79,7 @@ mod web {}let incoming: Vec<_> = self.files.incoming.borrow_mut().drain(..).collect();for (name, bytes, intent) in incoming {- let design = name.ends_with(&format!(".{}", solvecraft_engine::io::DESIGN_EXT));+ let design = solidcraft_engine::io::is_design_path(&name);let path = if design && intent == Intent::Open {// A design from the computer is kept in the browser (a copy), so Save works.let path = files::free_name(&name);@@ -133,13 +133,13 @@ mod web {entries.sort_by(|a, b| b.modified.total_cmp(&a.modified));let recent = &mut self.app.home.recent;recent.retain(|p| vfs::exists(p));- for e in entries.iter().filter(|e| e.name.ends_with(&format!(".{}", solvecraft_engine::io::DESIGN_EXT))) {+ for e in entries.iter().filter(|e| solidcraft_engine::io::is_design_path(&e.name)) {let p = format!("{}{}", files::OPFS, e.name);if !recent.contains(&p) {recent.push(p);}}- recent.truncate(solvecraft_ui_egui::home::MAX_RECENT);+ recent.truncate(solidcraft_ui_egui::home::MAX_RECENT);}/// The stored designs: open, insert, rename, delete, download; open from the computer.@@ -206,7 +206,7 @@ mod web {if ui.small_button("Open").clicked() {act = Some(("open", e.name.clone()));}- let design = e.name.ends_with(&format!(".{}", solvecraft_engine::io::DESIGN_EXT));+ let design = solidcraft_engine::io::is_design_path(&e.name);if !design && ui.small_button("Insert").on_hover_text("Into the open design (STEP, 3MF, STL)").clicked() {act = Some(("insert", e.name.clone()));}@@ -241,7 +241,7 @@ mod web {self.app.insert_path(&path);self.files.panel.set(false);}- "download" => match vfs::read(&path, solvecraft_engine::io::MAX_DESIGN_BYTES) {+ "download" => match vfs::read(&path, solidcraft_engine::io::MAX_DESIGN_BYTES) {Ok(b) => {if let Err(e) = files::download(&name, &b) {self.app.set_status(e, true);@@ -251,8 +251,8 @@ mod web {},"download_open" => {let d = &self.app.session.doc;- let bytes = solvecraft_engine::io::write_design(d);- if let Err(e) = files::download(&format!("{}.{}", d.name, solvecraft_engine::io::DESIGN_EXT), &bytes) {+ let bytes = solidcraft_engine::io::write_design(d);+ if let Err(e) = files::download(&format!("{}.{}", d.name, solidcraft_engine::io::DESIGN_EXT), &bytes) {self.app.set_status(e, true);}}@@ -318,7 +318,7 @@ mod web {let done = self.font_result.borrow_mut().take();if let Some(res) = done {let installed = match res {- Ok(bytes) => solvecraft_ui_egui::fonts::install_cjk_font(ctx, bytes),+ Ok(bytes) => solidcraft_ui_egui::fonts::install_cjk_font(ctx, bytes),Err(err) => {log::warn!("failed to fetch CJK font from {JAPANESE_FONT_PATH}: {err}");false@@ -349,7 +349,7 @@ mod web {self.tick_font(ctx);self.app.logic(ctx);self.files_tick(ctx);- UNSAVED.with(|u| u.set(solvecraft_ui_egui::documents::any_dirty(&self.app)));+ UNSAVED.with(|u| u.set(solidcraft_ui_egui::documents::any_dirty(&self.app)));}fn raw_input_hook(&mut self, _ctx: &egui::Context, raw: &mut egui::RawInput) {files::take_drops(&self.files, raw);@@ -365,14 +365,11 @@ mod web {// Persist the user's own language, not a session-only English fallback.let saved = self.font.persisted_language(&self.app.preferences.language).to_owned();let live = std::mem::replace(&mut self.app.preferences.language, saved);- storage.set_string(PREFS_KEY, self.app.prefs());+ storage.set_string(solidcraft_ui_egui::prefs::STORAGE_KEY, self.app.prefs());self.app.preferences.language = live;}}- /// Where the preferences (theme) are kept (the browser's local storage).- const PREFS_KEY: &str = "solvecraft.prefs";-fn query() -> String {web_sys::window().and_then(|w| w.location().search().ok()).unwrap_or_default()}@@ -411,7 +408,7 @@ mod web {canvas,options,Box::new(move |cc| {- solvecraft_ui_egui::fonts::setup_fonts(&cc.egui_ctx);+ solidcraft_ui_egui::fonts::setup_fonts(&cc.egui_ctx);let files = Rc::new(Files::default());files::start(&files);let panel = files.clone();@@ -423,13 +420,13 @@ mod web {})),// Designs are kept in the browser; everything else is downloaded.pick_save: Some(Box::new(|name: &str, exts: &[&str]| {- let design = exts.contains(&solvecraft_engine::io::DESIGN_EXT);+ let design = exts.contains(&solidcraft_engine::io::DESIGN_EXT);Some(format!("{}{name}", if design { files::OPFS } else { files::DOWNLOADS }))})),..Default::default()};let mut app = SolveApp::new(Session::default(), services);- if let Some(p) = cc.storage.and_then(|s| s.get_string(PREFS_KEY)) {+ if let Some(p) = cc.storage.and_then(|s| solidcraft_ui_egui::prefs::stored(|k| s.get_string(k))) {app.load_prefs(&p);}if let Some(rs) = &cc.wgpu_render_state {@@ -437,7 +434,7 @@ mod web {app.set_wgpu(rs, DEPTH_BITS, 0, 1);}if query().contains("sample") {- if let Err(e) = app.session.run_script(&solvecraft_engine::sample::script()) {+ if let Err(e) = app.session.run_script(&solidcraft_engine::sample::script()) {app.set_status(format!("sample: {e}"), true);}app.session.doc_mut().name = "Sample Plate".into();@@ -480,5 +477,5 @@ fn main() {#[cfg(not(target_arch = "wasm32"))]fn main() {- eprintln!("solvecraft-web only runs in the browser: build it with `trunk build --release` in apps/solvecraft-web");+ eprintln!("solidcraft-web only runs in the browser: build it with `trunk build --release` in apps/solidcraft-web");}diff --git a/apps/solvecraft/Cargo.toml b/apps/solidcraft/Cargo.tomlsimilarity index 91%rename from apps/solvecraft/Cargo.tomlrename to apps/solidcraft/Cargo.tomlindex 8ccf63b01c..01cbcc3330 100644--- a/apps/solvecraft/Cargo.toml+++ b/apps/solidcraft/Cargo.toml@@ -11,8 +11,8 @@ default-run = "solidcraft"workspace = true[dependencies]-solvecraft-engine = { workspace = true }-solvecraft-ui-egui = { workspace = true }+solidcraft-engine = { workspace = true }+solidcraft-ui-egui = { workspace = true }eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "wayland", "x11", "links"] }egui = { workspace = true }serde_json = { workspace = true }diff --git a/apps/solvecraft/build.rs b/apps/solidcraft/build.rssimilarity index 100%rename from apps/solvecraft/build.rsrename to apps/solidcraft/build.rsdiff --git a/apps/solvecraft/src/control_server.rs b/apps/solidcraft/src/control_server.rssimilarity index 96%rename from apps/solvecraft/src/control_server.rsrename to apps/solidcraft/src/control_server.rsindex 834818d3c4..792b10b3af 100644--- a/apps/solvecraft/src/control_server.rs+++ b/apps/solidcraft/src/control_server.rs@@ -8,8 +8,8 @@ use std::sync::mpsc::{Receiver, Sender, channel};use std::time::Duration;use serde_json::{Value, json};-use solvecraft_engine::MAX_LINE;-use solvecraft_ui_egui::ControlRequest;+use solidcraft_engine::MAX_LINE;+use solidcraft_ui_egui::ControlRequest;/// Connections served at once. The channel has no authentication beyond being bound to/// loopback, so a flood must not be able to spawn threads without end.@@ -24,11 +24,11 @@ pub fn start(port: u16, ctx: egui::Context) -> Receiver<ControlRequest> {let listener = match TcpListener::bind(("127.0.0.1", port)) {Ok(l) => l,Err(e) => {- eprintln!("solvecraft: control server failed to bind 127.0.0.1:{port}: {e}");+ eprintln!("solidcraft: control server failed to bind 127.0.0.1:{port}: {e}");return rx;}};- eprintln!("solvecraft: control server listening on 127.0.0.1:{port}");+ eprintln!("solidcraft: control server listening on 127.0.0.1:{port}");std::thread::spawn(move || {for stream in listener.incoming().flatten() {if OPEN.fetch_add(1, Ordering::Relaxed) >= MAX_CONNECTIONS {diff --git a/apps/solvecraft/src/main.rs b/apps/solidcraft/src/main.rssimilarity index 68%rename from apps/solvecraft/src/main.rsrename to apps/solidcraft/src/main.rsindex 0f7266c715..bb3f7986d0 100644--- a/apps/solvecraft/src/main.rs+++ b/apps/solidcraft/src/main.rs@@ -1,13 +1,13 @@-//! SolveCraft desktop app.+//! SolidCraft desktop app.//!-//! Usage: `solvecraft [--control <port>] [--sample] [--crash-log] [design.solvecraft | part.step]`+//! Usage: `solidcraft [--control <port>] [--sample] [--crash-log] [design.solidcraft | part.step]`//!//! A `.step`/`.stp` file opens as a new design holding the file's bodies (an Import feature); a//! `.3mf`/`.stl` file as a new design holding mesh bodies.//!-//! `--control <port>` (or `SOLVECRAFT_CONTROL_PORT`) starts a localhost JSON-lines control+//! `--control <port>` (or `SOLIDCRAFT_CONTROL_PORT`) starts a localhost JSON-lines control//! server: `{"id":1,"method":"engine.execute","params":{"command":"solid.box","params":{…}}}`.-//! See `solvecraft_ui_egui::control` and docs/control-protocol.md.+//! See `solidcraft_ui_egui::control` and docs/control-protocol.md.#![cfg_attr(all(target_os = "windows", not(debug_assertions)), windows_subsystem = "windows")]#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]#![forbid(unsafe_code)]@@ -19,8 +19,8 @@ mod control_server;#[cfg(any(target_os = "windows", target_os = "linux"))]mod space_mouse;-use solvecraft_engine::Session;-use solvecraft_ui_egui::{Services, SolveApp};+use solidcraft_engine::Session;+use solidcraft_ui_egui::{Services, SolveApp};struct App {solve: SolveApp,@@ -31,12 +31,12 @@ struct App {impl eframe::App for App {fn logic(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {// The design on screen is the one whose commands a crash report replays.- self.solve.session.crash_journal = solvecraft_engine::crash::enabled();+ self.solve.session.crash_journal = solidcraft_engine::crash::enabled();// The OS closing the window (Alt+F4, Cmd+Q, the window manager): ask about unsaved// designs first; the window closes once they are answered (`quit_requested`).if ctx.input(|i| i.viewport().close_requested()) && !self.solve.quit_requested {ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);- solvecraft_ui_egui::documents::request_quit(&mut self.solve);+ solidcraft_ui_egui::documents::request_quit(&mut self.solve);}self.solve.logic(ctx);#[cfg(any(target_os = "windows", target_os = "linux"))]@@ -52,26 +52,24 @@ impl eframe::App for App {self.solve.ui(ui);}fn save(&mut self, storage: &mut dyn eframe::Storage) {- storage.set_string(PREFS_KEY, self.solve.prefs());+ storage.set_string(solidcraft_ui_egui::prefs::STORAGE_KEY, self.solve.prefs());}fn on_exit(&mut self) {- solvecraft_ui_egui::recovery_ui::close(&mut self.solve);- solvecraft_engine::crash::end_session();+ solidcraft_ui_egui::recovery_ui::close(&mut self.solve);+ solidcraft_engine::crash::end_session();}}-/// Where the preferences (theme) are kept in eframe's storage.-const PREFS_KEY: &str = "solvecraft.prefs";-fn services() -> Services {Services {pick_open: Some(Box::new(|| {rfd::FileDialog::new().add_filter("Designs, STEP, IGES and meshes",- &["solvecraft", "step", "stp", "STEP", "STP", "igs", "iges", "IGS", "IGES", "3mf", "3MF", "stl", "STL"],+ &["solidcraft", "solvecraft", "step", "stp", "STEP", "STP", "igs", "iges", "IGS", "IGES", "3mf", "3MF", "stl", "STL"],)- .add_filter("SolidCraft design", &["solvecraft"])+ // The legacy extension is a compatibility shim (docs/compatibility.md).+ .add_filter("SolidCraft design", &solidcraft_engine::io::DESIGN_EXTS).add_filter("STEP", &["step", "stp", "STEP", "STP"]).add_filter("IGES", &["igs", "iges", "IGS", "IGES"]).add_filter("Mesh (3MF, STL)", &["3mf", "3MF", "stl", "STL"])@@ -104,10 +102,40 @@ fn services() -> Services {}}+/// The per-user settings folder: eframe's storage (`app.ron`) and the anti-aliasing preference.+fn settings_dir() -> Option<std::path::PathBuf> {+ eframe::storage_dir("SolidCraft")+}+/// The anti-aliasing preference, kept next to eframe's storage (it is needed before the/// window opens).fn graphics_path() -> Option<std::path::PathBuf> {- eframe::storage_dir("SolveCraft").map(|d| d.join("graphics.json"))+ settings_dir().map(|d| d.join("graphics.json"))+}++/// Compatibility shim (docs/compatibility.md): on the first launch after the rename, copy the+/// settings of earlier releases into the new folder. They kept `graphics.json` (and, on Linux+/// and macOS, the recovery folder) under the old product name, and eframe's `app.ron` under the+/// window's app id. The old folders are never changed.+fn adopt_legacy_settings() {+ let (Some(current), Some(legacy)) = (settings_dir(), eframe::storage_dir("SolveCraft")) else { return };+ let legacy_eframe = eframe::storage_dir(APP_ID);+ if let Err(e) = adopt_settings(¤t, &legacy, legacy_eframe.as_deref()) {+ log::warn!("settings: could not copy the previous release's settings into {}: {e}", current.display());+ }+}++fn adopt_settings(current: &std::path::Path, legacy: &std::path::Path, legacy_eframe: Option<&std::path::Path>) -> std::io::Result<()> {+ let fresh = !current.exists();+ solidcraft_engine::io::adopt_legacy_dir(current, legacy)?;+ if let Some(old) = legacy_eframe.map(|d| d.join("app.ron")).filter(|p| fresh && p.is_file()) {+ std::fs::create_dir_all(current)?;+ let new = current.join("app.ron");+ if !new.exists() {+ std::fs::copy(old, new)?;+ }+ }+ Ok(())}/// Anti-aliasing samples from Preferences (4 when unset).@@ -122,7 +150,7 @@ fn msaa() -> u16 {}/// Windows and Linux: no OS title bar; the application bar is the title bar-/// (`solvecraft_ui_egui::titlebar`). macOS keeps its traffic lights over the integrated bar.+/// (`solidcraft_ui_egui::titlebar`). macOS keeps its traffic lights over the integrated bar.const CUSTOM_TITLEBAR: bool = !cfg!(target_os = "macos");const DEPTH_BITS: u8 = 24;@@ -147,12 +175,17 @@ fn app_viewport() -> Result<egui::ViewportBuilder, eframe::Error> {.with_fullsize_content_view(true).with_titlebar_shown(false).with_title_shown(false)- .with_app_id("ai.storyteller.solvecraft"))+ .with_app_id(APP_ID))}+/// The window's app id: it names the desktop entry, so it stays the packages' reverse-DNS id,+/// which is kept from before the rename (compatibility shim, docs/compatibility.md).+const APP_ID: &str = "ai.storyteller.solvecraft";+fn main() -> eframe::Result {+ adopt_legacy_settings();let samples = msaa();- let mut control_port: Option<u16> = std::env::var("SOLVECRAFT_CONTROL_PORT").ok().and_then(|p| p.parse().ok());+ let mut control_port: Option<u16> = solidcraft_engine::geom::env::var("CONTROL_PORT").and_then(|p| p.parse().ok());let mut files = Vec::new();let mut sample = false;let mut args = std::env::args().skip(1);@@ -165,10 +198,10 @@ fn main() -> eframe::Result {return Ok(());}"--crash-log" => {- match solvecraft_engine::crash::default_dir() {+ match solidcraft_engine::crash::default_dir() {Some(dir) => {println!("crash reports: {}", dir.display());- for r in solvecraft_engine::crash::list(&dir).iter().take(5) {+ for r in solidcraft_engine::crash::list(&dir).iter().take(5) {println!(" {} {} {}", r.id, r.kind, r.message);}println!("more: solidcraft-cli crashes");@@ -178,21 +211,21 @@ fn main() -> eframe::Result {return Ok(());}"--help" | "-h" => {- println!("usage: solidcraft [--control PORT] [--sample] [--crash-log] [design.solvecraft | part.step]");+ println!("usage: solidcraft [--control PORT] [--sample] [--crash-log] [design.solidcraft | part.step]");return Ok(());}_ => files.push(a),}}- // Crashes leave a report in the crash folder (solvecraft_engine::crash, docs/crash-reports.md).- let crashed = solvecraft_engine::crash::default_dir()+ // Crashes leave a report in the crash folder (solidcraft_engine::crash, docs/crash-reports.md).+ let crashed = solidcraft_engine::crash::default_dir().map(|dir| {- let build = solvecraft_engine::crash::Build {- version: solvecraft_ui_egui::help::VERSION,- commit: solvecraft_ui_egui::help::COMMIT,- built: solvecraft_ui_egui::help::BUILD_DATE,+ let build = solidcraft_engine::crash::Build {+ version: solidcraft_ui_egui::help::VERSION,+ commit: solidcraft_ui_egui::help::COMMIT,+ built: solidcraft_ui_egui::help::BUILD_DATE,};- solvecraft_engine::crash::install(dir, build)+ solidcraft_engine::crash::install(dir, build)}).unwrap_or_default();let options = eframe::NativeOptions {@@ -200,6 +233,8 @@ fn main() -> eframe::Result {depth_buffer: DEPTH_BITS,stencil_buffer: STENCIL_BITS,multisampling: samples,+ // Kept with the other settings, not in a folder named after the app id.+ persistence_path: settings_dir().map(|d| d.join("app.ron")),..Default::default()};#[cfg(all(unix, not(target_os = "macos")))]@@ -209,7 +244,7 @@ fn main() -> eframe::Result {std::env::var_os("DISPLAY").is_some(),std::env::var_os("WAYLAND_DISPLAY").is_some(),std::env::var("XDG_CURRENT_DESKTOP").ok().as_deref(),- std::env::var("SOLVECRAFT_WAYLAND").ok().as_deref(),+ solidcraft_engine::geom::env::var("WAYLAND").as_deref(),) {options.event_loop_builder = Some(Box::new(|b| {use winit::platform::x11::EventLoopBuilderExtX11;@@ -220,20 +255,20 @@ fn main() -> eframe::Result {"SolidCraft",options,Box::new(move |cc| {- solvecraft_ui_egui::fonts::setup_fonts(&cc.egui_ctx);+ solidcraft_ui_egui::fonts::setup_fonts(&cc.egui_ctx);let mut app = SolveApp::new(Session::default(), services());app.custom_titlebar = CUSTOM_TITLEBAR;app.integrated_titlebar = cfg!(target_os = "macos");- if let Some(p) = cc.storage.and_then(|s| s.get_string(PREFS_KEY)) {+ if let Some(p) = cc.storage.and_then(|s| solidcraft_ui_egui::prefs::stored(|k| s.get_string(k))) {app.load_prefs(&p);}if let Some(rs) = &cc.wgpu_render_state {eprintln!("SolidCraft graphics: {:?}, MSAA {}x (requested {}x)", rs.adapter.get_info().backend, rs.msaa_samples, samples);app.set_wgpu(rs, DEPTH_BITS, STENCIL_BITS, rs.msaa_samples);// A saved anti-aliasing the device can't do: back to the default, with a notice.- solvecraft_ui_egui::prefs::check_msaa(&mut app, u32::from(samples));+ solidcraft_ui_egui::prefs::check_msaa(&mut app, u32::from(samples));let info = rs.adapter.get_info();- solvecraft_engine::crash::set_environment(&format!(+ solidcraft_engine::crash::set_environment(&format!("Renderer: {:?} {} ({}), MSAA {}x",info.backend, info.name, info.driver, rs.msaa_samples));@@ -243,7 +278,7 @@ fn main() -> eframe::Result {app = app.with_control(rx);}if sample {- if let Err(e) = app.session.run_script(&solvecraft_engine::sample::script()) {+ if let Err(e) = app.session.run_script(&solidcraft_engine::sample::script()) {app.set_status(format!("sample: {e}"), true);}app.session.doc_mut().name = "Sample Plate".into();@@ -260,12 +295,12 @@ fn main() -> eframe::Result {app.home.show(rev);}// Autosave, and offer what crashed sessions left behind.- if let Some(dir) = solvecraft_engine::recovery::default_dir() {+ if let Some(dir) = solidcraft_engine::recovery::default_dir() {let every = if app.autosave_minutes > 0.0 { app.autosave_minutes * 60.0 } else { f64::MAX / 4.0 };- solvecraft_ui_egui::recovery_ui::start(&mut app, &dir, std::time::Duration::from_secs_f64(every.min(1e9)));+ solidcraft_ui_egui::recovery_ui::start(&mut app, &dir, std::time::Duration::from_secs_f64(every.min(1e9)));}// Tell the user about crashes since the last start (after the recovery offer is set up).- solvecraft_ui_egui::crash_ui::announce(&mut app, &crashed);+ solidcraft_ui_egui::crash_ui::announce(&mut app, &crashed);#[cfg(any(target_os = "windows", target_os = "linux"))]let space_mouse = space_mouse::SpaceMouse::start(&cc.egui_ctx);Ok(Box::new(App {@@ -281,7 +316,7 @@ fn main() -> eframe::Result {/// on Wayland (only on X11), so dropping files from the file manager showed a "no" cursor: use/// XWayland when it's there. Except on niri, whose XWayland (xwayland-satellite) breaks window/// management (maximize/restore), so it stays on native Wayland and gives up file drops.-/// `SOLVECRAFT_WAYLAND=1` keeps native Wayland, `SOLVECRAFT_WAYLAND=0` forces XWayland.+/// `SOLIDCRAFT_WAYLAND=1` keeps native Wayland, `SOLIDCRAFT_WAYLAND=0` forces XWayland.#[cfg(all(unix, not(target_os = "macos")))]fn prefer_x11(display: bool, wayland_display: bool, desktop: Option<&str>, wayland_override: Option<&str>) -> bool {match wayland_override.map(str::trim) {@@ -308,7 +343,7 @@ mod backend_tests {assert!(!prefer_x11(true, true, Some("niri:GNOME"), None));// niri without a Wayland socket (nested X session) still uses X11.assert!(prefer_x11(true, false, Some("niri"), None));- // SOLVECRAFT_WAYLAND: anything but 0 keeps Wayland, 0 forces XWayland (when present).+ // SOLIDCRAFT_WAYLAND: anything but 0 keeps Wayland, 0 forces XWayland (when present).assert!(!prefer_x11(true, true, Some("GNOME"), Some("1")));assert!(!prefer_x11(true, true, Some("GNOME"), Some("")));assert!(prefer_x11(true, true, Some("niri"), Some("0")));@@ -323,7 +358,7 @@ mod icon_tests {fn macos_preserves_the_bundle_icon_instead_of_setting_a_runtime_bitmap() {let viewport = super::app_viewport().expect("viewport");assert_eq!(viewport.icon.as_deref(), Some(&eframe::egui::IconData::default()));- assert_eq!(viewport.app_id.as_deref(), Some("ai.storyteller.solvecraft"));+ assert_eq!(viewport.app_id.as_deref(), Some(super::APP_ID));}#[cfg(not(target_os = "macos"))]@@ -333,12 +368,34 @@ mod icon_tests {let icon = viewport.icon.expect("running window must have an icon");assert_eq!((icon.width, icon.height), (64, 64));assert_eq!(icon.rgba, super::app_icon::rgba(64).expect("original mark"));- assert_eq!(viewport.app_id.as_deref(), Some("ai.storyteller.solvecraft"));+ assert_eq!(viewport.app_id.as_deref(), Some(super::APP_ID));}}#[cfg(test)]mod msaa_tests {+ #[test]+ fn first_launch_adopts_the_previous_release_settings() {+ let d = std::env::temp_dir().join(format!("solidcraft-adopt-settings-{}", std::process::id()));+ let _ = std::fs::remove_dir_all(&d);+ let (current, legacy, legacy_eframe) = (d.join("solidcraft"), d.join("solvecraft"), d.join("ai.storyteller.solvecraft"));+ std::fs::create_dir_all(&legacy).unwrap();+ std::fs::create_dir_all(&legacy_eframe).unwrap();+ std::fs::write(legacy.join("graphics.json"), r#"{"msaa":8}"#).unwrap();+ std::fs::write(legacy_eframe.join("app.ron"), "(prefs)").unwrap();+ super::adopt_settings(¤t, &legacy, Some(&legacy_eframe)).unwrap();+ assert_eq!(std::fs::read_to_string(current.join("graphics.json")).unwrap(), r#"{"msaa":8}"#);+ assert_eq!(std::fs::read_to_string(current.join("app.ron")).unwrap(), "(prefs)");+ assert!(legacy.join("graphics.json").is_file() && legacy_eframe.join("app.ron").is_file());+ // Later launches leave the current settings alone.+ std::fs::write(current.join("app.ron"), "(mine)").unwrap();+ std::fs::remove_file(current.join("graphics.json")).unwrap();+ super::adopt_settings(¤t, &legacy, Some(&legacy_eframe)).unwrap();+ assert_eq!(std::fs::read_to_string(current.join("app.ron")).unwrap(), "(mine)");+ assert!(!current.join("graphics.json").exists());+ let _ = std::fs::remove_dir_all(&d);+ }+#[test]fn saved_multisampling_uses_the_selected_backend_policy() {use eframe::wgpu::Backend;diff --git a/apps/solvecraft/src/space_mouse.rs b/apps/solidcraft/src/space_mouse.rssimilarity index 97%rename from apps/solvecraft/src/space_mouse.rsrename to apps/solidcraft/src/space_mouse.rsindex 6698453f5f..0880577f85 100644--- a/apps/solvecraft/src/space_mouse.rs+++ b/apps/solidcraft/src/space_mouse.rs@@ -15,8 +15,8 @@ use hid_descriptor::Layout;use hidapi::{DeviceInfo, HidApi};use quick_xml::Reader;use quick_xml::events::Event;-use solvecraft_engine::render::Camera;-use solvecraft_ui_egui::SolveApp;+use solidcraft_engine::render::Camera;+use solidcraft_ui_egui::SolveApp;const STALE_AFTER: Duration = Duration::from_millis(150);const RETRY_AFTER: Duration = Duration::from_secs(2);@@ -185,7 +185,10 @@ fn parse_driver_mapping(xml: &[u8]) -> Option<DriverMapping> {}fn load_driver_mapping() -> Option<DriverMapping> {- let profile = std::path::PathBuf::from(std::env::var_os("APPDATA")?).join("3Dconnexion").join("3DxWare").join("Cfg").join("solvecraft-KMJ.xml");+ let cfg = std::path::PathBuf::from(std::env::var_os("APPDATA")?).join("3Dconnexion").join("3DxWare").join("Cfg");+ // The driver names the profile after the executable; one made for the pre-rename executable+ // still applies until the driver writes a new one (compatibility shim).+ let profile = ["solidcraft-KMJ.xml", "solvecraft-KMJ.xml"].into_iter().map(|n| cfg.join(n)).find(|p| p.is_file())?;if std::fs::metadata(&profile).ok()?.len() > MAX_PROFILE_BYTES {log::warn!("3D mouse: ignoring oversized 3DxWare profile {}", profile.display());return None;@@ -371,7 +374,7 @@ impl SpaceMouse {let shared = Arc::new(Mutex::new(Reading::new(now)));let worker_state = Arc::clone(&shared);let worker_ctx = ctx.clone();- if let Err(error) = std::thread::Builder::new().name("solvecraft-3d-mouse".into()).spawn(move || reader(worker_ctx, worker_state)) {+ if let Err(error) = std::thread::Builder::new().name("solidcraft-3d-mouse".into()).spawn(move || reader(worker_ctx, worker_state)) {log::warn!("3D mouse: reader could not start: {error}");}Self { shared, last_frame: now, driver_mapping: load_driver_mapping().unwrap_or_default(), mapping_checked_at: now }diff --git a/apps/solvecraft/src/space_mouse/hid_descriptor.rs b/apps/solidcraft/src/space_mouse/hid_descriptor.rssimilarity index 100%rename from apps/solvecraft/src/space_mouse/hid_descriptor.rsrename to apps/solidcraft/src/space_mouse/hid_descriptor.rsdiff --git a/apps/solvecraft/src/space_mouse/hidraw.rs b/apps/solidcraft/src/space_mouse/hidraw.rssimilarity index 100%rename from apps/solvecraft/src/space_mouse/hidraw.rsrename to apps/solidcraft/src/space_mouse/hidraw.rsdiff --git a/crates/doc/Cargo.toml b/crates/doc/Cargo.tomlindex 3be05de4ec..30240420c5 100644--- a/crates/doc/Cargo.toml+++ b/crates/doc/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-doc"+name = "solidcraft-doc"description = "SolidCraft document model: parameters and expressions, sketches and features on a parametric timeline, incremental evaluation"version.workspace = trueedition.workspace = true@@ -9,9 +9,9 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }-solvecraft-sketch = { workspace = true }-solvecraft-kernel = { workspace = true }+solidcraft-geom = { workspace = true }+solidcraft-sketch = { workspace = true }+solidcraft-kernel = { workspace = true }serde = { workspace = true }serde_json = { workspace = true }thiserror = { workspace = true }diff --git a/crates/doc/src/anchor_frame.rs b/crates/doc/src/anchor_frame.rsindex 1759bf89af..9b7e7b682c 100644--- a/crates/doc/src/anchor_frame.rs+++ b/crates/doc/src/anchor_frame.rs@@ -7,7 +7,7 @@ pub fn state_in_face_anchor_frame<'a>(doc: &Document, state: &'a ModelState, anclet raw = state.body(&anchor.target.body).ok_or_else(|| DocError::Unknown(format!("anchored body `{}`", anchor.target.body)))?;let relative = anchor.source_to_author(doc, author, raw)?;let mut output = crate::state_in_frame_at(doc, state, author, frame).into_owned();- let shape = if crate::is_identity(&relative) { raw.body.clone() } else { solvecraft_kernel::transform_matrix(&raw.body, relative)? };+ let shape = if crate::is_identity(&relative) { raw.body.clone() } else { solidcraft_kernel::transform_matrix(&raw.body, relative)? };let mut body = ModelBody::new(raw.name.clone(), shape, raw.feature);body.component = raw.component;body.transferred = raw.transferred;diff --git a/crates/doc/src/appearance.rs b/crates/doc/src/appearance.rsindex 08ba9f6ca0..cfb4eb10ea 100644--- a/crates/doc/src/appearance.rs+++ b/crates/doc/src/appearance.rs@@ -6,7 +6,7 @@use std::collections::BTreeMap;use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Document;diff --git a/crates/doc/src/assembly.rs b/crates/doc/src/assembly.rsindex b8924d45da..0422e883cd 100644--- a/crates/doc/src/assembly.rs+++ b/crates/doc/src/assembly.rs@@ -9,7 +9,7 @@//! and the engine maps a new feature's geometry into the active component's frame.use serde::{Deserialize, Serialize};-use solvecraft_geom::{Plane, Vec3};+use solidcraft_geom::{Plane, Vec3};use crate::{AxisRef, DocError, Document, FeatureKind, PatternKind, PlaneRef, Result};diff --git a/crates/doc/src/body_transfer.rs b/crates/doc/src/body_transfer.rsindex bc629ba5a9..07fa5071dc 100644--- a/crates/doc/src/body_transfer.rs+++ b/crates/doc/src/body_transfer.rs@@ -1,6 +1,6 @@//! Recorded ownership changes are evaluated at their timeline position.use crate::{DocError, Document, Mat, ModelBody, ModelState, Result};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use std::collections::BTreeSet;pub fn valid_transfer_matrix(m: &Mat) -> bool {@@ -39,7 +39,7 @@ pub(crate) fn evaluate(doc: &Document, st: &mut ModelState, bodies: &[String], fif doc.model_body_component(old) != from {return Err(DocError::Invalid(format!("body `{name}` no longer belongs to transfer source component {from}")));}- let shape = if crate::is_identity(&transform) { old.body.clone() } else { solvecraft_kernel::transform_matrix(&old.body, transform)? };+ let shape = if crate::is_identity(&transform) { old.body.clone() } else { solidcraft_kernel::transform_matrix(&old.body, transform)? };let mut body = ModelBody::new(old.name.clone(), shape, old.feature);body.component = to;body.transferred = true;diff --git a/crates/doc/src/body_transfer_sheet.rs b/crates/doc/src/body_transfer_sheet.rsindex 10f9297e7e..be971d30a4 100644--- a/crates/doc/src/body_transfer_sheet.rs+++ b/crates/doc/src/body_transfer_sheet.rs@@ -1,5 +1,5 @@//! World-frame metadata at a timeline body ownership boundary.-use solvecraft_geom::Plane;+use solidcraft_geom::Plane;use crate::{DocError, Mat, ModelState, Result, apply_point, apply_vector};diff --git a/crates/doc/src/canvas.rs b/crates/doc/src/canvas.rsindex 2c7cb9cc5b..6955a01fe4 100644--- a/crates/doc/src/canvas.rs+++ b/crates/doc/src/canvas.rs@@ -2,7 +2,7 @@//! The image bytes travel inside the design file (base64), so it reopens without the original.use serde::{Deserialize, Serialize};-use solvecraft_geom::{Plane, Vec2, Vec3};+use solidcraft_geom::{Plane, Vec2, Vec3};use crate::PlaneRef;diff --git a/crates/doc/src/clipboard.rs b/crates/doc/src/clipboard.rsindex c4ad4a3567..63d4e1a986 100644--- a/crates/doc/src/clipboard.rs+++ b/crates/doc/src/clipboard.rs@@ -202,13 +202,13 @@ fn remap_plane(}fn remap_link(- source: &mut solvecraft_sketch::LinkSource,+ source: &mut solidcraft_sketch::LinkSource,ids: &BTreeMap<u64, u64>,names: &BTreeMap<String, String>,bodies: &BTreeMap<String, String>,depth: usize,) {- use solvecraft_sketch::LinkSource;+ use solidcraft_sketch::LinkSource;if depth > 64 {return;}@@ -441,11 +441,11 @@ fn checked_plane(p: &PlaneRef, depth: usize) -> crate::Result<()> {}Ok(())}-fn checked_link(source: &solvecraft_sketch::LinkSource, depth: usize) -> crate::Result<()> {+fn checked_link(source: &solidcraft_sketch::LinkSource, depth: usize) -> crate::Result<()> {if depth > 64 {return Err(crate::DocError::Invalid("copy link nesting exceeds 64".into()));}- if let solvecraft_sketch::LinkSource::Intersection { a, b } = source {+ if let solidcraft_sketch::LinkSource::Intersection { a, b } = source {checked_link(a, depth + 1)?;checked_link(b, depth + 1)?;}diff --git a/crates/doc/src/config_certificates.rs b/crates/doc/src/config_certificates.rsindex a44d22341a..66cc709bee 100644--- a/crates/doc/src/config_certificates.rs+++ b/crates/doc/src/config_certificates.rs@@ -1,7 +1,7 @@//! Certificates are producer identities, never a nearest-surface selection.use crate::{DocError, Document, FeatureKind, ModelBody, Result, SolvedSketch};use serde::{Deserialize, Serialize};-use solvecraft_geom::Seg2;+use solidcraft_geom::Seg2;fn valid_signature(outer: &[String], holes: &[Vec<String>]) -> bool {let valid = |ids: &[String]| {@@ -68,11 +68,11 @@ pub(crate) fn cap_key(outer: &[String], holes: &[Vec<String>]) -> String {}format!("{:x}", hash.finalize())}-fn exact_region_signature(curves: &ExactSketchCurves, region: &solvecraft_geom::Region2) -> Option<solvecraft_kernel::CapSignature> {+fn exact_region_signature(curves: &ExactSketchCurves, region: &solidcraft_geom::Region2) -> Option<solidcraft_kernel::CapSignature> {if region.outer.segs.len() + region.holes.iter().map(|hole| hole.segs.len()).sum::<usize>() > 4096 || region.holes.len() > 128 {return None;}- let signature = |outline: &solvecraft_geom::Loop2| {+ let signature = |outline: &solidcraft_geom::Loop2| {let mut ids = outline.segs.iter().map(|segment| curves.find(segment)).collect::<Option<Vec<_>>>()?;ids.sort();ids.dedup();@@ -85,9 +85,9 @@ fn exact_region_signature(curves: &ExactSketchCurves, region: &solvecraft_geom::}/// Charge all source-curve comparisons before matching; over-budget tools stay usable but uncertified.-type CapBindings = Vec<Vec<Option<solvecraft_kernel::CapSignature>>>;-pub(crate) fn extrude_cap_bindings(sketch: &SolvedSketch, bodies: &[solvecraft_kernel::Body], budget: usize) -> Option<CapBindings> {- use solvecraft_kernel::FaceSource;+type CapBindings = Vec<Vec<Option<solidcraft_kernel::CapSignature>>>;+pub(crate) fn extrude_cap_bindings(sketch: &SolvedSketch, bodies: &[solidcraft_kernel::Body], budget: usize) -> Option<CapBindings> {+ use solidcraft_kernel::FaceSource;if sketch.sketch.curves.len() > 2000 {return None;}@@ -116,7 +116,7 @@ pub(crate) fn extrude_cap_bindings(sketch: &SolvedSketch, bodies: &[solvecraft_klet mut counts = std::collections::BTreeMap::new();let mut bindings = Vec::with_capacity(bodies.len());for body in bodies {- let mut cached: Option<(&solvecraft_geom::Region2, Option<solvecraft_kernel::CapSignature>)> = None;+ let mut cached: Option<(&solidcraft_geom::Region2, Option<solidcraft_kernel::CapSignature>)> = None;let mut values = Vec::new();for source in body.face_sources().into_iter().flatten() {let signature = if let Some(FaceSource::ExtrudeCap { region, high, .. }) = source {@@ -260,8 +260,8 @@ pub(crate) fn shell_certificate_role(source: &FaceCertificate, inner: bool) -> ROk(format!("shell:{}:{role}", if inner { "inner" } else { "outer" }))}-pub(crate) fn flat_source_certificate(source: &solvecraft_kernel::FaceSource) -> Option<(u64, FaceCertificate)> {- use solvecraft_kernel::FaceSource;+pub(crate) fn flat_source_certificate(source: &solidcraft_kernel::FaceSource) -> Option<(u64, FaceCertificate)> {+ use solidcraft_kernel::FaceSource;match source {FaceSource::Box { producer: Some(producer), axis, high, .. } => Some((*producer, FaceCertificate::Box { axis: *axis, high: *high })),FaceSource::CertifiedExtrudeSide { producer, sketch, curve, .. } => {@@ -277,8 +277,8 @@ pub(crate) fn flat_source_certificate(source: &solvecraft_kernel::FaceSource) ->}}-pub(crate) fn flat_source_matches(certificate: &FaceCertificate, source: &solvecraft_kernel::FaceSource, producer: u64) -> bool {- use solvecraft_kernel::FaceSource;+pub(crate) fn flat_source_matches(certificate: &FaceCertificate, source: &solidcraft_kernel::FaceSource, producer: u64) -> bool {+ use solidcraft_kernel::FaceSource;match (certificate, source) {(FaceCertificate::Box { axis, high }, FaceSource::Box { producer: Some(current), axis: current_axis, high: current_high, .. }) => {producer == *current && axis == current_axis && high == current_high@@ -324,14 +324,14 @@ impl<'a> ExactSketchCurves<'a> {if curve.construction|| !matches!(curve.kind,- solvecraft_sketch::CurveKind::Line { .. }- | solvecraft_sketch::CurveKind::Arc { .. }- | solvecraft_sketch::CurveKind::Circle { .. }+ solidcraft_sketch::CurveKind::Line { .. }+ | solidcraft_sketch::CurveKind::Arc { .. }+ | solidcraft_sketch::CurveKind::Circle { .. }){continue;}- let originals = if let solvecraft_sketch::CurveKind::Circle { c, r } = curve.kind {+ let originals = if let solidcraft_sketch::CurveKind::Circle { c, r } = curve.kind {sketch.sketch.point(c)@@ -364,7 +364,7 @@ fn exact_segment_contains(original: &Seg2, generated: &Seg2) -> bool {(Seg2::Line { a, b }, Seg2::Line { a: c, b: d }) => {let direction = *b - *a;let scale = direction.len().max((*d - *c).len()).max(1.);- let interval = |point: solvecraft_geom::Vec2| {+ let interval = |point: solidcraft_geom::Vec2| {let t = (point - *a).dot(direction) / direction.len2();(-1e-10..=1. + 1e-10).contains(&t)};@@ -400,18 +400,18 @@ fn exact_segment_contains(original: &Seg2, generated: &Seg2) -> bool {}impl Document {- pub fn configuration_face_target(&self, body: &ModelBody, index: usize, point: solvecraft_geom::Vec3) -> Result<crate::config::ConfigFaceTarget> {+ pub fn configuration_face_target(&self, body: &ModelBody, index: usize, point: solidcraft_geom::Vec3) -> Result<crate::config::ConfigFaceTarget> {let names = crate::naming::face_names(body);let mut name = names.get(index).map(|name| crate::naming::strip_piece(name).to_string()).ok_or_else(|| DocError::Unknown("face source name missing".into()))?;let origin = match body.body.face_sources().and_then(|sources| sources.get(index)).and_then(Option::as_ref) {- Some(solvecraft_kernel::FaceSource::Imported { producer: Some(producer), .. })- | Some(solvecraft_kernel::FaceSource::CertifiedExtrudeSide { producer, .. })- | Some(solvecraft_kernel::FaceSource::CertifiedExtrudeCap { producer, .. })- | Some(solvecraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), .. })- | Some(solvecraft_kernel::FaceSource::Box { producer: Some(producer), .. }) => *producer,+ Some(solidcraft_kernel::FaceSource::Imported { producer: Some(producer), .. })+ | Some(solidcraft_kernel::FaceSource::CertifiedExtrudeSide { producer, .. })+ | Some(solidcraft_kernel::FaceSource::CertifiedExtrudeCap { producer, .. })+ | Some(solidcraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), .. })+ | Some(solidcraft_kernel::FaceSource::Box { producer: Some(producer), .. }) => *producer,_ => name.strip_prefix('F').and_then(|name| name.split_once(':'))@@ -439,7 +439,7 @@ impl Document {let Some(source) = body.body.face_sources().and_then(|sources| sources.get(index)).and_then(Option::as_ref) else {return Ok(None);};- if let solvecraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), source, inner, .. } = source {+ if let solidcraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), source, inner, .. } = source {if !self.feature(*producer).is_some_and(|feature| matches!(feature.kind, FeatureKind::Shell { .. })) {return Err(DocError::Invalid("shell source producer missing".into()));}@@ -452,7 +452,7 @@ impl Document {certificate.validate()?;return Ok(Some(certificate));}- if let solvecraft_kernel::FaceSource::Imported { item, face, payload_sha256: Some(digest), producer: Some(producer) } = source {+ if let solidcraft_kernel::FaceSource::Imported { item, face, payload_sha256: Some(digest), producer: Some(producer) } = source {if !self.feature(*producer).is_some_and(|feature| matches!(feature.kind, FeatureKind::Import { .. })) {return Err(DocError::Invalid("import source producer missing".into()));}@@ -461,7 +461,7 @@ impl Document {return Ok(Some(certificate));}let certificate = match source {- solvecraft_kernel::FaceSource::CertifiedExtrudeSide { producer, sketch, curve, .. } => {+ solidcraft_kernel::FaceSource::CertifiedExtrudeSide { producer, sketch, curve, .. } => {if !self.feature(*producer).is_some_and(|feature| matches!(feature.kind, FeatureKind::Extrude { .. })) {return Err(DocError::Invalid("side source producer missing".into()));}@@ -472,16 +472,16 @@ impl Document {certificate.validate()?;Ok(Some(certificate))}- pub fn strong_face_target(&self, body: &ModelBody, index: usize, point: solvecraft_geom::Vec3) -> Result<crate::config::ConfigFaceTarget> {+ pub fn strong_face_target(&self, body: &ModelBody, index: usize, point: solidcraft_geom::Vec3) -> Result<crate::config::ConfigFaceTarget> {let mut target = self.configuration_face_target(body, index, point)?;match body.body.face_sources().and_then(|sources| sources.get(index)).and_then(Option::as_ref) {- Some(solvecraft_kernel::FaceSource::Box { producer: Some(producer), axis, high, .. }) => {+ Some(solidcraft_kernel::FaceSource::Box { producer: Some(producer), axis, high, .. }) => {target.origin_feature = *producer;let axis_name = ["x", "y", "z"].get(*axis as usize).ok_or_else(|| DocError::Invalid("invalid box face axis".into()))?;target.name = format!("F{producer}:{}{axis_name}", if *high { "+" } else { "-" });target.certificate = Some(FaceCertificate::Box { axis: *axis, high: *high });}- Some(solvecraft_kernel::FaceSource::CertifiedExtrudeCap { producer, sketch, high, outer, holes, .. }) => {+ Some(solidcraft_kernel::FaceSource::CertifiedExtrudeCap { producer, sketch, high, outer, holes, .. }) => {target.origin_feature = *producer;target.name = format!("F{producer}:cap:{}:{}", if *high { "high" } else { "low" }, cap_key(outer, holes));target.certificate = Some(FaceCertificate::ExtrudeCap { sketch: *sketch, high: *high, outer: outer.clone(), holes: holes.clone() });@@ -507,15 +507,15 @@ mod tests {use super::*;use serde_json::json;- fn solved(mut sketch: solvecraft_sketch::Sketch) -> SolvedSketch {- let report = solvecraft_sketch::solve(&mut sketch);- SolvedSketch { feature: 1, name: "sources".into(), plane: solvecraft_geom::Plane::XY, sketch, report, profiles: Vec::new() }+ fn solved(mut sketch: solidcraft_sketch::Sketch) -> SolvedSketch {+ let report = solidcraft_sketch::solve(&mut sketch);+ SolvedSketch { feature: 1, name: "sources".into(), plane: solidcraft_geom::Plane::XY, sketch, report, profiles: Vec::new() }}#[test]fn prepared_sources_keep_exact_identity_and_reject_ambiguity() {- use solvecraft_geom::Vec2;- let mut sketch = solvecraft_sketch::Sketch::new();+ use solidcraft_geom::Vec2;+ let mut sketch = solidcraft_sketch::Sketch::new();sketch.add_line(Vec2::ZERO, Vec2::new(10., 0.), None, None, Some("line")).unwrap();sketch.add_circle(Vec2::new(20., 0.), 2., None, Some("circle")).unwrap();let construction = sketch.add_line(Vec2::ZERO, Vec2::new(10., 0.), None, None, Some("construction")).unwrap();@@ -532,7 +532,7 @@ mod tests {// A prepared pass borrows one immutable evaluated sketch, so an upstream edit// necessarily prepares fresh sources rather than retaining stale coordinates.let mut moved = sketch.clone();- moved.sketch = solvecraft_sketch::Sketch::new();+ moved.sketch = solidcraft_sketch::Sketch::new();moved.sketch.add_line(Vec2::new(0., 1.), Vec2::new(10., 1.), None, None, Some("line")).unwrap();assert_eq!(ExactSketchCurves::new(&moved).find(&partial), None);}@@ -540,8 +540,8 @@ mod tests {#[test]#[ignore = "manual optimized certification microbenchmark; no timing assertion"]fn benchmark_prepared_extrude_sources() {- use solvecraft_geom::Vec2;- let mut sketch = solvecraft_sketch::Sketch::new();+ use solidcraft_geom::Vec2;+ let mut sketch = solidcraft_sketch::Sketch::new();for i in 0..1000 {let y = i as f64;sketch.add_line(Vec2::new(0., y), Vec2::new(10., y), None, None, None).unwrap();@@ -593,7 +593,7 @@ mod tests {#[test]fn analytic_arc_interval_refuses_unsampled_gaps_and_accepts_wrap_reversal() {let radians = |degrees: f64| degrees.to_radians();- let arc = |start, sweep| Seg2::Arc { center: solvecraft_geom::Vec2::default(), radius: 10., start: radians(start), sweep: radians(sweep) };+ let arc = |start, sweep| Seg2::Arc { center: solidcraft_geom::Vec2::default(), radius: 10., start: radians(start), sweep: radians(sweep) };assert!(!exact_segment_contains(&arc(10., 350.), &arc(20., 360.)), "five point probes missed the missing ten-degree gap");assert!(!exact_segment_contains(&arc(10., 350.), &arc(20., -360.)));assert!(exact_segment_contains(&arc(350., 40.), &arc(355., 20.)));diff --git a/crates/doc/src/config_clone.rs b/crates/doc/src/config_clone.rsindex da1aac9238..0821c5385d 100644--- a/crates/doc/src/config_clone.rs+++ b/crates/doc/src/config_clone.rs@@ -142,7 +142,7 @@ mod tests {body: "Old".into(),origin_feature: 3,name: "F3:+z".into(),- point: solvecraft_geom::Vec3::new(1., 1., 2.),+ point: solidcraft_geom::Vec3::new(1., 1., 2.),certificate: None,}),],@@ -199,7 +199,7 @@ mod tests {body: "Foreign".into(),origin_feature: 3,name: "F3:+z".into(),- point: solvecraft_geom::Vec3::ZERO,+ point: solidcraft_geom::Vec3::ZERO,certificate: None,}),],diff --git a/crates/doc/src/config_shell_tests.rs b/crates/doc/src/config_shell_tests.rsindex 4bb90342da..65499c1776 100644--- a/crates/doc/src/config_shell_tests.rs+++ b/crates/doc/src/config_shell_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::{FeatureKind, Model, PlaneRef};use serde_json::json;-use solvecraft_geom::{Vec2, Vec3};+use solidcraft_geom::{Vec2, Vec3};fn shell_document() -> (Document, u64, u64) {let mut doc = Document::new("certified shell");@@ -35,23 +35,23 @@ fn face_index(body: &ModelBody, inner: bool) -> usize {.unwrap().iter().position(|source| {- matches!(source, Some(solvecraft_kernel::FaceSource::ShellPlanar { inner: current, source, .. })- if *current == inner && matches!(source.as_ref(), solvecraft_kernel::FaceSource::Box { axis:0,high:true,.. }))+ matches!(source, Some(solidcraft_kernel::FaceSource::ShellPlanar { inner: current, source, .. })+ if *current == inner && matches!(source.as_ref(), solidcraft_kernel::FaceSource::Box { axis:0,high:true,.. }))}).unwrap()}#[test]fn shell_planar_raw_bounds_flat_identity_and_clone_remap() {- let plane = solvecraft_geom::Plane::XY;- let same = |planes: &[Option<solvecraft_geom::Plane>]| super::super::styles::shell_plane_family(planes.iter().copied());+ let plane = solidcraft_geom::Plane::XY;+ let same = |planes: &[Option<solidcraft_geom::Plane>]| super::super::styles::shell_plane_family(planes.iter().copied());assert!(same(&[Some(plane), Some(plane)]));assert!(!same(&[]));assert!(!same(&[Some(plane), None]));for different in [- solvecraft_geom::Plane { origin: Vec3::X, ..plane },- solvecraft_geom::Plane { x: -plane.x, y: -plane.y, ..plane },- solvecraft_geom::Plane { y: -plane.y, ..plane },+ solidcraft_geom::Plane { origin: Vec3::X, ..plane },+ solidcraft_geom::Plane { x: -plane.x, y: -plane.y, ..plane },+ solidcraft_geom::Plane { y: -plane.y, ..plane },] {assert!(!same(&[Some(plane), Some(different)]));}@@ -82,15 +82,15 @@ fn shell_planar_anchor_rebuild_cold_geometry_and_missing_source_errors() {let body = state.body("Case").unwrap();let outer = doc.strong_face_target(body, face_index(body, false), Vec3::default()).unwrap();let outer_matches: Vec<_> = body.body.face_sources().unwrap().iter().enumerate().filter_map(|(index, source)| {- matches!(source, Some(solvecraft_kernel::FaceSource::ShellPlanar { inner: false, source, .. }) if matches!(source.as_ref(), solvecraft_kernel::FaceSource::Box { axis: 0, high: true, .. })).then_some((index, body.body.face_plane(index)))+ matches!(source, Some(solidcraft_kernel::FaceSource::ShellPlanar { inner: false, source, .. }) if matches!(source.as_ref(), solidcraft_kernel::FaceSource::Box { axis: 0, high: true, .. })).then_some((index, body.body.face_plane(index)))}).collect();assert_eq!(outer_matches.len(), 1, "outer support must be one physical face: {outer_matches:?}");assert!(super::super::styles::shell_plane_family(outer_matches.iter().map(|(_, plane)| *plane)));let outer_plane = body.body.face_plane(face_index(body, false)).unwrap();let outer_anchor = doc.capture_face_anchor(body, face_index(body, false), &outer_plane, &[], 0, &[]).unwrap();- let projected = crate::project::resolve_anchored_face(&doc, &state, &outer_plane, solvecraft_sketch::LinkKind::Project, &outer_anchor).unwrap();- let mut linked = solvecraft_sketch::Sketch::new();- let link = linked.add_link(solvecraft_sketch::LinkKind::Project, projected.source, &projected.geom).unwrap();+ let projected = crate::project::resolve_anchored_face(&doc, &state, &outer_plane, solidcraft_sketch::LinkKind::Project, &outer_anchor).unwrap();+ let mut linked = solidcraft_sketch::Sketch::new();+ let link = linked.add_link(solidcraft_sketch::LinkKind::Project, projected.source, &projected.geom).unwrap();assert!(!linked.update_link(&link, &projected.geom).unwrap());let inner_index = face_index(body, true);let inner = doc.strong_face_target(body, inner_index, Vec3::default()).unwrap();@@ -100,7 +100,7 @@ fn shell_planar_anchor_rebuild_cold_geometry_and_missing_source_errors() {let picked = body.body.face_plane(inner_index).unwrap();assert!((picked.origin.x - 18.).abs() < 1e-8);let anchor = doc.capture_face_anchor(body, inner_index, &picked, &[], 0, &[]).unwrap();- let mut sketch = solvecraft_sketch::Sketch::new();+ let mut sketch = solidcraft_sketch::Sketch::new();let points: Vec<_> =[(2., 2.), (4., 2.), (4., 4.), (2., 4.)].into_iter().map(|(x, y)| sketch.add_point(Vec2::new(x, y), None).unwrap()).collect();for edge in 0..4 {@@ -136,11 +136,11 @@ fn shell_planar_anchor_rebuild_cold_geometry_and_missing_source_errors() {let plane = doc.resolve_face_anchor(&anchor, 0, &changed).unwrap();assert!((plane.origin.x - 27.).abs() < 1e-8);let after = changed.bodies.iter().find(|body| body.feature == boss).unwrap().mesh().bounds();- assert!((solvecraft_kernel::measure(&changed.bodies.iter().find(|body| body.feature == boss).unwrap().body).unwrap().volume - 8.).abs() < 1e-8);+ assert!((solidcraft_kernel::measure(&changed.bodies.iter().find(|body| body.feature == boss).unwrap().body).unwrap().volume - 8.).abs() < 1e-8);assert!((doc.resolve_face_anchor(&outer_anchor, 0, &changed).unwrap().origin.x - 30.).abs() < 1e-8);let changed_outer_plane = doc.resolve_face_anchor(&outer_anchor, 0, &changed).unwrap();let refreshed =- crate::project::resolve_anchored_face(&doc, &changed, &changed_outer_plane, solvecraft_sketch::LinkKind::Project, &outer_anchor).unwrap();+ crate::project::resolve_anchored_face(&doc, &changed, &changed_outer_plane, solidcraft_sketch::LinkKind::Project, &outer_anchor).unwrap();assert!(!linked.update_link(&link, &refreshed.geom).unwrap(), "same exterior boundary must retain projected IDs");assert!((after.min.x - before.min.x - 9.).abs() < 1e-8, "{before:?} -> {after:?}");assert!((after.max.x - before.max.x - 9.).abs() < 1e-8, "{before:?} -> {after:?}");@@ -173,11 +173,11 @@ fn shell_planar_anchor_rebuild_cold_geometry_and_missing_source_errors() {fn shell_planar_format13_keeps_v12_documents_and_refuses_future() {let (doc, _, _) = shell_document();let mut legacy: serde_json::Value = serde_json::from_str(&doc.to_json()).unwrap();- legacy["format"] = json!("solvecraft/12");+ legacy["format"] = json!("solidcraft/12");let loaded = crate::format::read(&legacy.to_string()).unwrap();let mut current: serde_json::Value = serde_json::from_str(&loaded.to_json()).unwrap();assert_eq!(current["format"], crate::format::format_string(crate::format::FORMAT));- current["format"] = json!("solvecraft/12");+ current["format"] = json!("solidcraft/12");crate::format::pieces_in_shell_order(&mut legacy["features"]);assert_eq!(legacy, current, "the migration preserves every prior field");legacy["format"] = json!(crate::format::format_string(crate::format::FORMAT + 1));@@ -199,7 +199,7 @@ fn regularized_shell_keeps_legacy_and_explicit_single_face_projections_closed()let body = state.body("Case").unwrap();let index = face_index(body, false);let mesh = body.mesh();- assert_eq!(body.body.face_sources().unwrap().iter().filter(|source|matches!(source,Some(solvecraft_kernel::FaceSource::ShellPlanar {inner:false,source,..}) if matches!(source.as_ref(),solvecraft_kernel::FaceSource::Box {axis:0,high:true,..}))).count(),1,"no physical outer-wall strip face may remain");+ assert_eq!(body.body.face_sources().unwrap().iter().filter(|source|matches!(source,Some(solidcraft_kernel::FaceSource::ShellPlanar {inner:false,source,..}) if matches!(source.as_ref(),solidcraft_kernel::FaceSource::Box {axis:0,high:true,..}))).count(),1,"no physical outer-wall strip face may remain");let plane = body.body.face_plane(index).unwrap();let point = mesh.triangles@@ -208,14 +208,14 @@ fn regularized_shell_keeps_legacy_and_explicit_single_face_projections_closed().find_map(|(tri, face)| (*face as usize == index).then(|| mesh.tri(tri)).flatten()).map(|[a, b, c]| (a + b + c) / 3.).unwrap();- let source = solvecraft_sketch::LinkSource::Face { body: "Case".into(), at: point };+ let source = solidcraft_sketch::LinkSource::Face { body: "Case".into(), at: point };let (values, _) = doc.param_values();- let legacy = crate::project::resolve(&doc, &values, &state, &plane, solvecraft_sketch::LinkKind::Project, &source).unwrap();- let explicit = crate::project::resolve_face_indices(&state, &plane, solvecraft_sketch::LinkKind::Project, "Case", &[index]).unwrap();+ let legacy = crate::project::resolve(&doc, &values, &state, &plane, solidcraft_sketch::LinkKind::Project, &source).unwrap();+ let explicit = crate::project::resolve_face_indices(&state, &plane, solidcraft_sketch::LinkKind::Project, "Case", &[index]).unwrap();assert_eq!(legacy.geom, explicit.geom);assert_eq!(explicit.geom.len(), 4, "raw planar piece keeps all four edges");- let mut sketch = solvecraft_sketch::Sketch::new();- let link = sketch.add_link(solvecraft_sketch::LinkKind::Project, source, &legacy.geom).unwrap();+ let mut sketch = solidcraft_sketch::Sketch::new();+ let link = sketch.add_link(solidcraft_sketch::LinkKind::Project, source, &legacy.geom).unwrap();sketch.links[0].face_name = Some(crate::naming::face_names(body)[index].clone());let warnings = crate::project::refresh_links(&doc, &values, &state, &plane, &mut sketch);assert!(warnings.is_empty(), "{warnings:?}");@@ -242,11 +242,11 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_material// Legacy Shell did not propagate construction certificates. Omit transient// metadata here; operand paint also disables new wall-run coalescence so// this control retains the actual historical raw pieces.- let raw_source = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(20., 12., 10.)).unwrap().with_paint(Some(solvecraft_kernel::Paint {+ let raw_source = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(20., 12., 10.)).unwrap().with_paint(Some(solidcraft_kernel::Paint {opacity: 1.,- faces: vec![solvecraft_kernel::FacePaint { face: 0, color: [1., 0., 0.], opacity: 1. }],+ faces: vec![solidcraft_kernel::FacePaint { face: 0, color: [1., 0., 0.], opacity: 1. }],}));- let raw = solvecraft_kernel::shell(&raw_source, &[Vec3::new(5., 6., 10.)], 2.).unwrap();+ let raw = solidcraft_kernel::shell(&raw_source, &[Vec3::new(5., 6., 10.)], 2.).unwrap();let mut old_body = ModelBody::new("Case".into(), raw, shell);old_body.names = crate::naming::NameCell::new(Some(std::sync::Arc::new(crate::naming::NamingOrigin {feature: doc.feature(shell).unwrap().clone(),@@ -258,13 +258,13 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_materialassert_eq!(crate::naming::parent_piece(&captured), Some(stem.as_str()), "actual strip capture records a piece name");// What the builds before format 14 saved for that piece: its number by centroid order.let former = format!("{stem}#1");- let mut sketch = solvecraft_sketch::Sketch::new();+ let mut sketch = solidcraft_sketch::Sketch::new();let corners = [Vec2::new(0., 0.), Vec2::new(12., 0.), Vec2::new(12., 2.), Vec2::new(0., 2.)];- let geometry: Vec<_> = (0..4).map(|i| solvecraft_sketch::LinkGeom::Line(corners[i], corners[(i + 1) % 4])).collect();+ let geometry: Vec<_> = (0..4).map(|i| solidcraft_sketch::LinkGeom::Line(corners[i], corners[(i + 1) % 4])).collect();sketch.add_link(- solvecraft_sketch::LinkKind::Project,- solvecraft_sketch::LinkSource::Face { body: "Case".into(), at: Vec3::new(20., 6., 1.) },+ solidcraft_sketch::LinkKind::Project,+ solidcraft_sketch::LinkSource::Face { body: "Case".into(), at: Vec3::new(20., 6., 1.) },&geometry,).unwrap();@@ -289,7 +289,7 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_material).unwrap();let mut legacy: serde_json::Value = serde_json::from_str(&doc.to_json()).unwrap();- legacy["format"] = json!("solvecraft/12");+ legacy["format"] = json!("solidcraft/12");let mut doc = crate::format::read(&legacy.to_string()).unwrap();for width in [20., 30.] {doc.set_param("width", &width.to_string(), Some("mm"), None).unwrap();@@ -308,7 +308,7 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_materialassert_eq!(solved.sketch.points, original.points);let material = state.bodies.iter().find(|body| body.feature == boss).unwrap();assert!(- (solvecraft_kernel::measure(&material.body).unwrap().volume - 24.).abs() < 1e-8,+ (solidcraft_kernel::measure(&material.body).unwrap().volume - 24.).abs() < 1e-8,"old24mm3 profile must not silently become120mm3 wall profile");let bounds = material.mesh().bounds();@@ -320,8 +320,8 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_material#[test]fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {- use solvecraft_kernel::{FacePaint, Paint};- use solvecraft_sketch::{LinkKind, LinkSource, Sketch};+ use solidcraft_kernel::{FacePaint, Paint};+ use solidcraft_sketch::{LinkKind, LinkSource, Sketch};let mut doc = Document::new("saved curved strip");doc.set_param("width", "80", Some("mm"), None).unwrap();doc.set_param("wall", "2", Some("mm"), None).unwrap();@@ -362,14 +362,14 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {.body.clone().with_paint(Some(Paint { opacity: 1., faces: vec![FacePaint { face: 0, color: [1., 0., 0.], opacity: 1. }] }));- let cavity_box = solvecraft_kernel::box_solid(Vec3::new(-38., -28., 2.), Vec3::new(38., 28., 35.)).unwrap();- let cavity = solvecraft_kernel::fillet(+ let cavity_box = solidcraft_kernel::box_solid(Vec3::new(-38., -28., 2.), Vec3::new(38., 28., 35.)).unwrap();+ let cavity = solidcraft_kernel::fillet(&cavity_box,&[Vec3::new(38., 28., 15.), Vec3::new(-38., 28., 15.), Vec3::new(-38., -28., 15.), Vec3::new(38., -28., 15.)],4.,).unwrap();- let raw = solvecraft_kernel::boolean(&old_source, &cavity, solvecraft_kernel::BoolOp::Cut).unwrap().unwrap();+ let raw = solidcraft_kernel::boolean(&old_source, &cavity, solidcraft_kernel::BoolOp::Cut).unwrap().unwrap();let mut old_body = ModelBody::new("Case".into(), raw, shell);old_body.names = crate::naming::NameCell::new(Some(std::sync::Arc::new(crate::naming::NamingOrigin {feature: doc.feature(shell).unwrap().clone(),@@ -403,18 +403,18 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {continue;}let points = &mesh.edges[index];- let a = solvecraft_geom::Plane::YZ.to_local(*points.first().unwrap());- let b = solvecraft_geom::Plane::YZ.to_local(*points.last().unwrap());+ let a = solidcraft_geom::Plane::YZ.to_local(*points.first().unwrap());+ let b = solidcraft_geom::Plane::YZ.to_local(*points.last().unwrap());let (a, b) = (Vec2::new(a.x, a.y), Vec2::new(b.x, b.y));assert!(a.dist(b) > 1e-6);for point in points {- let q = solvecraft_geom::Plane::YZ.to_local(*point);+ let q = solidcraft_geom::Plane::YZ.to_local(*point);let q = Vec2::new(q.x, q.y);let direction = b - a;let t = ((q - a).dot(direction) / direction.dot(direction)).clamp(0., 1.);assert!(q.dist(a + direction * t) < 1e-7, "exact cylindrical quadrant projects to a straight support");}- geometry.push(solvecraft_sketch::LinkGeom::Line(a, b));+ geometry.push(solidcraft_sketch::LinkGeom::Line(a, b));}assert_eq!(geometry.len(), 4, "historical curved strip has a complete four-edge rectangular projection");let mut sketch = Sketch::new();@@ -422,7 +422,7 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {sketch.links[0].face_name = Some(former);let original = sketch.clone();let sk = doc- .add_feature(FeatureKind::Sketch { plane: PlaneRef::Custom { plane: solvecraft_geom::Plane::YZ }, sketch }, Some("Saved corner strip"))+ .add_feature(FeatureKind::Sketch { plane: PlaneRef::Custom { plane: solidcraft_geom::Plane::YZ }, sketch }, Some("Saved corner strip")).unwrap();let boss = doc.add_feature(@@ -454,7 +454,7 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {assert_eq!(solved.sketch.curves, original.curves);let material = state.bodies.iter().find(|body| body.feature == boss).unwrap();assert!(- (solvecraft_kernel::measure(&material.body).unwrap().volume - 12.).abs() < 1e-7,+ (solidcraft_kernel::measure(&material.body).unwrap().volume - 12.).abs() < 1e-7,"two-mm strip cannot expand to a full thirty-mm wall");}@@ -463,8 +463,8 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() {#[test]fn saved_stepped_tab_cut_piece_projection_is_lost_without_expanding_material() {- use solvecraft_kernel::{BoolOp, FacePaint, Paint};- use solvecraft_sketch::{LinkKind, LinkSource, Sketch};+ use solidcraft_kernel::{BoolOp, FacePaint, Paint};+ use solidcraft_sketch::{LinkKind, LinkSource, Sketch};let mut doc = Document::new("public stepped tab case");doc.set_param("length", "40", Some("mm"), None).unwrap();doc.set_param("wall", "2", Some("mm"), None).unwrap();@@ -508,7 +508,7 @@ fn saved_stepped_tab_cut_piece_projection_is_lost_without_expanding_material() {.body.clone().with_paint(Some(Paint { opacity: 1., faces: vec![FacePaint { face: 0, color: [1., 0., 0.], opacity: 1. }] }));- let old_cut = solvecraft_kernel::boolean(&old_stock, &before.body("Pocket tool").unwrap().body, BoolOp::Cut).unwrap().unwrap();+ let old_cut = solidcraft_kernel::boolean(&old_stock, &before.body("Pocket tool").unwrap().body, BoolOp::Cut).unwrap().unwrap();let mut old_body = ModelBody::new("Case".into(), old_cut, cut);old_body.names = crate::naming::NameCell::new(Some(std::sync::Arc::new(crate::naming::NamingOrigin {feature: doc.feature(cut).unwrap().clone(),@@ -522,7 +522,7 @@ fn saved_stepped_tab_cut_piece_projection_is_lost_without_expanding_material() {let index = crate::naming::face_on_body(&old_body, &former, at).unwrap().0;let mut old_state = crate::ModelState::default();old_state.bodies.push(old_body);- let plane = solvecraft_geom::Plane::YZ;+ let plane = solidcraft_geom::Plane::YZ;let resolved = crate::project::resolve_face_indices(&old_state, &plane, LinkKind::Project, "Case", &[index]).unwrap();let current_state = model.state();let current = current_state.body("Case").unwrap();@@ -569,15 +569,15 @@ fn saved_stepped_tab_cut_piece_projection_is_lost_without_expanding_material() {assert_eq!(saved.sketch.curves, original.curves);let stock = state.bodies.iter().find(|b| b.feature == material).unwrap();assert!(- (solvecraft_kernel::measure(&stock.body).unwrap().volume - 200.).abs() < 1e-7,+ (solidcraft_kernel::measure(&stock.body).unwrap().volume - 200.).abs() < 1e-7,"saved10x20 patch must not become30x20 wall; actualvolume={}, bounds={:?}, originalpoints={:?}",- solvecraft_kernel::measure(&stock.body).unwrap().volume,+ solidcraft_kernel::measure(&stock.body).unwrap().volume,stock.mesh().bounds(),original.points);let case = state.body("Case").unwrap();let expected = length * 30. * 20. + 8. * 10. * 8. - (length - 2. * wall) * (30. - 2. * wall) * (20. - wall);- assert!((solvecraft_kernel::measure(&case.body).unwrap().volume - expected).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&case.body).unwrap().volume - expected).abs() < 1e-6);}}}diff --git a/crates/doc/src/config_styles.rs b/crates/doc/src/config_styles.rsindex 0bdf010dc7..63d921feff 100644--- a/crates/doc/src/config_styles.rs+++ b/crates/doc/src/config_styles.rs@@ -3,9 +3,9 @@ use super::Column;use crate::{DocError, Document, FeatureKind, ModelState, Result};use serde::{Deserialize, Serialize};use serde_json::Value;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;-pub(crate) fn shell_plane_family(planes: impl IntoIterator<Item = Option<solvecraft_geom::Plane>>) -> bool {+pub(crate) fn shell_plane_family(planes: impl IntoIterator<Item = Option<solidcraft_geom::Plane>>) -> bool {let mut planes = planes.into_iter();let Some(Some(first)) = planes.next() else { return false };first.origin.is_finite() && first.x.is_finite() && first.y.is_finite() && planes.all(|plane| plane == Some(first))@@ -112,7 +112,7 @@ impl Document {(FaceCertificate::ExtrudeCap { sketch, .. }, FeatureKind::Extrude { sketch: current, extent, operation: crate::Operation::NewBody, .. }) => sketch == current && extent.taper.is_none(),(FaceCertificate::ExtrudeSide { sketch, curve }, FeatureKind::Extrude { sketch: current, extent, operation: crate::Operation::NewBody, .. }) => {sketch == current && extent.taper.is_none()- && self.feature(*sketch).is_some_and(|feature| matches!(&feature.kind, FeatureKind::Sketch { sketch, .. } if sketch.curves.iter().any(|candidate| candidate.id == *curve && !candidate.construction && matches!(candidate.kind, solvecraft_sketch::CurveKind::Line { .. } | solvecraft_sketch::CurveKind::Circle { .. } | solvecraft_sketch::CurveKind::Arc { .. }))))+ && self.feature(*sketch).is_some_and(|feature| matches!(&feature.kind, FeatureKind::Sketch { sketch, .. } if sketch.curves.iter().any(|candidate| candidate.id == *curve && !candidate.construction && matches!(candidate.kind, solidcraft_sketch::CurveKind::Line { .. } | solidcraft_sketch::CurveKind::Circle { .. } | solidcraft_sketch::CurveKind::Arc { .. }))))}(FaceCertificate::Imported { .. }, FeatureKind::Import { .. }) => true,_ => false,@@ -138,7 +138,7 @@ impl Document {}(super::FaceCertificate::ExtrudeSide { sketch, curve }, FeatureKind::Extrude { sketch: producer_sketch, extent, operation: crate::Operation::NewBody, .. }) => {sketch == producer_sketch && extent.taper.is_none() && role == format!("side:{curve}")- && self.feature(*sketch).is_some_and(|feature| matches!(&feature.kind, FeatureKind::Sketch { sketch, .. } if sketch.curves.iter().any(|candidate| candidate.id == *curve && !candidate.construction && matches!(candidate.kind, solvecraft_sketch::CurveKind::Line { .. } | solvecraft_sketch::CurveKind::Circle { .. } | solvecraft_sketch::CurveKind::Arc { .. }))))+ && self.feature(*sketch).is_some_and(|feature| matches!(&feature.kind, FeatureKind::Sketch { sketch, .. } if sketch.curves.iter().any(|candidate| candidate.id == *curve && !candidate.construction && matches!(candidate.kind, solidcraft_sketch::CurveKind::Line { .. } | solidcraft_sketch::CurveKind::Circle { .. } | solidcraft_sketch::CurveKind::Arc { .. }))))}(super::FaceCertificate::Imported { .. }, FeatureKind::Import { .. }) => role.strip_prefix("face:").is_some_and(|index| index.parse::<usize>().is_ok()),(super::FaceCertificate::ShellPlanar { source_producer, source, inner }, FeatureKind::Shell { .. }) => {@@ -183,7 +183,7 @@ impl Document {}if let Some(super::FaceCertificate::ShellPlanar { source_producer, source, inner }) = &target.certificate {let indices: Vec<_> = body.body.face_sources().into_iter().flatten().enumerate().filter_map(|(index, current)| {- matches!(current, Some(solvecraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), source: current_source, inner: current_inner, .. }) if *producer == target.origin_feature && inner == current_inner && super::flat_source_matches(source, current_source, *source_producer)).then_some(index)+ matches!(current, Some(solidcraft_kernel::FaceSource::ShellPlanar { producer: Some(producer), source: current_source, inner: current_inner, .. }) if *producer == target.origin_feature && inner == current_inner && super::flat_source_matches(source, current_source, *source_producer)).then_some(index)}).collect();// A shell can split one original support into several pieces. All pieces// must retain the same canonical frame, not merely lie on a common plane.@@ -203,11 +203,11 @@ impl Document {let matched = match (&target.certificate, source) {(Some(super::FaceCertificate::Box { axis, high }),- Some(solvecraft_kernel::FaceSource::Box { producer: Some(producer), axis: current_axis, high: current_high, .. }),+ Some(solidcraft_kernel::FaceSource::Box { producer: Some(producer), axis: current_axis, high: current_high, .. }),) => *producer == target.origin_feature && axis == current_axis && high == current_high,(Some(super::FaceCertificate::ExtrudeCap { sketch, high, outer, holes }),- Some(solvecraft_kernel::FaceSource::CertifiedExtrudeCap {+ Some(solidcraft_kernel::FaceSource::CertifiedExtrudeCap {producer,sketch: current_sketch,high: current_high,@@ -234,7 +234,7 @@ impl Document {}if let Some(super::FaceCertificate::ExtrudeSide { sketch, curve }) = &target.certificate {let indices: Vec<_> = body.body.face_sources().into_iter().flatten().enumerate().filter_map(|(index, source)| {- matches!(source, Some(solvecraft_kernel::FaceSource::CertifiedExtrudeSide { producer, sketch: current_sketch, curve: current_curve, .. }) if *producer == target.origin_feature && current_sketch == sketch && current_curve == curve).then_some(index)+ matches!(source, Some(solidcraft_kernel::FaceSource::CertifiedExtrudeSide { producer, sketch: current_sketch, curve: current_curve, .. }) if *producer == target.origin_feature && current_sketch == sketch && current_curve == curve).then_some(index)}).collect();if indices.is_empty() {return Err(DocError::Unknown("constructed side certificate no longer exists".into()));@@ -243,7 +243,7 @@ impl Document {}if let Some(super::FaceCertificate::Imported { payload_sha256, item, face }) = &target.certificate {let indices: Vec<_> = body.body.face_sources().into_iter().flatten().enumerate().filter_map(|(index, source)| {- matches!(source, Some(solvecraft_kernel::FaceSource::Imported { item: current_item, face: current_face, payload_sha256: Some(digest), producer: Some(producer) }) if current_item == item && current_face == face && digest == payload_sha256 && *producer == target.origin_feature).then_some(index)+ matches!(source, Some(solidcraft_kernel::FaceSource::Imported { item: current_item, face: current_face, payload_sha256: Some(digest), producer: Some(producer) }) if current_item == item && current_face == face && digest == payload_sha256 && *producer == target.origin_feature).then_some(index)}).collect();if indices.is_empty() {return Err(DocError::Unknown("immutable import face certificate no longer exists".into()));diff --git a/crates/doc/src/construct.rs b/crates/doc/src/construct.rsindex 9f040d054c..916e1d1d5b 100644--- a/crates/doc/src/construct.rs+++ b/crates/doc/src/construct.rs@@ -8,8 +8,8 @@use std::collections::BTreeMap;use serde::{Deserialize, Serialize};-use solvecraft_geom::{Plane, Vec2, Vec3};-use solvecraft_kernel::{self as kernel, FaceSurface};+use solidcraft_geom::{Plane, Vec2, Vec3};+use solidcraft_kernel::{self as kernel, FaceSurface};use crate::eval::{ModelBody, ModelState};use crate::expr::{Kind, Value};diff --git a/crates/doc/src/document.rs b/crates/doc/src/document.rsindex dae2e0f97f..c3ac371695 100644--- a/crates/doc/src/document.rs+++ b/crates/doc/src/document.rs@@ -1,6 +1,6 @@use serde::{Deserialize, Serialize};-use solvecraft_geom::{Plane, Vec2, Vec3};-use solvecraft_sketch::Sketch;+use solidcraft_geom::{Plane, Vec2, Vec3};+use solidcraft_sketch::Sketch;use crate::construct::{AxisDef, GeoRef, PointDef};use crate::expr::{self, Kind};@@ -884,7 +884,7 @@ pub enum FeatureKind {step: String,/// The file's product/assembly tree, kept for components.#[serde(default, skip_serializing_if = "Vec::is_empty")]- components: Vec<solvecraft_kernel::StepNode>,+ components: Vec<solidcraft_kernel::StepNode>,},/// Rebuild an upstream constant-section mesh with analytic planar/cylindrical faces.MeshConvert {@@ -1697,7 +1697,7 @@ pub struct Document {pub struct NamedView {#[serde(default)]pub name: String,- pub target: solvecraft_geom::Vec3,+ pub target: solidcraft_geom::Vec3,pub yaw: f64,pub pitch: f64,pub distance: f64,@@ -1774,13 +1774,13 @@ impl Document {let mut st = state.clone();for b in &mut st.bodies {let c = self.body_color(b);- let faces: Vec<solvecraft_kernel::FacePaint> = self+ let faces: Vec<solidcraft_kernel::FacePaint> = self.face_colors(b).into_iter()- .map(|(face, l)| solvecraft_kernel::FacePaint { face, color: l.rgb(), opacity: l.opacity as f32 })+ .map(|(face, l)| solidcraft_kernel::FacePaint { face, color: l.rgb(), opacity: l.opacity as f32 }).collect();let opacity = self.model_body_opacity(b) as f32;- let paint = solvecraft_kernel::Paint { opacity, faces };+ let paint = solidcraft_kernel::Paint { opacity, faces };if c != b.body.color() || b.body.paint() != Some(&paint) {b.body = b.body.clone().with_color(c).with_paint(Some(paint));}@@ -2214,14 +2214,14 @@ impl Document {&self,vals: &std::collections::BTreeMap<String, expr::Value>,sk: &mut Sketch,- stored: &solvecraft_sketch::DrivingValues,- ) -> Result<solvecraft_sketch::SolveReport> {+ stored: &solidcraft_sketch::DrivingValues,+ ) -> Result<solidcraft_sketch::SolveReport> {self.apply_dimension_values(vals, sk)?;- let mut report = solvecraft_sketch::solve_after_value_edit(sk, stored);+ let mut report = solidcraft_sketch::solve_after_value_edit(sk, stored);if !sk.offsets.is_empty() || !sk.freeform_offsets.is_empty() {// Source dimensions may have moved curves during the solve.sk.refresh_offsets()?;- report = if report.ok() { solvecraft_sketch::solve(sk) } else { solvecraft_sketch::solve_after_value_edit(sk, stored) };+ report = if report.ok() { solidcraft_sketch::solve(sk) } else { solidcraft_sketch::solve_after_value_edit(sk, stored) };}Ok(report)}diff --git a/crates/doc/src/eval.rs b/crates/doc/src/eval.rsindex 31cc4e5fc4..50f1971701 100644--- a/crates/doc/src/eval.rs+++ b/crates/doc/src/eval.rs@@ -5,9 +5,9 @@ use std::hash::{Hash, Hasher};use std::sync::{Arc, OnceLock};use serde::Serialize;-use solvecraft_geom::{Mesh, Plane, Region2, Vec2, Vec3};-use solvecraft_kernel::{self as kernel, Body, BoolOp};-use solvecraft_sketch::{CurveKind, Profile, SolveReport, find_profiles};+use solidcraft_geom::{Mesh, Plane, Region2, Vec2, Vec3};+use solidcraft_kernel::{self as kernel, Body, BoolOp};+use solidcraft_sketch::{CurveKind, Profile, SolveReport, find_profiles};use crate::expr::{self, Kind, Value};use crate::lineage::Traced;@@ -79,7 +79,7 @@ pub struct SolvedSketch {pub feature: u64,pub name: String,pub plane: Plane,- pub sketch: solvecraft_sketch::Sketch,+ pub sketch: solidcraft_sketch::Sketch,pub report: SolveReport,pub profiles: Vec<Profile>,}@@ -217,7 +217,7 @@ fn thread_on(st: &ModelState, feature: u64, p: Vec3, designation: Option<&str>,/// profile, 60° flanks): cut from the shaft (external) or the hole wall (internal), running from/// `start` to `end` along the axis. `radius` is the face's own radius; `open` says which ends/// of the threaded length are free ends of the face.-fn thread_groove(t: &ThreadInfo, radius: f64, open: (bool, bool)) -> Result<solvecraft_geom::Mesh> {+fn thread_groove(t: &ThreadInfo, radius: f64, open: (bool, bool)) -> Result<solidcraft_geom::Mesh> {let (p, d) = (t.pitch, t.major_diameter);let h = p * 3f64.sqrt() / 2.0;let slope = (std::f64::consts::PI / 6.0).tan();@@ -538,7 +538,7 @@ const QUANTUM: f64 = 1e-6;/// Put what a solve writes into a sketch on the [`QUANTUM`] grid: positions, radii and the/// measured values of driven dimensions.-fn quantize(sk: &mut solvecraft_sketch::Sketch) {+fn quantize(sk: &mut solidcraft_sketch::Sketch) {let q = |v: f64| (v / QUANTUM).round() * QUANTUM;for p in &mut sk.points {p.pos = Vec2::new(q(p.pos.x), q(p.pos.y));@@ -572,7 +572,7 @@ fn feature_json(f: &Feature) -> String {/// constraints' values. Nothing else: what evaluation derives for its own copy (an offset's/// upgraded topology, refreshed links) stays out of the stored sketch. A `solved` that does not/// match `stored` entity for entity is not adopted.-fn adopt_solution(stored: &mut solvecraft_sketch::Sketch, solved: &solvecraft_sketch::Sketch) {+fn adopt_solution(stored: &mut solidcraft_sketch::Sketch, solved: &solidcraft_sketch::Sketch) {if stored.points.len() != solved.points.len()|| stored.curves.len() != solved.curves.len()|| stored.constraints.len() != solved.constraints.len()@@ -771,7 +771,7 @@ impl Model {/// recomputed; the next [`Model::evaluate`] recomputes from the sketch on. Returns `false`,/// changing nothing, when the sketch has no evaluated result or a feature before it is/// already stale (only a full evaluation brings that up to date).- pub fn show_live_sketch(&mut self, feature: u64, sketch: solvecraft_sketch::Sketch, report: SolveReport) -> bool {+ pub fn show_live_sketch(&mut self, feature: u64, sketch: solidcraft_sketch::Sketch, report: SolveReport) -> bool {let Some(i) = self.results.iter().position(|r| r.id == feature) else { return false };if self.results.iter().take(i).any(|r| r.stale) {return false;@@ -1042,7 +1042,7 @@ pub fn select_profiles(ss: &SolvedSketch, sel: &ProfileSel) -> Result<Vec<Region// "All" means what was drawn: projected reference geometry (a face's auto-projected// edges) only counts when the drawn curves alone make no profile.ProfileSel::All => {- let drawn = solvecraft_sketch::find_drawn_profiles(&ss.sketch);+ let drawn = solidcraft_sketch::find_drawn_profiles(&ss.sketch);if drawn.is_empty() { ps.iter().map(|p| p.region.clone()).collect() } else { drawn.into_iter().map(|p| p.region).collect() }}ProfileSel::Indices { indices } => {@@ -1066,7 +1066,7 @@ pub fn select_profiles(ss: &SolvedSketch, sel: &ProfileSel) -> Result<Vec<Regionlet mut v = Vec::new();for p in points {// Innermost profile containing the point.- let found = solvecraft_sketch::profile_at_point(ps, *p).and_then(|i| ps.get(i));+ let found = solidcraft_sketch::profile_at_point(ps, *p).and_then(|i| ps.get(i));v.push(found.ok_or_else(|| DocError::Unknown(format!("profile at {:?} in {}", [p.x, p.y], ss.name)))?.region.clone());}v@@ -1079,12 +1079,12 @@ pub fn select_profiles(ss: &SolvedSketch, sel: &ProfileSel) -> Result<Vec<Region}/// The error for a profile picked by curves that no longer names exactly one profile.-pub fn curve_pick_error(e: solvecraft_sketch::CurvePick, ids: &[String], sketch: &str) -> DocError {+pub fn curve_pick_error(e: solidcraft_sketch::CurvePick, ids: &[String], sketch: &str) -> DocError {match e {- solvecraft_sketch::CurvePick::Missing => DocError::Invalid(format!(+ solidcraft_sketch::CurvePick::Missing => DocError::Invalid(format!("no profile of {sketch} is bounded by exactly the curves {ids:?} (a curve was deleted, or another curve now cuts the region)")),- solvecraft_sketch::CurvePick::Ambiguous(n) => DocError::Invalid(format!(+ solidcraft_sketch::CurvePick::Ambiguous(n) => DocError::Invalid(format!("{n} profiles of {sketch} are bounded by exactly the curves {ids:?}; add a curve that tells them apart, or pick by index or point")),}@@ -1389,7 +1389,7 @@ fn grow_profile_for_coplanar(st: &ModelState, r: &Region2, op: Operation, targetlet delta = (size * 0.005).max(1e-3);let lp = r.outer.ccw();let lines: Option<Vec<(Vec2, Vec2)>> =- lp.segs.iter().map(|s| if let solvecraft_geom::Seg2::Line { a, b } = *s { Some((a, b)) } else { None }).collect();+ lp.segs.iter().map(|s| if let solidcraft_geom::Seg2::Line { a, b } = *s { Some((a, b)) } else { None }).collect();let Some(lines) = lines else { return r.clone() };let inside_any = |p: Vec3| meshes.iter().any(|m| m.contains(p));let mut grow = vec![0.0; lines.len()];@@ -1436,7 +1436,7 @@ fn grow_profile_for_coplanar(st: &ModelState, r: &Region2, op: Operation, targetlet t = (p1 - p0).cross(d1) / den;pts.push(p0 + d0 * t);}- Region2 { outer: solvecraft_geom::Loop2::polygon(&pts), holes: r.holes.clone() }+ Region2 { outer: solidcraft_geom::Loop2::polygon(&pts), holes: r.holes.clone() }}/// Booleans struggle with coincident faces (a cut starting on the face it cuts, a boss@@ -1771,7 +1771,7 @@ fn hole_tools(let seam = std::cell::Cell::new(0.0);let disc = |rad: f64| {seam.set(seam.get() + 0.613);- Region2 { outer: solvecraft_geom::Loop2::circle_from(Vec2::ZERO, rad, seam.get()), holes: vec![] }+ Region2 { outer: solidcraft_geom::Loop2::circle_from(Vec2::ZERO, rad, seam.get()), holes: vec![] }};let cyl = |rad: f64, lo: f64, hi: f64| -> Result<Body> {kernel::extrude(&plane, &[disc(rad)], lo, hi)?.pop().ok_or_else(|| DocError::Invalid("hole tool".into()))@@ -1794,7 +1794,7 @@ fn hole_tools(let side = up.any_perp();let rp = Plane::new(*position, side, up).ok_or_else(|| DocError::Invalid("hole axis".into()))?;let pts = [Vec2::new(0.0, top), Vec2::new(r, top), Vec2::new(r, bottom), Vec2::new(0.0, bottom - tip)];- let region = Region2 { outer: solvecraft_geom::Loop2::polygon(&pts), holes: vec![] };+ let region = Region2 { outer: solidcraft_geom::Loop2::polygon(&pts), holes: vec![] };tools.extend(kernel::revolve(&rp, &[region], Vec2::ZERO, Vec2::Y, std::f64::consts::TAU)?);} else {tools.push(cyl(r, bottom, top)?);@@ -1987,7 +1987,7 @@ fn feature_tools_with_constructor(match &f.kind {FeatureKind::Extrude { sketch, profiles, extent, operation, targets } => {let ss = st.sketch(*sketch).ok_or_else(|| DocError::Unknown(format!("sketch {sketch} (it must come earlier in the timeline)")))?.clone();- let regions = solvecraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);// From / To Object: where the face or point lies along the normal, measured over the// middle of the profiles.let n = ss.plane.normal();@@ -2130,7 +2130,7 @@ fn feature_tools_with_constructor(}FeatureKind::Revolve { sketch, profiles, axis, angle, angle2, symmetric, convention, to, .. } => {let ss = st.sketch(*sketch).ok_or_else(|| DocError::Unknown(format!("sketch {sketch} (it must come earlier in the timeline)")))?.clone();- let regions = solvecraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);let (o, d) = revolve_axis(&ss, axis)?;let angles = if to.is_some() {(0.0, None)@@ -2257,7 +2257,7 @@ fn feature_tools_with_constructor(let [a, b] = §ions[..] else { return Err(DocError::Invalid("not supported yet: a point section in a loft of more than two".into())) };let (prof, pt) = if a.point.is_some() { (b, a) } else { (a, b) };let ss = st.sketch(prof.sketch).ok_or_else(|| DocError::Unknown(format!("sketch {}", prof.sketch)))?;- let regions = solvecraft_sketch::merge_regions(&select_profiles(ss, &prof.profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(ss, &prof.profiles)?);let [r] = ®ions[..] else { return Err(DocError::Invalid("each loft section must be one profile".into())) };let ps = st.sketch(pt.sketch).ok_or_else(|| DocError::Unknown(format!("sketch {}", pt.sketch)))?;let id = pt.point.as_deref().unwrap_or_default();@@ -2292,10 +2292,10 @@ fn feature_tools_with_constructor(let plane = Plane { origin: *base, x, y: k };let c = Vec2::new(r, 0.0);let outer = match section {- crate::CoilSection::Circular => solvecraft_geom::Loop2::circle(c, s / 2.0),+ crate::CoilSection::Circular => solidcraft_geom::Loop2::circle(c, s / 2.0),crate::CoilSection::Square => {let h = s / 2.0;- solvecraft_geom::Loop2::polygon(&[c + Vec2::new(-h, -h), c + Vec2::new(h, -h), c + Vec2::new(h, h), c + Vec2::new(-h, h)])+ solidcraft_geom::Loop2::polygon(&[c + Vec2::new(-h, -h), c + Vec2::new(h, -h), c + Vec2::new(h, h), c + Vec2::new(-h, h)])}};let region = Region2 { outer, holes: Vec::new() };@@ -2310,7 +2310,7 @@ fn feature_tools_with_constructor(let ss = st.sketch(sec.sketch).ok_or_else(|| DocError::Unknown(format!("sketch {} (it must come earlier in the timeline)", sec.sketch)))?;- let regions = solvecraft_sketch::merge_regions(&select_profiles(ss, &sec.profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(ss, &sec.profiles)?);let [r] = ®ions[..] else { return Err(DocError::Invalid("each loft section must be one profile".into())) };secs.push((ss.plane, r.outer.clone()));}@@ -2332,7 +2332,7 @@ fn feature_tools_with_constructor(};let mapped = path_in_frame(doc, ps, f.component)?;let ps = mapped.as_ref();- let regions = solvecraft_sketch::merge_regions(&select_profiles(ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(ss, profiles)?);let start = regions.first().map(|r| ss.plane.to_world(r.centroid())).unwrap_or_default();let tool = |r: &Region2, body: Body| crate::lineage::ProfileRoles::swept(Some(ss), Some(r)).tool(body, None);// A path through 3D sketch curves follows them as points.@@ -2407,14 +2407,14 @@ fn pipe_region(vals: &BTreeMap<String, Value>, r: f64, wall: &Option<String>) ->if !(wt > 0.0 && wt < r) {return Err(DocError::Invalid("the wall must be thinner than the radius".into()));}- vec![solvecraft_geom::Loop2::circle(Vec2::ZERO, r - wt).reversed()]+ vec![solidcraft_geom::Loop2::circle(Vec2::ZERO, r - wt).reversed()]}None => Vec::new(),};- Ok(Region2 { outer: solvecraft_geom::Loop2::circle(Vec2::ZERO, r), holes })+ Ok(Region2 { outer: solidcraft_geom::Loop2::circle(Vec2::ZERO, r), holes })}-fn map_wire(wire: &mut solvecraft_sketch::Wire, matrix: &Mat) {+fn map_wire(wire: &mut solidcraft_sketch::Wire, matrix: &Mat) {for point in wire.pts.iter_mut().chain(&mut wire.fit) {*point = crate::apply_point(matrix, *point);}@@ -2453,7 +2453,7 @@ fn path_in_frame<'a>(doc: &Document, sketch: &'a SolvedSketch, consumer: u64) ->).ok_or_else(|| DocError::Invalid("path sketch frame is invalid".into()))?;for wire in &mut mapped.sketch.wires {- let matrix = if wire.space == solvecraft_sketch::WireSpace::Component { &relative } else { &inverse };+ let matrix = if wire.space == solidcraft_sketch::WireSpace::Component { &relative } else { &inverse };map_wire(wire, matrix);}Ok(Cow::Owned(mapped))@@ -2530,7 +2530,7 @@ fn path_segments(ps: &SolvedSketch, ids: &[String], start: Vec3) -> Result<Vec<kif let Some(pts) = path_points(ps, ids, start)? {return Ok(pts.windows(2).map(|w| kernel::PathSeg::Line { a: w[0], b: w[1] }).collect());}- let mut segs: Vec<solvecraft_geom::Seg2> = Vec::new();+ let mut segs: Vec<solidcraft_geom::Seg2> = Vec::new();for id in ids {let ci = ps.sketch.curve_index(id).ok_or_else(|| DocError::Unknown(format!("path curve `{id}`")))?;segs.extend(ps.sketch.segs(ci));@@ -2564,12 +2564,12 @@ fn path_segments(ps: &SolvedSketch, ids: &[String], start: Vec3) -> Result<Vec<kOk(segs.iter().flat_map(|s| match *s {- solvecraft_geom::Seg2::Line { a, b } => vec![kernel::PathSeg::Line { a: w(a), b: w(b) }],- solvecraft_geom::Seg2::Arc { center, sweep, .. } => {+ solidcraft_geom::Seg2::Line { a, b } => vec![kernel::PathSeg::Line { a: w(a), b: w(b) }],+ solidcraft_geom::Seg2::Arc { center, sweep, .. } => {vec![kernel::PathSeg::Arc { a: w(s.start()), center: w(center), axis: n * sweep.signum(), angle: sweep.abs() }]}// Free-form path curves are followed as polylines.- solvecraft_geom::Seg2::Cubic { .. } | solvecraft_geom::Seg2::Conic { .. } | solvecraft_geom::Seg2::Bezier { .. } => {+ solidcraft_geom::Seg2::Cubic { .. } | solidcraft_geom::Seg2::Conic { .. } | solidcraft_geom::Seg2::Bezier { .. } => {s.polyline(1e-2).windows(2).map(|q| kernel::PathSeg::Line { a: w(q[0]), b: w(q[1]) }).collect()}})@@ -3388,7 +3388,7 @@ fn eval_feature(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st:(None, Some(sid)) => {let ss = st.sketch(*sid).ok_or_else(|| DocError::Unknown(format!("sketch {sid}")))?;// Each curve's exact segments (lines and arcs split by their own plane and cylinder).- let curves: Vec<Vec<solvecraft_geom::Seg2>> = (0..ss.sketch.curves.len())+ let curves: Vec<Vec<solidcraft_geom::Seg2>> = (0..ss.sketch.curves.len()).filter(|ci| ss.sketch.curves.get(*ci).is_some_and(|c| !c.construction)).map(|ci| ss.sketch.segs(ci)).filter(|segs| !segs.is_empty())@@ -3681,7 +3681,7 @@ fn eval_feature(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st:}FeatureKind::BoundingSolid { bodies, margin } => {let m = val(vals, margin, Kind::Length)?;- let mut bb = solvecraft_geom::Aabb3::EMPTY;+ let mut bb = solidcraft_geom::Aabb3::EMPTY;for b in st.bodies.iter().filter(|b| bodies.is_empty() || bodies.contains(&b.name)) {bb = bb.union(&b.mesh().bounds());}@@ -3812,7 +3812,7 @@ pub fn state_in_frame_at<'a>(doc: &Document, st: &'a ModelState, comp: u64, fram.collect();let sketch_m: Vec<Mat> = st.sketches.iter().map(|s| rel(comp_of_feature(s.feature), None)).collect();let world_wires_need_mapping = !crate::is_identity(&inv)- && st.sketches.iter().any(|sketch| sketch.sketch.wires.iter().any(|wire| wire.space == solvecraft_sketch::WireSpace::World));+ && st.sketches.iter().any(|sketch| sketch.sketch.wires.iter().any(|wire| wire.space == solidcraft_sketch::WireSpace::World));if body_m.iter().chain(&sketch_m).all(crate::is_identity) && !world_wires_need_mapping {return Cow::Borrowed(st);}@@ -3835,7 +3835,7 @@ pub fn state_in_frame_at<'a>(doc: &Document, st: &'a ModelState, comp: u64, fram}for (s, m) in out.sketches.iter_mut().zip(&sketch_m) {// Only a sketch the frame moves is copied.- let maps_wire = |w: &solvecraft_sketch::Wire| !crate::is_identity(if w.space == solvecraft_sketch::WireSpace::Component { m } else { &inv });+ let maps_wire = |w: &solidcraft_sketch::Wire| !crate::is_identity(if w.space == solidcraft_sketch::WireSpace::Component { m } else { &inv });if crate::is_identity(m) && !s.sketch.wires.iter().any(maps_wire) {continue;}@@ -3846,7 +3846,7 @@ pub fn state_in_frame_at<'a>(doc: &Document, st: &'a ModelState, comp: u64, frams.plane = np;}for wire in &mut s.sketch.wires {- let matrix = if wire.space == solvecraft_sketch::WireSpace::Component { m } else { &inv };+ let matrix = if wire.space == solidcraft_sketch::WireSpace::Component { m } else { &inv };map_wire(wire, matrix);}}@@ -3919,7 +3919,7 @@ pub fn world_state(doc: &Document, st: &ModelState) -> ModelState {}}for wire in &mut s2.sketch.wires {- if wire.space == solvecraft_sketch::WireSpace::Component {+ if wire.space == solidcraft_sketch::WireSpace::Component {map_wire(wire, &m);}}diff --git a/crates/doc/src/eval_more.rs b/crates/doc/src/eval_more.rsindex cb51deab10..d0ab8e89a4 100644--- a/crates/doc/src/eval_more.rs+++ b/crates/doc/src/eval_more.rs@@ -5,7 +5,7 @@ use super::*;use crate::EmbossFace;use crate::apply_point;use crate::sheet;-use solvecraft_geom::{Loop2, Seg2};+use solidcraft_geom::{Loop2, Seg2};pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st: &mut ModelState) -> Result<()> {match &f.kind {@@ -357,7 +357,7 @@ pub(super) fn sheet_eval(match &f.kind {FeatureKind::SheetBase { sketch, profiles, rule, flip } => {let ss = st.sketch(*sketch).ok_or_else(|| DocError::Unknown(format!("sketch {sketch}")))?.clone();- let regions = solvecraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);let r = doc.sheet_rule(rule.as_deref());let rv = doc.rule_values(vals, &r)?;for (k, region) in regions.into_iter().enumerate() {@@ -631,7 +631,7 @@ pub(super) fn sheet_cut(return Ok(Vec::new());}let Some(ss) = st.sketch(*sketch).cloned() else { return Ok(Vec::new()) };- let regions = solvecraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);let n = ss.plane.normal();let mut work = sheet::FlatWork::new();let faces = tools.iter().fold(0usize, |count, body| count.saturating_add(body.face_count()));@@ -836,7 +836,7 @@ pub(super) fn sheet_cut(/// Outline loops (in `plane` coordinates) of the mesh triangles lying in the plane at distance/// `level` from `at` along `n`: the edges used by one of them only, chained.-fn face_loops(mesh: &solvecraft_geom::Mesh, plane: &Plane, at: Vec3, n: Vec3, level: f64, tol: f64) -> Vec<Vec<Vec2>> {+fn face_loops(mesh: &solidcraft_geom::Mesh, plane: &Plane, at: Vec3, n: Vec3, level: f64, tol: f64) -> Vec<Vec<Vec2>> {let on: Vec<[u32; 3]> = mesh.triangles.iter()diff --git a/crates/doc/src/eval_surface.rs b/crates/doc/src/eval_surface.rsindex 1010c9e6d3..55d5a57a37 100644--- a/crates/doc/src/eval_surface.rs+++ b/crates/doc/src/eval_surface.rs@@ -8,7 +8,7 @@ pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature,let mut made = Vec::new();if let Some(sk) = sketch {let ss = st.sketch(*sk).ok_or_else(|| DocError::Unknown(format!("sketch {sk} (it must come earlier in the timeline)")))?;- let regions = solvecraft_sketch::merge_regions(&select_profiles(ss, profiles)?);+ let regions = solidcraft_sketch::merge_regions(&select_profiles(ss, profiles)?);for r in ®ions {made.push(kernel::patch_region(&ss.plane, r)?);}diff --git a/crates/doc/src/face_anchor.rs b/crates/doc/src/face_anchor.rsindex 6dde99d2f9..39961fd66d 100644--- a/crates/doc/src/face_anchor.rs+++ b/crates/doc/src/face_anchor.rs@@ -3,7 +3,7 @@ use crate::config::ConfigFaceTarget;use crate::{DocError, Document, EmbossFace, FeatureKind, Model, ModelBody, ModelState, PlaneRef, Result};use serde::{Deserialize, Serialize};use serde_json::Value;-use solvecraft_geom::Plane;+use solidcraft_geom::Plane;#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]#[serde(deny_unknown_fields)]@@ -311,7 +311,7 @@ pub fn validate_face_anchors_json(value: &Value) -> Result<()> {#[cfg(test)]mod tests {use super::*;- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;fn fixture() -> (Document, ModelBody, usize, Plane) {let mut doc = Document::default();let kind: FeatureKind =@@ -319,7 +319,7 @@ mod tests {let id = doc.add_feature(kind, Some("Base")).unwrap();let body = ModelBody::new("Base".into(),- solvecraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 10.)).unwrap().with_box_certificate(id).unwrap(),+ solidcraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 10.)).unwrap().with_box_certificate(id).unwrap(),id,);let index = body@@ -327,7 +327,7 @@ mod tests {.face_sources().unwrap().iter()- .position(|source| matches!(source, Some(solvecraft_kernel::FaceSource::Box { axis: 2, high: true, .. })))+ .position(|source| matches!(source, Some(solidcraft_kernel::FaceSource::Box { axis: 2, high: true, .. }))).unwrap();let canonical = body.body.face_plane(index).unwrap();let picked = Plane::new(canonical.origin + canonical.x * 2. + canonical.y * 3., canonical.y, -canonical.x).unwrap();@@ -350,7 +350,7 @@ mod tests {assert!((initial.x - picked.x).len() < 1e-9);state.bodies[0] = ModelBody::new("Base".into(),- solvecraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 20.))+ solidcraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 20.)).unwrap().with_box_certificate(anchor.target.origin_feature).unwrap(),@@ -361,7 +361,7 @@ mod tests {assert!((changed.origin.x - initial.origin.x).abs() < 1e-9);state.bodies[0] = ModelBody::new("Control".into(),- solvecraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 30.))+ solidcraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 30.)).unwrap().with_box_certificate(anchor.target.origin_feature).unwrap(),@@ -369,7 +369,7 @@ mod tests {);assert!(doc.resolve_face_anchor(&anchor, 0, &state).is_err());state.bodies[0].name = "Base".into();- state.bodies[0].body = solvecraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 30.))+ state.bodies[0].body = solidcraft_kernel::box_solid(Vec3::default(), Vec3::new(10., 10., 30.)).unwrap().with_box_certificate(anchor.target.origin_feature + 1).unwrap();@@ -400,8 +400,8 @@ mod tests {}#[test]fn extrude_cap_profile_reordering_never_retargets_an_ordinal_body() {- use solvecraft_geom::Vec2;- let mut sketch = solvecraft_sketch::Sketch::new();+ use solidcraft_geom::Vec2;+ let mut sketch = solidcraft_sketch::Sketch::new();for offset in [0., 30.] {let points: Vec<_> = [(0., 0.), (10., 0.), (10., 10.), (0., 10.)].iter()@@ -432,7 +432,7 @@ mod tests {assert_eq!(state.bodies.len(), 2);let solved = state.sketch(source).unwrap();let regions = crate::select_profiles(solved, &crate::ProfileSel::All).unwrap();- let raw = solvecraft_kernel::extrude(&solved.plane, ®ions, 0., 10.).unwrap();+ let raw = solidcraft_kernel::extrude(&solved.plane, ®ions, 0., 10.).unwrap();assert!(crate::config::extrude_cap_bindings(solved, &raw, 0).is_none(),"exhausted certification work must leave the complete producer uncertified"@@ -449,7 +449,7 @@ mod tests {.face_sources().unwrap().iter()- .position(|source| matches!(source, Some(solvecraft_kernel::FaceSource::CertifiedExtrudeCap { high: true, .. })))+ .position(|source| matches!(source, Some(solidcraft_kernel::FaceSource::CertifiedExtrudeCap { high: true, .. }))).unwrap();let picked = body.body.face_plane(index).unwrap();let anchor = doc.capture_face_anchor(body, index, &picked, &[], 0, &[]).unwrap();@@ -476,7 +476,7 @@ mod tests {base: Box::new(PlaneRef::Face { plane: picked, at: picked.origin, name: None, anchor: None }),distance: "2".into(),},- sketch: solvecraft_sketch::Sketch::new(),+ sketch: solidcraft_sketch::Sketch::new(),},None,)@@ -492,7 +492,7 @@ mod tests {}#[test]fn warm_root_body_offset_edit_matches_cold_attached_sketch_and_downstream_bounds() {- use solvecraft_geom::Vec2;+ use solidcraft_geom::Vec2;let (mut doc, _, _, _) = fixture();let mut warm = Model::new();warm.evaluate(&doc);@@ -503,12 +503,12 @@ mod tests {.face_sources().unwrap().iter()- .position(|source| matches!(source, Some(solvecraft_kernel::FaceSource::Box { axis: 2, high: true, .. })))+ .position(|source| matches!(source, Some(solidcraft_kernel::FaceSource::Box { axis: 2, high: true, .. }))).unwrap();let picked = body.body.face_plane(index).unwrap();let anchor = doc.capture_face_anchor(body, index, &picked, &[], 0, &[]).unwrap();let source_name = body.name.clone();- let mut sketch = solvecraft_sketch::Sketch::new();+ let mut sketch = solidcraft_sketch::Sketch::new();let points: Vec<_> =[(2., 2.), (4., 2.), (4., 4.), (2., 4.)].iter().map(|(x, y)| sketch.add_point(Vec2::new(*x, *y), None).unwrap()).collect();for edge in 0..4 {diff --git a/crates/doc/src/format.rs b/crates/doc/src/format.rsindex 24118b0fa0..0816837fd1 100644--- a/crates/doc/src/format.rs+++ b/crates/doc/src/format.rs@@ -1,6 +1,6 @@//! The design file format version and the migrations that bring older files up to date.//!-//! A design file starts with `"format": "solvecraft/N"`. A file of an older format is read and+//! A design file starts with `"format": "solidcraft/N"`. A file of an older format is read and//! upgraded step by step (N → N+1 → … → current): JSON-level steps first, for changes in the//! file's shape, then document-level steps. A file of a newer format than this build knows is//! refused with a message saying so, never guessed at.@@ -55,12 +55,16 @@ use crate::{DocError, Document, Result};pub const FORMAT: u32 = 14;pub fn format_string(n: u32) -> String {- format!("solvecraft/{n}")+ format!("solidcraft/{n}")}-/// The version in a format string (`solvecraft/N`).+/// The format tag of designs saved before the rename. Compatibility shim (docs/compatibility.md):+/// read, never written.+pub const LEGACY_FORMAT_PREFIX: &str = "solvecraft/";++/// The version in a format string (`solidcraft/N`, or the legacy `solvecraft/N`).pub fn version_of(s: &str) -> Option<u32> {- s.strip_prefix("solvecraft/")?.parse().ok()+ s.strip_prefix("solidcraft/").or_else(|| s.strip_prefix(LEGACY_FORMAT_PREFIX))?.parse().ok()}/// JSON-level upgrades: entry `i` turns format `i + 1` into `i + 2`.@@ -300,7 +304,7 @@ pub fn read(s: &str) -> Result<Document> {if let Some(crate::Feature { kind: crate::FeatureKind::Sketch { sketch, .. }, .. }) = d.features.get_mut(feature_index) {let mut spaces = std::collections::BTreeMap::new();for link in &sketch.links {- spaces.entry(link.id.as_str()).or_insert_with(|| solvecraft_sketch::WireSpace::from_legacy_link(link));+ spaces.entry(link.id.as_str()).or_insert_with(|| solidcraft_sketch::WireSpace::from_legacy_link(link));}for wire_index in wire_indices {if let Some(wire) = sketch.wires.get_mut(wire_index) {@@ -358,9 +362,9 @@ fn validate_sketch_sizes(value: &Value) -> Result<()> {}let Some(sketch) = feature.get("sketch") else { continue };let len = |key: &str| sketch.get(key).and_then(Value::as_array).map_or(0, Vec::len);- if len("points") > solvecraft_sketch::MAX_POINTS- || len("curves") > solvecraft_sketch::MAX_CURVES- || len("constraints") > solvecraft_sketch::MAX_CONSTRAINTS+ if len("points") > solidcraft_sketch::MAX_POINTS+ || len("curves") > solidcraft_sketch::MAX_CURVES+ || len("constraints") > solidcraft_sketch::MAX_CONSTRAINTS{return Err(invalid());}@@ -553,7 +557,7 @@ fn validate_versioned_geometry(value: &Value) -> Result<()> {}let indices = curve.get("pts").and_then(Value::as_array).ok_or_else(invalid)?;work = work.saturating_add(indices.len());- if !(4..=solvecraft_sketch::MAX_SPLINE_POINTS).contains(&indices.len())+ if !(4..=solidcraft_sketch::MAX_SPLINE_POINTS).contains(&indices.len())|| work > 1_000_000|| curve.get("control").is_some_and(|control| control.as_bool() != Some(false))|| curve.get("degree").is_some_and(|degree| degree.as_u64() != Some(3))@@ -630,7 +634,7 @@ fn validate_freeform_offsets(value: &Value) -> Result<()> {if !(1..=256).contains(&divisions)|| !divisions.is_power_of_two()|| !(1..=256).contains(&pieces)- || pieces * divisions >= solvecraft_sketch::MAX_SPLINE_POINTS as u64+ || pieces * divisions >= solidcraft_sketch::MAX_SPLINE_POINTS as u64|| !distance.is_finite()|| !(1e-9..=MAX_REAL).contains(&distance.abs())|| !tolerance.is_finite()@@ -727,7 +731,7 @@ mod tests {#[test]fn version_thirteen_names_keep_their_meaning_under_the_legacy_mark() {let file = serde_json::json!({- "format": "solvecraft/13",+ "format": "solidcraft/13","features": [{"type": "fillet", "edge_names": ["F2:side:l2|F2:top#2~1", ""], "face_names": ["F2:top#1", ""]},{"type": "sheet_flange", "edge_names": ["base:l1:top"]},@@ -774,7 +778,7 @@ mod tests {#[test]fn version_thirteen_marking_targets_name_fields_not_key_names() {let file = serde_json::json!({- "format": "solvecraft/13",+ "format": "solidcraft/13","features": [{"type": "extrude", "options": {"face": "flat", "face_name": "label", "face_names": ["a"]}},{"type": "fillet", "settings": {"edge_names": ["kept"]}},@@ -794,8 +798,8 @@ mod tests {#[test]fn version_nine_wire_spaces_preserve_saved_points_and_explicit_markers() {- use solvecraft_geom::Vec3;- use solvecraft_sketch::{LinkKind, LinkSource, Sketch, WireSpace};+ use solidcraft_geom::Vec3;+ use solidcraft_sketch::{LinkKind, LinkSource, Sketch, WireSpace};let mut sketch = Sketch::new();sketch.add_drawn_wire(&[Vec3::new(12.0, 3.0, 4.0)]).unwrap();let link = sketch@@ -810,7 +814,7 @@ mod tests {let mut doc = Document::new("legacy wire spaces");doc.add_feature(crate::FeatureKind::Sketch { plane: crate::PlaneRef::Origin { name: "XY".into() }, sketch }, None).unwrap();let mut json: Value = serde_json::from_str(&doc.to_json()).unwrap();- json["format"] = Value::from("solvecraft/9");+ json["format"] = Value::from("solidcraft/9");for wire in json["features"][0]["sketch"]["wires"].as_array_mut().unwrap() {wire.as_object_mut().unwrap().remove("space");}@@ -891,7 +895,7 @@ mod tests {let mut document = Document::new("legacy named extent");document.set_param("offset", "2", Some("mm"), None).unwrap();let sketch = document- .add_feature(FeatureKind::Sketch { plane: PlaneRef::Origin { name: "XY".into() }, sketch: solvecraft_sketch::Sketch::new() }, None)+ .add_feature(FeatureKind::Sketch { plane: PlaneRef::Origin { name: "XY".into() }, sketch: solidcraft_sketch::Sketch::new() }, None).unwrap();document.add_feature(@@ -905,9 +909,9 @@ mod tests {start_offset: None,through_all: false,taper: Some("0 deg".into()),- to: Some(solvecraft_geom::Vec3::new(0.0, 0.0, 10.0)),+ to: Some(solidcraft_geom::Vec3::new(0.0, 0.0, 10.0)),to_offset: Some("offset + 1 mm".into()),- from: Some(solvecraft_geom::Vec3::new(0.0, 0.0, 5.0)),+ from: Some(solidcraft_geom::Vec3::new(0.0, 0.0, 5.0)),},operation: Operation::NewBody,targets: vec![],@@ -928,7 +932,7 @@ mod tests {).unwrap();let mut legacy: Value = serde_json::from_str(&document.to_json()).unwrap();- legacy["format"] = Value::from("solvecraft/8");+ legacy["format"] = Value::from("solidcraft/8");// Version 8 exposed distance and taper, but had no model slot for To Offset.legacy["features"][1]["param_names"] = serde_json::json!(["d1", "d2"]);legacy["features"][2]["param_names"] = serde_json::json!(["d3", "d4", "d5"]);@@ -952,8 +956,8 @@ mod tests {#[test]fn saved_offset_cannot_alias_and_overwrite_its_source_geometry() {- use solvecraft_geom::Vec2;- use solvecraft_sketch::{CurveKind, Sketch};+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::{CurveKind, Sketch};let mut sketch = Sketch::new();let center = sketch.add_point(Vec2::ZERO, None).unwrap();let major = sketch.add_point(Vec2::new(10.0, 0.0), None).unwrap();@@ -976,7 +980,7 @@ mod tests {let mut document = Document::new("missing offset geometry");document.add_feature(- crate::FeatureKind::Sketch { plane: crate::PlaneRef::Origin { name: "XY".into() }, sketch: solvecraft_sketch::Sketch::new() },+ crate::FeatureKind::Sketch { plane: crate::PlaneRef::Origin { name: "XY".into() }, sketch: solidcraft_sketch::Sketch::new() },None,).unwrap();@@ -1052,7 +1056,7 @@ mod tests {("degree", serde_json::json!(2)),("pts", serde_json::json!([0, 1, 2])),("pts", serde_json::json!([0, 1, 2, u64::MAX])),- ("pts", serde_json::json!(vec![0; solvecraft_sketch::MAX_SPLINE_POINTS + 1])),+ ("pts", serde_json::json!(vec![0; solidcraft_sketch::MAX_SPLINE_POINTS + 1])),] {let mut damaged = curve.clone();damaged[key] = malformed;@@ -1091,8 +1095,8 @@ mod tests {#[test]fn periodic_file_validation_refuses_damaged_closed_geometry() {- use solvecraft_geom::Vec2;- use solvecraft_sketch::{CurveKind, Sketch};+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::{CurveKind, Sketch};let mut sketch = Sketch::new();let mut pts = Vec::new();for point in [Vec2::ZERO, Vec2::new(10.0, 0.0), Vec2::new(0.0, 10.0), Vec2::ZERO] {@@ -1199,7 +1203,7 @@ mod tests {];d.configs.active = Some("Default".into());let mut legacy: Value = serde_json::from_str(&d.to_json()).unwrap();- legacy["format"] = Value::from("solvecraft/6");+ legacy["format"] = Value::from("solidcraft/6");let original_table = legacy["configs"].clone();let upgraded = read(&legacy.to_string()).unwrap();d.features.iter_mut().for_each(|f| f.shell_piece_order = true);@@ -1224,7 +1228,7 @@ mod tests {}];d.apply_configuration("Blue steel").unwrap();let mut value: Value = serde_json::from_str(&d.to_json()).unwrap();- value["format"] = Value::from("solvecraft/7");+ value["format"] = Value::from("solidcraft/7");let original_table = value["configs"].clone();let roundtrip = read(&value.to_string()).unwrap();assert_eq!(roundtrip, d);@@ -1241,8 +1245,8 @@ mod tests {#[test]fn version_seven_origin_sketch_keeps_geometry_dimension_ids_and_expressions() {- use solvecraft_geom::Vec2;- use solvecraft_sketch::{ConstraintKind, Sketch};+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::{ConstraintKind, Sketch};let mut d = Document::new("legacy origin dimensions");d.set_param("reach", "25 mm", Some("mm"), None).unwrap();let dim = d.new_model_param("reach", "mm");@@ -1253,7 +1257,7 @@ mod tests {sketch.add_constraint(ConstraintKind::Length { l: line, value: 25.0 }, Some(dim)).unwrap();d.add_feature(crate::FeatureKind::Sketch { plane: crate::PlaneRef::Origin { name: "XY".into() }, sketch }, Some("Dimensioned")).unwrap();let mut legacy: Value = serde_json::from_str(&d.to_json()).unwrap();- legacy["format"] = Value::from("solvecraft/7");+ legacy["format"] = Value::from("solidcraft/7");let mut features = legacy["features"].clone();pieces_in_shell_order(&mut features);let params = legacy["params"].clone();@@ -1268,8 +1272,8 @@ mod tests {#[test]fn version_eight_persistent_angle_sweep_and_slot_dimensions_roundtrip() {- use solvecraft_geom::Vec2;- use solvecraft_sketch::{ConstraintKind, Sketch};+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::{ConstraintKind, Sketch};let mut d = Document::new("persistent typed dimensions");let heading = d.new_model_param("45 deg", "deg");let sweep = d.new_model_param("180 deg", "deg");@@ -1358,8 +1362,11 @@ mod tests {#[test]fn versions() {- assert_eq!(version_of("solvecraft/1"), Some(1));- assert_eq!(version_of("solvecraft/x"), None);+ assert_eq!(version_of("solidcraft/1"), Some(1));+ assert_eq!(version_of("solidcraft/x"), None);+ // Compatibility shim: files saved before the rename carry the legacy tag.+ assert_eq!(version_of("solvecraft/13"), Some(13));+ assert_eq!(version_of("solvecraftx/13"), None);let d = Document::new("A");assert_eq!(d.format, format_string(FORMAT));let back = read(&d.to_json()).unwrap();@@ -1378,44 +1385,44 @@ mod tests {).unwrap();let mut json: Value = serde_json::from_str(&doc.to_json()).unwrap();- json["format"] = Value::from("solvecraft/5");+ json["format"] = Value::from("solidcraft/5");let migrated = read(&json.to_string()).unwrap();let crate::FeatureKind::ConstructionPlane { plane } = &migrated.feature(id).unwrap().kind else { panic!("plane") };let (values, errors) = migrated.param_values();assert!(errors.is_empty());let p = migrated.resolve_plane(&values, plane, 0).unwrap();- assert_eq!(p.y, solvecraft_geom::Vec3::Z);- assert_eq!(p.normal(), -solvecraft_geom::Vec3::Y);- assert_eq!(p.origin, solvecraft_geom::Vec3::new(0.0, -7.0, 0.0));+ assert_eq!(p.y, solidcraft_geom::Vec3::Z);+ assert_eq!(p.normal(), -solidcraft_geom::Vec3::Y);+ assert_eq!(p.origin, solidcraft_geom::Vec3::new(0.0, -7.0, 0.0));assert_eq!(read(&migrated.to_json()).unwrap(), migrated);let fresh = doc.resolve_plane(&values, &crate::PlaneRef::Origin { name: "XZ".into() }, 0).unwrap();- assert_eq!(fresh.normal(), solvecraft_geom::Vec3::Y);+ assert_eq!(fresh.normal(), solidcraft_geom::Vec3::Y);}#[test]fn older_upgraded_newer_refused_others_rejected() {let mut v: Value = serde_json::from_str(&Document::new("A").to_json()).unwrap();- v["format"] = Value::from("solvecraft/1");+ v["format"] = Value::from("solidcraft/1");assert_eq!(read(&v.to_string()).unwrap().format, format_string(FORMAT));v.as_object_mut().unwrap().remove("format");assert!(read(&v.to_string()).is_ok(), "a file without a format is format 1");v["format"] = Value::from(format_string(FORMAT + 1));let e = read(&v.to_string()).unwrap_err().to_string();assert!(e.contains("newer SolidCraft"), "{e}");- for bad in ["solvecraft/0", "acad/3", "solvecraft/-1", "solvecraft/99999999999999999999"] {+ for bad in ["solidcraft/0", "acad/3", "solidcraft/-1", "solidcraft/99999999999999999999"] {v["format"] = Value::from(bad);assert!(read(&v.to_string()).is_err(), "{bad}");}assert!(read("[]").is_err());// Format 2 body colours become body appearances.let mut old: Value = serde_json::from_str(&Document::new("A").to_json()).unwrap();- old["format"] = Value::from("solvecraft/2");+ old["format"] = Value::from("solidcraft/2");old["appearances"] = serde_json::json!({"Body1": [200, 10, 20]});let d = read(&old.to_string()).unwrap();let l = d.appearances.bodies.get("Body1").unwrap();// Format 3 joints (aligned unless flipped) keep their placement.let mut j: Value = serde_json::from_str(&Document::new("A").to_json()).unwrap();- j["format"] = Value::from("solvecraft/3");+ j["format"] = Value::from("solidcraft/3");j["assembly"] = serde_json::json!({"joints": [{"id": 1, "name": "J", "kind": "rigid", "a": {"occurrence": 0, "snap": {"type": "point", "point": [0, 0, 0]}}, "b": {"occurrence": 0, "snap": {"type": "point", "point": [0, 0, 0]}}}]});let dj = read(&j.to_string()).unwrap();assert!(dj.assembly.joints[0].flip, "aligned before = not mated now");@@ -1431,14 +1438,14 @@ mod tests {/// file too, before the arrays are deserialised.#[test]fn oversized_sketches_are_refused_before_typed_decoding() {- use solvecraft_sketch::{MAX_CONSTRAINTS, MAX_CURVES, MAX_POINTS, Sketch};+ use solidcraft_sketch::{MAX_CONSTRAINTS, MAX_CURVES, MAX_POINTS, Sketch};// A sketch right at the point cap, chained by coincident constraints.let mut sketch = Sketch::new();let mut previous = 0;while sketch.points.len() < MAX_POINTS {- let i = sketch.add_point(solvecraft_geom::Vec2::new(0.001 * sketch.points.len() as f64, 0.0), None).unwrap();- sketch.add_constraint(solvecraft_sketch::ConstraintKind::Coincident { p: previous, q: i }, None).unwrap();+ let i = sketch.add_point(solidcraft_geom::Vec2::new(0.001 * sketch.points.len() as f64, 0.0), None).unwrap();+ sketch.add_constraint(solidcraft_sketch::ConstraintKind::Coincident { p: previous, q: i }, None).unwrap();previous = i;}let mut doc = Document::new("big sketch");diff --git a/crates/doc/src/format_offsets.rs b/crates/doc/src/format_offsets.rsindex 82591c3ba9..c6087d1973 100644--- a/crates/doc/src/format_offsets.rs+++ b/crates/doc/src/format_offsets.rs@@ -380,11 +380,11 @@ mod tests {#[test]fn formats_one_through_eleven_keep_legacy_offset_geometry_and_ids() {- let mut sketch = solvecraft_sketch::Sketch::new();- let center = sketch.add_point(solvecraft_geom::Vec2::new(4., 7.), Some("center")).unwrap();- sketch.add_circle(solvecraft_geom::Vec2::new(4., 7.), 10., Some(center), Some("source")).unwrap();- sketch.add_circle(solvecraft_geom::Vec2::new(4., 7.), 9., Some(center), Some("offset")).unwrap();- sketch.offsets.push(solvecraft_sketch::OffsetChain {+ let mut sketch = solidcraft_sketch::Sketch::new();+ let center = sketch.add_point(solidcraft_geom::Vec2::new(4., 7.), Some("center")).unwrap();+ sketch.add_circle(solidcraft_geom::Vec2::new(4., 7.), 10., Some(center), Some("source")).unwrap();+ sketch.add_circle(solidcraft_geom::Vec2::new(4., 7.), 9., Some(center), Some("offset")).unwrap();+ sketch.offsets.push(solidcraft_sketch::OffsetChain {sources: vec![("source".into(), true)],outputs: vec!["offset".into()],distance: 1.,@@ -409,15 +409,15 @@ mod tests {let state = model.state();let solved = state.sketch(sketch_id).unwrap();let radius = solved.sketch.curves.iter().find(|curve| curve.id == "offset").map(|curve| &curve.kind);- assert!(matches!(radius,Some(solvecraft_sketch::CurveKind::Circle {r,..}) if *r ==9.));+ assert!(matches!(radius,Some(solidcraft_sketch::CurveKind::Circle {r,..}) if *r ==9.));}}#[test]fn missing_boundary_or_defining_sketch_reopens_as_a_model_error_without_retarget() {for missing_sketch in [false, true] {- let mut sketch = solvecraft_sketch::Sketch::new();- sketch.add_circle(solvecraft_geom::Vec2::new(0., 0.), 10., None, Some("unrelated-circle")).unwrap();+ let mut sketch = solidcraft_sketch::Sketch::new();+ sketch.add_circle(solidcraft_geom::Vec2::new(0., 0.), 10., None, Some("unrelated-circle")).unwrap();let mut document = Document::new("repairable lost boundary");let id = document.add_feature(FeatureKind::Sketch { plane: crate::PlaneRef::Origin { name: "XY".into() }, sketch }, None).unwrap();documentdiff --git a/crates/doc/src/history_names.rs b/crates/doc/src/history_names.rsindex af1757e5c8..80d400ecc8 100644--- a/crates/doc/src/history_names.rs+++ b/crates/doc/src/history_names.rs@@ -17,7 +17,7 @@use std::collections::{BTreeMap, BTreeSet};use std::sync::{Arc, OnceLock};-use solvecraft_kernel::history::{FaceOrigin, FaceProv, History};+use solidcraft_kernel::history::{FaceOrigin, FaceProv, History};use crate::ModelBody;use crate::lineage::{Lineage, Operand};diff --git a/crates/doc/src/joints.rs b/crates/doc/src/joints.rsindex ead63f331c..f0f56044d7 100644--- a/crates/doc/src/joints.rs+++ b/crates/doc/src/joints.rs@@ -13,7 +13,7 @@use std::collections::{BTreeMap, BTreeSet, VecDeque};use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::{DocError, Document, IDENTITY, Mat, ModelState, Result, apply_point, apply_vector, mat_inverse, mat_mul};@@ -273,9 +273,9 @@ pub fn resolve_origin(doc: &Document, st: &ModelState, o: &JointOrigin) -> Resullet comp = component_of(doc, o.occurrence)?;let cyl = component_bodies(doc, st, comp).into_iter()- .filter_map(|b| solvecraft_kernel::cylinder_face_at(&b.body, *pick))+ .filter_map(|b| solidcraft_kernel::cylinder_face_at(&b.body, *pick)).min_by(|a, b| {- let off = |c: &solvecraft_kernel::CylinderFace| {+ let off = |c: &solidcraft_kernel::CylinderFace| {let v = *pick - c.axis_point;((v - c.axis * v.dot(c.axis)).len() - c.radius).abs()};diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rsindex 2617b468db..b0aba13ddc 100644--- a/crates/doc/src/lib.rs+++ b/crates/doc/src/lib.rs@@ -1,4 +1,4 @@-//! The SolveCraft document: user and model parameters, and a parametric timeline of features+//! The SolidCraft document: user and model parameters, and a parametric timeline of features//! (sketches, extrudes, revolves, fillets, primitives, combines…). Evaluating the timeline with//! the kernel produces the model (bodies and solved sketches). Evaluation is incremental: a//! feature is recomputed only when it, a parameter it uses, or an earlier feature changed.@@ -47,8 +47,8 @@ pub use eval::{state_in_frame_at, through_all_distance, world_state,};pub use params::{ParamRow, ParamUser, cycles};-pub use solvecraft_kernel as kernel;-pub use solvecraft_sketch as sketch;+pub use solidcraft_kernel as kernel;+pub use solidcraft_sketch as sketch;#[derive(Debug, Clone, PartialEq, thiserror::Error)]pub enum DocError {@@ -59,9 +59,9 @@ pub enum DocError {#[error("unknown {0}")]Unknown(String),#[error(transparent)]- Sketch(#[from] solvecraft_sketch::SketchError),+ Sketch(#[from] solidcraft_sketch::SketchError),#[error(transparent)]- Kernel(#[from] solvecraft_kernel::KernelError),+ Kernel(#[from] solidcraft_kernel::KernelError),}pub type Result<T> = std::result::Result<T, DocError>;diff --git a/crates/doc/src/lineage.rs b/crates/doc/src/lineage.rsindex a883135d06..505faa2e46 100644--- a/crates/doc/src/lineage.rs+++ b/crates/doc/src/lineage.rs@@ -11,9 +11,9 @@use std::sync::{Arc, OnceLock};-use solvecraft_geom::Region2;-use solvecraft_kernel::Body;-use solvecraft_kernel::history::{Change, FaceOrigin, FaceProv, History};+use solidcraft_geom::Region2;+use solidcraft_kernel::Body;+use solidcraft_kernel::history::{Change, FaceOrigin, FaceProv, History};use crate::SolvedSketch;@@ -183,7 +183,7 @@ impl<'a> ProfileRoles<'a> {if history.operands != 0 {return None;}- let segments: Vec<&solvecraft_geom::Seg2> =+ let segments: Vec<&solidcraft_geom::Seg2> =self.region.map(|r| std::iter::once(&r.outer).chain(&r.holes).flat_map(|l| &l.segs).collect()).unwrap_or_default();let curves = self.sketch.map(crate::config::ExactSketchCurves::new);let curve = |segment: usize| -> Option<String> { curves.as_ref()?.find(segments.get(segment)?).map(|id| format!("side:{id}")) };@@ -235,7 +235,7 @@ pub(crate) fn box_tool(body: Body) -> Traced {sources.iter().map(|source| match source {- Some(solvecraft_kernel::FaceSource::Box { axis, high, .. }) => {+ Some(solidcraft_kernel::FaceSource::Box { axis, high, .. }) => {["x", "y", "z"].get(usize::from(*axis)).map(|a| vec![format!("{}{a}", if *high { "+" } else { "-" })]).unwrap_or_default()}_ => Vec::new(),diff --git a/crates/doc/src/motion.rs b/crates/doc/src/motion.rsindex e99d487f87..1b0a921710 100644--- a/crates/doc/src/motion.rs+++ b/crates/doc/src/motion.rs@@ -3,7 +3,7 @@//! shown without changing the design).use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;/// Occurrences whose bodies may touch but not pass through each other while joints move.#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]diff --git a/crates/doc/src/name_lookup.rs b/crates/doc/src/name_lookup.rsindex d9305c92d1..c9036e7b2f 100644--- a/crates/doc/src/name_lookup.rs+++ b/crates/doc/src/name_lookup.rs@@ -8,7 +8,7 @@//! was worked out from geometry, found where the reference's point no longer lies, is reported://! only geometry decided.-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::history_names::{Match, Names};use crate::naming::{self, closest, edge_names, face_names, legacy_edge_names, legacy_face_names, strip_piece};diff --git a/crates/doc/src/named_projection_tests.rs b/crates/doc/src/named_projection_tests.rsindex 201f30b867..4adae985d0 100644--- a/crates/doc/src/named_projection_tests.rs+++ b/crates/doc/src/named_projection_tests.rs@@ -1,11 +1,11 @@use crate::{Document, ModelBody, ModelState};-use solvecraft_geom::{Plane, Vec3};-use solvecraft_sketch::{LinkKind, LinkSource, Sketch};+use solidcraft_geom::{Plane, Vec3};+use solidcraft_sketch::{LinkKind, LinkSource, Sketch};use std::collections::BTreeMap;use std::sync::Arc;fn named_box(name: &str, width: f64, height: f64) -> ModelBody {- let body = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(width, width, height)).unwrap();+ let body = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(width, width, height)).unwrap();let mut names = vec!["unrelated".to_string(); body.faces(0.01).unwrap().len()];let top = body.faces(0.01).unwrap().into_iter().find(|face| face.plane_normal.is_some_and(|normal| normal.z > 0.99)).unwrap().index;names[top] = "shared:top".into();diff --git a/crates/doc/src/naming.rs b/crates/doc/src/naming.rsindex ff23126d6e..a2d0204e3c 100644--- a/crates/doc/src/naming.rs+++ b/crates/doc/src/naming.rs@@ -17,7 +17,7 @@use std::sync::{Arc, OnceLock};-use solvecraft_geom::{Mesh, Seg2, Vec2, Vec3};+use solidcraft_geom::{Mesh, Seg2, Vec2, Vec3};use crate::history_names::Names;use crate::lineage::Lineage;@@ -737,7 +737,7 @@ mod tests {#[test]fn merged_face_votes_collectively_for_pieces_of_one_source() {- let body = ModelBody::new("Input".into(), solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(4., 1., 1.)).unwrap(), 1);+ let body = ModelBody::new("Input".into(), solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(4., 1., 1.)).unwrap(), 1);let mut mesh = Mesh::default();let mut points = Vec::new();for i in 0..3u32 {diff --git a/crates/doc/src/profile_refs.rs b/crates/doc/src/profile_refs.rsindex 7359809d7f..5ca4548852 100644--- a/crates/doc/src/profile_refs.rs+++ b/crates/doc/src/profile_refs.rs@@ -5,7 +5,7 @@ use crate::{DocError, ProfileSel, Result, SolvedSketch, WholeProfileBoundary};const MAX_SELECTIONS: usize = 128;-fn whole_boundary(profile: &solvecraft_sketch::Profile) -> Option<WholeProfileBoundary> {+fn whole_boundary(profile: &solidcraft_sketch::Profile) -> Option<WholeProfileBoundary> {let (outer, holes) = profile.whole_curve_boundaries()?;Some(WholeProfileBoundary { outer, holes })}@@ -117,10 +117,10 @@ pub fn profile_selection_indices(ss: &SolvedSketch, selection: &ProfileSel) -> Rif curves.iter().collect::<BTreeSet<_>>().len() != curves.len()&& !ss.profiles.iter().any(|profile| same_ids(curves, &profile.outer_curves)){- return Err(crate::curve_pick_error(solvecraft_sketch::CurvePick::Missing, curves, &ss.name));+ return Err(crate::curve_pick_error(solidcraft_sketch::CurvePick::Missing, curves, &ss.name));}indices.push(- solvecraft_sketch::profile_by_curves(&ss.profiles, curves)+ solidcraft_sketch::profile_by_curves(&ss.profiles, curves).map_err(|error| crate::curve_pick_error(error, curves, &ss.name))?,);}@@ -230,8 +230,8 @@ pub fn capture_profile_selection(ss: &SolvedSketch, indices: &[usize]) -> Resultmod tests {#![allow(clippy::unwrap_used, clippy::panic)]use super::*;- use solvecraft_geom::{Plane, Vec2};- use solvecraft_sketch::{Sketch, find_profiles, solve};+ use solidcraft_geom::{Plane, Vec2};+ use solidcraft_sketch::{Sketch, find_profiles, solve};fn rounded_source(sketch: &mut Sketch, radius: f64) -> Vec<(String, bool)> {let endpoints = [@@ -328,13 +328,13 @@ mod tests {).unwrap();model.evaluate(&document);- let volume = solvecraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;+ let volume = solidcraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;assert!((volume - 2. * 73.2 * 63.2).abs() < 1e-6, "{volume}");let reopened = crate::Document::from_json(&document.to_json()).unwrap();assert_eq!(reopened, document);let mut cold = crate::Model::new();cold.evaluate(&reopened);- assert!((solvecraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - volume).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - volume).abs() < 1e-6);let crate::FeatureKind::Sketch { sketch, .. } = &mut document.features[0].kind else { panic!("sketch") };set_source_radius(sketch, 2.);model.evaluate(&document);@@ -345,7 +345,7 @@ mod tests {assert_eq!(active, original_roles);let rounded_area = 75.2 * 65.2 - (4. - std::f64::consts::PI) * 0.6 * 0.6;assert!((crate::select_profiles(solved, &selection).unwrap()[0].area() - rounded_area).abs() < 1e-7);- let volume = solvecraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;+ let volume = solidcraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;// Kernel volume integrates the curved display mesh; the analytic region above// checks the exact rounded geometry independently of that tessellation.assert!((volume - 2. * rounded_area).abs() < 0.002, "{volume}");@@ -359,7 +359,7 @@ mod tests {);let reopened = crate::Document::from_json(&document.to_json()).unwrap();cold.evaluate(&reopened);- assert!((solvecraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - volume).abs() < 1e-5);+ assert!((solidcraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - volume).abs() < 1e-5);}#[test]@@ -387,7 +387,7 @@ mod tests {fn periodic_offset_ring_whole_source_survives_adaptive_spans_and_reopen() {let mut sketch = Sketch::new();let major = sketch.add_point(Vec2::new(10., 0.), None).unwrap();- let ellipse = sketch.add_curve(solvecraft_sketch::CurveKind::Ellipse { c: 0, m: major, r: 5. }, None).unwrap();+ let ellipse = sketch.add_curve(solidcraft_sketch::CurveKind::Ellipse { c: 0, m: major, r: 5. }, None).unwrap();let first = sketch.add_freeform_offset(ellipse, true, -1.).unwrap();sketch.add_freeform_offset(first, true, -0.5).unwrap();let mut document = crate::Document::new("periodic offset ring multiset");@@ -453,7 +453,7 @@ mod tests {).unwrap();model.evaluate(&document);- let initial_volume = solvecraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;+ let initial_volume = solidcraft_kernel::measure(&model.state().bodies[0].body).unwrap().volume;// Kernel measurement integrates the curved mesh. Scale the established// periodic-ring tolerance (0.05 mm³ at height3) to this height2 extrusion.// Exact profile identity and cold/warm equality below remain strict.@@ -481,7 +481,7 @@ mod tests {assert!(updated_region.contains(ring_point));assert!(!updated_region.contains(source_point + normal * 0.5));assert!(!updated_region.contains(source_point + normal * 1.75));- let updated_volume = solvecraft_kernel::measure(&updated_state.bodies[0].body).unwrap().volume;+ let updated_volume = solidcraft_kernel::measure(&updated_state.bodies[0].body).unwrap().volume;assert!(updated_volume > initial_volume);assert!((updated_volume - 2. * updated_region.area()).abs() < volume_tolerance,@@ -491,7 +491,7 @@ mod tests {let reopened_document = crate::Document::from_json(&document.to_json()).unwrap();cold.evaluate(&reopened_document);assert!(cold.results.iter().all(|result| result.error.is_none()));- assert!((solvecraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - updated_volume).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&cold.state().bodies[0].body).unwrap().volume - updated_volume).abs() < 1e-6);// A new hole is a semantic boundary change, not the old ring. Whole-source// identities include holes and must not silently absorb the new material cutout.diff --git a/crates/doc/src/project.rs b/crates/doc/src/project.rsindex 8188e85887..b3a17dea2d 100644--- a/crates/doc/src/project.rs+++ b/crates/doc/src/project.rs@@ -8,8 +8,8 @@use std::collections::BTreeMap;-use solvecraft_geom::{Mesh, Plane, Vec2, Vec3};-use solvecraft_sketch::{CurveKind, LinkGeom, LinkKind, LinkSource, Sketch};+use solidcraft_geom::{Mesh, Plane, Vec2, Vec3};+use solidcraft_sketch::{CurveKind, LinkGeom, LinkKind, LinkSource, Sketch};use crate::eval::ModelState;use crate::expr::Value;@@ -259,7 +259,7 @@ fn resolve_uncached(_ => vec![LinkGeom::Point(o)],}}- LinkSource::Text { text, at, height, angle } => solvecraft_sketch::text_geometry(text, *at, *height, *angle)?,+ LinkSource::Text { text, at, height, angle } => solidcraft_sketch::text_geometry(text, *at, *height, *angle)?,LinkSource::Plane { name } => {let pr =if Plane::named(name).is_some() { PlaneRef::Origin { name: name.clone() } } else { PlaneRef::Construction { name: name.clone() } };@@ -310,7 +310,7 @@ fn projection_face_edges(body: &crate::ModelBody, mesh: &Mesh, index: u32, plane.body.face_sources().and_then(|sources| sources.get(index as usize))- .is_some_and(|source| matches!(source, Some(solvecraft_kernel::FaceSource::ShellPlanar { .. })));+ .is_some_and(|source| matches!(source, Some(solidcraft_kernel::FaceSource::ShellPlanar { .. })));if shell_plane { order::raw_face_edges(mesh, index, plane) } else { order::face_edges(mesh, index, plane) }}@@ -319,10 +319,10 @@ fn certified_planar_construction(body: &crate::ModelBody, index: usize) -> boolmatches!(source,Some(- solvecraft_kernel::FaceSource::ShellPlanar { producer: Some(_), .. }- | solvecraft_kernel::FaceSource::Box { producer: Some(_), .. }- | solvecraft_kernel::FaceSource::CertifiedExtrudeSide { plane: Some(_), .. }- | solvecraft_kernel::FaceSource::CertifiedExtrudeCap { .. }+ solidcraft_kernel::FaceSource::ShellPlanar { producer: Some(_), .. }+ | solidcraft_kernel::FaceSource::Box { producer: Some(_), .. }+ | solidcraft_kernel::FaceSource::CertifiedExtrudeSide { plane: Some(_), .. }+ | solidcraft_kernel::FaceSource::CertifiedExtrudeCap { .. }))})@@ -785,7 +785,7 @@ fn as_spline(pts: &[Vec2], tol: f64) -> Option<LinkGeom> {if fit.len() < 2 {return None;}- let poly = solvecraft_sketch::spline_polyline(&fit, false, 3);+ let poly = solidcraft_sketch::spline_polyline(&fit, false, 3);let ok = pts.iter().all(|q| {poly.windows(2).map(|w| {diff --git a/crates/doc/src/project3d.rs b/crates/doc/src/project3d.rsindex df1bb10b2d..42f23a37c5 100644--- a/crates/doc/src/project3d.rs+++ b/crates/doc/src/project3d.rs@@ -4,8 +4,8 @@use std::collections::BTreeMap;use std::sync::Arc;-use solvecraft_geom::{Mesh, Plane, Vec2, Vec3};-use solvecraft_sketch::LinkSource;+use solidcraft_geom::{Mesh, Plane, Vec2, Vec3};+use solidcraft_sketch::LinkSource;use crate::eval::ModelState;@@ -439,8 +439,8 @@ fn tri_dist(p: Vec3, t: &[Vec3; 3]) -> f64 {}/// Sample a fitted planar curve.-fn link_polyline(g: &solvecraft_sketch::LinkGeom) -> Vec<Vec2> {- use solvecraft_sketch::LinkGeom;+fn link_polyline(g: &solidcraft_sketch::LinkGeom) -> Vec<Vec2> {+ use solidcraft_sketch::LinkGeom;match *g {LinkGeom::Line(a, b) => vec![a, b],LinkGeom::Circle(c, r) => (0..=96).map(|i| c + Vec2::from_angle(i as f64 / 96.0 * std::f64::consts::TAU) * r).collect(),@@ -452,11 +452,11 @@ fn link_polyline(g: &solvecraft_sketch::LinkGeom) -> Vec<Vec2> {let r = c.dist(a);(0..=48).map(|i| c + Vec2::from_angle(s0 + sw * i as f64 / 48.0) * r).collect()}- LinkGeom::Conic { a, apex, b, rho } => (0..=32).map(|i| solvecraft_sketch::conic_point(a, apex, b, rho, i as f64 / 32.0)).collect(),+ LinkGeom::Conic { a, apex, b, rho } => (0..=32).map(|i| solidcraft_sketch::conic_point(a, apex, b, rho, i as f64 / 32.0)).collect(),LinkGeom::Ellipse { c, major, minor } => {- (0..=96).map(|i| solvecraft_sketch::ellipse_point(c, major, minor, i as f64 / 96.0 * std::f64::consts::TAU)).collect()+ (0..=96).map(|i| solidcraft_sketch::ellipse_point(c, major, minor, i as f64 / 96.0 * std::f64::consts::TAU)).collect()}- LinkGeom::Spline { ref pts, control, degree, periodic } => solvecraft_sketch::spline_polyline_mode(pts, control, degree, periodic),+ LinkGeom::Spline { ref pts, control, degree, periodic } => solidcraft_sketch::spline_polyline_mode(pts, control, degree, periodic),LinkGeom::Point(_) => Vec::new(),}}diff --git a/crates/doc/src/project_order.rs b/crates/doc/src/project_order.rsindex 18bcdef6dd..1671769251 100644--- a/crates/doc/src/project_order.rs+++ b/crates/doc/src/project_order.rs@@ -3,7 +3,7 @@use std::collections::BTreeMap;-use solvecraft_geom::{Mesh, Plane, Vec3};+use solidcraft_geom::{Mesh, Plane, Vec3};use crate::{DocError, Result};@@ -60,7 +60,7 @@ fn boundary_edges(mesh: &Mesh, mut edges: Vec<usize>, plane: &Plane) -> Result<Vif edges.iter().any(|e| !mesh.edges.get(*e).is_some_and(|p| p.len() >= 2 && p.iter().all(|p| p.is_finite()))) {return Err(DocError::Invalid("face projection has an invalid boundary edge".into()));}- if edges.len() > solvecraft_sketch::MAX_LINK_ENTITIES {+ if edges.len() > solidcraft_sketch::MAX_LINK_ENTITIES {return Err(DocError::Invalid("face projection exceeds the boundary edge limit".into()));}let geometry_key = |e: usize| {@@ -197,17 +197,17 @@ mod tests {let edges = family_edges(&mesh, &[0, 1].into_iter().collect(), &Plane::XY).unwrap();assert_eq!(edges.len(), 8);let geom: Vec<_> = edges.iter().flat_map(|edge| super::super::fit_world(&Plane::XY, &mesh.edges[*edge])).collect();- let mut sk = solvecraft_sketch::Sketch::new();+ let mut sk = solidcraft_sketch::Sketch::new();let link = sk- .add_link(solvecraft_sketch::LinkKind::Project, solvecraft_sketch::LinkSource::Face { body: "ambiguous".into(), at: Vec3::ZERO }, &geom)+ .add_link(solidcraft_sketch::LinkKind::Project, solidcraft_sketch::LinkSource::Face { body: "ambiguous".into(), at: Vec3::ZERO }, &geom).unwrap();assert!(sk.update_link(&link, &geom).is_err());}#[test]fn family_line_normalization_preserves_corners_arcs_branches_and_retracing() {- use solvecraft_geom::Vec2;- use solvecraft_sketch::LinkGeom;+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::LinkGeom;let line = |a, b| LinkGeom::Line(Vec2::new(a, 0.), Vec2::new(b, 0.));assert_eq!(super::super::merge_family_lines(vec![line(0., 1.), line(2., 1.)]).unwrap(), vec![line(0., 2.)]);for geometry in [@@ -271,8 +271,8 @@ mod tests {let normalized: Vec<_> = expected.iter().map(|g| {- let solvecraft_sketch::LinkGeom::Line(a, b) = g[0] else { panic!("line") };- if a.x > b.x || a.y > b.y { vec![solvecraft_sketch::LinkGeom::Line(b, a)] } else { g.clone() }+ let solidcraft_sketch::LinkGeom::Line(a, b) = g[0] else { panic!("line") };+ if a.x > b.x || a.y > b.y { vec![solidcraft_sketch::LinkGeom::Line(b, a)] } else { g.clone() }}).collect();assert_eq!(actual, normalized);@@ -288,8 +288,8 @@ mod tests {#[test]fn rounded_boundary_arc_sweeps_survive_individual_edge_reversal() {- use solvecraft_geom::{Seg2, Vec2};- use solvecraft_sketch::LinkGeom;+ use solidcraft_geom::{Seg2, Vec2};+ use solidcraft_sketch::LinkGeom;let mut mesh = Mesh::default();for (extent, radius) in [(10.0, 3.0), (8.0, 1.0)] {for k in 0..4 {diff --git a/crates/doc/src/sheet.rs b/crates/doc/src/sheet.rsindex ab7616ab31..31a2ac1cb7 100644--- a/crates/doc/src/sheet.rs+++ b/crates/doc/src/sheet.rs@@ -10,8 +10,8 @@//! together; the flat solid is the outline extruded through the thickness.use serde::{Deserialize, Serialize};-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};-use solvecraft_kernel::{self as kernel, Body, EdgeSpec, FaceSpec, SurfSpec};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_kernel::{self as kernel, Body, EdgeSpec, FaceSpec, SurfSpec};use crate::expr::{self, Kind, Value};use crate::{DocError, Document, IDENTITY, Mat, Result, apply_point, apply_vector, mat_inverse, mat_mul};diff --git a/crates/doc/src/tests.rs b/crates/doc/src/tests.rsindex 9546678eaf..75cd08ab6e 100644--- a/crates/doc/src/tests.rs+++ b/crates/doc/src/tests.rs@@ -1,6 +1,6 @@-use solvecraft_geom::{Vec2, Vec3};-use solvecraft_kernel::measure;-use solvecraft_sketch::{ConstraintKind, Sketch};+use solidcraft_geom::{Vec2, Vec3};+use solidcraft_kernel::measure;+use solidcraft_sketch::{ConstraintKind, Sketch};use crate::*;@@ -379,7 +379,7 @@ fn input_sketches_lists_every_variant_with_a_sketch_field() {#[test]fn timeline_clones_share_meshes_even_when_cloned_before_tessellation() {- let body = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 10.)).unwrap();+ let body = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 10.)).unwrap();let a = crate::eval::ModelBody::new("box".into(), body, 1);let b = a.clone();assert!(std::sync::Arc::ptr_eq(&a.mesh(), &b.mesh()));diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.tomlindex 2f875a3015..89d54bfd58 100644--- a/crates/engine/Cargo.toml+++ b/crates/engine/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-engine"+name = "solidcraft-engine"description = "SolidCraft engine: the session, the command registry (everything is a command), undo/redo and selection"version.workspace = trueedition.workspace = true@@ -9,12 +9,12 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }-solvecraft-sketch = { workspace = true }-solvecraft-kernel = { workspace = true }-solvecraft-doc = { workspace = true }-solvecraft-io = { workspace = true }-solvecraft-render = { workspace = true }+solidcraft-geom = { workspace = true }+solidcraft-sketch = { workspace = true }+solidcraft-kernel = { workspace = true }+solidcraft-doc = { workspace = true }+solidcraft-io = { workspace = true }+solidcraft-render = { workspace = true }serde = { workspace = true }serde_json = { workspace = true }thiserror = { workspace = true }diff --git a/crates/engine/src/boolean_regression_tests.rs b/crates/engine/src/boolean_regression_tests.rsindex 20bcea1666..d030f24398 100644--- a/crates/engine/src/boolean_regression_tests.rs+++ b/crates/engine/src/boolean_regression_tests.rs@@ -13,7 +13,7 @@ fn replay(script: &str) -> Session {}fn volume(s: &Session, body: &str) -> f64 {- s.model.state().body(body).map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).unwrap_or(0.0)+ s.model.state().body(body).map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).unwrap_or(0.0)}/// Slab less a 557.68 × 100 × 120 pocket and the loft below its floor (556.68 × 99 down 4 mm todiff --git a/crates/engine/src/cmd/browser.rs b/crates/engine/src/cmd/browser.rsindex d03501cad9..016f4301bf 100644--- a/crates/engine/src/cmd/browser.rs+++ b/crates/engine/src/cmd/browser.rs@@ -6,7 +6,7 @@use serde_json::{Value, json};-use solvecraft_doc::FeatureKind;+use solidcraft_doc::FeatureKind;use super::CommandSpec;use crate::params::{bad, bool_, str_};@@ -92,7 +92,7 @@ fn group(s: &mut Session, p: &Value) -> Result<Value> {for g in d.browser_groups.iter_mut().filter(|g| g.component == component && g.folder == folder) {g.items.retain(|k| !items.contains(k));}- d.browser_groups.push(solvecraft_doc::BrowserGroup { id, name: name.clone(), component, folder, items });+ d.browser_groups.push(solidcraft_doc::BrowserGroup { id, name: name.clone(), component, folder, items });Ok(json!({ "group": id, "name": name }))}@@ -326,7 +326,7 @@ fn document_units(s: &mut Session, p: &Value) -> Result<Value> {.doc.params.iter()- .filter(|p| !p.model && p.unit.is_empty() && solvecraft_doc::expr::is_literal(&p.expr) && p.expr.trim().parse::<f64>().is_ok())+ .filter(|p| !p.model && p.unit.is_empty() && solidcraft_doc::expr::is_literal(&p.expr) && p.expr.trim().parse::<f64>().is_ok()).map(|p| (p.name.clone(), p.expr.trim().to_string())).collect();for (name, e) in bare {@@ -354,7 +354,7 @@ fn document_units(s: &mut Session, p: &Value) -> Result<Value> {fn view_save(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "view.save";let c = p.get("camera").ok_or_else(|| bad(cmd, "`camera` is required"))?;- let mut v: solvecraft_doc::NamedView = serde_json::from_value(c.clone()).map_err(|e| bad(cmd, format!("bad camera: {e}")))?;+ let mut v: solidcraft_doc::NamedView = serde_json::from_value(c.clone()).map_err(|e| bad(cmd, format!("bad camera: {e}")))?;let ok = [v.target.x, v.target.y, v.target.z, v.yaw, v.pitch, v.distance, v.fov].iter().all(|x| x.is_finite()) && v.distance > 0.0;if !ok {return Err(bad(cmd, "the camera must be finite with a positive distance"));@@ -405,7 +405,7 @@ fn view_list(s: &mut Session, _p: &Value) -> Result<Value> {}/// Rename an item key in the browser's groups and orders of a folder.-fn rename_key(d: &mut solvecraft_doc::Document, folder: &str, old: &str, new: &str) {+fn rename_key(d: &mut solidcraft_doc::Document, folder: &str, old: &str, new: &str) {for g in d.browser_groups.iter_mut().filter(|g| g.folder == folder) {for k in g.items.iter_mut().filter(|k| *k == old) {*k = new.to_string();@@ -472,7 +472,7 @@ fn rename_body(s: &mut Session, p: &Value) -> Result<Value> {let bodies = std::collections::BTreeMap::from([(old.clone(), name.to_string())]);anchor.remap_target(&ids, &bodies)?;for link in &mut sketch.links {- if link.auto_face && matches!(&link.source,solvecraft_sketch::LinkSource::Face {body,..} if *body==old) {+ if link.auto_face && matches!(&link.source,solidcraft_sketch::LinkSource::Face {body,..} if *body==old) {link.face_name = Some(anchor.target.name.clone());}}@@ -499,10 +499,10 @@ fn rename_body(s: &mut Session, p: &Value) -> Result<Value> {}for column in &mut d.configs.columns {match column {- solvecraft_doc::config::Column::Material(body) | solvecraft_doc::config::Column::Appearance(body) if *body == old => {+ solidcraft_doc::config::Column::Material(body) | solidcraft_doc::config::Column::Appearance(body) if *body == old => {*body = name.to_string();}- solvecraft_doc::config::Column::FaceAppearance(target) if target.body == old => {+ solidcraft_doc::config::Column::FaceAppearance(target) if target.body == old => {target.body = name.to_string();}_ => {}@@ -592,7 +592,7 @@ fn redefine_sketch(s: &mut Session, p: &Value) -> Result<Value> {.filter(|link| {link.auto_face&& link.face_name.as_ref() == Some(&anchor.target.name)- && matches!(&link.source,solvecraft_sketch::LinkSource::Face {body,..} if *body==anchor.target.body)+ && matches!(&link.source,solidcraft_sketch::LinkSource::Face {body,..} if *body==anchor.target.body)}).map(|link| link.id.clone()).collect();@@ -723,7 +723,7 @@ mod tests {run(&mut s, "view.save", json!({"camera": cam, "name": "Detail"}));run(&mut s, "view.rename", json!({"view": "Named View1", "name": "Overview"}));assert!(s.execute("view.rename", &json!({"view": "Overview", "name": "Detail"})).is_err());- let back: solvecraft_doc::Document = serde_json::from_str(&serde_json::to_string(&*s.doc).unwrap()).unwrap();+ let back: solidcraft_doc::Document = serde_json::from_str(&serde_json::to_string(&*s.doc).unwrap()).unwrap();assert_eq!(back.named_views.len(), 2);assert_eq!(back.named_views[0].target.z, 3.0);run(&mut s, "view.delete", json!({"view": "Detail"}));@@ -748,7 +748,7 @@ mod tests {run(&mut s, "construct.plane.offset", json!({"base": "XY", "offset": 5, "name": "Floor"}));let body = s.model.state().bodies[0].name.clone();let drain_name = s.doc.feature(drain).unwrap().name.clone();- let cam = solvecraft_render::Camera::default();+ let cam = solidcraft_render::Camera::default();let lines = |s: &Session| crate::view::scene(s, &cam).lines.len();let shown = |s: &mut Session| {let d = run(s, "document.inspect", json!({}));@@ -806,7 +806,7 @@ mod tests {run(&mut s, "browser.move", json!({"folder": "bodies", "items": [b.clone()]}));assert_eq!(s.doc.browser_groups[0].items, vec!["Bolt".to_string()]);run(&mut s, "browser.order", json!({"folder": "bodies", "order": [b.clone(), "Bolt"]}));- let saved: solvecraft_doc::Document = serde_json::from_str(&serde_json::to_string(&*s.doc).unwrap()).unwrap();+ let saved: solidcraft_doc::Document = serde_json::from_str(&serde_json::to_string(&*s.doc).unwrap()).unwrap();assert_eq!(saved.browser_groups, s.doc.browser_groups);assert_eq!(saved.browser_order["0/bodies"], vec![b, "Bolt".to_string()]);run(&mut s, "browser.ungroup", json!({"group": g}));diff --git a/crates/engine/src/cmd/clipboard.rs b/crates/engine/src/cmd/clipboard.rsindex c26baefd33..238abb7c81 100644--- a/crates/engine/src/cmd/clipboard.rs+++ b/crates/engine/src/cmd/clipboard.rs@@ -5,7 +5,7 @@use std::collections::BTreeMap;use serde_json::{Value, json};-use solvecraft_doc::{FeatureKind, PlaneRef};+use solidcraft_doc::{FeatureKind, PlaneRef};use super::CommandSpec;use crate::params::{bad, string_list, vec3};@@ -31,7 +31,7 @@ fn copy(s: &mut Session, p: &Value) -> Result<Value> {ids.push(s.doc.find_feature(k).map(|f| f.id).ok_or_else(|| bad(cmd, format!("no feature `{k}`")))?);}// Keep timeline order so sketches come before the features that use them.- let copied: Vec<solvecraft_doc::Feature> = s.doc.features.iter().filter(|f| ids.contains(&f.id)).cloned().collect();+ let copied: Vec<solidcraft_doc::Feature> = s.doc.features.iter().filter(|f| ids.contains(&f.id)).cloned().collect();let names: Vec<String> = copied.iter().map(|f| f.name.clone()).collect();s.clipboard = copied;Ok(json!({"copied": names}))@@ -41,7 +41,7 @@ fn copy(s: &mut Session, p: &Value) -> Result<Value> {fn explicit_planes(p: &mut PlaneRef) {match p {PlaneRef::Origin { name } => {- if let Some(plane) = solvecraft_geom::Plane::named(name) {+ if let Some(plane) = solidcraft_geom::Plane::named(name) {*p = PlaneRef::Custom { plane };}}@@ -66,7 +66,7 @@ fn paste(s: &mut Session, p: &Value) -> Result<Value> {let mut used: std::collections::BTreeSet<String> = s.model.state().bodies.iter().map(|body| body.name.clone()).collect();let mut notices = Vec::new();let author_path = s.active_occurrence_path.clone().unwrap_or_else(|| s.doc.first_path(comp));- solvecraft_doc::EmbossFace::component_frame(&s.placed_document(), comp, &author_path)?;+ solidcraft_doc::EmbossFace::component_frame(&s.placed_document(), comp, &author_path)?;let mut names: BTreeMap<String, String> = BTreeMap::new();let mut made = Vec::new();for f in feats {@@ -92,7 +92,7 @@ fn paste(s: &mut Session, p: &Value) -> Result<Value> {if let FeatureKind::Sketch { sketch, .. } = &mut kind {for link in &mut sketch.links {if link.auto_face {- if let solvecraft_sketch::LinkSource::Face { body, .. } = &mut link.source+ if let solidcraft_sketch::LinkSource::Face { body, .. } = &mut link.source&& let Some(mapped) = bodies.get(body){*body = mapped.clone();@@ -138,7 +138,7 @@ fn paste(s: &mut Session, p: &Value) -> Result<Value> {if let FeatureKind::Sketch { plane, .. } | FeatureKind::ConstructionPlane { plane } = &mut kind {explicit_planes(plane);}- let mut m = solvecraft_doc::IDENTITY;+ let mut m = solidcraft_doc::IDENTITY;m[3][0] = t.x;m[3][1] = t.y;m[3][2] = t.z;diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rsindex 16bda80f57..4f08654942 100644--- a/crates/engine/src/cmd/component.rs+++ b/crates/engine/src/cmd/component.rs@@ -1,11 +1,11 @@-//! Components and occurrences: the design as a tree (see `solvecraft_doc` assembly docs).+//! Components and occurrences: the design as a tree (see `solidcraft_doc` assembly docs).//! New sketches and features go into the active component, authored in its frame; bodies//! belong to their feature's component unless moved; occurrences place components (instances//! share contents, "paste new" copies them) and can be grounded and moved.use serde_json::{Value, json};-use solvecraft_doc::{FeatureKind, Mat, Occurrence};-use solvecraft_geom::Vec3;+use solidcraft_doc::{FeatureKind, Mat, Occurrence};+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, bool_, str_, string_list, vec3};@@ -70,7 +70,7 @@ fn occurrence(s: &Session, p: &Value, cmd: &str) -> Result<u64> {}fn translation(t: Vec3) -> Mat {- solvecraft_doc::rigid(t, Vec3::ZERO, Vec3::Z, 0.0)+ solidcraft_doc::rigid(t, Vec3::ZERO, Vec3::Z, 0.0)}fn move_vector(p: &Value, key: &str, default: Vec3, coordinate: bool, cmd: &str) -> Result<Vec3> {@@ -285,7 +285,7 @@ fn copy_occurrence(s: &mut Session, p: &Value) -> Result<Value> {let parent = if p.get("parent").is_some() { component(s, p, "parent", cmd)? } else { src.parent };let t = move_vector(p, "translate", Vec3::ZERO, true, cmd)?;let base = s.pending_moves.get(&src.id).unwrap_or(&src.transform);- let m = solvecraft_doc::mat_mul(&translation(t), base);+ let m = solidcraft_doc::mat_mul(&translation(t), base);if !valid_position(&m) {return Err(bad(cmd, "copy transform exceeds supported numeric range"));}@@ -314,8 +314,8 @@ fn paste_new(s: &mut Session, p: &Value) -> Result<Value> {s.doc.occurrence_of(comp).cloned()};let t = move_vector(p, "translate", Vec3::ZERO, true, cmd)?;- let base = occ.as_ref().map(|o| s.pending_moves.get(&o.id).copied().unwrap_or(o.transform)).unwrap_or(solvecraft_doc::IDENTITY);- let transform = solvecraft_doc::mat_mul(&translation(t), &base);+ let base = occ.as_ref().map(|o| s.pending_moves.get(&o.id).copied().unwrap_or(o.transform)).unwrap_or(solidcraft_doc::IDENTITY);+ let transform = solidcraft_doc::mat_mul(&translation(t), &base);if !valid_position(&transform) {return Err(bad(cmd, "copy transform exceeds supported numeric range"));}@@ -361,7 +361,7 @@ fn move_occurrence(s: &mut Session, p: &Value) -> Result<Value> {let t = move_vector(p, "translate", Vec3::ZERO, true, cmd)?;let axis = move_vector(p, "axis", Vec3::Z, false, cmd)?;let angle = match p.get("angle") {- Some(Value::String(e)) => s.doc.eval(e, solvecraft_doc::expr::Kind::Angle).map_err(|e| bad(cmd, e.to_string()))?,+ Some(Value::String(e)) => s.doc.eval(e, solidcraft_doc::expr::Kind::Angle).map_err(|e| bad(cmd, e.to_string()))?,None => 0.0,Some(value) => value.as_f64().ok_or_else(|| bad(cmd, "angle must be a number or angle expression"))?,};@@ -372,7 +372,7 @@ fn move_occurrence(s: &mut Session, p: &Value) -> Result<Value> {return Err(bad(cmd, "rotation axis must have a finite nonzero length"));}let origin = move_vector(p, "origin", Vec3::ZERO, true, cmd)?;- let delta = solvecraft_doc::rigid(t, origin, axis, angle);+ let delta = solidcraft_doc::rigid(t, origin, axis, angle);let space = match p.get("space") {None => "local",Some(Value::String(space)) => space.as_str(),@@ -384,8 +384,8 @@ fn move_occurrence(s: &mut Session, p: &Value) -> Result<Value> {let path = if p.get("path").is_some() || space == "world" { Some(occurrence_path(s, p, id, cmd)?) } else { None };let delta = if space == "world" {let placement = s.occurrence_placement(path.as_deref().unwrap_or(&[]))?;- let inverse = solvecraft_doc::mat_inverse(&placement.parent_world).ok_or_else(|| bad(cmd, "parent frame is singular"))?;- solvecraft_doc::mat_mul(&solvecraft_doc::mat_mul(&inverse, &delta), &placement.parent_world)+ let inverse = solidcraft_doc::mat_inverse(&placement.parent_world).ok_or_else(|| bad(cmd, "parent frame is singular"))?;+ solidcraft_doc::mat_mul(&solidcraft_doc::mat_mul(&inverse, &delta), &placement.parent_world)} else {delta};@@ -396,7 +396,7 @@ fn move_occurrence(s: &mut Session, p: &Value) -> Result<Value> {|| base[1][3].abs() > 1e-12|| base[2][3].abs() > 1e-12|| (base[3][3] - 1.0).abs() > 1e-12- || solvecraft_doc::mat_inverse(&base).is_none()+ || solidcraft_doc::mat_inverse(&base).is_none(){return Err(bad(cmd, "base_transform must be finite, affine and invertible"));}@@ -404,7 +404,7 @@ fn move_occurrence(s: &mut Session, p: &Value) -> Result<Value> {} else {s.pending_moves.get(&id).copied().unwrap_or(o.transform)};- let next = solvecraft_doc::mat_mul(&delta, &cur);+ let next = solidcraft_doc::mat_mul(&delta, &cur);if !valid_position(&next) {return Err(bad(cmd, "move transform exceeds supported numeric range"));}@@ -474,10 +474,10 @@ pub fn to_active_frame(s: &Session, kind: &mut FeatureKind) {return;}let m = s.active_component_frame();- if solvecraft_doc::is_identity(&m) {+ if solidcraft_doc::is_identity(&m) {return;}- if let Some(inv) = solvecraft_doc::mat_inverse(&m) {+ if let Some(inv) = solidcraft_doc::mat_inverse(&m) {kind.transform_geometry(&inv);}}diff --git a/crates/engine/src/cmd/component_clone.rs b/crates/engine/src/cmd/component_clone.rsindex 403b928f3a..c5895f4e76 100644--- a/crates/engine/src/cmd/component_clone.rs+++ b/crates/engine/src/cmd/component_clone.rs@@ -4,12 +4,12 @@ use std::collections::{BTreeMap, BTreeSet};use crate::params::bad;use crate::{Result, Sel, Session};use serde_json::{Value, json};-use solvecraft_doc::{Document, Feature, FeatureKind, Mat, Occurrence};+use solidcraft_doc::{Document, Feature, FeatureKind, Mat, Occurrence};const CMD: &str = "component.paste_new";const MAX_WORK: usize = 10_000;-fn mesh_distance(mesh: &solvecraft_geom::Mesh, point: solvecraft_geom::Vec3) -> f64 {+fn mesh_distance(mesh: &solidcraft_geom::Mesh, point: solidcraft_geom::Vec3) -> f64 {mesh.triangles.iter().filter_map(|triangle| mesh.tri(triangle))@@ -32,7 +32,7 @@ fn mesh_distance(mesh: &solvecraft_geom::Mesh, point: solvecraft_geom::Vec3) ->.fold(f64::INFINITY, f64::min)}-fn material_probe_matches(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh, point: solvecraft_geom::Vec3, tol_a: f64, tol_b: f64) -> bool {+fn material_probe_matches(a: &solidcraft_geom::Mesh, b: &solidcraft_geom::Mesh, point: solidcraft_geom::Vec3, tol_a: f64, tol_b: f64) -> bool {if !point.is_finite() || !tol_a.is_finite() || !tol_b.is_finite() || tol_a <= 0. || tol_b <= 0. {return false;}@@ -47,7 +47,7 @@ fn material_probe_matches(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh,let offset = 4. * tol_a.max(tol_b);let mut material = false;let mut void = false;- for axis in [solvecraft_geom::Vec3::X, solvecraft_geom::Vec3::Y, solvecraft_geom::Vec3::Z] {+ for axis in [solidcraft_geom::Vec3::X, solidcraft_geom::Vec3::Y, solidcraft_geom::Vec3::Z] {for sign in [-1., 1.] {let q = point + axis * (sign * offset);if !q.is_finite() {@@ -294,7 +294,7 @@ pub(super) fn paste(if body.body.is_mesh() {return Err(bad(CMD, "Paste New of a reassigned mesh body is not supported yet"));}- let offset = source.model_body_offset(body).copied().unwrap_or(solvecraft_doc::IDENTITY);+ let offset = source.model_body_offset(body).copied().unwrap_or(solidcraft_doc::IDENTITY);// An external transfer establishes the local baseline in this graph.// Freeze AFTER that boundary, then replay it as an identity ownership event.let entry = feats.iter().find(|f| {@@ -313,8 +313,8 @@ pub(super) fn paste(let entered = entry.and_then(|f| s.model.result(f.id)).map(|r| r.state.clone());let base = entered.as_ref().and_then(|st| st.body(&body.name)).or_else(|| before.as_ref().and_then(|st| st.body(&body.name))).unwrap_or(body);let baseline_component = source.model_body_component(base);- let geometry = solvecraft_kernel::transform_matrix(&base.body, offset)?;- let step = solvecraft_kernel::step_export(&[&geometry], "SolidCraft independent reassigned body")?;+ let geometry = solidcraft_kernel::transform_matrix(&base.body, offset)?;+ let step = solidcraft_kernel::step_export(&[&geometry], "SolidCraft independent reassigned body")?;let new_name = unique(&body.name, &mut used);bodies.insert(body.name.clone(), new_name.clone());let feature_name = unique(&format!("{} Base", body.name), &mut used);@@ -351,7 +351,7 @@ pub(super) fn paste(&& let Some(p) = source_parameters.get(name.as_str())&& p.model{- if scratch.doc.params.len() >= solvecraft_doc::MAX_PARAMS {+ if scratch.doc.params.len() >= solidcraft_doc::MAX_PARAMS {return Err(bad(CMD, "too many copied parameters"));}let new = scratch.doc_mut().new_model_param(&p.expr, &p.unit);@@ -367,7 +367,7 @@ pub(super) fn paste(if let Some(p) = source_parameters.get(old.as_str())&& p.model{- let expr = solvecraft_doc::clone_expression(&p.expr, ¶meters);+ let expr = solidcraft_doc::clone_expression(&p.expr, ¶meters);if let Some(p) = scratch.doc_mut().params.iter_mut().find(|p| p.name == *new) {p.expr = expr;p.comment = source_parameters.get(old.as_str()).map(|p| p.comment.clone()).unwrap_or_default();@@ -389,7 +389,7 @@ pub(super) fn paste(*from = *mapped;} else {*from = *to;- *transform = solvecraft_doc::IDENTITY;+ *transform = solidcraft_doc::IDENTITY;}}if let FeatureKind::Emboss { face: Some(face), .. } = &mut f.kind@@ -466,15 +466,15 @@ pub(super) fn paste(return Err(bad(CMD, "cannot copy strict face paint through uncertified foreign re-export"));}if let Some(name) = &face.name {- face.point = solvecraft_doc::naming::point_on_face(&state, name, face.point)+ face.point = solidcraft_doc::naming::point_on_face(&state, name, face.point).map(|(point, _)| point).ok_or_else(|| bad(CMD, "source frozen face appearance lost its identity"))?;}let source_body = state.body(&face.body).ok_or_else(|| bad(CMD, "source frozen face appearance lost its body"))?;- face.point = solvecraft_doc::apply_point(source.model_body_offset(source_body).unwrap_or(&solvecraft_doc::IDENTITY), face.point);+ face.point = solidcraft_doc::apply_point(source.model_body_offset(source_body).unwrap_or(&solidcraft_doc::IDENTITY), face.point);face.name = None;} else if let Some(name) = &mut face.name {- *name = solvecraft_doc::remap_topology(name, &features, &bodies);+ *name = solidcraft_doc::remap_topology(name, &features, &bodies);}face.body = new.clone();if let Some(certificate) = &mut face.certificate {@@ -484,7 +484,7 @@ pub(super) fn paste(}}// Typed configuration and assembly helpers preserve original targets.- scratch.doc_mut().configs.clone_targets(&solvecraft_doc::config::ConfigCloneMaps {+ scratch.doc_mut().configs.clone_targets(&solidcraft_doc::config::ConfigCloneMaps {features: features.clone(),components: components.clone(),bodies: bodies.clone(),@@ -500,7 +500,7 @@ pub(super) fn paste(notices.push(format!("{} retains external selected occurrence path {:?}", feature.name, face.path));}if let FeatureKind::Sketch { sketch, .. } = &feature.kind {- use solvecraft_sketch::LinkSource as L;+ use solidcraft_sketch::LinkSource as L;let mut pending: Vec<_> = sketch.links.iter().map(|l| &l.source).collect();let mut work = 0;while let Some(link) = pending.pop() {@@ -563,7 +563,7 @@ pub(super) fn paste(}}for expression in feature.kind.expressions() {- for name in solvecraft_doc::expr::references(expression) {+ for name in solidcraft_doc::expr::references(expression) {reference_work += 1;if reference_work > 100_000 {return Err(bad(CMD, "expression references exceed copy work limit"));@@ -590,8 +590,8 @@ pub(super) fn paste(if bodies.iter().any(|(old, new)| frozen.contains(old) && *new == face.body) {let body = resolved.body(&face.body).ok_or_else(|| bad(CMD, "missing frozen face body"))?;let face_index =- solvecraft_doc::appearance::face_index_at(body, face.point).ok_or_else(|| bad(CMD, "cannot reproduce frozen face appearance"))?;- let name = solvecraft_doc::naming::face_names(body).get(face_index).cloned().ok_or_else(|| bad(CMD, "missing frozen face identity"))?;+ solidcraft_doc::appearance::face_index_at(body, face.point).ok_or_else(|| bad(CMD, "cannot reproduce frozen face appearance"))?;+ let name = solidcraft_doc::naming::face_names(body).get(face_index).cloned().ok_or_else(|| bad(CMD, "missing frozen face identity"))?;face_updates.push((index, name));}}@@ -638,10 +638,10 @@ pub(super) fn paste(for body in state.bodies.iter().filter(|b| selected.contains(&source.model_body_component(b))) {let new = bodies.get(&body.name).ok_or_else(|| bad(CMD, format!("body {} has no clone identity", body.name)))?;let cloned = copied_bodies.get(new.as_str()).ok_or_else(|| bad(CMD, format!("copy did not reproduce body {}", body.name)))?;- let a = solvecraft_kernel::transform_matrix(&body.body, *source.model_body_offset(body).unwrap_or(&solvecraft_doc::IDENTITY))?;- let b = solvecraft_kernel::transform_matrix(&cloned.body, *scratch.doc.model_body_offset(cloned).unwrap_or(&solvecraft_doc::IDENTITY))?;- let ma = solvecraft_kernel::measure(&a)?;- let mb = solvecraft_kernel::measure(&b)?;+ let a = solidcraft_kernel::transform_matrix(&body.body, *source.model_body_offset(body).unwrap_or(&solidcraft_doc::IDENTITY))?;+ let b = solidcraft_kernel::transform_matrix(&cloned.body, *scratch.doc.model_body_offset(cloned).unwrap_or(&solidcraft_doc::IDENTITY))?;+ let ma = solidcraft_kernel::measure(&a)?;+ let mb = solidcraft_kernel::measure(&b)?;let tolerance = 1e-5 * (1.0 + (ma.bbox.max - ma.bbox.min).len()) + 64.0 * f64::EPSILON * (ma.bbox.min.len() + ma.bbox.max.len());let mut material_matches = true;let tol_a = (a.size() * 1e-3).max(1e-3).max(a.size() * 1e-6);@@ -658,7 +658,7 @@ pub(super) fn paste(for y in [0.2, 0.5, 0.8] {for z in [0.2, 0.5, 0.8] {let d = ma.bbox.max - ma.bbox.min;- let p = ma.bbox.min + solvecraft_geom::Vec3::new(d.x * x, d.y * y, d.z * z);+ let p = ma.bbox.min + solidcraft_geom::Vec3::new(d.x * x, d.y * y, d.z * z);let roundoff = 64. * f64::EPSILON * (1. + p.len());material_matches &= material_probe_matches(&mesh_a, &mesh_b, p, tol_a + roundoff, tol_b + roundoff);}@@ -668,7 +668,7 @@ pub(super) fn paste(// chord-volume biases after STEP. Only independently certified current// sections may replace that volume comparison; shape mismatches still// refuse even when their volumes happen to agree.- let volume_matches = match solvecraft_kernel::certified_prism_equivalent(&a, &b)? {+ let volume_matches = match solidcraft_kernel::certified_prism_equivalent(&a, &b)? {Some(same) => same,None => (ma.volume - mb.volume).abs() <= 1e-5 * (1.0 + ma.volume.abs()),};diff --git a/crates/engine/src/cmd/component_clone_assembly.rs b/crates/engine/src/cmd/component_clone_assembly.rsindex 22a186fc13..a07845abe7 100644--- a/crates/engine/src/cmd/component_clone_assembly.rs+++ b/crates/engine/src/cmd/component_clone_assembly.rs@@ -2,8 +2,8 @@use std::collections::{BTreeMap, BTreeSet};-use solvecraft_doc::Document;-use solvecraft_doc::joints::{Assembly, JointOrigin, Snap};+use solidcraft_doc::Document;+use solidcraft_doc::joints::{Assembly, JointOrigin, Snap};use crate::{EngineError, Result};diff --git a/crates/engine/src/cmd/component_clone_assembly_tests.rs b/crates/engine/src/cmd/component_clone_assembly_tests.rsindex 99a6e57dc8..6930db7513 100644--- a/crates/engine/src/cmd/component_clone_assembly_tests.rs+++ b/crates/engine/src/cmd/component_clone_assembly_tests.rs@@ -1,9 +1,9 @@#![allow(clippy::unwrap_used, clippy::panic)]use super::*;-use solvecraft_doc::joints::{Joint, JointKind, MotionLink, NamedOrigin};-use solvecraft_doc::motion::{ContactSet, ExplodedView, MotionStudy, StudyKey};-use solvecraft_doc::{IDENTITY, Occurrence};-use solvecraft_geom::Vec3;+use solidcraft_doc::joints::{Joint, JointKind, MotionLink, NamedOrigin};+use solidcraft_doc::motion::{ContactSet, ExplodedView, MotionStudy, StudyKey};+use solidcraft_doc::{IDENTITY, Occurrence};+use solidcraft_geom::Vec3;fn at(occurrence: u64) -> JointOrigin {JointOrigin { occurrence, snap: Snap::Point { point: Vec3::ZERO, z: None } }diff --git a/crates/engine/src/cmd/component_clone_tests.rs b/crates/engine/src/cmd/component_clone_tests.rsindex 49483555e9..f755ed2549 100644--- a/crates/engine/src/cmd/component_clone_tests.rs+++ b/crates/engine/src/cmd/component_clone_tests.rs@@ -28,8 +28,8 @@ fn coincident_independent_primitives_keep_their_own_semantic_faces() {let state = s.model.state();let a = state.body("Cube").unwrap();let b = state.body("Other").unwrap();- let a_names = solvecraft_doc::naming::face_names(a);- let b_names = solvecraft_doc::naming::face_names(b);+ let a_names = solidcraft_doc::naming::face_names(a);+ let b_names = solidcraft_doc::naming::face_names(b);assert!(a_names.contains(&format!("F{first}:+z")));assert!(b_names.contains(&format!("F{second}:+z")));assert!(!b_names.contains(&format!("F{first}:+z")));@@ -55,7 +55,7 @@ fn nested_definition_dag_and_histories_are_independent() {near(volume(&mut s, parent), 24.0);near(volume(&mut s, new), 16.0);let saved = s.doc.to_json();- let reopened = solvecraft_doc::Document::from_json(&saved).unwrap();+ let reopened = solidcraft_doc::Document::from_json(&saved).unwrap();assert_eq!(reopened.occurrences.iter().filter(|o| o.parent == new).count(), 2);}@@ -144,7 +144,7 @@ fn generated_feature_parameter_dependencies_are_independent() {.doc.features.iter()- .find(|f| f.component == clone && matches!(f.kind, solvecraft_doc::FeatureKind::Box { .. }))+ .find(|f| f.component == clone && matches!(f.kind, solidcraft_doc::FeatureKind::Box { .. })).unwrap().param_names.clone();@@ -195,12 +195,12 @@ fn copied_sheet_base_targets_its_own_sketch_history() {let copied = copy(&mut s, part);let new = copied["component"].as_u64().unwrap();near(volume(&mut s, new), source_volume);- let clone_sketch = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solvecraft_doc::FeatureKind::Sketch { .. })).unwrap().id;+ let clone_sketch = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap().id;assert_ne!(clone_sketch, sketch);- let base = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solvecraft_doc::FeatureKind::SheetBase { .. })).unwrap();+ let base = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solidcraft_doc::FeatureKind::SheetBase { .. })).unwrap();assert_eq!(base.kind.input_sketches(), vec![clone_sketch]);// Mutate only source geometry, then verify the copied base remains unchanged.- if let solvecraft_doc::FeatureKind::Sketch { sketch, .. } = &mut s.doc_mut().feature_mut(sketch).unwrap().kind {+ if let solidcraft_doc::FeatureKind::Sketch { sketch, .. } = &mut s.doc_mut().feature_mut(sketch).unwrap().kind {for p in &mut sketch.points {p.pos.x *= 2.0;}@@ -223,8 +223,8 @@ fn renamed_pattern_outputs_and_later_body_operands_follow_clone() {near(volume(&mut s, new), 24.0);let state = s.model.state();let target = state.bodies.iter().find(|b| b.name == "Custom Output (copy)").unwrap();- near(solvecraft_kernel::measure(&target.body).unwrap().centroid.y, 6.0);- assert_eq!(s.doc.features.iter().filter(|f| f.component == new && matches!(f.kind, solvecraft_doc::FeatureKind::Move { .. })).count(), 1);+ near(solidcraft_kernel::measure(&target.body).unwrap().centroid.y, 6.0);+ assert_eq!(s.doc.features.iter().filter(|f| f.component == new && matches!(f.kind, solidcraft_doc::FeatureKind::Move { .. })).count(), 1);}#[test]@@ -233,15 +233,15 @@ fn configuration_rows_follow_copied_parameters_material_and_strict_face_lineage(let part = component(&mut s, "Configured");let source = box2(&mut s);let length = s.doc.feature(source).unwrap().param_names[0].clone();- let target = solvecraft_doc::config::ConfigFaceTarget {+ let target = solidcraft_doc::config::ConfigFaceTarget {body: "Cube".into(),origin_feature: source,name: format!("F{source}:+z"),- point: solvecraft_geom::Vec3::new(1.0, 1.0, 2.0),+ point: solidcraft_geom::Vec3::new(1.0, 1.0, 2.0),certificate: None,};run(&mut s, "config.configure", json!({"params":[length],"materials":["Cube"],"component_appearances":[part],"face_appearances":[target]}));- let face_key = s.doc.config_key(&solvecraft_doc::config::Column::FaceAppearance(target.clone()));+ let face_key = s.doc.config_key(&solidcraft_doc::config::Column::FaceAppearance(target.clone()));run(&mut s,"config.row",@@ -271,26 +271,26 @@ fn configured_extrude_cap_copy_keeps_independent_semantic_lineage() {run(&mut s, "sketch.finish", json!({}));let feature = run(&mut s, "solid.extrude", json!({"distance":2}))["feature"].as_u64().unwrap();let body_name = s.model.state().bodies.last().unwrap().name.clone();- let target = solvecraft_doc::config::ConfigFaceTarget {+ let target = solidcraft_doc::config::ConfigFaceTarget {body: body_name,origin_feature: feature,name: format!("F{feature}:top"),- point: solvecraft_geom::Vec3::new(1.0, 1.0, 2.0),+ point: solidcraft_geom::Vec3::new(1.0, 1.0, 2.0),certificate: None,};run(&mut s, "config.configure", json!({"face_appearances":[target]}));- let key = s.doc.config_key(&solvecraft_doc::config::Column::FaceAppearance(target));+ let key = s.doc.config_key(&solidcraft_doc::config::Column::FaceAppearance(target));run(&mut s, "config.row", json!({"name":"Painted","values":{key:{"name":"Custom","color":[0,255,0],"opacity":1.0}}}));let copied = copy(&mut s, part)["component"].as_u64().unwrap();run(&mut s, "config.activate", json!({"row":"Painted"}));let state = s.model.state();let body = state.bodies.iter().find(|b| b.component == copied).unwrap();- assert!(solvecraft_doc::naming::face_names(body).contains(&format!("F{}:top", body.feature)));+ assert!(solidcraft_doc::naming::face_names(body).contains(&format!("F{}:top", body.feature)));assert!(s.doc.face_colors(body).iter().any(|(_, look)| look.color == [0, 255, 0]));assert!(s.doc.configuration_style_status(&state).is_ok());let saved = s.doc.to_json();- let reopened = solvecraft_doc::Document::from_json(&saved).unwrap();- let mut model = solvecraft_doc::Model::default();+ let reopened = solidcraft_doc::Document::from_json(&saved).unwrap();+ let mut model = solidcraft_doc::Model::default();model.evaluate(&reopened);assert!(reopened.configuration_style_status(&model.state()).is_ok());}@@ -310,8 +310,8 @@ fn selected_second_occurrence_emboss_copy_remaps_target_and_author_paths_and_reolet copied = run(&mut s, "component.paste_new", json!({"component":part,"occurrence":second,"path":[second],"translate":[20,0,0]}));let new = copied["component"].as_u64().unwrap();let placement = copied["occurrence"].as_u64().unwrap();- let emboss = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solvecraft_doc::FeatureKind::Emboss { .. })).unwrap();- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &emboss.kind else { panic!("missing selected face") };+ let emboss = s.doc.features.iter().find(|f| f.component == new && matches!(f.kind, solidcraft_doc::FeatureKind::Emboss { .. })).unwrap();+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &emboss.kind else { panic!("missing selected face") };assert_eq!(face.body, "Sleeve (copy)");assert_eq!(face.path, vec![placement]);assert_eq!(face.author_path, vec![placement]);@@ -321,7 +321,7 @@ fn selected_second_occurrence_emboss_copy_remaps_target_and_author_paths_and_reorun(&mut s, "parameters.change", json!({"name":height,"expression":"30 mm"}));near(volume(&mut s, new), clone_volume);assert!(volume(&mut s, part) > original_volume);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!(reopened.doc.features.iter().all(|f| reopened.model.result(f.id).is_some_and(|r| r.error.is_none())));near(volume(&mut reopened, new), clone_volume);@@ -339,7 +339,7 @@ fn reassigned_sample_plate_paste_new_preserves_complex_frozen_geometry() {run(&mut s, "occurrence.ground", json!({"occurrence":occurrence,"grounded":true}));let original_volume = volume(&mut s, part);let source_mesh = s.model.state().body(&body).unwrap().mesh();- let boss_probe = solvecraft_geom::Vec3::new(40.0, 35.0, 12.0);+ let boss_probe = solidcraft_geom::Vec3::new(40.0, 35.0, 12.0);let source_boss = source_mesh.contains(boss_probe);let copied = run(&mut s, "component.paste_new", json!({"component":part,"translate":[10,10,0]}));assert_eq!(s.doc.components.len(), 2);@@ -354,11 +354,11 @@ fn reassigned_sample_plate_paste_new_preserves_complex_frozen_geometry() {for (point, expected) in[([5.0, 25.0, 4.0], true), ([12.0, 25.0, 4.0], false), ([68.0, 25.0, 4.0], false), ([40.0, 25.0, 12.0], false), ([0.0, 0.0, 4.0], false)]{- assert_eq!(mesh.contains(solvecraft_geom::Vec3::new(point[0], point[1], point[2])), expected, "{point:?}");+ assert_eq!(mesh.contains(solidcraft_geom::Vec3::new(point[0], point[1], point[2])), expected, "{point:?}");}assert_eq!(mesh.contains(boss_probe), source_boss);assert_eq!(state.body(&body).unwrap().mesh().contains(boss_probe), source_boss);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!((volume(&mut reopened, new) - original_volume).abs() < 1e-5 * original_volume);}@@ -375,7 +375,7 @@ fn generated_copy_parameters_cannot_heal_an_unrelated_missing_reference() {let missing = probe.new_model_param("2 mm", "mm");let feature = s.doc_mut().feature_mut(broken).unwrap();feature.component = 0;- if let solvecraft_doc::FeatureKind::Box { width, .. } = &mut feature.kind {+ if let solidcraft_doc::FeatureKind::Box { width, .. } = &mut feature.kind {*width = missing;}s.refresh();@@ -418,7 +418,7 @@ fn external_transfer_entry_and_internal_rotated_transfer_clone_once() {assert!(before.min.dist(after.min) < 1e-6);assert!(before.max.dist(after.max) < 1e-6);assert!(body.transferred);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!(reopened.model.state().body("Foreign (copy)").unwrap().mesh().bounds().min.dist(before.min) < 1e-6);}@@ -433,7 +433,7 @@ fn suppressed_external_entry_does_not_supply_clone_baseline() {let skipped = s.doc_mut().add_feature(- solvecraft_doc::FeatureKind::BodyTransfer { bodies: vec!["Foreign".into()], from: 0, to: part, transform: solvecraft_doc::IDENTITY },+ solidcraft_doc::FeatureKind::BodyTransfer { bodies: vec!["Foreign".into()], from: 0, to: part, transform: solidcraft_doc::IDENTITY },None,).unwrap();@@ -454,13 +454,13 @@ fn transferred_frozen_face_paint_ignores_consumed_legacy_offset() {run(&mut s, "appearance.assign", json!({"body":"Foreign","faces":[[1,1,2]],"color":"#00ff00"}));s.doc_mut().body_offsets.insert("Foreign".into(),- solvecraft_doc::rigid(solvecraft_geom::Vec3::new(7.0, 0.0, 0.0), solvecraft_geom::Vec3::ZERO, solvecraft_geom::Vec3::Z, 0.0),+ solidcraft_doc::rigid(solidcraft_geom::Vec3::new(7.0, 0.0, 0.0), solidcraft_geom::Vec3::ZERO, solidcraft_geom::Vec3::Z, 0.0),);s.refresh();let part = component(&mut s, "Part");run(&mut s, "component.move_bodies", json!({"component":part,"bodies":["Foreign"]}));let original = s.doc.appearances.faces.iter().find(|face| face.body == "Foreign").unwrap();- let expected = solvecraft_doc::naming::point_on_face(&s.model.state(), original.name.as_ref().unwrap(), original.point).unwrap().0;+ let expected = solidcraft_doc::naming::point_on_face(&s.model.state(), original.name.as_ref().unwrap(), original.point).unwrap().0;copy(&mut s, part);let paint = s.doc.appearances.faces.iter().find(|face| face.body == "Foreign (copy)").unwrap();assert!(paint.point.dist(expected) < 1e-6, "{:?} versus {expected:?}", paint.point);@@ -468,18 +468,18 @@ fn transferred_frozen_face_paint_ignores_consumed_legacy_offset() {#[test]fn boundary_material_proof_requires_resolvable_stock_and_void() {- use solvecraft_geom::Vec3;- let a = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 10.)).unwrap().tessellate(1e-3).unwrap();- let b = solvecraft_kernel::box_solid(Vec3::new(1e-5, 0., 0.), Vec3::new(10.00001, 10., 10.)).unwrap().tessellate(1e-3).unwrap();+ use solidcraft_geom::Vec3;+ let a = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 10.)).unwrap().tessellate(1e-3).unwrap();+ let b = solidcraft_kernel::box_solid(Vec3::new(1e-5, 0., 0.), Vec3::new(10.00001, 10., 10.)).unwrap().tessellate(1e-3).unwrap();let p = Vec3::new(5e-6, 5., 5.);assert_ne!(a.contains(p), b.contains(p));assert!((super::mesh_distance(&a, p) - 5e-6).abs() < 1e-12);assert!((super::mesh_distance(&b, p) - 5e-6).abs() < 1e-12);assert!(super::material_probe_matches(&a, &b, p, 1e-3, 1e-3));- let shifted = solvecraft_kernel::box_solid(Vec3::new(1., 0., 0.), Vec3::new(11., 10., 10.)).unwrap().tessellate(1e-3).unwrap();+ let shifted = solidcraft_kernel::box_solid(Vec3::new(1., 0., 0.), Vec3::new(11., 10., 10.)).unwrap().tessellate(1e-3).unwrap();assert!(!super::material_probe_matches(&a, &shifted, p, 1e-3, 1e-3));- let thin = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 1e-4)).unwrap().tessellate(1e-6).unwrap();- let thin_shifted = solvecraft_kernel::box_solid(Vec3::new(0., 0., 1e-4), Vec3::new(10., 10., 2e-4)).unwrap().tessellate(1e-6).unwrap();+ let thin = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 10., 1e-4)).unwrap().tessellate(1e-6).unwrap();+ let thin_shifted = solidcraft_kernel::box_solid(Vec3::new(0., 0., 1e-4), Vec3::new(10., 10., 2e-4)).unwrap().tessellate(1e-6).unwrap();// Every resolvable replacement is void: thin ambiguous material is refused.assert!(!super::material_probe_matches(&thin, &thin_shifted, Vec3::new(5., 5., 5e-5), 1e-3, 1e-3));assert!(!super::material_probe_matches(&a, &b, p, f64::INFINITY, 1e-3));@@ -487,7 +487,7 @@ fn boundary_material_proof_requires_resolvable_stock_and_void() {#[test]fn frozen_bore_boundary_copy_preserves_stock_void_and_reopen() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let bore = |center: f64| {let mut s = Session::default();run(&mut s, "solid.box", json!({"length":30,"width":20,"height":10,"body_name":"Drilled"}));@@ -500,7 +500,7 @@ fn frozen_bore_boundary_copy_preserves_stock_void_and_reopen() {// cardinal angle, so its distance is bounded by the requested sag tolerance.assert!(super::mesh_distance(&source, Vec3::new(6., 10., 5.)) <= 1e-3);let shifted = bore(11.).model.state().body("Drilled").unwrap().body.tessellate(1e-3).unwrap();- let lost = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(30., 20., 10.)).unwrap().tessellate(1e-3).unwrap();+ let lost = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(30., 20., 10.)).unwrap().tessellate(1e-3).unwrap();assert!(!super::material_probe_matches(&source, &shifted, Vec3::new(6.5, 10., 5.), 1e-3, 1e-3));assert!(!super::material_probe_matches(&source, &lost, Vec3::new(10., 10., 5.), 1e-3, 1e-3));let created = run(&mut s, "component.from_bodies", json!({"bodies":["Drilled"]}));@@ -517,17 +517,17 @@ fn frozen_bore_boundary_copy_preserves_stock_void_and_reopen() {}};check(&s);- check(&Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));+ check(&Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));}#[test]fn frozen_r6_bore_copy_uses_current_geometry_despite_mesh_measure_bias() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = Session::default();run(&mut s, "solid.box", json!({"length":20,"width":20,"height":10,"body_name":"Drilled"}));run(&mut s, "solid.cylinder", json!({"base":[10,10,0],"radius":6,"height":10,"operation":"cut"}));let source = s.model.state().body("Drilled").unwrap().body.clone();- let original = solvecraft_kernel::step_export(&[&source], "source").unwrap();+ let original = solidcraft_kernel::step_export(&[&source], "source").unwrap();let created = run(&mut s, "component.from_bodies", json!({"bodies":["Drilled"]}));let part = created["components"][0]["component"].as_u64().unwrap();let before = s.doc.to_json();@@ -535,7 +535,7 @@ fn frozen_r6_bore_copy_uses_current_geometry_despite_mesh_measure_bias() {let check = |session: &Session| {let state = session.model.state();let body = state.bodies.iter().find(|b| session.doc.model_body_component(b) == copied).unwrap();- assert_eq!(solvecraft_kernel::certified_prism_equivalent(&source, &body.body).unwrap(), Some(true));+ assert_eq!(solidcraft_kernel::certified_prism_equivalent(&source, &body.body).unwrap(), Some(true));let mesh = body.body.tessellate(1e-3).unwrap();for (point, material) in[(Vec3::new(3., 10., 5.), true), (Vec3::new(5., 10., 5.), false), (Vec3::new(10., 10., 5.), false), (Vec3::new(18., 10., 5.), true)]@@ -543,10 +543,10 @@ fn frozen_r6_bore_copy_uses_current_geometry_despite_mesh_measure_bias() {assert_eq!(mesh.contains(point), material, "{point:?}");}let original_body = state.body("Drilled").unwrap();- assert_eq!(solvecraft_kernel::step_export(&[&original_body.body], "source").unwrap(), original);+ assert_eq!(solidcraft_kernel::step_export(&[&original_body.body], "source").unwrap(), original);};check(&s);- check(&Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));+ check(&Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);run(&mut s, "edit.redo", json!({}));diff --git a/crates/engine/src/cmd/component_properties.rs b/crates/engine/src/cmd/component_properties.rsindex 3d70262ad5..d26e890009 100644--- a/crates/engine/src/cmd/component_properties.rs+++ b/crates/engine/src/cmd/component_properties.rs@@ -1,7 +1,7 @@//! Physical properties of an assembly placement, with original body material assignments.use serde_json::{Value, json};-use solvecraft_doc::{Document, Mat};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Document, Mat};+use solidcraft_geom::Vec3;use crate::params::bad;use crate::{Result, Session};@@ -27,8 +27,8 @@ fn placed_doc(s: &Session) -> Document {/// A property total must cover the entire assembly. The display traversal intentionally/// truncates hostile designs, so use an explicit error instead of accepting its prefix.pub(in crate::cmd) fn placements(doc: &Document, cmd: &str) -> Result<Vec<(u64, Vec<u64>, Mat)>> {- let mut out = vec![(0, Vec::new(), solvecraft_doc::IDENTITY)];- let mut stack = vec![(0, Vec::<u64>::new(), solvecraft_doc::IDENTITY)];+ let mut out = vec![(0, Vec::new(), solidcraft_doc::IDENTITY)];+ let mut stack = vec![(0, Vec::<u64>::new(), solidcraft_doc::IDENTITY)];let mut children: std::collections::BTreeMap<u64, Vec<_>> = std::collections::BTreeMap::new();for occurrence in &doc.occurrences {children.entry(occurrence.parent).or_default().push(occurrence);@@ -40,7 +40,7 @@ pub(in crate::cmd) fn placements(doc: &Document, cmd: &str) -> Result<Vec<(u64,}let mut child_path = path.clone();child_path.push(occurrence.id);- let world = solvecraft_doc::mat_mul(&transform, &occurrence.transform);+ let world = solidcraft_doc::mat_mul(&transform, &occurrence.transform);out.push((occurrence.component, child_path.clone(), world));stack.push((occurrence.component, child_path, world));}@@ -95,7 +95,7 @@ fn properties(s: &Session, doc: &Document, selected: &[u64], descendants: bool,let (mut faces, mut edges, mut vertices) = (0, 0, 0);let mut placement_count = 0;let selected_placements = if selected.is_empty() {- if descendants { placements(doc, cmd)? } else { vec![(0, Vec::new(), solvecraft_doc::IDENTITY)] }+ if descendants { placements(doc, cmd)? } else { vec![(0, Vec::new(), solidcraft_doc::IDENTITY)] }} else {let placement = s.occurrence_placement(selected).map_err(|e| bad(cmd, e.to_string()))?;let mut out = vec![(placement.component, selected.to_vec(), placement.world)];@@ -107,7 +107,7 @@ fn properties(s: &Session, doc: &Document, selected: &[u64], descendants: bool,}let mut child = path.clone();child.push(occurrence.id);- let world = solvecraft_doc::mat_mul(&transform, &occurrence.transform);+ let world = solidcraft_doc::mat_mul(&transform, &occurrence.transform);out.push((occurrence.component, child.clone(), world));stack.push((occurrence.component, child, world));}@@ -117,9 +117,9 @@ fn properties(s: &Session, doc: &Document, selected: &[u64], descendants: bool,for (component, path, transform) in selected_placements {placement_count += 1;for body in state.bodies.iter().filter(|b| doc.model_body_component(b) == component) {- let transform: Mat = doc.model_body_offset(body).map(|offset| solvecraft_doc::mat_mul(&transform, offset)).unwrap_or(transform);- let placed = solvecraft_kernel::transform_matrix(&body.body, transform)?;- let measured = solvecraft_kernel::measure(&placed)?;+ let transform: Mat = doc.model_body_offset(body).map(|offset| solidcraft_doc::mat_mul(&transform, offset)).unwrap_or(transform);+ let placed = solidcraft_kernel::transform_matrix(&body.body, transform)?;+ let measured = solidcraft_kernel::measure(&placed)?;let density = doc.density(&body.name);let body_mass = measured.volume * density / 1000.0;volume += measured.volume;diff --git a/crates/engine/src/cmd/component_properties_tests.rs b/crates/engine/src/cmd/component_properties_tests.rsindex a9425c9da7..aeace2130e 100644--- a/crates/engine/src/cmd/component_properties_tests.rs+++ b/crates/engine/src/cmd/component_properties_tests.rs@@ -108,7 +108,7 @@ fn compact_exponentially_instanced_assembly_refuses_partial_totals() {for _ in 0..17 {let parent = s.active_component;let component = s.doc_mut().add_component(None, parent).unwrap();- last_occurrence = s.doc_mut().add_occurrence(component, parent, solvecraft_doc::IDENTITY).unwrap();+ last_occurrence = s.doc_mut().add_occurrence(component, parent, solidcraft_doc::IDENTITY).unwrap();s.active_component = component;}for command in ["component.properties", "occurrence.properties"] {diff --git a/crates/engine/src/cmd/component_transfer.rs b/crates/engine/src/cmd/component_transfer.rsindex be5ae1069e..685927276c 100644--- a/crates/engine/src/cmd/component_transfer.rs+++ b/crates/engine/src/cmd/component_transfer.rs@@ -10,8 +10,8 @@ fn unique_frames(s: &Session, cmd: &str) -> Result<UniqueFrames> {for occurrence in &doc.occurrences {children.entry(occurrence.parent).or_default().push(occurrence);}- let mut frames = BTreeMap::from([(0, Some((Vec::new(), solvecraft_doc::IDENTITY)))]);- let mut stack = vec![(0, Vec::new(), solvecraft_doc::IDENTITY)];+ let mut frames = BTreeMap::from([(0, Some((Vec::new(), solidcraft_doc::IDENTITY)))]);+ let mut stack = vec![(0, Vec::new(), solidcraft_doc::IDENTITY)];let mut work = 0usize;while let Some((component, path, matrix)) = stack.pop() {for occurrence in children.get(&component).into_iter().flatten() {@@ -21,7 +21,7 @@ fn unique_frames(s: &Session, cmd: &str) -> Result<UniqueFrames> {}let mut child_path = path.clone();child_path.push(occurrence.id);- let frame = solvecraft_doc::mat_mul(&matrix, &occurrence.transform);+ let frame = solidcraft_doc::mat_mul(&matrix, &occurrence.transform);frames.entry(occurrence.component).and_modify(|entry| *entry = None).or_insert_with(|| Some((child_path.clone(), frame)));stack.push((occurrence.component, child_path, frame));}@@ -61,16 +61,16 @@ fn transfer(s: &mut Session, name: &str, to: u64, frames: &UniqueFrames, cmd: &s};let source = unique(from)?;let destination = unique(to)?;- let old = doc.model_body_offset(body).map(|offset| solvecraft_doc::mat_mul(&source.1, offset)).unwrap_or(source.1);- let inv = solvecraft_doc::mat_inverse(&destination.1).ok_or_else(|| bad(cmd, "destination frame is not invertible"))?;- let transform = solvecraft_doc::mat_mul(&inv, &old);- if !solvecraft_doc::valid_transfer_matrix(&transform) {+ let old = doc.model_body_offset(body).map(|offset| solidcraft_doc::mat_mul(&source.1, offset)).unwrap_or(source.1);+ let inv = solidcraft_doc::mat_inverse(&destination.1).ok_or_else(|| bad(cmd, "destination frame is not invertible"))?;+ let transform = solidcraft_doc::mat_mul(&inv, &old);+ if !solidcraft_doc::valid_transfer_matrix(&transform) {return Err(bad(cmd, "body transfer exceeds supported rigid coordinate range"));}let inherited = (!s.doc.appearances.bodies.contains_key(name)).then(|| s.doc.appearances.components.get(&from).cloned()).flatten();let paths: BTreeSet<u64> = source.0.iter().chain(&destination.0).copied().collect();let captures: Vec<_> = paths.into_iter().filter_map(|id| s.pending_moves.get(&id).map(|transform| (id, *transform))).collect();- if captures.iter().any(|(_, transform)| !solvecraft_doc::valid_transfer_matrix(transform)) {+ if captures.iter().any(|(_, transform)| !solidcraft_doc::valid_transfer_matrix(transform)) {return Err(bad(cmd, "pending transfer position is not a supported rigid transform"));}drop(doc);diff --git a/crates/engine/src/cmd/component_transfer_tests.rs b/crates/engine/src/cmd/component_transfer_tests.rsindex 9a6fd2e82f..052db71f26 100644--- a/crates/engine/src/cmd/component_transfer_tests.rs+++ b/crates/engine/src/cmd/component_transfer_tests.rs@@ -10,7 +10,7 @@ fn recorded_assignment_preserves_sample_joined_material_and_timeline() {s.run_script(&crate::sample::script()).unwrap();let before = s.model.state();assert_eq!(before.bodies.len(), 1);- let volume = solvecraft_kernel::measure(&before.body("Plate").unwrap().body).unwrap().volume;+ let volume = solidcraft_kernel::measure(&before.body("Plate").unwrap().body).unwrap().volume;let created = run(&mut s, "component.from_bodies", json!({"bodies":["Plate"]}));let to = created["components"][0]["component"].as_u64().unwrap();let feature = created["components"][0]["feature"].as_u64().unwrap();@@ -19,7 +19,7 @@ fn recorded_assignment_preserves_sample_joined_material_and_timeline() {let body = after.body("Plate").unwrap();assert_eq!(body.component, to);assert!(body.transferred);- assert!((solvecraft_kernel::measure(&body.body).unwrap().volume - volume).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&body.body).unwrap().volume - volume).abs() < 1e-6);assert!(body.mesh().contains(Vec3::new(40.0, 35.0, 12.0)));let index = s.doc.feature_index(feature).unwrap();s.doc_mut().marker = Some(index);@@ -44,12 +44,12 @@ fn transformed_pending_destination_repeated_transfer_preserves_world_pose() {assert!(bounds.min.dist(Vec3::ZERO) < 1e-6);assert!(bounds.max.dist(Vec3::new(10.0, 10.0, 10.0)) < 1e-6);assert!(!s.pending_moves.contains_key(&occurrence));- let mut destination_reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut destination_reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };destination_reopened.refresh();assert!(destination_reopened.world_state().body("Block").unwrap().mesh().bounds().min.dist(Vec3::ZERO) < 1e-6);run(&mut s, "component.move_bodies", json!({"component":0,"bodies":["Block"]}));assert!(s.world_state().body("Block").unwrap().mesh().bounds().min.dist(Vec3::ZERO) < 1e-6);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!(reopened.world_state().body("Block").unwrap().mesh().bounds().min.dist(Vec3::ZERO) < 1e-6);}@@ -75,7 +75,7 @@ fn historical_join_cut_and_new_destination_modeling_keep_material() {run(&mut s, "solid.box", json!({"corner":[2,2,0],"length":2,"width":2,"height":10,"operation":"cut"}));let original = s.model.state();assert_eq!(original.bodies.len(), 1);- let v = solvecraft_kernel::measure(&original.body("Block").unwrap().body).unwrap().volume;+ let v = solidcraft_kernel::measure(&original.body("Block").unwrap().body).unwrap().volume;assert!((v - 1760.0).abs() < 1e-6);run(&mut s, "material.assign", json!({"bodies":["Block"],"material":"Brass"}));run(&mut s, "appearance.assign", json!({"bodies":["Block"],"color":"#bc8537"}));@@ -87,15 +87,15 @@ fn historical_join_cut_and_new_destination_modeling_keep_material() {run(&mut s, "solid.box", json!({"corner":[18,0,0],"length":2,"width":10,"height":10,"operation":"join"}));assert_eq!(s.model.state().bodies.len(), 1);assert_eq!(s.model.state().body("Block").unwrap().component, c);- let final_volume = solvecraft_kernel::measure(&s.model.state().body("Block").unwrap().body).unwrap().volume;+ let final_volume = solidcraft_kernel::measure(&s.model.state().body("Block").unwrap().body).unwrap().volume;assert!((final_volume - 1960.0).abs() < 1e-6);run(&mut s, "component.move_bodies", json!({"component":0,"bodies":["Block"]}));assert_eq!(s.model.state().body("Block").unwrap().component, 0);run(&mut s, "edit.undo", json!({}));assert_eq!(s.model.state().body("Block").unwrap().component, c);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();- assert!((solvecraft_kernel::measure(&reopened.model.state().body("Block").unwrap().body).unwrap().volume - final_volume).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&reopened.model.state().body("Block").unwrap().body).unwrap().volume - final_volume).abs() < 1e-6);}#[test]@@ -107,7 +107,7 @@ fn ownership_only_boundary_invalidates_old_boolean_cache() {let c = s.doc_mut().add_component(Some("Destination"), 0).unwrap();let id = s.doc_mut()- .add_feature(FeatureKind::BodyTransfer { bodies: vec!["Block".into()], from: 0, to: c, transform: solvecraft_doc::IDENTITY }, None)+ .add_feature(FeatureKind::BodyTransfer { bodies: vec!["Block".into()], from: 0, to: c, transform: solidcraft_doc::IDENTITY }, None).unwrap();let index = s.doc.feature_index(id).unwrap();let transfer = s.doc_mut().features.remove(index);@@ -115,7 +115,7 @@ fn ownership_only_boundary_invalidates_old_boolean_cache() {s.refresh();assert_eq!(s.model.state().bodies.len(), 2);assert_eq!(s.model.state().body("Block").unwrap().component, c);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert_eq!(reopened.model.state().bodies.len(), 2);assert_eq!(reopened.model.state().body("Block").unwrap().component, c);@@ -128,7 +128,7 @@ fn failed_transfer_cannot_change_evaluated_world_owner() {let c = s.doc_mut().add_component(Some("Destination"), 0).unwrap();let id = s.doc_mut()- .add_feature(FeatureKind::BodyTransfer { bodies: vec!["Block".into()], from: c, to: c, transform: solvecraft_doc::IDENTITY }, None)+ .add_feature(FeatureKind::BodyTransfer { bodies: vec!["Block".into()], from: c, to: c, transform: solidcraft_doc::IDENTITY }, None).unwrap();s.refresh();assert!(s.model.result(id).unwrap().error.is_some());@@ -149,7 +149,7 @@ fn transferred_thread_follows_body_frame_without_changing_world_axis() {let after = s.world_state().threads[0].clone();assert!(after.axis_point.dist(before.axis_point) < 1e-6);assert!(after.axis.dist(before.axis) < 1e-6);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!(reopened.world_state().threads[0].axis.dist(before.axis) < 1e-6);}@@ -159,7 +159,7 @@ fn inherited_component_appearance_and_legacy_assignment_survive_transfer() {let mut s = Session::default();let source = run(&mut s, "component.create", json!({"name":"Source"}))["component"].as_u64().unwrap();run(&mut s, "solid.box", json!({"length":10,"width":10,"height":10,"body_name":"Block"}));- s.doc_mut().appearances.components.insert(source, solvecraft_doc::appearance::Look { name: "Green".into(), color: [0, 150, 0], opacity: 0.7 });+ s.doc_mut().appearances.components.insert(source, solidcraft_doc::appearance::Look { name: "Green".into(), color: [0, 150, 0], opacity: 0.7 });s.refresh();let look = s.doc.model_body_look(s.model.state().body("Block").unwrap()).unwrap();run(&mut s, "component.move_bodies", json!({"component":0,"bodies":["Block"]}));@@ -169,12 +169,12 @@ fn inherited_component_appearance_and_legacy_assignment_survive_transfer() {run(&mut legacy, "solid.box", json!({"length":10,"width":10,"height":10,"body_name":"Old"}));let c = legacy.doc_mut().add_component(Some("Legacy"), 0).unwrap();legacy.doc_mut().body_components.insert("Old".into(), c);- legacy.doc_mut().body_offsets.insert("Old".into(), solvecraft_doc::rigid(Vec3::new(7.0, 0.0, 0.0), Vec3::ZERO, Vec3::Z, 0.0));+ legacy.doc_mut().body_offsets.insert("Old".into(), solidcraft_doc::rigid(Vec3::new(7.0, 0.0, 0.0), Vec3::ZERO, Vec3::Z, 0.0));legacy.refresh();assert!(!legacy.model.state().body("Old").unwrap().transferred);run(&mut legacy, "component.move_bodies", json!({"component":0,"bodies":["Old"]}));assert!((legacy.world_state().body("Old").unwrap().mesh().bounds().min.x - 7.0).abs() < 1e-6);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&legacy.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&legacy.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!((reopened.world_state().body("Old").unwrap().mesh().bounds().min.x - 7.0).abs() < 1e-6);}@@ -190,7 +190,7 @@ fn deleting_external_transfer_source_refuses_without_dangling_archive() {let document = s.doc.to_json();assert!(s.execute("component.delete", &json!({"component":a})).is_err());assert_eq!(s.doc.to_json(), document);- assert!(solvecraft_doc::Document::from_json(&document).is_ok());+ assert!(solidcraft_doc::Document::from_json(&document).is_ok());}#[test]@@ -204,7 +204,7 @@ fn earlier_selected_cylinder_emboss_keeps_source_frame_after_transfer_and_edit()run(&mut s, "sketch.rectangle.two_point", json!({"p0":[-2,5],"p1":[2,10]}));run(&mut s, "sketch.finish", json!({}));let emboss = run(&mut s, "solid.emboss", json!({"sketch":"Badge","face":[30,10,7.5],"depth":1}))["feature"].as_u64().unwrap();- let before = solvecraft_kernel::measure(&s.world_state().body("Sleeve").unwrap().body).unwrap().volume;+ let before = solidcraft_kernel::measure(&s.world_state().body("Sleeve").unwrap().body).unwrap().volume;run(&mut s, "component.activate", json!({"component":0}));let destination = run(&mut s, "component.create", json!({"name":"Destination"}));let to = destination["component"].as_u64().unwrap();@@ -212,13 +212,13 @@ fn earlier_selected_cylinder_emboss_keeps_source_frame_after_transfer_and_edit()run(&mut s, "occurrence.move", json!({"occurrence":destination_occurrence,"translate":[0,40,0],"axis":[1,0,0],"angle":90,"capture":true}));run(&mut s, "component.move_bodies", json!({"component":to,"bodies":["Sleeve"]}));assert!(s.doc.features.iter().all(|feature| s.model.result(feature.id).is_some_and(|result| result.error.is_none())));- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert!(reopened.doc.features.iter().all(|feature| reopened.model.result(feature.id).is_some_and(|result| result.error.is_none())));- assert!((solvecraft_kernel::measure(&reopened.world_state().body("Sleeve").unwrap().body).unwrap().volume - before).abs() < 1e-5);+ assert!((solidcraft_kernel::measure(&reopened.world_state().body("Sleeve").unwrap().body).unwrap().volume - before).abs() < 1e-5);let depth = reopened.doc.feature(emboss).unwrap().param_names[0].clone();run(&mut reopened, "parameters.change", json!({"name":depth,"expression":"2 mm"}));- assert!(solvecraft_kernel::measure(&reopened.world_state().body("Sleeve").unwrap().body).unwrap().volume > before);+ assert!(solidcraft_kernel::measure(&reopened.world_state().body("Sleeve").unwrap().body).unwrap().volume > before);}#[test]@@ -280,7 +280,7 @@ fn edited_transfer_destination_updates_history_owner_copy_and_reopen() {assert_eq!(s.pending_moves, pending);let copied = run(&mut s, "component.paste_new", json!({"component":b}))["component"].as_u64().unwrap();assert_eq!(s.model.state().body("Block (copy)").unwrap().component, copied);- let mut reopened = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };+ let mut reopened = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Session::default() };reopened.refresh();assert_eq!(reopened.model.state().body("Block").unwrap().component, b);assert_eq!(reopened.model.state().body("Block (copy)").unwrap().component, copied);diff --git a/crates/engine/src/cmd/config.rs b/crates/engine/src/cmd/config.rsindex 171cb20ff3..56e373f495 100644--- a/crates/engine/src/cmd/config.rs+++ b/crates/engine/src/cmd/config.rs@@ -2,7 +2,7 @@//! suppressions) and switching between its rows.use serde_json::{Value, json};-use solvecraft_doc::config::{Column, ConfigRow, MAX_COLUMNS, MAX_ROWS};+use solidcraft_doc::config::{Column, ConfigRow, MAX_COLUMNS, MAX_ROWS};use super::CommandSpec;use crate::params::{bad, bool_, str_, string_list};@@ -64,8 +64,8 @@ fn column_of(s: &Session, p: &Value, cmd: &str) -> Result<Column> {.ok_or_else(|| bad(cmd, "no face column"));}if let Some(target) = value.get("target") {- solvecraft_doc::config::validate_face_target_json(target).map_err(|error| bad(cmd, error.to_string()))?;- let target: solvecraft_doc::config::ConfigFaceTarget =+ solidcraft_doc::config::validate_face_target_json(target).map_err(|error| bad(cmd, error.to_string()))?;+ let target: solidcraft_doc::config::ConfigFaceTarget =serde_json::from_value(target.clone()).map_err(|error| bad(cmd, error.to_string()))?;let state = s.model.state();let body = state.body(&target.body).ok_or_else(|| bad(cmd, "no face definition"))?;@@ -79,7 +79,7 @@ fn column_of(s: &Session, p: &Value, cmd: &str) -> Result<Column> {if body.body.is_mesh() {return Err(bad(cmd, "mesh faces have no supported semantic lineage"));}- let index = solvecraft_doc::appearance::face_index_at(body, point).ok_or_else(|| bad(cmd, "no face at picked point"))?;+ let index = solidcraft_doc::appearance::face_index_at(body, point).ok_or_else(|| bad(cmd, "no face at picked point"))?;let target = s.doc.configuration_face_target(body, index, point).map_err(|error| bad(cmd, error.to_string()))?;s.doc.certify_config_face(&target).map_err(|error| bad(cmd, error.to_string()))?;s.doc.configuration_face_indices(body, &target).map_err(|error| bad(cmd, error.to_string()))?;@@ -265,10 +265,10 @@ fn row(s: &mut Session, p: &Value) -> Result<Value> {.ok_or_else(|| bad(cmd, format!("`{k}` is not a column (config.column adds one)")))?;match s.doc.configs.columns.get(col) {Some(Column::Material(_)) => {- text = solvecraft_doc::config::material_cell(&text).map_err(|e| bad(cmd, e.to_string()))?.unwrap_or_else(|| "Default".into());+ text = solidcraft_doc::config::material_cell(&text).map_err(|e| bad(cmd, e.to_string()))?.unwrap_or_else(|| "Default".into());}Some(Column::Appearance(_) | Column::ComponentAppearance(_) | Column::FaceAppearance(_)) => {- text = match solvecraft_doc::config::appearance_cell(&text).map_err(|e| bad(cmd, e.to_string()))? {+ text = match solidcraft_doc::config::appearance_cell(&text).map_err(|e| bad(cmd, e.to_string()))? {Some(look) => serde_json::to_string(&look).map_err(|e| bad(cmd, e.to_string()))?,None => String::new(),};@@ -329,8 +329,8 @@ fn validate_rows(s: &Session, cmd: &str) -> Result<()> {fn rule(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "config.rule";if let Some(value) = p.get("rule") {- solvecraft_doc::config::validate_rules_json(&json!({"configs":{"rules":[value]}})).map_err(|e| bad(cmd, e.to_string()))?;- let mut rule: solvecraft_doc::config::ConfigRule = serde_json::from_value(value.clone()).map_err(|e| bad(cmd, e.to_string()))?;+ solidcraft_doc::config::validate_rules_json(&json!({"configs":{"rules":[value]}})).map_err(|e| bad(cmd, e.to_string()))?;+ let mut rule: solidcraft_doc::config::ConfigRule = serde_json::from_value(value.clone()).map_err(|e| bad(cmd, e.to_string()))?;if rule.length_unit.is_none() {rule.length_unit = s.doc@@ -345,7 +345,7 @@ fn rule(s: &mut Session, p: &Value) -> Result<Value> {if let Some(index) = rules.iter().position(|r| r.id == rule.id) {rules[index] = rule;} else {- if rules.len() >= solvecraft_doc::config::MAX_RULES {+ if rules.len() >= solidcraft_doc::config::MAX_RULES {return Err(bad(cmd, "too many rules"));}rules.push(rule);@@ -541,7 +541,7 @@ mod tests {run(&mut s, "config.rule", json!({"id":"limit","delete":true}));run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc, before);- let reopened = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(reopened.configs.rules, s.doc.configs.rules);}@@ -580,7 +580,7 @@ mod tests {assert!((volume(&mut s) - 1000.0).abs() < 1e-6, "captured Default preserves geometry in an inch design");run(&mut s, "config.row", json!({"name":"Inches", "values":{length.clone():"2", format!("suppress:{feature}"):"NO"}}));run(&mut s, "config.activate", json!({"row":"Inches"}));- assert_eq!(s.doc.config_current(&solvecraft_doc::config::Column::Param(length.clone())).as_deref(), Some("2 in"));+ assert_eq!(s.doc.config_current(&solidcraft_doc::config::Column::Param(length.clone())).as_deref(), Some("2 in"));assert!(s.doc.configuration_matches());assert!((volume(&mut s) - 5080.0).abs() < 1e-6);let feature_id = s.doc.features[0].id;@@ -682,7 +682,7 @@ mod tests {let mass = run(&mut s, "inspect.measure", json!({}));assert!((mass["bodies"][0]["mass_g"].as_f64().unwrap() - 2.7).abs() < 1e-6);assert_eq!(s.doc.appearances.bodies.get(&body).unwrap().opacity, 0.4);- let reopened = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(reopened, *s.doc);assert!(reopened.configuration_matches());run(&mut s, "edit.undo", json!({}));@@ -740,7 +740,7 @@ mod tests {run(&mut s, "config.activate", json!({"row": "Default"}));assert_eq!(s.doc.appearances.bodies.get(&body).unwrap().name, name);assert!(s.doc.configuration_matches());- let reopened = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert!(reopened.configuration_matches());}@@ -775,7 +775,7 @@ mod tests {run(&mut s, "edit.undo", json!({}));assert_eq!(run(&mut s, "config.table", json!({}))["columns"][2], "material:Block");run(&mut s, "edit.redo", json!({}));- let mut reopened = Session::new(solvecraft_doc::format::read(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::format::read(&s.doc.to_json()).unwrap());run(&mut reopened, "config.activate", json!({"row": "Default"}));assert!(!reopened.doc.materials.contains_key("Housing"));assert!(!reopened.doc.appearances.bodies.contains_key("Housing"));diff --git a/crates/engine/src/cmd/config_certificate_tests.rs b/crates/engine/src/cmd/config_certificate_tests.rsindex 0bc2592720..ec0eceb6ca 100644--- a/crates/engine/src/cmd/config_certificate_tests.rs+++ b/crates/engine/src/cmd/config_certificate_tests.rs@@ -1,10 +1,10 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_doc::{+use solidcraft_doc::{FeatureKind,config::{Column, FaceCertificate},};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;fn run(session: &mut Session, command: &str, params: Value) -> Value {session.execute(command, ¶ms).unwrap_or_else(|error| panic!("{command} {params}: {error}"))@@ -21,11 +21,11 @@ fn painted_radius(session: &Session, name: &str, radius: f64) -> usize {state.body(name).unwrap_or_else(|| panic!("missing {name}; bodies {:?}", state.bodies.iter().map(|body| &body.name).collect::<Vec<_>>()));let painted = session.doc.face_colors(body);let mesh = body.body.tessellate(0.001).unwrap();- let inverse = solvecraft_doc::mat_inverse(&body.source_transform).unwrap();+ let inverse = solidcraft_doc::mat_inverse(&body.source_transform).unwrap();for (triangle, face) in mesh.triangles.iter().zip(&mesh.tri_face) {if painted.iter().any(|(index, _)| *index == *face as usize) {for vertex in mesh.tri(triangle).unwrap() {- let vertex = solvecraft_doc::apply_point(&inverse, vertex);+ let vertex = solidcraft_doc::apply_point(&inverse, vertex);assert!((vertex.x.hypot(vertex.y) - radius).abs() < 1e-7, "{name}: {vertex:?}");}}@@ -60,7 +60,7 @@ fn certified_annulus_side_rows_follow_radius_edits_and_clone() {assert_eq!(s.doc.configs.columns.len(), 2);run(&mut s, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&s, "Ring (copy)", 12.), 2);- let reopened = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();let mut reopened = Session::new(reopened);run(&mut reopened, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&reopened, "Ring", 12.), 2);@@ -83,19 +83,19 @@ fn imported(session: &mut Session, step: String, name: &str) -> u64 {#[test]fn legacy_v9_imported_emboss_anchor_and_ordinary_face_paint_replay_without_renaming() {let mut s = Session::default();- let cylinder = solvecraft_kernel::cylinder(Vec3::ZERO, Vec3::Z, 10., 20.).unwrap();- let step = solvecraft_kernel::step_export(&[&cylinder], "legacy anchored cylinder").unwrap();+ let cylinder = solidcraft_kernel::cylinder(Vec3::ZERO, Vec3::Z, 10., 20.).unwrap();+ let step = solidcraft_kernel::step_export(&[&cylinder], "legacy anchored cylinder").unwrap();let source = imported(&mut s, step, "Sleeve");run(&mut s, "material.assign", json!({"bodies":["Sleeve"],"material":"Steel"}));let before_volume = s.model.state().body("Sleeve").unwrap().body.tessellate_with(1e-4, true).unwrap().measure().volume;- let legacy_names = solvecraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());+ let legacy_names = solidcraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());assert!(legacy_names.iter().all(|name| name.starts_with(&format!("F{source}:face:"))));run(&mut s, "appearance.assign", json!({"faces":[{"body":"Sleeve","point":[6,0,20]}],"appearance":"ABS - Blue"}));assert!(s.doc.appearances.faces[0].certificate.is_none());let badge = run(&mut s, "sketch.create", json!({"plane":{"face":[0,0,20]},"name":"Badge","project_edges":false}))["sketch"].as_u64().unwrap();let FeatureKind::Sketch { plane: saved_plane, .. } = &s.doc.feature(badge).unwrap().kind else { panic!() };let saved_plane = saved_plane.clone();- assert!(matches!(&saved_plane, solvecraft_doc::PlaneRef::Face { name: Some(name), .. } if legacy_names.contains(name)));+ assert!(matches!(&saved_plane, solidcraft_doc::PlaneRef::Face { name: Some(name), .. } if legacy_names.contains(name)));run(&mut s, "sketch.rectangle.two_point", json!({"p0":[-2,-2],"p1":[2,2]}));run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.emboss", json!({"sketch":"Badge","profiles":"all","depth":1,"targets":["Sleeve"],"name":"Raised Badge"}));@@ -106,16 +106,16 @@ fn legacy_v9_imported_emboss_anchor_and_ordinary_face_paint_replay_without_renamassert!((volume - before_volume - 16.).abs() < 0.01, "addedvolume {} baseline {before_volume}", volume - before_volume);let paint = s.doc.appearances.faces.clone();let mut legacy: Value = serde_json::from_str(&s.doc.to_json()).unwrap();- legacy["format"] = json!("solvecraft/9");- let reopened = Session::new(solvecraft_doc::Document::from_json(&legacy.to_string()).unwrap());+ legacy["format"] = json!("solidcraft/9");+ let reopened = Session::new(solidcraft_doc::Document::from_json(&legacy.to_string()).unwrap());// Saved before format 14, it keeps naming the pieces it makes in the kernel's shell order.- let anchored = solvecraft_doc::Feature { shell_piece_order: true, ..anchored };+ let anchored = solidcraft_doc::Feature { shell_piece_order: true, ..anchored };assert_eq!(reopened.doc.feature(anchored.id).unwrap(), &anchored);// Names saved before format 14 keep naming the face they named, marked so they are found as// the build that saved them found them.- let mark = |name: &Option<String>| name.as_ref().map(|n| format!("{}{n}", solvecraft_doc::naming::LEGACY_MARK));+ let mark = |name: &Option<String>| name.as_ref().map(|n| format!("{}{n}", solidcraft_doc::naming::LEGACY_MARK));let mut saved_plane = saved_plane;- if let solvecraft_doc::PlaneRef::Face { name, .. } = &mut saved_plane {+ if let solidcraft_doc::PlaneRef::Face { name, .. } = &mut saved_plane {*name = mark(name);}let paint: Vec<_> = paint@@ -173,10 +173,10 @@ fn legacy_v9_annulus_outer_side_emboss_keeps_its_original_heuristic_anchor() {run(&mut s, "sketch.circle.center", json!({"center":[0,0],"radius":9,"id":"inner"}));run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"distance":20,"profiles":[{"point":[9.5,0]}],"body_name":"Sleeve"}));- let names = solvecraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());+ let names = solidcraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());// The outer wall is named after its own sketch curve: its history says so. (Builds before// format 14 named it after the curve nearest its centre, the inner circle; see below.)- let name = solvecraft_doc::naming::face_names_at(&s.model.state(), &[Vec3::new(0., 10., 7.5)]).remove(0);+ let name = solidcraft_doc::naming::face_names_at(&s.model.state(), &[Vec3::new(0., 10., 7.5)]).remove(0);assert!(name.contains("side:outer"));run(&mut s, "sketch.create", json!({"plane":{"origin":[0,10,0],"x_dir":[-1,0,0],"y_dir":[0,0,1]},"name":"Badge"}));run(&mut s, "sketch.rectangle.two_point", json!({"p0":[-2,5],"p1":[2,10]}));@@ -189,7 +189,7 @@ fn legacy_v9_annulus_outer_side_emboss_keeps_its_original_heuristic_anchor() {let volume = s.model.state().body("Sleeve").unwrap().body.tessellate_with(1e-4, true).unwrap().measure().volume;assert!((volume - std::f64::consts::PI * 380. - 21.).abs() < 0.2, "volume {volume}");let mut legacy: Value = serde_json::from_str(&s.doc.to_json()).unwrap();- legacy["format"] = json!("solvecraft/9");+ legacy["format"] = json!("solidcraft/9");// What a version 9 design stored for that pick: the centroid-family name of the outer wall// piece holding the point. It keeps finding that piece, as it did when saved.for feature in legacy["features"].as_array_mut().unwrap() {@@ -197,7 +197,7 @@ fn legacy_v9_annulus_outer_side_emboss_keeps_its_original_heuristic_anchor() {feature["face_names"] = json!(["F2:side:inner#4"]);}}- let reopened = Session::new(solvecraft_doc::Document::from_json(&legacy.to_string()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&legacy.to_string()).unwrap());assert!(reopened.model.result(feature_id).unwrap().error.is_none());assert!((reopened.model.state().body("Sleeve").unwrap().body.tessellate_with(1e-4, true).unwrap().measure().volume - volume).abs() < 1e-8);}@@ -218,7 +218,7 @@ fn certified_side_transfer_preserves_geometry_and_unsupported_taper_refuses_atomrun(&mut s, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&s, "Round", 10.), 2);let before = s.world_state().body("Round").unwrap().mesh().bounds();- let mut s = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut s = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());run(&mut s, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&s, "Round", 10.), 2);assert!(@@ -242,8 +242,8 @@ fn certified_side_transfer_preserves_geometry_and_unsupported_taper_refuses_atom#[test]fn certified_import_payload_binding_roundtrip_clone_and_replacement_refusal() {- let geometry = solvecraft_kernel::cylinder(Vec3::ZERO, Vec3::Z, 10., 10.).unwrap();- let step = solvecraft_kernel::step_export(&[&geometry], "certificate fixture").unwrap();+ let geometry = solidcraft_kernel::cylinder(Vec3::ZERO, Vec3::Z, 10., 10.).unwrap();+ let step = solidcraft_kernel::step_export(&[&geometry], "certificate fixture").unwrap();let mut s = Session::default();let part = run(&mut s, "component.create", json!({"name":"ImportedPart"}))["component"].as_u64().unwrap();let source = imported(&mut s, step.clone(), "Imported");@@ -256,7 +256,7 @@ fn certified_import_payload_binding_roundtrip_clone_and_replacement_refusal() {run(&mut s, "component.paste_new", json!({"component":part,"translate":[30,0,0]}));run(&mut s, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&s, "Imported (copy)", 10.), pieces);- let reopened = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();let mut s = Session::new(reopened);run(&mut s, "config.activate", json!({"row":"Painted"}));assert_eq!(painted_radius(&s, "Imported", 10.), pieces);diff --git a/crates/engine/src/cmd/config_style_tests.rs b/crates/engine/src/cmd/config_style_tests.rsindex d81c0591a0..c34b81340f 100644--- a/crates/engine/src/cmd/config_style_tests.rs+++ b/crates/engine/src/cmd/config_style_tests.rs@@ -1,6 +1,6 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_doc::config::{Column, ConfigFaceTarget};+use solidcraft_doc::config::{Column, ConfigFaceTarget};fn run(s: &mut Session, command: &str, params: Value) -> Value {s.execute(command, ¶ms).unwrap_or_else(|error| panic!("{command} {params}: {error}"))}@@ -63,7 +63,7 @@ fn strict_face_rows_resize_rename_preview_suppress_and_roundtrip() {let mb = state.body(&body).unwrap();let colors = s.doc.face_colors(mb);assert_eq!(colors.len(), 1);- let names = solvecraft_doc::naming::face_names(mb);+ let names = solidcraft_doc::naming::face_names(mb);assert!(names[colors[0].0].ends_with(":+z"));assert!(s.doc.appearances.faces[0].strict_name);run(&mut s, "appearance.assign", json!({"faces":[{"body":body,"point":[5,5,20]}]}));@@ -76,7 +76,7 @@ fn strict_face_rows_resize_rename_preview_suppress_and_roundtrip() {let hidden = run(&mut s, "config.activate", json!({"row":"Hidden"}));assert_eq!(hidden["styles"][0]["dormant"], true);assert!(s.model.state().bodies.is_empty());- let reopened = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let reopened = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(reopened, *s.doc);run(&mut s, "config.activate", json!({"row":"Tall"}));assert_eq!(s.doc.face_colors(s.model.state().body("Housing").unwrap())[0].1.name, "ABS - Red");@@ -103,9 +103,9 @@ fn strict_face_split_pieces_share_lineage_without_index_targets() {let state = s.model.state();let body = state.body(&body).unwrap();let colors = s.doc.face_colors(body);- let names = solvecraft_doc::naming::face_names(body);+ let names = solidcraft_doc::naming::face_names(body);assert!(colors.len() >= 2, "split should create multiple painted pieces: {names:?}");- assert!(colors.iter().all(|(index, look)| solvecraft_doc::naming::strip_piece(&names[*index]).ends_with(":+z") && look.name == "ABS - Red"));+ assert!(colors.iter().all(|(index, look)| solidcraft_doc::naming::strip_piece(&names[*index]).ends_with(":+z") && look.name == "ABS - Red"));}#[test]@@ -127,10 +127,10 @@ fn strict_face_missing_lineage_never_retargets_and_rolls_back() {assert_eq!(s.doc, before);assert_eq!(s.revision, revision);assert_eq!(s.undo.len(), history);- let look = solvecraft_doc::appearance::library("ABS - Red").unwrap();- s.doc_mut().appearances.faces.push(solvecraft_doc::appearance::FaceLook {+ let look = solidcraft_doc::appearance::library("ABS - Red").unwrap();+ s.doc_mut().appearances.faces.push(solidcraft_doc::appearance::FaceLook {body: body.clone(),- point: solvecraft_geom::Vec3::new(5., 5., 10.),+ point: solidcraft_geom::Vec3::new(5., 5., 10.),name: Some(format!("F{other}:+z")),strict_name: true,certificate: None,@@ -150,11 +150,11 @@ fn face_occurrence_pick_uses_definition_identity_and_coordinates() {let world = s.world_state();let placed = world.bodies.iter().find(|body| body.name != body.definition_name()).unwrap();let placed_name = placed.name.clone();- let point = solvecraft_doc::apply_point(&placed.source_transform, solvecraft_geom::Vec3::new(5., 5., 10.));+ let point = solidcraft_doc::apply_point(&placed.source_transform, solidcraft_geom::Vec3::new(5., 5., 10.));let key = face_column(&mut s, &placed_name, json!(point));let Column::FaceAppearance(target) = &s.doc.configs.columns[0] else { panic!() };assert_eq!(target.body, body);- assert!(target.point.dist(solvecraft_geom::Vec3::new(5., 5., 10.)) < 1e-8);+ assert!(target.point.dist(solidcraft_geom::Vec3::new(5., 5., 10.)) < 1e-8);run(&mut s, "config.row", json!({"name":"Paint","values":{key:"ABS - Blue"}}));run(&mut s, "config.activate", json!({"row":"Paint"}));assert!(s.world_state().bodies.iter().all(|body| s.doc.face_colors(body).len() == 1));@@ -171,10 +171,10 @@ fn extrude_cap_certification_follows_actual_positive_negative_and_symmetric_namelet state = s.model.state();let body = state.body("Pad").unwrap();let faces = body.body.faces(0.01).unwrap();- let names = solvecraft_doc::naming::face_names(body);+ let names = solidcraft_doc::naming::face_names(body);let mut caps = 0;for face in faces {- let name = solvecraft_doc::naming::strip_piece(&names[face.index]);+ let name = solidcraft_doc::naming::strip_piece(&names[face.index]);let origin = name.strip_prefix('F').unwrap().split_once(':').unwrap().0.parse().unwrap();let target = ConfigFaceTarget { body: "Pad".into(), origin_feature: origin, name: name.into(), point: face.centroid, certificate: None };if name.ends_with(":start") || name.ends_with(":top") || name.ends_with(":bottom") {@@ -216,7 +216,7 @@ fn hostile_and_uncertified_face_targets_are_rejected() {body: body.clone(),origin_feature: id,name: format!("F{id}:face:0"),- point: solvecraft_geom::Vec3::ZERO,+ point: solidcraft_geom::Vec3::ZERO,certificate: None,};assert!(s.doc.certify_config_face(&target).is_err());@@ -225,7 +225,7 @@ fn hostile_and_uncertified_face_targets_are_rejected() {json!({"body":body,"origin_feature":id,"name":format!("F{id}:+z"),"point":[0,0,1e20]}),json!({"body":body,"origin_feature":id,"name":format!("F{id}:+z"),"point":[0,0,0],"extra":[[]]}),] {- assert!(solvecraft_doc::config::validate_styles_json(&json!({"configs":{"columns":[{"face_appearance":value}]}})).is_err());+ assert!(solidcraft_doc::config::validate_styles_json(&json!({"configs":{"columns":[{"face_appearance":value}]}})).is_err());}assert!(s.execute("config.column", &json!({"component_appearance":0})).is_err());assert!(s.execute("config.column", &json!({"face_appearance":{"body":body,"point":[0,0,1e20]}})).is_err());diff --git a/crates/engine/src/cmd/construct.rs b/crates/engine/src/cmd/construct.rsindex e1787bbf19..38e4103e9b 100644--- a/crates/engine/src/cmd/construct.rs+++ b/crates/engine/src/cmd/construct.rs@@ -7,8 +7,8 @@//! persistent names.use serde_json::Value;-use solvecraft_doc::construct::{AxisDef, GeoRef, PointDef};-use solvecraft_doc::{FeatureKind, PlaneRef};+use solidcraft_doc::construct::{AxisDef, GeoRef, PointDef};+use solidcraft_doc::{FeatureKind, PlaneRef};use super::CommandSpec;use super::features::{add_feature, check_expr, plane_param, sketch_id};@@ -137,7 +137,7 @@ fn geo(s: &Session, v: Option<&Value>, cmd: &str, what: &str) -> Result<GeoRef>fn t_param(s: &Session, p: &Value, cmd: &str) -> Result<String> {let t = if p.get("t").is_some() { req_expr(cmd, p, "t")? } else { "0.5".to_string() };- check_expr(s, &t, solvecraft_doc::expr::Kind::Unitless, cmd, "t")?;+ check_expr(s, &t, solidcraft_doc::expr::Kind::Unitless, cmd, "t")?;Ok(t)}diff --git a/crates/engine/src/cmd/contact_sweep.rs b/crates/engine/src/cmd/contact_sweep.rsindex 219551816b..b1875e22a6 100644--- a/crates/engine/src/cmd/contact_sweep.rs+++ b/crates/engine/src/cmd/contact_sweep.rs@@ -3,9 +3,9 @@use std::collections::{BTreeSet, HashMap};use std::sync::Arc;-use solvecraft_doc::joints;-use solvecraft_doc::{IDENTITY, Mat, apply_point, mat_mul};-use solvecraft_geom::{Aabb3, Mesh, Vec3};+use solidcraft_doc::joints;+use solidcraft_doc::{IDENTITY, Mat, apply_point, mat_mul};+use solidcraft_geom::{Aabb3, Mesh, Vec3};use crate::params::bad;use crate::{Result, Session};diff --git a/crates/engine/src/cmd/contact_sweep_tests.rs b/crates/engine/src/cmd/contact_sweep_tests.rsindex 6e7b6bafde..096731b466 100644--- a/crates/engine/src/cmd/contact_sweep_tests.rs+++ b/crates/engine/src/cmd/contact_sweep_tests.rs@@ -1,6 +1,6 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;fn run(s: &mut Session, command: &str, p: Value) -> Value {s.execute(command, &p).unwrap()@@ -57,7 +57,7 @@ fn revolute_cannot_cross_a_blocker_between_clear_endpoints() {assert!(result["stopped_by_contact"].is_object(), "{result}");let angle = s.doc.assembly.joints.iter().find(|j| j.name == "Pivot").unwrap().values[0];assert!(angle > 60_f64.to_radians() && angle < 90_f64.to_radians(), "angle={angle}");- let arm = solvecraft_doc::apply_point(&solvecraft_doc::joints::occurrence_world(&s.doc, occurrence(&s, "Arm")), Vec3::new(22.0, 0.0, 0.0));+ let arm = solidcraft_doc::apply_point(&solidcraft_doc::joints::occurrence_world(&s.doc, occurrence(&s, "Arm")), Vec3::new(22.0, 0.0, 0.0));assert!(arm.y > 20.0 && arm.x > 2.0, "{arm:?}");}@@ -105,7 +105,7 @@ fn over_budget_sweep_errors_and_restores_document() {#[test]fn thin_tilted_plates_cannot_cross_between_axis_bound_samples() {let mut s = Session::default();- let normal = solvecraft_doc::apply_vector(&solvecraft_doc::rigid(Vec3::ZERO, Vec3::ZERO, Vec3::new(1.0, 1.0, 0.0), 55_f64.to_radians()), Vec3::Z);+ let normal = solidcraft_doc::apply_vector(&solidcraft_doc::rigid(Vec3::ZERO, Vec3::ZERO, Vec3::new(1.0, 1.0, 0.0), 55_f64.to_radians()), Vec3::Z);for name in ["Plate A", "Plate B"] {run(&mut s, "component.activate", json!({"component": 0}));run(&mut s, "component.create", json!({"name": name}));diff --git a/crates/engine/src/cmd/delete.rs b/crates/engine/src/cmd/delete.rsindex 5699c20dbe..9a3bc89b75 100644--- a/crates/engine/src/cmd/delete.rs+++ b/crates/engine/src/cmd/delete.rs@@ -5,8 +5,8 @@//! changing anything, so the UI can ask first.use serde_json::{Value, json};-use solvecraft_doc::FeatureKind;-use solvecraft_geom::Vec3;+use solidcraft_doc::FeatureKind;+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, bool_};diff --git a/crates/engine/src/cmd/diagnostics.rs b/crates/engine/src/cmd/diagnostics.rsindex b8423d252f..716b3bd8d3 100644--- a/crates/engine/src/cmd/diagnostics.rs+++ b/crates/engine/src/cmd/diagnostics.rs@@ -24,7 +24,7 @@ pub static COMMANDS: &[CommandSpec] = &[CommandSpec::new("diagnostics.crash_test", "Crash Test", crash_test).noundo().enabled(crash_test_enabled).params("mode: panic | kernel | abort. Checks that crash reports work: panic = an internal error in this command (caught; \the design is unchanged), kernel = one inside the geometry kernel (caught), abort = the app ends at once (reported \- at the next start). Only when the SOLVECRAFT_CRASH_TEST environment variable is set",+ at the next start). Only when the SOLIDCRAFT_CRASH_TEST environment variable is set",),];@@ -52,18 +52,18 @@ fn clear(_: &mut Session, p: &Value) -> Result<Value> {}fn crash_test_enabled(_: &Session) -> std::result::Result<(), String> {- if std::env::var_os("SOLVECRAFT_CRASH_TEST").is_some() { Ok(()) } else { Err("set SOLVECRAFT_CRASH_TEST to use the crash test".into()) }+ if solidcraft_geom::env::var_os("CRASH_TEST").is_some() { Ok(()) } else { Err("set SOLIDCRAFT_CRASH_TEST to use the crash test".into()) }}// The one deliberate panic: it proves the crash reports work, and runs only when asked for with-// SOLVECRAFT_CRASH_TEST.+// SOLIDCRAFT_CRASH_TEST.#[allow(clippy::panic)]fn crash_test(_: &mut Session, p: &Value) -> Result<Value> {let cmd = "diagnostics.crash_test";match str_(p, "mode") {Some("panic") => std::panic::panic_any(String::from("crash test: an internal error in a command")),Some("kernel") => {- solvecraft_kernel::guard("crash test", || -> solvecraft_kernel::Result<()> {+ solidcraft_kernel::guard("crash test", || -> solidcraft_kernel::Result<()> {std::panic::panic_any(String::from("an internal error in the kernel"))})?;Err(EngineError::Other("crash test: the kernel error was not caught".into()))diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rsindex b4072325a1..a8636c4e0f 100644--- a/crates/engine/src/cmd/edit.rs+++ b/crates/engine/src/cmd/edit.rs@@ -1,7 +1,7 @@//! Undo/redo, the timeline, deletion and selection.use serde_json::{Value, json};-use solvecraft_doc::{Feature, FeatureKind};+use solidcraft_doc::{Feature, FeatureKind};use super::CommandSpec;use crate::params::{bad, bool_, num, str_, string_list};@@ -96,7 +96,7 @@ fn restore_checkpoint(s: &mut Session, p: &Value) -> Result<Value> {}fn compute_all(s: &mut Session, _p: &Value) -> Result<Value> {- s.model = solvecraft_doc::Model::new();+ s.model = solidcraft_doc::Model::new();s.refresh();let errors = s.model.results.iter().filter(|r| r.error.is_some()).count();Ok(json!({"features": s.model.results.len(), "errors": errors}))@@ -303,7 +303,7 @@ fn edit_feature(s: &mut Session, p: &Value) -> Result<Value> {return Err(bad(cmd, "the feature type cannot change"));}if let FeatureKind::BodyTransfer { bodies, from, to, transform } = &nf.kind {- solvecraft_doc::validate_body_transfer(&s.doc, bodies, *from, *to, transform)?;+ solidcraft_doc::validate_body_transfer(&s.doc, bodies, *from, *to, transform)?;nf.component = *to;}if let (FeatureKind::Sketch { sketch: a, .. }, FeatureKind::Sketch { sketch: b, .. }) = (&nf.kind, &f.kind)@@ -319,8 +319,8 @@ fn edit_feature(s: &mut Session, p: &Value) -> Result<Value> {&& a != b{let before = s.model.state_before(id);- nf.edge_refs = solvecraft_doc::edge_refs(&before, body, a);- nf.edge_names = solvecraft_doc::edge_names_for(&before, body, a);+ nf.edge_refs = solidcraft_doc::edge_refs(&before, body, a);+ nf.edge_names = solidcraft_doc::edge_names_for(&before, body, a);}// Profiles picked by index or point are kept by their curves, as when the feature was made.if nf.kind.clone().profile_sels_mut() != f.kind.clone().profile_sels_mut() {@@ -328,7 +328,7 @@ fn edit_feature(s: &mut Session, p: &Value) -> Result<Value> {}// New face points: their faces' names now.if nf.kind.face_points() != f.kind.face_points() {- nf.face_names = solvecraft_doc::naming::face_names_at(&s.model.state_before(id), &nf.kind.face_points());+ nf.face_names = solidcraft_doc::naming::face_names_at(&s.model.state_before(id), &nf.kind.face_points());}if let Some(slot) = s.doc_mut().feature_mut(id) {*slot = nf;@@ -372,7 +372,7 @@ fn select_clear(s: &mut Session, _p: &Value) -> Result<Value> {}/// Features that worked in `before` and fail in `after`: (name, error).-fn newly_broken(before: &solvecraft_doc::Model, after: &solvecraft_doc::Model) -> Vec<(String, String)> {+fn newly_broken(before: &solidcraft_doc::Model, after: &solidcraft_doc::Model) -> Vec<(String, String)> {after.results.iter()@@ -398,7 +398,7 @@ fn reorder(s: &mut Session, p: &Value) -> Result<Value> {let name = f.name.clone();next.features.insert(to, f);// Everything that evaluated before must still evaluate.- let mut after = solvecraft_doc::Model::new();+ let mut after = solidcraft_doc::Model::new();after.evaluate(&next);let broken = newly_broken(&s.model, &after);if !broken.is_empty() {@@ -409,13 +409,13 @@ fn reorder(s: &mut Session, p: &Value) -> Result<Value> {Ok(json!({"feature": id, "position": to}))}-fn input_keys(kind: &FeatureKind) -> Vec<(String, solvecraft_doc::expr::Kind)> {+fn input_keys(kind: &FeatureKind) -> Vec<(String, solidcraft_doc::expr::Kind)> {let mut keys: Vec<_> = kind.inputs().into_iter().map(|(label, _, unit)| (label.to_string(), unit)).collect();if let FeatureKind::Fillet { style, .. } = kind {if let Some((key, _)) = keys.first_mut() {*key = "fillet.radius".into();}- if let solvecraft_doc::FilletStyle::Variable { mid, .. } = style {+ if let solidcraft_doc::FilletStyle::Variable { mid, .. } = style {for ((key, _), (position, _)) in keys.iter_mut().skip(2).zip(mid) {*key = format!("fillet.mid.{}", position.to_bits());}@@ -583,7 +583,7 @@ fn dependents(s: &mut Session, p: &Value) -> Result<Value> {let id = feature_id(s, p.get("feature"), cmd)?;let mut next = (*s.doc).clone();let gone = next.delete_feature(id)?;- let mut after = solvecraft_doc::Model::new();+ let mut after = solidcraft_doc::Model::new();after.evaluate(&next);let names = |ids: &[u64]| -> Vec<String> { ids.iter().filter(|x| **x != id).filter_map(|x| s.doc.feature(*x).map(|f| f.name.clone())).collect() };let broken: Vec<String> = newly_broken(&s.model, &after).into_iter().map(|(n, _)| n).collect();diff --git a/crates/engine/src/cmd/edit_tests.rs b/crates/engine/src/cmd/edit_tests.rsindex 1d1dd86e28..65d866cba0 100644--- a/crates/engine/src/cmd/edit_tests.rs+++ b/crates/engine/src/cmd/edit_tests.rs@@ -135,7 +135,7 @@ fn redefine_rejects_sheet_exports_before_they_touch_any_files() {run(&mut s, "sketch.finish", json!({}));run(&mut s, "sheet.flange", json!({"name": "Plate"}));let doc = s.doc.clone();- let base = std::env::temp_dir().join(format!("solvecraft-redefine-export-{}", std::process::id()));+ let base = std::env::temp_dir().join(format!("solidcraft-redefine-export-{}", std::process::id()));std::fs::create_dir_all(&base).unwrap();for command in ["sheet.export_dxf", "sheet.export_bend_table"] {for existing in [false, true] {@@ -182,9 +182,9 @@ fn redefine_keeps_allocator_above_component_and_occurrence_ids() {assert_eq!(s.doc.find_feature("Join").unwrap().id, original_feature);let combine_index = s.doc.feature_index(original_feature).unwrap();assert!(- matches!(&s.doc.features[combine_index + 1].kind, solvecraft_doc::FeatureKind::BodyTransfer { bodies, to, .. } if bodies == &["Base"] && *to == destination)+ matches!(&s.doc.features[combine_index + 1].kind, solidcraft_doc::FeatureKind::BodyTransfer { bodies, to, .. } if bodies == &["Base"] && *to == destination));- assert!((solvecraft_kernel::measure(&s.world_state().body("Base").unwrap().body).unwrap().volume - 6000.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&s.world_state().body("Base").unwrap().body).unwrap().volume - 6000.0).abs() < 1e-6);assert_eq!(s.world_state().bodies.len(), 1);run(&mut s, "timeline.rollback", json!({"position":combine_index + 1}));assert_eq!(s.world_state().body("Base").unwrap().component, 0, "the result transfers only AFTER Combine");@@ -192,9 +192,9 @@ fn redefine_keeps_allocator_above_component_and_occurrence_ids() {run(&mut s, "edit.undo", json!({}));assert_eq!(*s.doc, *original);run(&mut s, "edit.redo", json!({}));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert_eq!(reopened.world_state().body("Base").unwrap().component, destination);- assert!((solvecraft_kernel::measure(&reopened.world_state().body("Base").unwrap().body).unwrap().volume - 6000.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&reopened.world_state().body("Base").unwrap().body).unwrap().volume - 6000.0).abs() < 1e-6);let max_id =s.doc.components.iter().map(|c| c.id).chain(s.doc.occurrences.iter().map(|o| o.id)).chain(s.doc.features.iter().map(|f| f.id)).max().unwrap();assert!(s.doc.next_id > max_id);@@ -215,7 +215,7 @@ fn redefine_cannot_publish_a_second_transfer_that_breaks_existing_ownership() {let full = s.doc.to_json();let join_index = s.doc.features.iter().position(|feature| feature.name == "Join").unwrap();for marker in [None, Some(join_index), Some(join_index + 1)] {- let mut s = Session::new(solvecraft_doc::Document::from_json(&full).unwrap());+ let mut s = Session::new(solidcraft_doc::Document::from_json(&full).unwrap());s.doc_mut().marker = marker;s.refresh();let before = s.doc.to_json();@@ -225,7 +225,7 @@ fn redefine_cannot_publish_a_second_transfer_that_breaks_existing_ownership() {assert_eq!(s.doc.to_json(), before);assert_eq!(s.pending_moves, pending);}- let reopened = Session::new(solvecraft_doc::Document::from_json(&full).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&full).unwrap());assert_eq!(reopened.world_state().body("Base").unwrap().component, reopened.doc.find_component("Original").unwrap());assert!(reopened.doc.features.iter().all(|feature| reopened.model.result(feature.id).is_some_and(|result| result.error.is_none())));}diff --git a/crates/engine/src/cmd/face.rs b/crates/engine/src/cmd/face.rsindex ca66bb4946..59af605ac0 100644--- a/crates/engine/src/cmd/face.rs+++ b/crates/engine/src/cmd/face.rs@@ -3,8 +3,8 @@//! edges become lines, circular edges circles or arcs, anything else a chain of lines.use serde_json::{Value, json};-use solvecraft_doc::{EmbossFace, apply_point, mat_inverse, mat_mul};-use solvecraft_geom::{Mesh, Vec2, Vec3};+use solidcraft_doc::{EmbossFace, apply_point, mat_inverse, mat_mul};+use solidcraft_geom::{Mesh, Vec2, Vec3};use crate::params::bad;use crate::{Result, Session};diff --git a/crates/engine/src/cmd/face_tests.rs b/crates/engine/src/cmd/face_tests.rsindex b2defefda8..f58ea97190 100644--- a/crates/engine/src/cmd/face_tests.rs+++ b/crates/engine/src/cmd/face_tests.rs@@ -1,8 +1,8 @@#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]use crate::Session;use serde_json::{Value, json};-use solvecraft_doc::{Document, FeatureKind, PlaneRef};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Document, FeatureKind, PlaneRef};+use solidcraft_geom::Vec3;use std::f64::consts::PI;fn run(s: &mut Session, command: &str, params: Value) -> Value {@@ -12,7 +12,7 @@ fn check(s: &mut Session, want: f64, hole: bool, height: f64) {s.refresh();assert!(s.model.results.iter().all(|result| result.error.is_none() && result.warning.is_none()), "{:?}", s.model.results);let state = s.model.state();- let got: f64 = state.bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum();+ let got: f64 = state.bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).sum();// Legacy linked outlines fit tessellated curves; enforce the existing 1e-4 material envelope.assert!((got - want).abs() < want * 1e-4, "{got} vs {want}");assert!(state.bodies.iter().any(|b| b.body.contains(Vec3::new(5.0, 5.0, height - 1.0))));@@ -39,7 +39,7 @@ fn generated_face_profiles_keep_exact_links_live_after_edit_and_reopen() {let FeatureKind::Sketch { plane, sketch: profile } = &generated.kind else { panic!("sketch") };let PlaneRef::Face { anchor: Some(anchor), .. } = plane else { panic!("the original Box cap remains exact after a hole cut") };assert_eq!(anchor.target.origin_feature, base);- assert!(matches!(anchor.target.certificate, Some(solvecraft_doc::config::FaceCertificate::Box { axis: 2, high: true })));+ assert!(matches!(anchor.target.certificate, Some(solidcraft_doc::config::FaceCertificate::Box { axis: 2, high: true })));assert!(!profile.links.is_empty());assert!(profile.links.iter().all(|link| link.auto_face && !link.lost));let area = 1200.0 - if hole { 25.0 * PI } else { 0.0 };@@ -54,12 +54,12 @@ fn generated_face_profiles_keep_exact_links_live_after_edit_and_reopen() {let solved = edited.sketch(sketch).unwrap().plane;assert!((solved.origin.z - 25.0).abs() < 1e-6);let before = s.model.state();- let before_volume: f64 = before.bodies.iter().map(|body| solvecraft_kernel::measure(&body.body).unwrap().volume).sum();+ let before_volume: f64 = before.bodies.iter().map(|body| solidcraft_kernel::measure(&body.body).unwrap().volume).sum();let before_bounds: Vec<_> = before.bodies.iter().map(|body| (body.name.clone(), body.mesh().bounds())).collect();let mut reopened = Session::new(Document::from_json(&s.doc.to_json()).unwrap());check(&mut reopened, area * 35.0, hole, 35.0);let after = reopened.model.state();- let after_volume: f64 = after.bodies.iter().map(|body| solvecraft_kernel::measure(&body.body).unwrap().volume).sum();+ let after_volume: f64 = after.bodies.iter().map(|body| solidcraft_kernel::measure(&body.body).unwrap().volume).sum();assert!((before_volume - after_volume).abs() < 1e-6);for (name, bounds) in before_bounds {let cold = after.body(&name).unwrap().mesh().bounds();@@ -121,12 +121,12 @@ fn generated_profiles_and_press_pull_convert_rotated_occurrence_picks_once() {if hole {assert!(!world.bodies.iter().any(|body| body.body.contains(Vec3::new(50.0, 21.0 - height, 25.0))));}- let before_volume: f64 = world.bodies.iter().map(|body| solvecraft_kernel::measure(&body.body).unwrap().volume).sum();+ let before_volume: f64 = world.bodies.iter().map(|body| solidcraft_kernel::measure(&body.body).unwrap().volume).sum();let before_bounds: Vec<_> = world.bodies.iter().map(|body| (body.name.clone(), body.mesh().bounds())).collect();let reopened = Session::new(Document::from_json(&s.doc.to_json()).unwrap());let after = reopened.world_state();assert!(after.bodies.iter().any(|body| body.body.contains(occupied)));- let v: f64 = after.bodies.iter().map(|body| solvecraft_kernel::measure(&body.body).unwrap().volume).sum();+ let v: f64 = after.bodies.iter().map(|body| solidcraft_kernel::measure(&body.body).unwrap().volume).sum();assert!((v - area * height).abs() < area * height * 1e-4);assert!((v - before_volume).abs() < 1e-6);for (name, bounds) in before_bounds {diff --git a/crates/engine/src/cmd/features.rs b/crates/engine/src/cmd/features.rsindex 666e0e46b4..df8c67da34 100644--- a/crates/engine/src/cmd/features.rs+++ b/crates/engine/src/cmd/features.rs@@ -1,8 +1,8 @@//! Solid feature commands: extrude, revolve, fillet, chamfer, primitives, combine, move.use serde_json::{Value, json};-use solvecraft_doc::{AxisRef, Direction, Extent, FeatureKind, Operation, PointExpr, ProfileSel, expr::Kind, point_expr};-use solvecraft_geom::Vec3;+use solidcraft_doc::{AxisRef, Direction, Extent, FeatureKind, Operation, PointExpr, ProfileSel, expr::Kind, point_expr};+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, bool_, expr, req_expr, str_, string_list, vec2, vec3};@@ -125,7 +125,7 @@ fn extrude_base(s: &Session, p: &Value) -> Option<(Vec3, Vec3)> {ProfileSel::Indices { indices } => ps.get(*indices.first()?)?.region.interior_point(),ProfileSel::Points { points } => *points.first()?,selection @ (ProfileSel::Curves { .. } | ProfileSel::OffsetBoundaries { .. } | ProfileSel::WholeBoundaries { .. }) => {- let indices = solvecraft_doc::profile_selection_indices(ss, &selection).ok()?;+ let indices = solidcraft_doc::profile_selection_indices(ss, &selection).ok()?;ps.get(*indices.first()?)?.region.interior_point()}};@@ -210,12 +210,12 @@ pub(super) fn feature_sketch(s: &Session, p: &Value, cmd: &str) -> Result<u64> {/// curves) stays as given. Curve picks are checked: one that names no profile, or several, is/// refused now rather than failing later.pub(super) fn stable_profiles(s: &Session, kind: &mut FeatureKind) -> Result<()> {- use solvecraft_doc::sketch::profile_at_point;+ use solidcraft_doc::sketch::profile_at_point;let st = s.model.state();for (sketch, sel) in kind.profile_sels_mut() {let Some(ss) = st.sketch(sketch) else { continue };let indices = match sel {- ProfileSel::Indices { .. } => solvecraft_doc::profile_selection_indices(ss, sel)?,+ ProfileSel::Indices { .. } => solidcraft_doc::profile_selection_indices(ss, sel)?,ProfileSel::Points { points } => {let Some(indices) = points.iter().map(|point| profile_at_point(&ss.profiles, *point)).collect::<Option<Vec<_>>>() else { continue };indices@@ -240,19 +240,19 @@ pub(super) fn stable_profiles(s: &Session, kind: &mut FeatureKind) -> Result<()>}}let selection = ProfileSel::Curves { loops: normalized };- solvecraft_doc::profile_selection_indices(ss, &selection)?;+ solidcraft_doc::profile_selection_indices(ss, &selection)?;*sel = selection;continue;}ProfileSel::OffsetBoundaries { .. } | ProfileSel::WholeBoundaries { .. } => {// Explicit identities retain the caller's semantics. Validate through the// same resolver as recomputation, including reserved-role precedence.- solvecraft_doc::profile_selection_indices(ss, sel)?;+ solidcraft_doc::profile_selection_indices(ss, sel)?;continue;}ProfileSel::All => continue,};- let captured = solvecraft_doc::capture_profile_selection(ss, &indices)?;+ let captured = solidcraft_doc::capture_profile_selection(ss, &indices)?;*sel = match captured {ProfileSel::OffsetBoundaries { associations }if associations.iter().any(|id| {@@ -288,7 +288,7 @@ pub(super) fn profiles(p: &Value, cmd: &str) -> Result<ProfileSel> {match v {Value::Object(fields) => {if fields.get("type").and_then(Value::as_str) == Some("whole_boundaries") {- return solvecraft_doc::whole_profile_selection_from_value(v).map_err(|error| bad(cmd, error.to_string()));+ return solidcraft_doc::whole_profile_selection_from_value(v).map_err(|error| bad(cmd, error.to_string()));}let associations = fields.get("offset_boundaries")@@ -384,11 +384,11 @@ fn add_feature_in(s: &mut Session, p: &Value, kind: FeatureKind, world: bool) ->let (refs, names) = match &kind {FeatureKind::Fillet { edges, body, .. } | FeatureKind::Chamfer { edges, body, .. } => {let st = s.model.state();- (solvecraft_doc::edge_refs(&st, body, edges), solvecraft_doc::edge_names_for(&st, body, edges))+ (solidcraft_doc::edge_refs(&st, body, edges), solidcraft_doc::edge_names_for(&st, body, edges))}// Sheet metal edges are named by the sheet model.FeatureKind::SheetFlange { edges, .. } | FeatureKind::SheetHem { edges, .. } => {- (Vec::new(), solvecraft_doc::sheet::sheet_edge_names(&s.model.state(), edges))+ (Vec::new(), solidcraft_doc::sheet::sheet_edge_names(&s.model.state(), edges))}_ => (Vec::new(), Vec::new()),};@@ -398,11 +398,11 @@ fn add_feature_in(s: &mut Session, p: &Value, kind: FeatureKind, world: bool) ->let state = s.model.state();let body = state.body(&face.body).ok_or_else(|| EngineError::Other("selected cylinder body no longer exists".into()))?;let frame = face.body_frame(&s.doc, body).map_err(|e| EngineError::Other(e.to_string()))?;- let inverse = solvecraft_doc::mat_inverse(&frame).ok_or_else(|| EngineError::Other("invalid cylinder placement".into()))?;- let at = solvecraft_doc::apply_point(&solvecraft_doc::mat_mul(&inverse, &s.active_component_frame()), face.at);- let mut scoped = solvecraft_doc::ModelState::default();+ let inverse = solidcraft_doc::mat_inverse(&frame).ok_or_else(|| EngineError::Other("invalid cylinder placement".into()))?;+ let at = solidcraft_doc::apply_point(&solidcraft_doc::mat_mul(&inverse, &s.active_component_frame()), face.at);+ let mut scoped = solidcraft_doc::ModelState::default();scoped.bodies.push(body.clone());- let names = solvecraft_doc::naming::face_names_at(&scoped, &[at]);+ let names = solidcraft_doc::naming::face_names_at(&scoped, &[at]);if names.len() != 1 || names.first().is_none_or(|name| name.is_empty()) {return Err(EngineError::Other("selected cylinder face has no persistent identity".into()));}@@ -410,7 +410,7 @@ fn add_feature_in(s: &mut Session, p: &Value, kind: FeatureKind, world: bool) ->} else if pts.is_empty() {Vec::new()} else {- solvecraft_doc::naming::face_names_at(&s.model.state(), &pts)+ solidcraft_doc::naming::face_names_at(&s.model.state(), &pts)}};// Primitives have no `targets` of their own: their `targets` are the bodies taking part (#259).@@ -578,7 +578,7 @@ fn revolve(s: &mut Session, p: &Value) -> Result<Value> {let symmetric =matches!(str_(p, "direction").map(str::to_ascii_lowercase).as_deref(), Some("symmetric")) || bool_(p, "symmetric").unwrap_or(false);let convention = match p.get("convention") {- None => solvecraft_doc::RevolveConvention::SketchNormal,+ None => solidcraft_doc::RevolveConvention::SketchNormal,Some(value) => serde_json::from_value(value.clone()).map_err(|_| bad(cmd, "`convention` must be sketch_normal or legacy_axis_start"))?,};let kind = FeatureKind::Revolve {@@ -729,7 +729,7 @@ fn press_pull(s: &mut Session, p: &Value) -> Result<Value> {if let Some(fp) = vec3(face)&& super::face::face_is_planar(s, fp) == Some(false){- let name = solvecraft_doc::naming::face_names_at(&s.model.state(), &[fp]).into_iter().next().unwrap_or_default();+ let name = solidcraft_doc::naming::face_names_at(&s.model.state(), &[fp]).into_iter().next().unwrap_or_default();let fid = name.strip_prefix('F').and_then(|r| r.split(':').next()).and_then(|x| x.parse::<u64>().ok());if name.contains(":blend") {let f = fid.and_then(|id| s.doc.feature(id)).cloned().ok_or_else(|| bad(cmd, "the blend's feature is gone"))?;@@ -757,8 +757,8 @@ fn fillet(s: &mut Session, p: &Value) -> Result<Value> {let radius = req_expr(cmd, p, "radius")?;check_expr(s, &radius, Kind::Length, cmd, "radius")?;let style = match str_(p, "type").map(str::to_ascii_lowercase).as_deref() {- None | Some("constant") | Some("rolling_ball") => solvecraft_doc::FilletStyle::Constant,- Some("chord") | Some("chord_length") => solvecraft_doc::FilletStyle::Chord,+ None | Some("constant") | Some("rolling_ball") => solidcraft_doc::FilletStyle::Constant,+ Some("chord") | Some("chord_length") => solidcraft_doc::FilletStyle::Chord,Some("variable") => {let radius2 = req_expr(cmd, p, "radius2")?;check_expr(s, &radius2, Kind::Length, cmd, "radius2")?;@@ -781,13 +781,13 @@ fn fillet(s: &mut Session, p: &Value) -> Result<Value> {mid.push((t, r));}let smooth = p.get("smooth").and_then(Value::as_bool).unwrap_or(false);- solvecraft_doc::FilletStyle::Variable { radius2, start, mid, smooth }+ solidcraft_doc::FilletStyle::Variable { radius2, start, mid, smooth }}Some(o) => return Err(bad(cmd, format!("unknown fillet type `{o}` (constant, chord or variable)"))),};let fit = match str_(p, "fit").map(str::to_ascii_lowercase).as_deref() {- None | Some("exact") => solvecraft_doc::FilletFit::Exact,- Some("reduce") => solvecraft_doc::FilletFit::Reduce,+ None | Some("exact") => solidcraft_doc::FilletFit::Exact,+ Some("reduce") => solidcraft_doc::FilletFit::Reduce,Some(o) => return Err(bad(cmd, format!("unknown fit `{o}` (exact or reduce)"))),};let mut out = add_feature(s, p, FeatureKind::Fillet { edges, radius, body: str_(p, "body").map(str::to_string), style, fit })?;@@ -909,19 +909,19 @@ fn axis_line(p: &Value, cmd: &str) -> Result<(Vec3, Vec3)> {}/// A pattern feature, or for `components`, new occurrences of them at each placement.-fn finish_pattern(s: &mut Session, p: &Value, features: Vec<String>, pattern: solvecraft_doc::PatternKind, bodies: Vec<String>) -> Result<Value> {+fn finish_pattern(s: &mut Session, p: &Value, features: Vec<String>, pattern: solidcraft_doc::PatternKind, bodies: Vec<String>) -> Result<Value> {let comps = string_list(p, "components");if comps.is_empty() {return add_feature(s, p, FeatureKind::Pattern { features, pattern, bodies });}let cmd = "pattern (components)";- let mats = solvecraft_doc::pattern_matrices(&s.doc, &s.model.state(), &pattern)?;+ let mats = solidcraft_doc::pattern_matrices(&s.doc, &s.model.state(), &pattern)?;let mut made = Vec::new();for c in &comps {let id = s.doc.find_component(c).filter(|id| *id != 0).ok_or_else(|| bad(cmd, format!("no component `{c}`")))?;let src = s.doc.occurrence_of(id).cloned().ok_or_else(|| bad(cmd, format!("component `{c}` has no occurrence")))?;for m in &mats {- made.push(s.doc_mut().add_occurrence(id, src.parent, solvecraft_doc::mat_mul(m, &src.transform))?);+ made.push(s.doc_mut().add_occurrence(id, src.parent, solidcraft_doc::mat_mul(m, &src.transform))?);}}Ok(json!({"occurrences": made}))@@ -960,7 +960,7 @@ fn pattern_rect(s: &mut Session, p: &Value) -> Result<Value> {if let Some(c) = &spacing2 {check_expr(s, c, Kind::Length, cmd, "spacing2")?;}- let pattern = solvecraft_doc::PatternKind::Rectangular { dir1, count1, spacing1, dir2, count2, spacing2 };+ let pattern = solidcraft_doc::PatternKind::Rectangular { dir1, count1, spacing1, dir2, count2, spacing2 };finish_pattern(s, p, features, pattern, bodies)}@@ -972,7 +972,7 @@ fn pattern_circ(s: &mut Session, p: &Value) -> Result<Value> {check_expr(s, &count, Kind::Unitless, cmd, "count")?;let angle = expr(p, "angle").unwrap_or_else(|| "360 deg".into());check_expr(s, &angle, Kind::Angle, cmd, "angle")?;- let pattern = solvecraft_doc::PatternKind::Circular { origin, axis, count, angle };+ let pattern = solidcraft_doc::PatternKind::Circular { origin, axis, count, angle };finish_pattern(s, p, features, pattern, bodies)}@@ -998,7 +998,7 @@ fn pattern_path(s: &mut Session, p: &Value) -> Result<Value> {Some(o) => return Err(bad(cmd, format!("unknown orientation `{o}` (identical or path)"))),};let flip = bool_(p, "flip").unwrap_or(false);- let pattern = solvecraft_doc::PatternKind::Path { path_sketch, path, count, spacing, extent, flip, orient };+ let pattern = solidcraft_doc::PatternKind::Path { path_sketch, path, count, spacing, extent, flip, orient };finish_pattern(s, p, features, pattern, bodies)}@@ -1027,7 +1027,7 @@ pub(super) fn origin_plane_alias(name: &str) -> Option<&'static str> {/// A construction plane may not take an origin plane's name (`XY`, `Top`...): a plane/// parameter could then mean either.pub(super) fn check_plane_name(name: &str, cmd: &str) -> Result<()> {- if solvecraft_geom::Plane::named(name.trim()).is_some() {+ if solidcraft_geom::Plane::named(name.trim()).is_some() {return Err(bad(cmd,format!("`{}` is reserved for an origin plane (XY, XZ, YZ, Top, Front, Right); give the construction plane another name", name.trim()),@@ -1040,8 +1040,8 @@ pub(super) fn check_plane_name(name: &str, cmd: &str) -> Result<()> {/// feature id; kept by name, so the feature follows the plane when it changes), or an/// explicit plane `{origin, x_dir, y_dir}` / `{origin, normal}`. Every command that takes a/// plane reads it here.-pub(super) fn plane_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<solvecraft_doc::PlaneRef> {- use solvecraft_doc::PlaneRef;+pub(super) fn plane_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<solidcraft_doc::PlaneRef> {+ use solidcraft_doc::PlaneRef;const WANT: &str = "XY, XZ, YZ, a construction plane name or id, or {origin, normal}";let construction = |r: &str| match s.doc.find_feature(r) {Some(f) if matches!(f.kind, FeatureKind::ConstructionPlane { .. }) => Ok(PlaneRef::Construction { name: f.name.clone() }),@@ -1049,7 +1049,7 @@ pub(super) fn plane_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<sNone => Err(bad(cmd, format!("no plane `{r}` (a plane is {WANT})"))),};match v {- Some(Value::String(n)) if solvecraft_geom::Plane::named(n.trim()).is_some() => {+ Some(Value::String(n)) if solidcraft_geom::Plane::named(n.trim()).is_some() => {if let Some(f) = s.doc.find_feature(n.trim())&& matches!(f.kind, FeatureKind::ConstructionPlane { .. }){@@ -1076,8 +1076,8 @@ pub(super) fn plane_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<sSome(x) => vec3(x).ok_or_else(|| bad(cmd, "the plane's `origin` must be a point [x, y, z]"))?,};let pl = match (o.get("x_dir").and_then(vec3), o.get("y_dir").and_then(vec3), o.get("normal").and_then(vec3)) {- (Some(x), Some(y), _) => solvecraft_geom::Plane::new(origin, x, y),- (_, _, Some(n)) => solvecraft_geom::Plane::from_normal(origin, n),+ (Some(x), Some(y), _) => solidcraft_geom::Plane::new(origin, x, y),+ (_, _, Some(n)) => solidcraft_geom::Plane::from_normal(origin, n),_ => None,};Ok(PlaneRef::Custom { plane: pl.ok_or_else(|| bad(cmd, "plane needs x_dir and y_dir, or normal"))? })@@ -1094,12 +1094,12 @@ fn plane_offset(s: &mut Session, p: &Value) -> Result<Value> {if let Some(face) = p.get("base").filter(|b| b.get("face").is_some()) {let base = super::sketch::face::capture(s, face, cmd)?;super::sketch::face::capture_positions(s, &base)?;- let kind = FeatureKind::ConstructionPlane { plane: solvecraft_doc::PlaneRef::Offset { base: Box::new(base), distance: d } };+ let kind = FeatureKind::ConstructionPlane { plane: solidcraft_doc::PlaneRef::Offset { base: Box::new(base), distance: d } };// The capture is already in the authoring frame.return add_feature_in(s, p, kind, false);}let base = plane_param(s, p.get("base"), cmd)?;- add_feature(s, p, FeatureKind::ConstructionPlane { plane: solvecraft_doc::PlaneRef::Offset { base: Box::new(base), distance: d } })+ add_feature(s, p, FeatureKind::ConstructionPlane { plane: solidcraft_doc::PlaneRef::Offset { base: Box::new(base), distance: d } })}fn plane_angle(s: &mut Session, p: &Value) -> Result<Value> {@@ -1111,7 +1111,7 @@ fn plane_angle(s: &mut Session, p: &Value) -> Result<Value> {add_feature(s,p,- FeatureKind::ConstructionPlane { plane: solvecraft_doc::PlaneRef::AtAngle { base: Box::new(base), axis_origin, axis_dir, angle } },+ FeatureKind::ConstructionPlane { plane: solidcraft_doc::PlaneRef::AtAngle { base: Box::new(base), axis_origin, axis_dir, angle } },)}@@ -1119,11 +1119,11 @@ fn split_face(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "solid.split_face";let faces = face_points(p, cmd)?;let body = str_(p, "body").map(str::to_string);- let xy = || solvecraft_doc::PlaneRef::Origin { name: "XY".into() };+ let xy = || solidcraft_doc::PlaneRef::Origin { name: "XY".into() };let kind = if let Some(t) = p.get("tool").filter(|t| !t.is_null()) {let tb = t.get("body").and_then(Value::as_str).ok_or_else(|| bad(cmd, "`tool.body` must name a body"))?.to_string();let point = t.get("point").and_then(crate::params::vec3).ok_or_else(|| bad(cmd, "`tool.point` must be [x, y, z] on the tool face"))?;- FeatureKind::SplitFace { faces, body, plane: xy(), tool: Some(solvecraft_doc::FaceAt { body: tb, point }), sketch: None }+ FeatureKind::SplitFace { faces, body, plane: xy(), tool: Some(solidcraft_doc::FaceAt { body: tb, point }), sketch: None }} else if p.get("sketch").is_some_and(|v| !v.is_null()) {let sketch = sketch_id(s, p.get("sketch"), cmd, "sketch")?;FeatureKind::SplitFace { faces, body, plane: xy(), tool: None, sketch: Some(sketch) }@@ -1146,7 +1146,7 @@ fn split_body(s: &mut Session, p: &Value) -> Result<Value> {let point = t.get("point").and_then(crate::params::vec3).ok_or_else(|| bad(cmd, "`tool.point` must be [x, y, z] on the tool face"))?;let st = s.model.state();let tbody = st.body(&tb).ok_or_else(|| bad(cmd, format!("no body `{tb}`")))?;- if solvecraft_doc::appearance::face_index_at(tbody, point).is_none() {+ if solidcraft_doc::appearance::face_index_at(tbody, point).is_none() {return Err(bad(cmd, "`tool.point` is not on a face of the tool body"));}return add_feature(@@ -1154,8 +1154,8 @@ fn split_body(s: &mut Session, p: &Value) -> Result<Value> {p,FeatureKind::Split {body,- plane: solvecraft_doc::PlaneRef::Origin { name: "XY".into() },- tool: Some(solvecraft_doc::FaceAt { body: tb, point }),+ plane: solidcraft_doc::PlaneRef::Origin { name: "XY".into() },+ tool: Some(solidcraft_doc::FaceAt { body: tb, point }),},);}@@ -1221,13 +1221,13 @@ fn hole(s: &mut Session, p: &Value) -> Result<Value> {let n = ss.plane.normal();let first =ids.first().and_then(|id| ss.sketch.points.iter().find(|q| &q.id == id)).map(|q| ss.plane.to_world(q.pos)).unwrap_or_default();- Some((solvecraft_doc::SketchPoints { sketch, ids }, first, -n))+ Some((solidcraft_doc::SketchPoints { sketch, ids }, first, -n))}_ => None,};let thread = str_(p, "thread").map(|t| t.trim().to_string()).filter(|t| !t.is_empty());if let Some(t) = &thread- && solvecraft_doc::parse_metric_thread(t).is_none()+ && solidcraft_doc::parse_metric_thread(t).is_none(){return Err(bad(cmd, format!("unknown thread `{t}` (ISO metric, like M6 or M6x0.75)")));}@@ -1268,7 +1268,7 @@ fn hole(s: &mut Session, p: &Value) -> Result<Value> {format!("{d} mm")}(None, Some(t), None) => {- let (major, pitch) = solvecraft_doc::parse_metric_thread(t).ok_or_else(|| bad(cmd, "thread"))?;+ let (major, pitch) = solidcraft_doc::parse_metric_thread(t).ok_or_else(|| bad(cmd, "thread"))?;format!("{} mm", ((major - pitch) * 1000.0).round() / 1000.0)}(None, None, None) => return Err(bad(cmd, "needs `diameter`, `thread` (a tapped hole) or `clearance` (a bolt size)")),@@ -1284,12 +1284,12 @@ fn hole(s: &mut Session, p: &Value) -> Result<Value> {};let kind = match str_(p, "type").unwrap_or("simple") {"simple" => match expr(p, "tip_angle") {- Some(t) if depth.is_some() => solvecraft_doc::HoleKind::Drilled { tip_angle: t },- _ => solvecraft_doc::HoleKind::Simple,+ Some(t) if depth.is_some() => solidcraft_doc::HoleKind::Drilled { tip_angle: t },+ _ => solidcraft_doc::HoleKind::Simple,},- "drilled" => solvecraft_doc::HoleKind::Drilled { tip_angle: expr(p, "tip_angle").unwrap_or_else(|| "118 deg".into()) },- "counterbore" => solvecraft_doc::HoleKind::Counterbore { cb_diameter: get("cb_diameter")?, cb_depth: get("cb_depth")? },- "countersink" => solvecraft_doc::HoleKind::Countersink {+ "drilled" => solidcraft_doc::HoleKind::Drilled { tip_angle: expr(p, "tip_angle").unwrap_or_else(|| "118 deg".into()) },+ "counterbore" => solidcraft_doc::HoleKind::Counterbore { cb_diameter: get("cb_diameter")?, cb_depth: get("cb_depth")? },+ "countersink" => solidcraft_doc::HoleKind::Countersink {cs_diameter: get("cs_diameter")?,cs_angle: expr(p, "cs_angle").unwrap_or_else(|| "90 deg".into()),},@@ -1309,11 +1309,11 @@ fn sketch_hole_points(s: &Session, sketch: u64) -> Vec<String> {let mut ends: Vec<usize> = Vec::new();for c in &ss.sketch.curves {match &c.kind {- solvecraft_sketch::CurveKind::Circle { .. } => {}- solvecraft_sketch::CurveKind::Arc { a, b, .. } | solvecraft_sketch::CurveKind::Line { a, b } => ends.extend([*a, *b]),- solvecraft_sketch::CurveKind::Ellipse { m, .. } => ends.push(*m),- solvecraft_sketch::CurveKind::Spline { pts, .. } => ends.extend(pts.iter().copied()),- solvecraft_sketch::CurveKind::Conic { a, b, apex, .. } => ends.extend([*a, *b, *apex]),+ solidcraft_sketch::CurveKind::Circle { .. } => {}+ solidcraft_sketch::CurveKind::Arc { a, b, .. } | solidcraft_sketch::CurveKind::Line { a, b } => ends.extend([*a, *b]),+ solidcraft_sketch::CurveKind::Ellipse { m, .. } => ends.push(*m),+ solidcraft_sketch::CurveKind::Spline { pts, .. } => ends.extend(pts.iter().copied()),+ solidcraft_sketch::CurveKind::Conic { a, b, apex, .. } => ends.extend([*a, *b, *apex]),}}ss.sketch.points.iter().enumerate().filter(|(i, p)| p.id != "origin" && !ends.contains(i)).map(|(_, p)| p.id.clone()).collect()@@ -1410,10 +1410,10 @@ fn loft(s: &mut Session, p: &Value) -> Result<Value> {if !st.sketch(sketch).is_some_and(|ss| ss.sketch.points.iter().any(|q| q.id == pt)) {return Err(bad(cmd, format!("no point `{pt}` in the section's sketch")));}- sections.push(solvecraft_doc::LoftSection { sketch, profiles: solvecraft_doc::ProfileSel::All, point: Some(pt.to_string()) });+ sections.push(solidcraft_doc::LoftSection { sketch, profiles: solidcraft_doc::ProfileSel::All, point: Some(pt.to_string()) });continue;}- sections.push(solvecraft_doc::LoftSection { sketch, profiles: profiles(sec, cmd)?, point: None });+ sections.push(solidcraft_doc::LoftSection { sketch, profiles: profiles(sec, cmd)?, point: None });}add_feature(s, p, FeatureKind::Loft { sections, operation: operation(p, cmd)?, targets: string_list(p, "targets") })}@@ -1426,7 +1426,7 @@ fn thread(s: &mut Session, p: &Value) -> Result<Value> {.ok_or_else(|| bad(cmd, "`face` must be a point [x, y, z] on a cylindrical face"))?;let designation = str_(p, "designation").map(|t| t.trim().to_string()).filter(|t| !t.is_empty());if let Some(t) = &designation- && solvecraft_doc::parse_metric_thread(t).is_none()+ && solidcraft_doc::parse_metric_thread(t).is_none(){return Err(bad(cmd, format!("unknown thread `{t}` (ISO metric, like M8 or M8x1)")));}diff --git a/crates/engine/src/cmd/features_more.rs b/crates/engine/src/cmd/features_more.rsindex b7971ab322..d798510233 100644--- a/crates/engine/src/cmd/features_more.rs+++ b/crates/engine/src/cmd/features_more.rs@@ -1,9 +1,9 @@//! Rib, Web, Emboss, Replace Face, Align and Remove.use serde_json::Value;-use solvecraft_doc::FeatureKind;-use solvecraft_doc::expr::Kind;-use solvecraft_geom::Vec3;+use solidcraft_doc::FeatureKind;+use solidcraft_doc::expr::Kind;+use solidcraft_geom::Vec3;use super::CommandSpec;use super::features::{add_feature, axis_dir_param, check_expr, feature_sketch, plane_param, point_param, profiles};@@ -43,7 +43,7 @@ pub static COMMANDS: &[CommandSpec] = &[fn coil(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "solid.coil";- let base = point_param(s, p, "base", cmd)?.unwrap_or_else(|| solvecraft_doc::point_expr(Vec3::ZERO));+ let base = point_param(s, p, "base", cmd)?.unwrap_or_else(|| solidcraft_doc::point_expr(Vec3::ZERO));let axis = axis_dir_param(p, cmd)?;let diameter = req_expr(cmd, p, "diameter")?;check_expr(s, &diameter, Kind::Length, cmd, "diameter")?;@@ -60,8 +60,8 @@ fn coil(s: &mut Session, p: &Value) -> Result<Value> {let section_size = req_expr(cmd, p, "section_size")?;check_expr(s, §ion_size, Kind::Length, cmd, "section_size")?;let section = match str_(p, "section").map(str::to_ascii_lowercase).as_deref() {- None | Some("circular" | "circle") => solvecraft_doc::CoilSection::Circular,- Some("square") => solvecraft_doc::CoilSection::Square,+ None | Some("circular" | "circle") => solidcraft_doc::CoilSection::Circular,+ Some("square") => solidcraft_doc::CoilSection::Square,Some(o) => return Err(bad(cmd, format!("unknown section `{o}` (circular or square)"))),};let position = match str_(p, "section_position").map(str::to_ascii_lowercase).as_deref() {@@ -146,7 +146,7 @@ fn emboss(s: &mut Session, p: &Value) -> Result<Value> {let mut targets = string_list(p, "targets");let face = if let Some(value) = p.get("face") {let local = vec3(value).ok_or_else(|| bad(cmd, "`face` must be a finite point [x,y,z]"))?;- let at = solvecraft_doc::apply_point(&s.active_component_frame(), local);+ let at = solidcraft_doc::apply_point(&s.active_component_frame(), local);let state = s.world_state();let mut candidates = Vec::new();for body in &state.bodies {@@ -179,19 +179,19 @@ fn emboss(s: &mut Session, p: &Value) -> Result<Value> {let (selected, index) = candidates.first().copied().ok_or_else(|| bad(cmd, "no target face"))?;let name = selected.definition_name();let body = &selected.body;- match solvecraft_kernel::face_surface(body, index) {- Some(solvecraft_kernel::FaceSurface::Plane { .. }) => {+ match solidcraft_kernel::face_surface(body, index) {+ Some(solidcraft_kernel::FaceSurface::Plane { .. }) => {targets = vec![name.to_owned()];None}- Some(solvecraft_kernel::FaceSurface::Cylinder { .. }) => {+ Some(solidcraft_kernel::FaceSurface::Cylinder { .. }) => {if targets.len() > 1 {return Err(bad(cmd, "cylinder emboss needs one selected target body"));}// Viewport picks lie on tessellated chords. Keep their axial and// angular position, and certify their distance before storing an// exact surface anchor for later replay.- let at = solvecraft_kernel::cylinder_emboss_anchor(body, index, at).map_err(|e| bad(cmd, e.to_string()))?;+ let at = solidcraft_kernel::cylinder_emboss_anchor(body, index, at).map_err(|e| bad(cmd, e.to_string()))?;let face = emboss_selection(s, selected, at)?;check_emboss_positions(s, sketch, selected, &face)?;targets = vec![name.to_owned()];@@ -209,7 +209,7 @@ fn emboss(s: &mut Session, p: &Value) -> Result<Value> {add_feature(s, p, FeatureKind::Emboss { sketch, profiles, depth, deboss, targets, face })}-fn emboss_selection(s: &Session, selected: &solvecraft_doc::ModelBody, at: Vec3) -> Result<solvecraft_doc::EmbossFace> {+fn emboss_selection(s: &Session, selected: &solidcraft_doc::ModelBody, at: Vec3) -> Result<solidcraft_doc::EmbossFace> {let cmd = "solid.emboss";let name = selected.definition_name();let original = s.model.state();@@ -229,11 +229,11 @@ fn emboss_selection(s: &Session, selected: &solvecraft_doc::ModelBody, at: Vec3)if path.len() > 64 || author_path.len() > 64 {return Err(bad(cmd, "cylinder placement is too deep"));}- let inverse = solvecraft_doc::mat_inverse(&s.active_component_frame()).ok_or_else(|| bad(cmd, "invalid active frame"))?;- Ok(solvecraft_doc::EmbossFace { body: name.to_owned(), at: solvecraft_doc::apply_point(&inverse, at), path, author_path })+ let inverse = solidcraft_doc::mat_inverse(&s.active_component_frame()).ok_or_else(|| bad(cmd, "invalid active frame"))?;+ Ok(solidcraft_doc::EmbossFace { body: name.to_owned(), at: solidcraft_doc::apply_point(&inverse, at), path, author_path })}-fn check_emboss_positions(s: &Session, sketch: u64, body: &solvecraft_doc::ModelBody, face: &solvecraft_doc::EmbossFace) -> Result<()> {+fn check_emboss_positions(s: &Session, sketch: u64, body: &solidcraft_doc::ModelBody, face: &solidcraft_doc::EmbossFace) -> Result<()> {let cmd = "solid.emboss";let owner = s.doc.model_body_component(body);let sketch_owner = s.doc.feature(sketch).map(|f| f.component).ok_or_else(|| bad(cmd, "profile sketch no longer exists"))?;@@ -253,15 +253,15 @@ fn check_emboss_positions(s: &Session, sketch: u64, body: &solvecraft_doc::Modelfn infer_emboss_selection(s: &Session,sketch: u64,- profiles: &solvecraft_doc::ProfileSel,+ profiles: &solidcraft_doc::ProfileSel,depth: &str,deboss: bool,targets: &[String],-) -> Result<Option<solvecraft_doc::EmbossFace>> {+) -> Result<Option<solidcraft_doc::EmbossFace>> {let cmd = "solid.emboss";let original = s.model.state();let ss = original.sketch(sketch).ok_or_else(|| bad(cmd, "the sketch is not evaluated"))?;- let regions = solvecraft_doc::select_profiles(ss, profiles).map_err(|e| bad(cmd, e.to_string()))?;+ let regions = solidcraft_doc::select_profiles(ss, profiles).map_err(|e| bad(cmd, e.to_string()))?;let sketch_owner = s.doc.feature(sketch).map(|f| f.component).ok_or_else(|| bad(cmd, "profile sketch no longer exists"))?;let d = s.doc.eval(&s.doc.with_design_unit(depth, Kind::Length), Kind::Length).map_err(|e| bad(cmd, e.to_string()))?;let world = s.world_state();@@ -278,26 +278,26 @@ fn infer_emboss_selection(if faces > 50_000 {return Err(bad(cmd, "cylinder target search exceeds face work limit"));}- if !solvecraft_kernel::has_cylinder_emboss_wall(&raw.body).map_err(|e| bad(cmd, e.to_string()))? {+ if !solidcraft_kernel::has_cylinder_emboss_wall(&raw.body).map_err(|e| bad(cmd, e.to_string()))? {continue;}let mut face = emboss_selection(s, selected, Vec3::ZERO)?;let body_frame = face.body_frame(&placed, raw).map_err(|e| bad(cmd, e.to_string()))?;- let inverse = solvecraft_doc::mat_inverse(&body_frame).ok_or_else(|| bad(cmd, "invalid cylinder body frame"))?;+ let inverse = solidcraft_doc::mat_inverse(&body_frame).ok_or_else(|| bad(cmd, "invalid cylinder body frame"))?;let displayed = world.sketch(sketch).ok_or_else(|| bad(cmd, "the profile sketch is not displayed"))?;- let plane = solvecraft_geom::Plane::new(- solvecraft_doc::apply_point(&inverse, displayed.plane.origin),- solvecraft_doc::apply_vector(&inverse, displayed.plane.x),- solvecraft_doc::apply_vector(&inverse, displayed.plane.y),+ let plane = solidcraft_geom::Plane::new(+ solidcraft_doc::apply_point(&inverse, displayed.plane.origin),+ solidcraft_doc::apply_vector(&inverse, displayed.plane.x),+ solidcraft_doc::apply_vector(&inverse, displayed.plane.y),).ok_or_else(|| bad(cmd, "invalid cylinder sketch frame"))?;if let Some((_, at)) =- solvecraft_kernel::infer_cylinder_emboss(&raw.body, &plane, ®ions, if deboss { -d } else { d }).map_err(|e| bad(cmd, e.to_string()))?+ solidcraft_kernel::infer_cylinder_emboss(&raw.body, &plane, ®ions, if deboss { -d } else { d }).map_err(|e| bad(cmd, e.to_string()))?{face.sketch_frame(&placed, s.active_component, sketch_owner, raw).map_err(|e| bad(cmd, e.to_string()))?;check_emboss_positions(s, sketch, selected, &face)?;- let author_inverse = solvecraft_doc::mat_inverse(&s.active_component_frame()).ok_or_else(|| bad(cmd, "invalid author frame"))?;- face.at = solvecraft_doc::apply_point(&solvecraft_doc::mat_mul(&author_inverse, &body_frame), at);+ let author_inverse = solidcraft_doc::mat_inverse(&s.active_component_frame()).ok_or_else(|| bad(cmd, "invalid author frame"))?;+ face.at = solidcraft_doc::apply_point(&solidcraft_doc::mat_mul(&author_inverse, &body_frame), at);if chosen.is_some() {return Err(bad(cmd, "multiple tangent cylinders match the selected profiles; select a target face or body"));}@@ -325,8 +325,8 @@ fn replace_face(s: &mut Session, p: &Value) -> Result<Value> {let target = match p.get("target_face").and_then(vec3) {Some(tp) => {let n = super::face::face_normal(s, tp).ok_or_else(|| bad(cmd, "the target face must be planar"))?;- let plane = solvecraft_geom::Plane::from_normal(tp, n).ok_or_else(|| bad(cmd, "the target face's plane"))?;- solvecraft_doc::PlaneRef::Custom { plane }+ let plane = solidcraft_geom::Plane::from_normal(tp, n).ok_or_else(|| bad(cmd, "the target face's plane"))?;+ solidcraft_doc::PlaneRef::Custom { plane }}None => plane_param(s, p.get("target"), cmd)?,};@@ -399,7 +399,7 @@ pub(super) fn snap_point(s: &Session, kind: &str, at: Vec3) -> Option<Vec3> {.collect(),),"edge_mid" => {- let d = |e: &solvecraft_doc::kernel::EdgeInfo| e.points.windows(2).map(|w| at.dist_to_segment(w[0], w[1])).fold(f64::MAX, f64::min);+ let d = |e: &solidcraft_doc::kernel::EdgeInfo| e.points.windows(2).map(|w| at.dist_to_segment(w[0], w[1])).fold(f64::MAX, f64::min);st.bodies.iter().filter_map(|b| b.body.edges((b.body.size() * 2e-3).max(1e-3)).ok())@@ -408,11 +408,11 @@ pub(super) fn snap_point(s: &Session, kind: &str, at: Vec3) -> Option<Vec3> {.map(|e| e.mid)}"face_center" => st.bodies.iter().find_map(|b| {- let i = solvecraft_doc::appearance::face_index_at(b, at)?;+ let i = solidcraft_doc::appearance::face_index_at(b, at)?;b.body.faces((b.body.size() * 2e-3).max(1e-3)).ok()?.into_iter().find(|f| f.index == i).map(|f| f.centroid)}),"circle_center" => st.bodies.iter().find_map(|b| {- let c = solvecraft_doc::kernel::cylinder_face_at(&b.body, at)?;+ let c = solidcraft_doc::kernel::cylinder_face_at(&b.body, at)?;let along = (at - c.axis_point).dot(c.axis);let end = if (along - c.start).abs() <= (c.end - along).abs() { c.start } else { c.end };Some(c.axis_point + c.axis * end)diff --git a/crates/engine/src/cmd/features_more_tests.rs b/crates/engine/src/cmd/features_more_tests.rsindex 6c15454dbd..7656e34549 100644--- a/crates/engine/src/cmd/features_more_tests.rs+++ b/crates/engine/src/cmd/features_more_tests.rs@@ -108,7 +108,7 @@ fn exact_cylinder_volume(s: &Session) -> f64 {#[test]fn cylinder_emboss_persists_selection_and_replays_radial_depth() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = cylinder_badge();let before = exact_cylinder_volume(&s);run(@@ -124,10 +124,10 @@ fn cylinder_emboss_persists_selection_and_replays_radial_depth() {assert!(mesh.contains(Vec3::new(-10.5 * 0.15_f64.sin(), 10.5 * 0.15_f64.cos(), 7.5)));let feature = s.doc.find_feature("Raised Badge").unwrap();assert!(- matches!(&feature.kind,solvecraft_doc::FeatureKind::Emboss{face:Some(face),..} if face.body=="Sleeve"&&face.at.dist(Vec3::new(0.,10.,7.5))<1e-10)+ matches!(&feature.kind,solidcraft_doc::FeatureKind::Emboss{face:Some(face),..} if face.body=="Sleeve"&&face.at.dist(Vec3::new(0.,10.,7.5))<1e-10));let saved = s.doc.to_json();- let mut loaded = Session { doc: solvecraft_doc::Document::from_json(&saved).unwrap().into(), ..Default::default() };+ let mut loaded = Session { doc: solidcraft_doc::Document::from_json(&saved).unwrap().into(), ..Default::default() };loaded.refresh();assert!(loaded.model.results.iter().all(|f| f.error.is_none()), "{:?}", loaded.model.results);assert!((exact_cylinder_volume(&loaded) - before - 21.0).abs() < 0.02);@@ -171,7 +171,7 @@ fn cylinder_small_chord_pick_is_saved_on_the_exact_surface() {.unwrap();assert!(((pick.x * pick.x + pick.y * pick.y).sqrt() - 0.1).abs() > 1e-7);run(&mut s, "solid.emboss", json!({"sketch":"Badge","profiles":"all","face":[pick.x,pick.y,pick.z],"depth":"0.01mm","targets":["Tiny"]}));- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {panic!("missing face");};assert!(((face.at.x * face.at.x + face.at.y * face.at.y).sqrt() - 0.1).abs() < 1e-12);@@ -186,7 +186,7 @@ fn cylinder_cross_component_emboss_keeps_source_owner_and_placements() {let a = run(&mut s, "component.create", json!({"name":"Source"}))["component"].as_u64().unwrap();run(&mut s, "solid.cylinder", json!({"radius":10,"height":20,"body_name":"Sleeve"}));let source_feature = s.model.state().bodies.first().unwrap().feature;- let source_names = solvecraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());+ let source_names = solidcraft_doc::naming::face_names(s.model.state().body("Sleeve").unwrap());let before = exact_cylinder_volume(&s);run(&mut s, "occurrence.move", json!({"occurrence":"Source:1","axis":[0,0,1],"angle":"90 deg","translate":[50,0,0]}));let second = run(&mut s, "occurrence.copy", json!({"component":a,"translate":[80,0,0]}))["occurrence"].as_u64().unwrap();@@ -204,7 +204,7 @@ fn cylinder_cross_component_emboss_keeps_source_owner_and_placements() {.world_state().bodies.iter()- .find(|b| b.body.tessellate_with(0.001, true).unwrap().contains(solvecraft_geom::Vec3::new(40.5 + pick_offset, 0., 7.5)))+ .find(|b| b.body.tessellate_with(0.001, true).unwrap().contains(solidcraft_geom::Vec3::new(40.5 + pick_offset, 0., 7.5))).unwrap().name.clone();@@ -213,7 +213,7 @@ fn cylinder_cross_component_emboss_keeps_source_owner_and_placements() {"solid.emboss",json!({"sketch":"Badge","profiles":"all","face":[40.+pick_offset,0,7.5],"depth":"badge_depth","targets":[target.clone()]}),);- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {panic!("missing selection");};assert_eq!(face.path, if pick_offset == 0. { s.doc.first_path(a) } else { vec![second] });@@ -228,9 +228,9 @@ fn cylinder_cross_component_emboss_keeps_source_owner_and_placements() {assert!((exact_cylinder_volume(&s) - before - 21.).abs() < 0.02);let world = s.world_state();for x in [39.5, 119.5] {- assert!(world.bodies.iter().any(|b| b.body.tessellate_with(0.001, true).unwrap().contains(solvecraft_geom::Vec3::new(x, 0., 7.5))));+ assert!(world.bodies.iter().any(|b| b.body.tessellate_with(0.001, true).unwrap().contains(solidcraft_geom::Vec3::new(x, 0., 7.5))));}- let mut loaded = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };+ let mut loaded = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };loaded.refresh();assert!(loaded.model.results.iter().all(|r| r.error.is_none()), "{:?}", loaded.model.results);run(&mut loaded, "parameters.change", json!({"name":"badge_depth","expression":"2mm"}));@@ -254,7 +254,7 @@ fn cylinder_cross_component_emboss_keeps_source_owner_and_placements() {assert!((exact_cylinder_volume(&loaded) - before - 69.).abs() < 0.02);let mut broken = loaded.doc.as_ref().clone();let id = broken.features.last().unwrap().id;- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &mut broken.feature_mut(id).unwrap().kind else {+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &mut broken.feature_mut(id).unwrap().kind else {panic!("missing selection");};face.path = vec![u64::MAX];@@ -283,12 +283,12 @@ fn check_active_second_source(auto: bool) {run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.emboss", json!({"sketch":"Badge","profiles":"all","face":[80,10,7.5],"depth":1}));assert!((exact_cylinder_volume(&s) - before - 21.).abs() < 0.02);- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &s.doc.features.last().unwrap().kind else {panic!("missing selection");};assert_eq!(face.path, vec![second]);assert_eq!(face.author_path, vec![second]);- let mut loaded = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };+ let mut loaded = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };loaded.refresh();assert!(loaded.model.results.iter().all(|r| r.error.is_none()), "{:?}", loaded.model.results);assert!((exact_cylinder_volume(&loaded) - before - 21.).abs() < 0.02);@@ -376,7 +376,7 @@ fn check_body_offset(auto: bool) {assert!((exact_cylinder_volume(&s) - before - 21.).abs() < 0.02);assert_eq!(s.doc.body_offsets["Sleeve"], offset);assert_eq!(s.doc.body_component("Sleeve", s.model.state().body("Sleeve").unwrap().feature), holder);- assert!(s.world_state().body("Sleeve").unwrap().body.tessellate_with(0.001, true).unwrap().contains(solvecraft_geom::Vec3::new(0., 10.5, 7.5)));+ assert!(s.world_state().body("Sleeve").unwrap().body.tessellate_with(0.001, true).unwrap().contains(solidcraft_geom::Vec3::new(0., 10.5, 7.5)));}#[test]@@ -486,14 +486,14 @@ fn loft_cut_through_a_shelled_basin_in_either_order() {#[test]fn cylinder_auto_inference_saves_a_profile_anchor_and_replays_both_depth_signs() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;for mode in ["emboss", "deboss"] {let mut s = cylinder_badge();let before = exact_cylinder_volume(&s);let initial = s.doc.to_json();run(&mut s, "solid.emboss", json!({"sketch":"Badge","profiles":"all","depth":"badge_depth","mode":mode,"name":"Auto Badge"}));let feature = s.doc.find_feature("Auto Badge").unwrap().clone();- let solvecraft_doc::FeatureKind::Emboss { face: Some(face), targets, .. } = &feature.kind else {+ let solidcraft_doc::FeatureKind::Emboss { face: Some(face), targets, .. } = &feature.kind else {panic!("missing inferred association");};assert_eq!(targets, &["Sleeve"]);@@ -514,7 +514,7 @@ fn cylinder_auto_inference_saves_a_profile_anchor_and_replays_both_depth_signs()assert_eq!(s.doc.to_json(), initial);run(&mut s, "edit.redo", json!({}));assert_eq!(s.doc.find_feature("Auto Badge").unwrap().kind, feature.kind);- let mut loaded = Session { doc: solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };+ let mut loaded = Session { doc: solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap().into(), ..Default::default() };loaded.refresh();assert!(loaded.model.results.iter().all(|r| r.error.is_none()), "{:?}", loaded.model.results);run(@@ -551,7 +551,7 @@ fn cylinder_auto_inference_ignores_remote_finite_tangent_walls_in_each_body_orde#[test]fn cylinder_auto_inference_retains_selected_holes_and_nested_islands() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;for mode in ["emboss", "deboss"] {let mut s = cylinder_badge();run(&mut s, "sketch.edit", json!({"sketch":"Badge"}));@@ -584,7 +584,7 @@ fn cylinder_auto_inference_refuses_ambiguity_curves_and_seam_crossing_atomicallyassert!(error.contains("multiple tangent cylinders"), "{error}");assert_eq!(s.doc.to_json(), before);run(&mut s, "solid.emboss", json!({"sketch":"Badge","depth":1,"targets":["Sleeve"]}));- assert!(matches!(&s.doc.features.last().unwrap().kind,solvecraft_doc::FeatureKind::Emboss{face:Some(face),..} if face.body=="Sleeve"));+ assert!(matches!(&s.doc.features.last().unwrap().kind,solidcraft_doc::FeatureKind::Emboss{face:Some(face),..} if face.body=="Sleeve"));for circle in [false, true] {let mut s = cylinder_badge();run(&mut s, "sketch.create", json!({"plane":{"origin":[0,10,0],"x_dir":[-1,0,0],"y_dir":[0,0,1]},"name":"Unsupported"}));diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rsindex a3ada5e713..9d3d5ac11a 100644--- a/crates/engine/src/cmd/file.rs+++ b/crates/engine/src/cmd/file.rs@@ -1,8 +1,8 @@//! Documents and files: new, open (designs and STEP), insert STEP, save, export.use serde_json::{Value, json};-use solvecraft_doc::Document;-use solvecraft_io::Format;+use solidcraft_doc::Document;+use solidcraft_io::Format;use super::CommandSpec;use crate::params::{bad, bool_, str_, string_list};@@ -14,7 +14,7 @@ pub static COMMANDS: &[CommandSpec] = &[.icon("open").key("Ctrl+O").noundo()- .params("path: .solvecraft design, or a .step/.stp file (opens as a new design)"),+ .params("path: .solidcraft design, or a .step/.stp file (opens as a new design)"),CommandSpec::new("file.insert_step", "Insert STEP", insert_step).at("SOLID", "INSERT").icon("import")@@ -50,9 +50,9 @@ fn path_arg<'a>(p: &'a Value, cmd: &str) -> Result<&'a str> {}/// Read a STEP file as an Import feature.-fn read_step(path: &str) -> Result<solvecraft_io::StepFeature> {- let bytes = solvecraft_io::vfs::read(path, solvecraft_io::MAX_STEP_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;- solvecraft_io::step_import_feature(&bytes, path).map_err(|e| EngineError::Other(format!("{path}: {e}")))+fn read_step(path: &str) -> Result<solidcraft_io::StepFeature> {+ let bytes = solidcraft_io::vfs::read(path, solidcraft_io::MAX_STEP_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::step_import_feature(&bytes, path).map_err(|e| EngineError::Other(format!("{path}: {e}")))}/// Add an Import feature for a STEP file to the session's design.@@ -76,8 +76,8 @@ fn add_step(s: &mut Session, path: &str, name: Option<&str>) -> Result<Value> {/// Add a MeshImport feature for a 3MF or STL file.fn add_mesh(s: &mut Session, path: &str, name: Option<&str>) -> Result<Value> {- let bytes = solvecraft_io::vfs::read(path, solvecraft_io::MAX_3MF_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;- let mf = solvecraft_io::mesh_import_feature(&bytes, path).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ let bytes = solidcraft_io::vfs::read(path, solidcraft_io::MAX_3MF_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ let mf = solidcraft_io::mesh_import_feature(&bytes, path).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;let fname = name.filter(|n| !n.trim().is_empty()).unwrap_or(&mf.name).to_string();let id = s.doc_mut().add_feature(mf.kind, Some(&fname))?;if let Some(f) = s.doc_mut().feature_mut(id) {@@ -97,7 +97,7 @@ fn add_mesh(s: &mut Session, path: &str, name: Option<&str>) -> Result<Value> {fn insert_mesh(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "file.insert_mesh";let path = path_arg(p, cmd)?;- if !solvecraft_io::is_mesh_path(path) {+ if !solidcraft_io::is_mesh_path(path) {return Err(bad(cmd, "only 3MF and STL files (.3mf, .stl) can be inserted as meshes"));}add_mesh(s, path, str_(p, "name"))@@ -106,7 +106,7 @@ fn insert_mesh(s: &mut Session, p: &Value) -> Result<Value> {fn insert_step(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "file.insert_step";let path = path_arg(p, cmd)?;- if !solvecraft_io::is_step_path(path) {+ if !solidcraft_io::is_step_path(path) {return Err(bad(cmd, "only STEP files (.step, .stp) can be inserted"));}add_step(s, path, str_(p, "name"))@@ -114,18 +114,18 @@ fn insert_step(s: &mut Session, p: &Value) -> Result<Value> {fn open(s: &mut Session, p: &Value) -> Result<Value> {let path = path_arg(p, "doc.open")?;- if solvecraft_io::is_step_path(path) || solvecraft_io::is_mesh_path(path) {+ if solidcraft_io::is_step_path(path) || solidcraft_io::is_mesh_path(path) {// A new, unsaved design holding the file's bodies.let stem = std::path::Path::new(path).file_stem().map(|x| x.to_string_lossy().to_string()).unwrap_or_else(|| "Untitled".into());let mut fresh = Session::new(Document::new(&stem));- let r = if solvecraft_io::is_step_path(path) { add_step(&mut fresh, path, None)? } else { add_mesh(&mut fresh, path, None)? };+ let r = if solidcraft_io::is_step_path(path) { add_step(&mut fresh, path, None)? } else { add_mesh(&mut fresh, path, None)? };fresh.undo.clear();*s = fresh;let errors = s.model.results.iter().filter(|r| r.error.is_some()).count();return Ok(json!({"path": path, "features": s.doc.features.len(), "errors": errors, "bodies": r["bodies"], "warnings": r["warnings"]}));}- let bytes = solvecraft_io::vfs::read(path, solvecraft_io::MAX_DESIGN_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;- let doc = solvecraft_io::read_design(&bytes)?;+ let bytes = solidcraft_io::vfs::read(path, solidcraft_io::MAX_DESIGN_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ let doc = solidcraft_io::read_design(&bytes)?;*s = Session::new(doc);s.path = Some(path.to_string());let errors = s.model.results.iter().filter(|r| r.error.is_some()).count();@@ -133,9 +133,9 @@ fn open(s: &mut Session, p: &Value) -> Result<Value> {}fn write(s: &mut Session, path: &str) -> Result<Value> {- let bytes = solvecraft_io::write_design(&s.doc);+ let bytes = solidcraft_io::write_design(&s.doc);// Atomic, keeping the version being replaced as `<file>.bak`.- solvecraft_io::write_atomic(std::path::Path::new(path), &bytes, true).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::write_atomic(std::path::Path::new(path), &bytes, true).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;s.path = Some(path.to_string());s.mark_saved();Ok(json!({"path": path, "bytes": bytes.len()}))@@ -158,12 +158,12 @@ fn export_to(s: &Session, path: &str, format: Format, bodies: &[String]) -> Resulet name = std::path::Path::new(path).file_stem().map(|x| x.to_string_lossy().to_string()).unwrap_or_else(|| s.doc.name.clone());// A design with components exports as a STEP assembly; otherwise bodies as placed.let bytes = if format == Format::Step && bodies.is_empty() && !s.doc.occurrences.is_empty() {- solvecraft_io::step_assembly(&s.doc, &s.doc.painted(&s.model.state()), &name)?+ solidcraft_io::step_assembly(&s.doc, &s.doc.painted(&s.model.state()), &name)?} else {// Bodies carry the colour they are shown in (appearance, material or imported).- solvecraft_io::export(&s.doc.painted(&s.world_state()), bodies, format, &name)?+ solidcraft_io::export(&s.doc.painted(&s.world_state()), bodies, format, &name)?};- solvecraft_io::vfs::write(path, &bytes).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::vfs::write(path, &bytes).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;Ok(json!({"path": path, "bytes": bytes.len(), "format": format!("{format:?}")}))}diff --git a/crates/engine/src/cmd/inspect.rs b/crates/engine/src/cmd/inspect.rsindex d50339b5af..3fb72bb227 100644--- a/crates/engine/src/cmd/inspect.rs+++ b/crates/engine/src/cmd/inspect.rs@@ -1,7 +1,7 @@//! Inspection: measure bodies, describe the document, sketches and model topology.use serde_json::{Value, json};-use solvecraft_sketch::CurveKind;+use solidcraft_sketch::CurveKind;use super::CommandSpec;use crate::params::{bad, bool_, str_, string_list};@@ -38,8 +38,8 @@ pub static COMMANDS: &[CommandSpec] = &[CommandSpec::new("engine.commands", "List Commands", commands).noundo(),];-pub fn measure_json(b: &solvecraft_doc::ModelBody) -> Value {- match solvecraft_kernel::measure(&b.body) {+pub fn measure_json(b: &solidcraft_doc::ModelBody) -> Value {+ match solidcraft_kernel::measure(&b.body) {Ok(m) => json!({"name": b.name,"volume_mm3": m.volume,@@ -234,7 +234,7 @@ fn inspect(s: &mut Session, p: &Value) -> Result<Value> {}))}-fn body_of<'a>(st: &'a solvecraft_doc::ModelState, p: &Value, cmd: &str) -> Result<&'a solvecraft_doc::ModelBody> {+fn body_of<'a>(st: &'a solidcraft_doc::ModelState, p: &Value, cmd: &str) -> Result<&'a solidcraft_doc::ModelBody> {let n = str_(p, "body").ok_or_else(|| bad(cmd, "`body` is required"))?;st.body(n).ok_or_else(|| bad(cmd, format!("no body `{n}`")))}@@ -243,7 +243,7 @@ fn model_edges(s: &mut Session, p: &Value) -> Result<Value> {let st = s.world_state();let b = body_of(&st, p, "model.edges")?;let tol = (b.body.size() * 2e-3).max(1e-3);- let names = solvecraft_doc::naming::edge_names(b);+ let names = solidcraft_doc::naming::edge_names(b);let edges: Vec<Value> = b.body.edges(tol)?@@ -256,14 +256,14 @@ fn model_edges(s: &mut Session, p: &Value) -> Result<Value> {fn model_faces(s: &mut Session, p: &Value) -> Result<Value> {let st = s.world_state();let b = body_of(&st, p, "model.faces")?;- let names = solvecraft_doc::naming::face_names(b);+ let names = solidcraft_doc::naming::face_names(b);let tol = (b.body.size() * 2e-3).max(1e-3);let faces: Vec<Value> = b.body.faces(tol)?.iter().map(|f| {- json!({"index": f.index, "name": names.get(f.index), "exact": solvecraft_doc::naming::face_name_exact(b, f.index),+ json!({"index": f.index, "name": names.get(f.index), "exact": solidcraft_doc::naming::face_name_exact(b, f.index),"area": f.area, "centroid": f.centroid, "plane_normal": f.plane_normal})}).collect();@@ -283,7 +283,7 @@ fn physical_material(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "material.assign";let bodies = string_list(p, "bodies");let material = str_(p, "material").ok_or_else(|| bad(cmd, "`material` must be a material name"))?;- let canonical = solvecraft_doc::MATERIALS+ let canonical = solidcraft_doc::MATERIALS.iter().find(|(n, _)| n.eq_ignore_ascii_case(material.trim())).map(|(n, _)| n.to_string())@@ -318,7 +318,7 @@ fn color_param(v: &Value) -> Option<[u8; 3]> {}fn appearance(s: &mut Session, p: &Value) -> Result<Value> {- use solvecraft_doc::appearance::{FaceLook, Look, library};+ use solidcraft_doc::appearance::{FaceLook, Look, library};let cmd = "appearance.assign";let look: Option<Look> = match (str_(p, "appearance"), p.get("color")) {// A colour with a name: that colour, called that (a name not in the library is fine).@@ -352,14 +352,14 @@ fn appearance(s: &mut Session, p: &Value) -> Result<Value> {return Err(bad(cmd, "`bodies` must list existing bodies"));}// Faces: a point on each, on the named body or the nearest one.- let mut faces: Vec<(String, solvecraft_geom::Vec3)> = Vec::new();+ let mut faces: Vec<(String, solidcraft_geom::Vec3)> = Vec::new();if let Some(list) = p.get("faces") {let list = list.as_array().filter(|a| a.len() <= 10_000).ok_or_else(|| bad(cmd, "`faces` must list points [x, y, z]"))?;for v in list {let pt = crate::params::vec3(v).or_else(|| v.get("point").and_then(crate::params::vec3)).ok_or_else(|| bad(cmd, "`faces` must list points [x, y, z]"))?;- let on = |b: &solvecraft_doc::ModelBody| solvecraft_doc::appearance::face_index_at(b, pt).is_some();+ let on = |b: &solidcraft_doc::ModelBody| solidcraft_doc::appearance::face_index_at(b, pt).is_some();let body = match v.get("body").and_then(Value::as_str).or_else(|| str_(p, "body")) {Some(n) => st.body(n).filter(|b| on(b)).map(|b| b.name.clone()),None => st.bodies.iter().filter(|b| on(b)).min_by(|a, b| dist_to(a, pt).total_cmp(&dist_to(b, pt))).map(|b| b.name.clone()),@@ -381,11 +381,11 @@ fn appearance(s: &mut Session, p: &Value) -> Result<Value> {return Err(bad(cmd, "give `bodies`, `faces` or `components`"));}// Persistent names of the picked faces.- let st_names: Vec<(String, solvecraft_geom::Vec3, Option<String>)> = faces+ let st_names: Vec<(String, solidcraft_geom::Vec3, Option<String>)> = faces.iter().map(|(b, pt)| {let n = st.body(b).and_then(|mb| {- solvecraft_doc::appearance::face_index_at(mb, *pt).and_then(|i| solvecraft_doc::naming::face_names(mb).get(i).cloned())+ solidcraft_doc::appearance::face_index_at(mb, *pt).and_then(|i| solidcraft_doc::naming::face_names(mb).get(i).cloned())});(b.clone(), *pt, n)})@@ -423,20 +423,20 @@ fn appearance(s: &mut Session, p: &Value) -> Result<Value> {.map(|(b, pt)| {(b.clone(),- st.body(b).and_then(|mb| solvecraft_doc::appearance::face_index_at(mb, *pt)),+ st.body(b).and_then(|mb| solidcraft_doc::appearance::face_index_at(mb, *pt)),st_names.iter().find(|(name, p, _)| name == b && p.dist(*pt) < 1e-12).and_then(|(_, _, name)| name.clone()),)}).collect();doc.appearances.faces.retain(|f| {- let idx = st.body(&f.body).and_then(|mb| solvecraft_doc::appearance::face_index_at(mb, f.point));+ let idx = st.body(&f.body).and_then(|mb| solidcraft_doc::appearance::face_index_at(mb, f.point));!picked.iter().any(|(b, i, name)| {*b == f.body&& (f.name.as_ref().zip(name.as_ref())- .is_some_and(|(a, b)| solvecraft_doc::naming::strip_piece(a) == solvecraft_doc::naming::strip_piece(b))+ .is_some_and(|(a, b)| solidcraft_doc::naming::strip_piece(a) == solidcraft_doc::naming::strip_piece(b))|| (!f.strict_name && i.is_some() && *i == idx))})});@@ -449,18 +449,18 @@ fn appearance(s: &mut Session, p: &Value) -> Result<Value> {}))}-fn dist_to(b: &solvecraft_doc::ModelBody, p: solvecraft_geom::Vec3) -> f64 {+fn dist_to(b: &solidcraft_doc::ModelBody, p: solidcraft_geom::Vec3) -> f64 {let bb = b.mesh().bounds();- let c = solvecraft_geom::Vec3::new(p.x.clamp(bb.min.x, bb.max.x), p.y.clamp(bb.min.y, bb.max.y), p.z.clamp(bb.min.z, bb.max.z));+ let c = solidcraft_geom::Vec3::new(p.x.clamp(bb.min.x, bb.max.x), p.y.clamp(bb.min.y, bb.max.y), p.z.clamp(bb.min.z, bb.max.z));c.dist(p)}-fn look_json(l: &solvecraft_doc::appearance::Look) -> Value {+fn look_json(l: &solidcraft_doc::appearance::Look) -> Value {json!({"name": l.name, "color": l.hex(), "opacity": l.opacity})}fn appearance_library(_s: &mut Session, _p: &Value) -> Result<Value> {- let list: Vec<Value> = solvecraft_doc::appearance::LIBRARY+ let list: Vec<Value> = solidcraft_doc::appearance::LIBRARY.iter().map(|(n, c, o)| {let category = n.split(" - ").next().unwrap_or(n);@@ -473,8 +473,8 @@ fn appearance_library(_s: &mut Session, _p: &Value) -> Result<Value> {fn appearance_list(s: &mut Session, p: &Value) -> Result<Value> {let a = &s.doc.appearances;// "In this design": each look used, with where.- let mut used: Vec<(solvecraft_doc::appearance::Look, Vec<Value>, Vec<Value>, Vec<Value>)> = Vec::new();- fn slot(used: &mut Vec<(solvecraft_doc::appearance::Look, Vec<Value>, Vec<Value>, Vec<Value>)>, l: &solvecraft_doc::appearance::Look) -> usize {+ let mut used: Vec<(solidcraft_doc::appearance::Look, Vec<Value>, Vec<Value>, Vec<Value>)> = Vec::new();+ fn slot(used: &mut Vec<(solidcraft_doc::appearance::Look, Vec<Value>, Vec<Value>, Vec<Value>)>, l: &solidcraft_doc::appearance::Look) -> usize {match used.iter().position(|(u, ..)| u == l) {Some(i) => i,None => {@@ -525,5 +525,5 @@ fn appearance_list(s: &mut Session, p: &Value) -> Result<Value> {}fn material_list(_s: &mut Session, _p: &Value) -> Result<Value> {- Ok(json!({"materials": solvecraft_doc::MATERIALS.iter().map(|(n, d)| json!({"name": n, "density_g_cm3": d})).collect::<Vec<_>>()}))+ Ok(json!({"materials": solidcraft_doc::MATERIALS.iter().map(|(n, d)| json!({"name": n, "density_g_cm3": d})).collect::<Vec<_>>()}))}diff --git a/crates/engine/src/cmd/joints.rs b/crates/engine/src/cmd/joints.rsindex 6a85761134..b3fd459369 100644--- a/crates/engine/src/cmd/joints.rs+++ b/crates/engine/src/cmd/joints.rs@@ -1,12 +1,12 @@-//! Joints between occurrences (`solvecraft_doc::joints`): Joint Origin, Joint, As-built Joint,+//! Joints between occurrences (`solidcraft_doc::joints`): Joint Origin, Joint, As-built Joint,//! Rigid Group, Drive Joints, Motion Link, limits, and Interference. Every change re-solves the//! joint graph and moves the occurrences it places; the session re-solves after any edit too,//! so joints follow the geometry their origins snap to.use serde_json::{Value, json};-use solvecraft_doc::expr::Kind;-use solvecraft_doc::joints::{self, Joint, JointKind, JointOrigin, MotionLink, NamedOrigin, Snap};-use solvecraft_geom::Vec3;+use solidcraft_doc::expr::Kind;+use solidcraft_doc::joints::{self, Joint, JointKind, JointOrigin, MotionLink, NamedOrigin, Snap};+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, bool_, num, str_, string_list, vec3};@@ -88,9 +88,9 @@ pub(crate) fn occurrence_at(s: &Session, p: Vec3) -> Option<u64> {let comp = s.doc.model_body_component(b);let occs: Vec<u64> = if comp == 0 { vec![0] } else { s.doc.occurrences.iter().filter(|o| o.component == comp).map(|o| o.id).collect() };for occ in occs {- let t = if occ == 0 { solvecraft_doc::IDENTITY } else { joints::occurrence_world(&s.doc, occ) };- let inv = solvecraft_doc::mat_inverse(&t)?;- let q = solvecraft_doc::apply_point(&inv, p);+ let t = if occ == 0 { solidcraft_doc::IDENTITY } else { joints::occurrence_world(&s.doc, occ) };+ let inv = solidcraft_doc::mat_inverse(&t)?;+ let q = solidcraft_doc::apply_point(&inv, p);let bb = b.mesh().bounds();let c = Vec3::new(q.x.clamp(bb.min.x, bb.max.x), q.y.clamp(bb.min.y, bb.max.y), q.z.clamp(bb.min.z, bb.max.z));let d = c.dist(q);@@ -126,10 +126,10 @@ fn origin_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<JointOriginNone => occurrence_at(s, world).ok_or_else(|| bad(cmd, "no body there"))?,};// World → the component's own coordinates.- let t = if occurrence == 0 { solvecraft_doc::IDENTITY } else { joints::occurrence_world(&s.doc, occurrence) };- let inv = solvecraft_doc::mat_inverse(&t).ok_or_else(|| bad(cmd, "occurrence transform"))?;- let local = |p: Vec3| solvecraft_doc::apply_point(&inv, p);- let local_dir = |d: Vec3| solvecraft_doc::apply_vector(&inv, d);+ let t = if occurrence == 0 { solidcraft_doc::IDENTITY } else { joints::occurrence_world(&s.doc, occurrence) };+ let inv = solidcraft_doc::mat_inverse(&t).ok_or_else(|| bad(cmd, "occurrence transform"))?;+ let local = |p: Vec3| solidcraft_doc::apply_point(&inv, p);+ let local_dir = |d: Vec3| solidcraft_doc::apply_vector(&inv, d);let snap = match what {"face" | "circle" => {let pick = local(world);@@ -139,7 +139,7 @@ fn origin_param(s: &Session, v: Option<&Value>, cmd: &str) -> Result<JointOrigin} else {pick};- let face = solvecraft_doc::naming::face_names_at(&s.model.state(), &[named_at]).into_iter().next().filter(|n| !n.is_empty());+ let face = solidcraft_doc::naming::face_names_at(&s.model.state(), &[named_at]).into_iter().next().filter(|n| !n.is_empty());if what == "face" { Snap::FaceCenter { pick, face } } else { Snap::CircleCenter { pick, face } }}"point" => Snap::Point { point: local(world), z: v.get("z").and_then(vec3).map(local_dir) },@@ -526,7 +526,7 @@ fn interference(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "inspect.interference";let want = string_list(p, "bodies");let st = s.world_state();- let bodies: Vec<&solvecraft_doc::ModelBody> =+ let bodies: Vec<&solidcraft_doc::ModelBody> =st.bodies.iter().filter(|b| want.is_empty() || want.contains(&b.name)).filter(|b| !b.body.is_mesh()).collect();if bodies.len() > 200 {return Err(bad(cmd, "too many bodies (200 at most)"));@@ -544,8 +544,8 @@ fn interference(s: &mut Session, p: &Value) -> Result<Value> {if apart {continue;}- let Ok(Some(o)) = solvecraft_kernel::boolean(&a.body, &b.body, solvecraft_kernel::BoolOp::Intersect) else { continue };- let Ok(m) = solvecraft_kernel::measure(&o) else { continue };+ let Ok(Some(o)) = solidcraft_kernel::boolean(&a.body, &b.body, solidcraft_kernel::BoolOp::Intersect) else { continue };+ let Ok(m) = solidcraft_kernel::measure(&o) else { continue };if m.volume > 1e-9 * a.body.size().max(1.0).powi(3) {hits.push(json!({"a": a.name, "b": b.name, "volume_mm3": m.volume, "area_mm2": m.area, "center": m.centroid, "bbox": {"min": m.bbox.min, "max": m.bbox.max}}));}@@ -559,8 +559,8 @@ fn interference(s: &mut Session, p: &Value) -> Result<Value> {mod tests;/// A point in the middle of the cylindrical face at `pick` (on its wall, halfway along).-fn cylinder_wall_point(b: &solvecraft_doc::kernel::Body, pick: Vec3) -> Option<Vec3> {- let c = solvecraft_doc::kernel::cylinder_face_at(b, pick)?;+fn cylinder_wall_point(b: &solidcraft_doc::kernel::Body, pick: Vec3) -> Option<Vec3> {+ let c = solidcraft_doc::kernel::cylinder_face_at(b, pick)?;let v = pick - c.axis_point;let along = v.dot(c.axis);let radial = (v - c.axis * along).normalized()?;diff --git a/crates/engine/src/cmd/joints_tests.rs b/crates/engine/src/cmd/joints_tests.rsindex 0e46e79ba4..11a905d388 100644--- a/crates/engine/src/cmd/joints_tests.rs+++ b/crates/engine/src/cmd/joints_tests.rs@@ -1,7 +1,7 @@use std::f64::consts::FRAC_PI_2;use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Session;@@ -18,7 +18,7 @@ fn occ(s: &Session, component: &str) -> u64 {}fn place(s: &Session, component: &str, p: Vec3) -> Vec3 {- solvecraft_doc::apply_point(&solvecraft_doc::joints::occurrence_world(&s.doc, occ(s, component)), p)+ solidcraft_doc::apply_point(&solidcraft_doc::joints::occurrence_world(&s.doc, occ(s, component)), p)}fn near(a: Vec3, b: Vec3) -> bool {@@ -55,9 +55,9 @@ fn revolute_hinge_turns_about_the_knuckle() {assert_eq!(dof, 1, "{l}");// Drive 90°: B turns about the knuckle axis (through (0, 33, 4), along the frame's z = −X).run(&mut s, "joint.drive", json!({"joint": "Hinge", "value": 90}));- let want = solvecraft_doc::rigid(Vec3::ZERO, Vec3::new(0.0, 33.0, 4.0), Vec3::new(-1.0, 0.0, 0.0), FRAC_PI_2);+ let want = solidcraft_doc::rigid(Vec3::ZERO, Vec3::new(0.0, 33.0, 4.0), Vec3::new(-1.0, 0.0, 0.0), FRAC_PI_2);let p = Vec3::new(20.0, 0.0, 0.0);- assert!(near(place(&s, "LeafB", p), solvecraft_doc::apply_point(&want, p)), "{:?}", place(&s, "LeafB", p));+ assert!(near(place(&s, "LeafB", p), solidcraft_doc::apply_point(&want, p)), "{:?}", place(&s, "LeafB", p));assert!(near(place(&s, "LeafB", p), Vec3::new(20.0, 29.0, 37.0)));// LeafA did not move; the knuckle axis is fixed.assert!(near(place(&s, "LeafA", p), p));@@ -108,7 +108,7 @@ fn slider_limits_clamp() {.doc.features.iter()- .find(|f| matches!(f.kind, solvecraft_doc::FeatureKind::Box { .. }))+ .find(|f| matches!(f.kind, solidcraft_doc::FeatureKind::Box { .. })).and_then(|f| f.param_names.get(2).cloned()).unwrap_or_default();run(&mut s, "parameters.change", json!({"name": h, "expression": "15"}));@@ -176,7 +176,7 @@ fn motion_links_and_interference() {run(&mut s, "joint.drive", json!({"joint": "Screw", "values": [0, 3]}));assert!(near(place(&s, "D", Vec3::new(65.0, 5.0, 0.0)), Vec3::new(5.0, 5.0, 16.0)), "{:?}", place(&s, "D", Vec3::new(65.0, 5.0, 0.0)));// Saved and reopened, joints come back.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.assembly, s.doc.assembly);let mut t = Session::new(back);let l = run(&mut t, "joint.list", json!({}));diff --git a/crates/engine/src/cmd/measure_sel.rs b/crates/engine/src/cmd/measure_sel.rsindex 9c978dfcb5..4ad82745d1 100644--- a/crates/engine/src/cmd/measure_sel.rs+++ b/crates/engine/src/cmd/measure_sel.rs@@ -3,7 +3,7 @@//! points) and, where both have a direction (planar faces, straight edges), the angle.use serde_json::{Value, json};-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::params::bad;use crate::{Result, Sel, Session};diff --git a/crates/engine/src/cmd/mesh.rs b/crates/engine/src/cmd/mesh.rsindex 1e72e88920..71361b65af 100644--- a/crates/engine/src/cmd/mesh.rs+++ b/crates/engine/src/cmd/mesh.rs@@ -1,8 +1,8 @@//! Parametric reconstruction of imported mechanical mesh bodies.use serde_json::Value;-use solvecraft_doc::FeatureKind;-use solvecraft_doc::expr::Kind;+use solidcraft_doc::FeatureKind;+use solidcraft_doc::expr::Kind;use super::{CommandSpec,diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rsindex 3a892ae327..797972da6a 100644--- a/crates/engine/src/cmd/mod.rs+++ b/crates/engine/src/cmd/mod.rs@@ -1,4 +1,4 @@-//! The command registry. Ids are SolveCraft's own dotted ids (`solid.extrude`,+//! The command registry. Ids are SolidCraft's own dotted ids (`solid.extrude`,//! `sketch.rectangle.two_point`); the toolbar placement (`tab`, `panel`) follows the familiar//! Design workspace layout.diff --git a/crates/engine/src/cmd/motion.rs b/crates/engine/src/cmd/motion.rsindex 367e942ee3..ab9b42f16d 100644--- a/crates/engine/src/cmd/motion.rs+++ b/crates/engine/src/cmd/motion.rs@@ -1,11 +1,11 @@//! Contact Sets, Motion Study and Exploded views.use serde_json::{Value, json};-use solvecraft_doc::Mat;-use solvecraft_doc::joints::{self, JointKind};-use solvecraft_doc::motion::{ContactSet, ExplodedView, MotionStudy, StudyKey};-use solvecraft_geom::Vec3;-use solvecraft_kernel::Body;+use solidcraft_doc::Mat;+use solidcraft_doc::joints::{self, JointKind};+use solidcraft_doc::motion::{ContactSet, ExplodedView, MotionStudy, StudyKey};+use solidcraft_geom::Vec3;+use solidcraft_kernel::Body;use super::CommandSpec;use super::joints::{joint_id, occurrence_id, resolve, value};@@ -93,8 +93,8 @@ fn placed(s: &Session) -> Vec<(Vec<u64>, Body)> {// Moving a body into another component preserves its world placement using an// offset from its authoring frame. Contact and explode centres must use that// same offset as display and physical properties.- let frame = s.doc.model_body_offset(b).map(|offset| solvecraft_doc::mat_mul(&m, offset)).unwrap_or(m);- if let Ok(t) = solvecraft_kernel::transform_matrix(&b.body, frame) {+ let frame = s.doc.model_body_offset(b).map(|offset| solidcraft_doc::mat_mul(&m, offset)).unwrap_or(m);+ if let Ok(t) = solidcraft_kernel::transform_matrix(&b.body, frame) {out.push((path.clone(), t));}}@@ -141,7 +141,7 @@ fn overlap(a: &Body, b: &Body) -> Option<f64> {mesh_overlap(&ma, &mb, 1e-4 * a.size().max(b.size()).max(1.0))}-fn mesh_overlap(ma: &solvecraft_geom::Mesh, mb: &solvecraft_geom::Mesh, tol: f64) -> Option<f64> {+fn mesh_overlap(ma: &solidcraft_geom::Mesh, mb: &solidcraft_geom::Mesh, tol: f64) -> Option<f64> {let (ba, bb) = (ma.bounds(), mb.bounds());if ba.max.x < bb.min.x + tol|| bb.max.x < ba.min.x + tol@@ -156,12 +156,12 @@ fn mesh_overlap(ma: &solvecraft_geom::Mesh, mb: &solvecraft_geom::Mesh, tol: f64(depth > tol).then_some(depth)}-fn tris(m: &solvecraft_geom::Mesh) -> Vec<[Vec3; 3]> {+fn tris(m: &solidcraft_geom::Mesh) -> Vec<[Vec3; 3]> {m.triangles.iter().filter_map(|t| m.tri(t)).collect()}/// The deepest any sample point of `a` lies inside `b` (0 if none).-fn deepest(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh, tol: f64) -> f64 {+fn deepest(a: &solidcraft_geom::Mesh, b: &solidcraft_geom::Mesh, tol: f64) -> f64 {let tb = tris(b);let bx = b.bounds();let mut pts: Vec<Vec3> = a.positions.clone();@@ -589,7 +589,7 @@ fn export(s: &mut Session, p: &Value) -> Result<Value> {} else {serde_json::to_string_pretty(&out).unwrap_or_default()};- solvecraft_io::write_atomic(std::path::Path::new(path), text.as_bytes(), false).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::write_atomic(std::path::Path::new(path), text.as_bytes(), false).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;return Ok(json!({"path": path, "samples": rows.len()}));}Ok(out)@@ -715,7 +715,7 @@ fn explode_delete(s: &mut Session, p: &Value) -> Result<Value> {/// World position of a point of an occurrence (tests).#[cfg(test)]pub fn world_point(s: &Session, occurrence: u64, p: Vec3) -> Vec3 {- solvecraft_doc::apply_point(&joints::occurrence_world(&s.doc, occurrence), p)+ solidcraft_doc::apply_point(&joints::occurrence_world(&s.doc, occurrence), p)}#[cfg(test)]diff --git a/crates/engine/src/cmd/motion_tests.rs b/crates/engine/src/cmd/motion_tests.rsindex 866adbe757..449448b1e4 100644--- a/crates/engine/src/cmd/motion_tests.rs+++ b/crates/engine/src/cmd/motion_tests.rs@@ -1,5 +1,5 @@use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Session;@@ -130,7 +130,7 @@ fn motion_study_plays_and_exports() {// The B occurrence's origin moves by the slider value (it starts at 0 offset with value 0 at 10 mm… so 10 → −5).assert!((bx(&rows[1]) - bx(&rows[0]) + 3.75).abs() < 1e-6, "{e}");assert!(rows[4]["stopped_by_contact"].is_object());- let dir = std::env::temp_dir().join(format!("solvecraft-motion-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-motion-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let csv = dir.join("push.csv");run(&mut s, "motion.export", json!({"study": "Push", "samples": 3, "path": csv.to_string_lossy()}));diff --git a/crates/engine/src/cmd/occurrence_tests.rs b/crates/engine/src/cmd/occurrence_tests.rsindex 515c9cb91f..530d4ae581 100644--- a/crates/engine/src/cmd/occurrence_tests.rs+++ b/crates/engine/src/cmd/occurrence_tests.rs@@ -190,8 +190,8 @@ fn duplicate_nested_labels_use_full_path_and_reopen_undo_preserve_placements() {let (parent_component, parent) = created(&mut s, "Parent");let (_, child) = created(&mut s, "Child");run(&mut s, "solid.box", json!({"length":1,"width":1,"height":1}));- let parent2 = s.doc_mut().add_occurrence(parent_component, 0, solvecraft_doc::IDENTITY).unwrap();- let parent3 = s.doc_mut().add_occurrence(parent_component, 0, solvecraft_doc::IDENTITY).unwrap();+ let parent2 = s.doc_mut().add_occurrence(parent_component, 0, solidcraft_doc::IDENTITY).unwrap();+ let parent3 = s.doc_mut().add_occurrence(parent_component, 0, solidcraft_doc::IDENTITY).unwrap();for o in s.doc_mut().occurrences.iter_mut().filter(|o| o.id == parent2 || o.id == parent3) {o.name = "Same".into();}@@ -199,7 +199,7 @@ fn duplicate_nested_labels_use_full_path_and_reopen_undo_preserve_placements() {let a = s.occurrence_bodies(&[parent2, child], false).unwrap()[0].clone();let b = s.occurrence_bodies(&[parent3, child], false).unwrap()[0].clone();assert_ne!(a, b);- let mut reopened = Session::new(solvecraft_doc::format::read(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::format::read(&s.doc.to_json()).unwrap());assert_eq!(reopened.occurrence_bodies(&[parent2, child], false).unwrap()[0], a);assert_eq!(reopened.occurrence_bodies(&[parent3, child], false).unwrap()[0], b);run(&mut reopened, "selection.delete", json!({"occurrences":[parent3]}));@@ -218,7 +218,7 @@ fn compact_duplicated_assembly_exact_resolution_and_expansion_limit() {let component = s.doc_mut().add_component(Some(&format!("Level{i}")), parent).unwrap();let occurrence = s.doc.occurrence_of(component).unwrap().id;path.push(occurrence);- s.doc_mut().add_occurrence(component, parent, solvecraft_doc::IDENTITY).unwrap();+ s.doc_mut().add_occurrence(component, parent, solidcraft_doc::IDENTITY).unwrap();parent = component;}assert!(s.occurrence_placement(&path).is_ok());@@ -326,7 +326,7 @@ fn isolate_nested_child_hides_ancestor_material_and_sibling() {.add_occurrence(child_component,parent_component,- solvecraft_doc::rigid(crate::geom::Vec3::new(20.0, 0.0, 0.0), crate::geom::Vec3::ZERO, crate::geom::Vec3::Z, 0.0),+ solidcraft_doc::rigid(crate::geom::Vec3::new(20.0, 0.0, 0.0), crate::geom::Vec3::ZERO, crate::geom::Vec3::Z, 0.0),).unwrap();s.refresh();@@ -412,14 +412,14 @@ fn instance_styles_follow_source_identity_after_collision_rename_and_pending_movassert!((measured["bodies"][0]["mass_g"].as_f64().unwrap() - 0.068).abs() < 1e-8);}let definition = s.model.state();- assert_eq!(solvecraft_kernel::measure(&definition.body("Shared Renamed").unwrap().body).unwrap().bbox.min, crate::geom::Vec3::ZERO);+ assert_eq!(solidcraft_kernel::measure(&definition.body("Shared Renamed").unwrap().body).unwrap().bbox.min, crate::geom::Vec3::ZERO);let painted = s.doc.painted(&world);let secondname = s.occurrence_bodies(&[second], false).unwrap()[0].clone();let body = painted.body(&secondname).unwrap();assert_eq!(body.body.color(), Some([1.0, 0.0, 0.0]));assert!(body.body.paint().unwrap().faces.iter().any(|f| f.color == [0.0, 1.0, 0.0]));- let bytes = solvecraft_io::export(&painted, &[secondname], solvecraft_io::Format::Step, "InstanceStyles").unwrap();- let imported = solvecraft_kernel::step_import(&String::from_utf8(bytes).unwrap()).unwrap();+ let bytes = solidcraft_io::export(&painted, &[secondname], solidcraft_io::Format::Step, "InstanceStyles").unwrap();+ let imported = solidcraft_kernel::step_import(&String::from_utf8(bytes).unwrap()).unwrap();assert_eq!(imported.bodies.len(), 1);assert_eq!(imported.bodies[0].body.color(), Some([1.0, 0.0, 0.0]));assert!(imported.bodies[0].body.paint().unwrap().faces.iter().any(|f| f.color == [0.0, 1.0, 0.0]));diff --git a/crates/engine/src/cmd/offset_edit_guard_tests.rs b/crates/engine/src/cmd/offset_edit_guard_tests.rsindex ec535c090f..87187cb675 100644--- a/crates/engine/src/cmd/offset_edit_guard_tests.rs+++ b/crates/engine/src/cmd/offset_edit_guard_tests.rs@@ -1,8 +1,8 @@#![allow(clippy::unwrap_used, clippy::panic)]use serde_json::{Value, json};-use solvecraft_doc::{Document, FeatureKind, ProfileSel};-use solvecraft_geom::Vec2;-use solvecraft_sketch::{CurveKind, Sketch};+use solidcraft_doc::{Document, FeatureKind, ProfileSel};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{CurveKind, Sketch};use crate::{Session, Snapshot};diff --git a/crates/engine/src/cmd/offset_identity_tests.rs b/crates/engine/src/cmd/offset_identity_tests.rsindex 90be0ab9b2..df7aba63ff 100644--- a/crates/engine/src/cmd/offset_identity_tests.rs+++ b/crates/engine/src/cmd/offset_identity_tests.rs@@ -1,6 +1,6 @@#![allow(clippy::unwrap_used, clippy::panic)]use serde_json::{Value, json};-use solvecraft_doc::{Document, FeatureKind, ProfileSel};+use solidcraft_doc::{Document, FeatureKind, ProfileSel};use crate::Session;@@ -26,7 +26,7 @@ fn rounded_offset(radius: f64) -> (Session, u64, String, String) {fn volume(session: &Session, feature: u64) -> f64 {let state = session.model.state();let body = state.bodies.iter().find(|body| body.feature == feature).unwrap();- solvecraft_kernel::measure(&body.body).unwrap().volume+ solidcraft_kernel::measure(&body.body).unwrap().volume}fn healthy(session: &Session) {@@ -41,13 +41,13 @@ fn legacy_offset_capture_persists_reserved_curves_without_a_transient_associatiolet reserved = raw.offsets[0].outputs.clone();assert_eq!(reserved.len(), 8);raw.offsets[0].topology = None;- document.format = "solvecraft/11".into();+ document.format = "solidcraft/11".into();let mut session = Session::new(Document::from_json(&document.to_json()).unwrap());assert!(session.doc.sketch(sketch).unwrap().offsets[0].topology.is_none());let state = session.model.state();let solved = state.sketch(sketch).unwrap();assert!(solved.sketch.offsets[0].topology.is_some(), "legacy upgrade belongs only to the evaluated copy");- let index = solvecraft_doc::profile_selection_indices(solved, &ProfileSel::Curves { loops: vec![reserved.clone()] }).unwrap()[0];+ let index = solidcraft_doc::profile_selection_indices(solved, &ProfileSel::Curves { loops: vec![reserved.clone()] }).unwrap()[0];let extrusion = run(&mut session, "solid.extrude", json!({"sketch":sketch,"profiles":[index],"distance":2,"name":"Legacy inner"}))["feature"].as_u64().unwrap();diff --git a/crates/engine/src/cmd/offset_plane_face_tests.rs b/crates/engine/src/cmd/offset_plane_face_tests.rsindex 148c62ff9a..7985ce64bc 100644--- a/crates/engine/src/cmd/offset_plane_face_tests.rs+++ b/crates/engine/src/cmd/offset_plane_face_tests.rs@@ -1,9 +1,9 @@#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]use crate::Session;use serde_json::{Value, json};-use solvecraft_doc::construct::ConstructGeom;-use solvecraft_doc::{Document, FeatureKind, PlaneRef};-use solvecraft_geom::Plane;+use solidcraft_doc::construct::ConstructGeom;+use solidcraft_doc::{Document, FeatureKind, PlaneRef};+use solidcraft_geom::Plane;fn run(s: &mut Session, command: &str, params: Value) -> Value {s.execute(command, ¶ms).unwrap_or_else(|e| panic!("{command} {params}: {e}"))@@ -18,7 +18,7 @@ fn plane(s: &Session, name: &str) -> Plane {}fn volume(s: &Session) -> f64 {- s.model.state().bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum()+ s.model.state().bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).sum()}#[test]diff --git a/crates/engine/src/cmd/offset_topology_tests.rs b/crates/engine/src/cmd/offset_topology_tests.rsindex e1f01eed78..1d418e1fa7 100644--- a/crates/engine/src/cmd/offset_topology_tests.rs+++ b/crates/engine/src/cmd/offset_topology_tests.rs@@ -1,7 +1,7 @@#![allow(clippy::unwrap_used, clippy::panic)]use serde_json::{Value, json};-use solvecraft_doc::{FeatureKind, ProfileSel};-use solvecraft_geom::Vec3;+use solidcraft_doc::{FeatureKind, ProfileSel};+use solidcraft_geom::Vec3;use crate::Session;@@ -37,7 +37,7 @@ fn breaking_offset_preserves_downstream_material_history_and_source_independencerun(&mut session, "parameters.change", json!({"name":radius,"expression":"2 mm"}));assert!(session.model.results.iter().all(|result| result.error.is_none()));assert!((session.world_state().bodies.last().unwrap().mesh().measure().volume.abs() - before_volume).abs() < 1e-6);- let reopened = Session::new(solvecraft_doc::Document::from_json(&session.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&session.doc.to_json()).unwrap());assert!(reopened.model.results.iter().all(|result| result.error.is_none()));assert!((reopened.world_state().bodies.last().unwrap().mesh().measure().volume.abs() - before_volume).abs() < 1e-6);}@@ -87,7 +87,7 @@ fn inset_past_corner_radius_creates_a_real_boundary_and_saved_profile_identity()};check(&session);let saved = session.doc.to_json();- let reopened = Session::new(solvecraft_doc::Document::from_json(&saved).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&saved).unwrap());check(&reopened);assert_eq!(reopened.doc.to_json(), saved);let undo = session.undo.len();diff --git a/crates/engine/src/cmd/parameters.rs b/crates/engine/src/cmd/parameters.rsindex 69381cb8f0..aa3c214742 100644--- a/crates/engine/src/cmd/parameters.rs+++ b/crates/engine/src/cmd/parameters.rs@@ -3,7 +3,7 @@//! graph, CSV/JSON import and export, expression evaluation and autocomplete.use serde_json::{Value, json};-use solvecraft_doc::expr::{self, Kind};+use solidcraft_doc::expr::{self, Kind};use super::CommandSpec;use crate::params::{bad, bool_, str_};@@ -123,7 +123,7 @@ fn list(s: &mut Session, p: &Value) -> Result<Value> {(_, Some(f)) => f.to_ascii_lowercase(),_ => "all".to_string(),};- let mut rows: Vec<solvecraft_doc::ParamRow> = s+ let mut rows: Vec<solidcraft_doc::ParamRow> = s.doc.param_rows().into_iter()@@ -136,7 +136,7 @@ fn list(s: &mut Session, p: &Value) -> Result<Value> {.collect();// Favourites first; otherwise the table order (user, sketch, feature).rows.sort_by_key(|r| !r.favorite);- let cycles = solvecraft_doc::cycles(&s.doc.all_param_exprs());+ let cycles = solidcraft_doc::cycles(&s.doc.all_param_exprs());Ok(json!({"parameters": rows, "count": rows.len(), "cycles": cycles}))}@@ -203,7 +203,7 @@ fn graph(s: &mut Session, _p: &Value) -> Result<Value> {let (_, errs) = s.doc.param_values();let nodes: Vec<String> = s.doc.param_defs().into_iter().map(|d| d.name).collect();let edges: Vec<[String; 2]> = s.doc.param_graph().into_iter().map(|(a, b)| [a, b]).collect();- let cycles = solvecraft_doc::cycles(&s.doc.all_param_exprs());+ let cycles = solidcraft_doc::cycles(&s.doc.all_param_exprs());Ok(json!({"nodes": nodes, "edges": edges, "cycles": cycles, "errors": errs}))}@@ -229,7 +229,7 @@ fn export(s: &mut Session, p: &Value) -> Result<Value> {other => return Err(bad(cmd, format!("unknown format `{other}` (csv or json)"))),};if let Some(path) = path {- solvecraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;}Ok(json!({"format": format, "path": path, "text": text}))}@@ -242,7 +242,7 @@ fn import(s: &mut Session, p: &Value) -> Result<Value> {let text = match (str_(p, "text"), str_(p, "path")) {(Some(t), _) => t.to_string(),(None, Some(path)) => {- solvecraft_io::vfs::read_to_string(path, MAX_PARAMETER_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?+ solidcraft_io::vfs::read_to_string(path, MAX_PARAMETER_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?}_ => return Err(bad(cmd, "give `text` or `path`")),};@@ -272,10 +272,10 @@ fn evaluate(s: &mut Session, p: &Value) -> Result<Value> {let (vals, _) = s.doc.param_values();let defaults = expr::Defaults::for_unit(unit.unwrap_or(""), 1.0);let refs = expr::references(&e);- let lookup = |n: &str| vals.get(n).copied().ok_or_else(|| solvecraft_doc::DocError::Expr(format!("unknown parameter `{n}`")));+ let lookup = |n: &str| vals.get(n).copied().ok_or_else(|| solidcraft_doc::DocError::Expr(format!("unknown parameter `{n}`")));let r = expr::eval_with_defaults(&e, &lookup, defaults).and_then(|v| match kind {Some(k) => v.to_kind_in(k, defaults).map(|x| (x, k)),- None => v.kind().map(|k| (v.v, k)).ok_or_else(|| solvecraft_doc::DocError::Expr(format!("the result is {}", v.describe()))),+ None => v.kind().map(|k| (v.v, k)).ok_or_else(|| solidcraft_doc::DocError::Expr(format!("the result is {}", v.describe()))),});Ok(match r {Ok((v, k)) => {@@ -301,7 +301,7 @@ fn complete(s: &mut Session, p: &Value) -> Result<Value> {let word: String = text.chars().rev().take_while(|c| c.is_alphanumeric() || *c == '_').collect::<Vec<_>>().into_iter().rev().collect();let starts = |n: &str| word.is_empty() || n.to_ascii_lowercase().starts_with(&word.to_ascii_lowercase());let mut out: Vec<Value> = Vec::new();- let mut rows: Vec<solvecraft_doc::ParamRow> = s.doc.param_rows().into_iter().filter(|r| starts(&r.name)).collect();+ let mut rows: Vec<solidcraft_doc::ParamRow> = s.doc.param_rows().into_iter().filter(|r| starts(&r.name)).collect();// Favourites, then user parameters, then the rest.rows.sort_by_key(|r| (!r.favorite, r.source != "user"));for r in rows.into_iter().take(200) {diff --git a/crates/engine/src/cmd/parameters_tests.rs b/crates/engine/src/cmd/parameters_tests.rsindex 9eaa66daad..a4b54aeef0 100644--- a/crates/engine/src/cmd/parameters_tests.rs+++ b/crates/engine/src/cmd/parameters_tests.rs@@ -157,7 +157,7 @@ fn rename_updates_every_reference() {assert!(rel(volume(&mut s), 40.0 * 40.0 * 10.0) < 1e-9);// Model and feature parameters can be renamed too: dimensions and features follow.let dim = s.doc.features.first().and_then(|f| match &f.kind {- solvecraft_doc::FeatureKind::Sketch { sketch, .. } => sketch.constraints.iter().filter_map(|c| c.param.clone()).next(),+ solidcraft_doc::FeatureKind::Sketch { sketch, .. } => sketch.constraints.iter().filter_map(|c| c.param.clone()).next(),_ => None,});let dim = dim.unwrap_or_default();@@ -235,7 +235,7 @@ fn csv_and_json_round_trip() {assert_eq!(s.doc.param("len").map(|p| p.expr.as_str()), Some("80 mm"));assert!(matches!(s.execute("parameters.import", &json!({})), Err(EngineError::BadParams { .. })));- let dir = std::env::temp_dir().join(format!("solvecraft-params-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-params-{}", std::process::id()));let _ = std::fs::create_dir_all(&dir);let path = dir.join("p.json");let r = run(&mut s, "parameters.export", json!({"path": path.to_string_lossy()}));@@ -307,7 +307,7 @@ fn dimension_edits_of_a_triconnected_linkage_continue_and_store_the_solved_sketclet solved = s.model.state().sketch(feature).unwrap().report.clone();assert!(solved.ok(), "{solved:?}");assert_eq!(linkage_turns(&s, feature), before);- let mut fresh = solvecraft_doc::Model::default();+ let mut fresh = solidcraft_doc::Model::default();fresh.evaluate(&s.doc);let again = fresh.state().sketch(feature).unwrap().report.clone();assert!(again.ok() && again.continuations == 0, "{again:?}");@@ -348,7 +348,7 @@ fn a_failed_edit_keeps_the_stored_sketch_solved_for_its_values() {run(&mut s, "sketch.point", json!({"point": [200, 200]}));let stored = s.doc.sketch(feature).unwrap();for c in stored.constraints.iter().filter(|c| c.param.is_some()) {- let measured = solvecraft_sketch::measure_dimension(stored, &c.kind).unwrap();+ let measured = solidcraft_sketch::measure_dimension(stored, &c.kind).unwrap();assert!((measured - c.kind.value().unwrap()).abs() < 1e-6, "{}: {measured} vs {:?}", c.id, c.kind.value());}}@@ -396,7 +396,7 @@ fn a_design_stored_with_other_values_still_rebuilds() {run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"sketch": "Linkage", "distance": 5}));set_params(&mut s, ¶ms, &FLIPPING);- let s = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let s = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());let state = s.model.state();let solved = state.sketch(feature).unwrap();assert!(solved.report.ok() && !solved.report.folded.is_empty(), "{:?}", solved.report);@@ -450,7 +450,7 @@ fn a_failed_auto_constrain_keeps_the_stored_sketch_consistent() {let consistent = |s: &Session, feature: u64| {let stored = s.doc.sketch(feature).unwrap();stored.constraints.iter().filter(|c| c.param.is_some()).all(|c| {- let measured = solvecraft_sketch::measure_dimension(stored, &c.kind).unwrap();+ let measured = solidcraft_sketch::measure_dimension(stored, &c.kind).unwrap();(measured - c.kind.value().unwrap()).abs() < 1e-6})};@@ -473,7 +473,7 @@ fn a_failed_auto_constrain_keeps_the_stored_sketch_consistent() {}/// The stored sketch's points, by id.-fn stored_points(s: &Session, feature: u64) -> Vec<solvecraft_geom::Vec2> {+fn stored_points(s: &Session, feature: u64) -> Vec<solidcraft_geom::Vec2> {s.doc.sketch(feature).unwrap().points.iter().map(|p| p.pos).collect()}@@ -504,7 +504,7 @@ fn an_unsolvable_value_edit_is_refused_and_changes_nothing() {fn value_edits_continue_from_the_last_solved_state() {// A → B → C, each a small edit solved in one jump; C is solved from B (the stored state),// and setting both values back reproduces A (the linkage is fully constrained).- let close = |a: &[solvecraft_geom::Vec2], b: &[solvecraft_geom::Vec2], tol: f64| a.iter().zip(b).all(|(p, q)| p.dist(*q) < tol);+ let close = |a: &[solidcraft_geom::Vec2], b: &[solidcraft_geom::Vec2], tol: f64| a.iter().zip(b).all(|(p, q)| p.dist(*q) < tol);let (mut s, feature, params) = linkage_session();run(&mut s, "sketch.finish", json!({}));let a = stored_points(&s, feature);@@ -520,7 +520,7 @@ fn value_edits_continue_from_the_last_solved_state() {let stored = from_b.driving_values();let (vals, _) = s.doc.param_values();s.doc.apply_dimension_values(&vals, &mut from_b).unwrap();- assert!(solvecraft_sketch::solve_after_value_edit(&mut from_b, &stored).ok());+ assert!(solidcraft_sketch::solve_after_value_edit(&mut from_b, &stored).ok());assert!(close(&c, &from_b.points.iter().map(|p| p.pos).collect::<Vec<_>>(), 1e-6) && !close(&c, &b, 1e-3));run(&mut s, "parameters.change", json!({"name": params[7], "expression": p7}));run(&mut s, "parameters.change", json!({"name": params[8], "expression": p8}));diff --git a/crates/engine/src/cmd/parts.rs b/crates/engine/src/cmd/parts.rsindex 92cc7529c5..b0a60e4bbb 100644--- a/crates/engine/src/cmd/parts.rs+++ b/crates/engine/src/cmd/parts.rs@@ -8,7 +8,7 @@//! washer, the top of a set screw or pin); the shank runs down −z.use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, num, str_, vec3};@@ -355,7 +355,7 @@ fn insert(s: &mut Session, p: &Value) -> Result<Value> {let c = run(s, "component.create", json!({"name": name}))?;let (comp, occ) = (c["component"].as_u64().unwrap_or(0), c["occurrence"].as_u64().unwrap_or(0));build(s, &sh)?;- s.doc_mut().parts.insert(comp, solvecraft_doc::StandardPart { family: family.clone(), size: size.clone(), length: shape_len(&sh) });+ s.doc_mut().parts.insert(comp, solidcraft_doc::StandardPart { family: family.clone(), size: size.clone(), length: shape_len(&sh) });run(s, "component.activate", json!({"component": active}))?;let mut out = json!({"component": comp, "occurrence": occ, "name": name});if let (Some(a), Some(h)) = (at, host) {@@ -370,7 +370,7 @@ fn insert(s: &mut Session, p: &Value) -> Result<Value> {} else if let Some(pt) = p.get("point").and_then(vec3) {// Placed at a point, its +z along `direction`.let dir = p.get("direction").and_then(vec3).and_then(|d| d.normalized()).unwrap_or(Vec3::Z);- let m = solvecraft_doc::rigid(+ let m = solidcraft_doc::rigid(Vec3::ZERO,Vec3::ZERO,Vec3::Z.cross(dir).normalized().unwrap_or(Vec3::X),@@ -393,7 +393,7 @@ fn hole_wall(s: &Session, a: Vec3) -> Option<Vec3> {for b in &st.bodies {for d in dirs {let q = a + d * step;- if let Some(c) = solvecraft_doc::kernel::cylinder_face_at(&b.body, q) {+ if let Some(c) = solidcraft_doc::kernel::cylinder_face_at(&b.body, q) {let v = q - c.axis_point;let along = v.dot(c.axis);let on_wall = ((v - c.axis * along).len() - c.radius).abs() < 1e-3 && along > c.start && along < c.end;@@ -435,7 +435,7 @@ fn resize(s: &mut Session, p: &Value) -> Result<Value> {run(s, "component.activate", json!({"component": comp}))?;build(s, &sh)?;let name = part_name(&part.family, &size, &sh);- s.doc_mut().parts.insert(comp, solvecraft_doc::StandardPart { family: part.family.clone(), size: size.clone(), length: shape_len(&sh) });+ s.doc_mut().parts.insert(comp, solidcraft_doc::StandardPart { family: part.family.clone(), size: size.clone(), length: shape_len(&sh) });if let Some(c) = s.doc_mut().components.iter_mut().find(|c| c.id == comp) {c.name = name.clone();}@@ -460,14 +460,14 @@ mod tests {}}- fn bbox(s: &Session, prefix: &str) -> (solvecraft_geom::Vec3, solvecraft_geom::Vec3) {+ fn bbox(s: &Session, prefix: &str) -> (solidcraft_geom::Vec3, solidcraft_geom::Vec3) {let st = s.world_state();let comp = s.doc.components.iter().find(|c| c.name.starts_with(prefix)).map(|c| c.id).unwrap_or(0);- let (mut lo, mut hi) = (solvecraft_geom::Vec3::new(f64::MAX, f64::MAX, f64::MAX), solvecraft_geom::Vec3::new(f64::MIN, f64::MIN, f64::MIN));+ let (mut lo, mut hi) = (solidcraft_geom::Vec3::new(f64::MAX, f64::MAX, f64::MAX), solidcraft_geom::Vec3::new(f64::MIN, f64::MIN, f64::MIN));for b in st.bodies.iter().filter(|b| s.doc.model_body_component(b) == comp) {let m = b.mesh().bounds();- lo = solvecraft_geom::Vec3::new(lo.x.min(m.min.x), lo.y.min(m.min.y), lo.z.min(m.min.z));- hi = solvecraft_geom::Vec3::new(hi.x.max(m.max.x), hi.y.max(m.max.y), hi.z.max(m.max.z));+ lo = solidcraft_geom::Vec3::new(lo.x.min(m.min.x), lo.y.min(m.min.y), lo.z.min(m.min.z));+ hi = solidcraft_geom::Vec3::new(hi.x.max(m.max.x), hi.y.max(m.max.y), hi.z.max(m.max.z));}(lo, hi)}diff --git a/crates/engine/src/cmd/patterns_tests.rs b/crates/engine/src/cmd/patterns_tests.rsindex 33a9446118..c94ffbd707 100644--- a/crates/engine/src/cmd/patterns_tests.rs+++ b/crates/engine/src/cmd/patterns_tests.rs@@ -85,7 +85,7 @@ fn circular_numeric_axis_origin_preserves_hole_geometry_and_reopens() {assert_eq!(s.doc.to_json(), before);run(&mut s, "edit.redo", json!({}));assert_eq!(s.doc.to_json(), saved);- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&saved).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&saved).unwrap());assert!(rel(volume(&mut reopened), expected) < 1e-4);}// The documented omission of origin still means zero.@@ -94,7 +94,7 @@ fn circular_numeric_axis_origin_preserves_hole_geometry_and_reopens() {let before = s.doc.to_json();run(&mut s, "solid.pattern.circular", json!({"bodies":["Cube"],"axis":{"dir":[0,0,1]},"count":4}));let implicit = s.doc.to_json();- let mut explicit = Session::new(solvecraft_doc::Document::from_json(&before).unwrap());+ let mut explicit = Session::new(solidcraft_doc::Document::from_json(&before).unwrap());run(&mut explicit, "solid.pattern.circular", json!({"bodies":["Cube"],"axis":{"origin":[0,0,0],"dir":[0,0,1]},"count":4}));assert_eq!(implicit, explicit.doc.to_json());}diff --git a/crates/engine/src/cmd/plastic.rs b/crates/engine/src/cmd/plastic.rsindex 86e333e165..74470aae8d 100644--- a/crates/engine/src/cmd/plastic.rs+++ b/crates/engine/src/cmd/plastic.rs@@ -1,10 +1,10 @@//! Plastic (enclosure) features: Boss, Lip / Groove, Snap Fit and Rest, and plastic rules.use serde_json::{Value, json};-use solvecraft_doc::FeatureKind;-use solvecraft_doc::expr::Kind;-use solvecraft_doc::plastic::PlasticRule;-use solvecraft_geom::Vec3;+use solidcraft_doc::FeatureKind;+use solidcraft_doc::expr::Kind;+use solidcraft_doc::plastic::PlasticRule;+use solidcraft_geom::Vec3;use super::CommandSpec;use super::features::{add_feature, check_expr};@@ -267,7 +267,7 @@ fn snap_fit(s: &mut Session, p: &Value) -> Result<Value> {#[cfg(test)]mod tests {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;use std::f64::consts::PI;use serde_json::{Value, json};@@ -362,7 +362,7 @@ mod tests {run(&mut s, "parameters.change", json!({"name":"board_d","expression":"50 mm"}));let before = s.model.state_before(feature.id);let name = feature.face_names.first().unwrap();- let point = solvecraft_doc::naming::point_on_face(&before, name, Vec3::new(0., -28., 20.))+ let point = solidcraft_doc::naming::point_on_face(&before, name, Vec3::new(0., -28., 20.)).expect("the original wall identity survives merged pieces").0;assert!((point - Vec3::new(0., -33., 20.)).len() < 1e-8, "{point:?}");@@ -372,7 +372,7 @@ mod tests {let after = &session.model.result(feature.id).unwrap().state;let old = before.body("Case").unwrap();let body = after.body("Case").unwrap();- let added = solvecraft_kernel::measure(&body.body).unwrap().volume - solvecraft_kernel::measure(&old.body).unwrap().volume;+ let added = solidcraft_kernel::measure(&body.body).unwrap().volume - solidcraft_kernel::measure(&old.body).unwrap().volume;// Rectangular arm + triangular catch; the small attachment overlap lies inside the wall.assert!((added - (8. * 1.2 + 0.8 * 1.5 / 2.) * 6.).abs() < 0.05, "{added}");let mesh = body.mesh();@@ -382,7 +382,7 @@ mod tests {assert!(!mesh.contains(Vec3::new(0., -24., 19.4)), "the arm ends at its specified length");};check(&s);- let cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(cold.model.results.iter().all(|result| result.error.is_none()));check(&cold);}diff --git a/crates/engine/src/cmd/revolve_convention_tests.rs b/crates/engine/src/cmd/revolve_convention_tests.rsindex 55cf400ca6..e2f40d67e3 100644--- a/crates/engine/src/cmd/revolve_convention_tests.rs+++ b/crates/engine/src/cmd/revolve_convention_tests.rs@@ -2,8 +2,8 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_doc::{Document, FeatureKind, RevolveConvention};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Document, FeatureKind, RevolveConvention};+use solidcraft_geom::Vec3;use std::f64::consts::{FRAC_PI_2, PI, SQRT_2};fn run(s: &mut Session, cmd: &str, p: Value) -> Value {@@ -28,7 +28,7 @@ fn turn(s: &mut Session, sign: f64, settings: Value) {fn check_centered(s: &Session, opposed: bool) {let state = s.model.state();let expected = 30.0 * PI * if opposed { 2.0 } else { 1.0 };- let volume: f64 = state.bodies.iter().map(|mb| solvecraft_kernel::measure(&mb.body).unwrap().volume).sum();+ let volume: f64 = state.bodies.iter().map(|mb| solidcraft_kernel::measure(&mb.body).unwrap().volume).sum();assert!((volume - expected).abs() < 0.03, "{volume} vs {expected}");for sign in if opposed { vec![1.0, -1.0] } else { vec![1.0] } {let body = &state.bodies.iter().find(|mb| mb.body.contains(Vec3::new(sign * 3.0, 5.0, 0.0))).unwrap().body;@@ -40,7 +40,7 @@ fn check_centered(s: &Session, opposed: bool) {assert!((bounds.max.z - 2.0 * SQRT_2).abs() < 1e-6, "{bounds:?}");let inner_x = if sign > 0.0 { bounds.min.x } else { -bounds.max.x };assert!((inner_x - SQRT_2).abs() < 1e-6, "{bounds:?}");- let centroid = solvecraft_kernel::measure(body).unwrap().centroid;+ let centroid = solidcraft_kernel::measure(body).unwrap().centroid;let radial = (2.0 / 3.0) * (64.0 - 8.0) / (16.0 - 4.0);let want_x = radial * (PI / 4.0).sin() / (PI / 4.0);assert!((centroid.x - sign * want_x).abs() < 0.005, "{centroid:?}");@@ -87,7 +87,7 @@ fn two_sided_revolves_use_the_canonical_negative_and_positive_limits() {assert!((bounds.max.z - 2.0 * 3.0f64.sqrt()).abs() < 1e-6);assert!(body.contains(Vec3::new(3.0, 5.0, 0.0)));assert!(!body.contains(Vec3::new(0.0, 5.0, 3.0)));- assert!((solvecraft_kernel::measure(body).unwrap().volume - 30.0 * PI).abs() < 0.03);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 30.0 * PI).abs() < 0.03);}}@@ -97,7 +97,7 @@ fn legacy_missing_convention_keeps_geometry_through_edit_redefine_undo_and_reopeprofile(&mut s, false);turn(&mut s, -1.0, json!({"convention":"legacy_axis_start"}));let mut saved: Value = serde_json::from_str(&s.doc.to_json()).unwrap();- saved["format"] = json!("solvecraft/10");+ saved["format"] = json!("solidcraft/10");for f in saved["features"].as_array_mut().unwrap() {f.as_object_mut().unwrap().remove("convention");}@@ -149,7 +149,7 @@ fn extent_handle_angles_match_new_and_legacy_material() {let ss = &state.sketches[0];let regions = vec![ss.profiles[0].region.clone()];for convention in [RevolveConvention::SketchNormal, RevolveConvention::LegacyAxisStart] {- let extent = solvecraft_doc::revolve_extent_with_convention(+ let extent = solidcraft_doc::revolve_extent_with_convention(&state,&ss.plane,®ions,@@ -180,7 +180,7 @@ fn symmetric_revolve_preserves_a_translated_rotated_sketch_frame() {assert!(bounds.max.dist(Vec3::new(20.0, 20.0 + 2.0 * SQRT_2, 34.0)) < 1e-4, "{bounds:?}");assert!(body.contains(Vec3::new(15.0, 20.0, 33.0)));assert!(!body.contains(Vec3::new(15.0, 23.0, 30.0)));- assert!((solvecraft_kernel::measure(body).unwrap().volume - 30.0 * PI).abs() < 0.03);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 30.0 * PI).abs() < 0.03);}#[test]@@ -217,7 +217,7 @@ fn centered_coplanar_cut_uses_the_actual_angular_interval() {// Removed sector clipped by x>=2: 10∫[-π/4,π/4](16−4sec²θ)/2 dθ.// The sector crosses the whole stock at z=0, leaving two disconnected solids.let expected = 200.0 - 40.0 * PI;- let volumes: Vec<_> = state.bodies.iter().map(|mb| solvecraft_kernel::measure(&mb.body).unwrap().volume).collect();+ let volumes: Vec<_> = state.bodies.iter().map(|mb| solidcraft_kernel::measure(&mb.body).unwrap().volume).collect();let total: f64 = volumes.iter().sum();assert!((total - expected).abs() < 0.05, "{volumes:?}: total{total}, expected{expected}");assert_eq!(state.bodies.len(), 2);@@ -241,7 +241,7 @@ fn one_sided_and_full_revolves_keep_the_existing_material() {assert!(body.contains(Vec3::new(3.0 / SQRT_2, 5.0, 3.0 / SQRT_2)));assert_eq!(body.contains(Vec3::new(-3.0 / SQRT_2, 5.0, -3.0 / SQRT_2)), angle == "360 deg");let expected = if angle == "360 deg" { 120.0 * PI } else { 30.0 * PI };- assert!((solvecraft_kernel::measure(body).unwrap().volume - expected).abs() < 0.08);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - expected).abs() < 0.08);}}}@@ -256,7 +256,7 @@ fn point_targets_use_each_profiles_canonical_axis_for_both_axis_signs() {turn(&mut s, sign, json!({"to":[0,5,3]}));let state = s.model.state();let expected = 30.0 * PI * if opposed { 2.0 } else { 1.0 };- let volume: f64 = state.bodies.iter().map(|mb| solvecraft_kernel::measure(&mb.body).unwrap().volume).sum();+ let volume: f64 = state.bodies.iter().map(|mb| solidcraft_kernel::measure(&mb.body).unwrap().volume).sum();assert!((volume - expected).abs() < 0.05, "{volume}");assert!(state.bodies.iter().any(|mb| mb.body.contains(Vec3::new(3.0 / SQRT_2, 5.0, 3.0 / SQRT_2))));assert!(!state.bodies.iter().any(|mb| mb.body.contains(Vec3::new(3.0 / SQRT_2, 5.0, -3.0 / SQRT_2))));@@ -299,10 +299,10 @@ fn curved_targets_keep_only_the_material_before_the_post_for_both_axis_signs() {assert!(!arc.contains(Vec3::new(-side * 12.0 * (PI / 6.0).cos(), 6.0, -2.5)));assert!(!arc.contains(Vec3::new(side * 12.0 * (PI / 6.0).cos(), -6.0, -2.5)));let full = PI * (225.0 - 100.0) * 5.0;- let angle = solvecraft_kernel::measure(arc).unwrap().volume / full * 360.0;+ let angle = solidcraft_kernel::measure(arc).unwrap().volume / full * 360.0;assert!(angle > 60.0 && angle < 90.0, "{angle}");- let overlap = solvecraft_kernel::boolean(arc, post, solvecraft_kernel::BoolOp::Intersect).unwrap();- assert!(overlap.is_none_or(|b| solvecraft_kernel::measure(&b).unwrap().volume < 1e-3));+ let overlap = solidcraft_kernel::boolean(arc, post, solidcraft_kernel::BoolOp::Intersect).unwrap();+ assert!(overlap.is_none_or(|b| solidcraft_kernel::measure(&b).unwrap().volume < 1e-3));}}}diff --git a/crates/engine/src/cmd/section.rs b/crates/engine/src/cmd/section.rsindex a65f7ee429..60e136286e 100644--- a/crates/engine/src/cmd/section.rs+++ b/crates/engine/src/cmd/section.rs@@ -2,7 +2,7 @@//! positive side is hidden). It changes no geometry and is not an undo step.use serde_json::{Value, json};-use solvecraft_geom::{Plane, Vec3};+use solidcraft_geom::{Plane, Vec3};use super::CommandSpec;use crate::params::{bad, bool_, expr, vec3};@@ -35,13 +35,13 @@ fn section(s: &mut Session, p: &Value) -> Result<Value> {// A construction plane (name or id): where it is now.Some(v @ (Value::String(_) | Value::Number(_))) => {let r = super::features::plane_param(s, Some(v), cmd)?;- let solvecraft_doc::PlaneRef::Construction { name } = &r else { return Err(bad(cmd, "`plane` must be a plane")) };+ let solidcraft_doc::PlaneRef::Construction { name } = &r else { return Err(bad(cmd, "`plane` must be a plane")) };let st = s.model.state();let pl = st.construct.iter().find(|c| &c.name == name)- .and_then(|c| if let solvecraft_doc::construct::ConstructGeom::Plane(pl) = &c.geom { Some(*pl) } else { None })+ .and_then(|c| if let solidcraft_doc::construct::ConstructGeom::Plane(pl) = &c.geom { Some(*pl) } else { None }).ok_or_else(|| bad(cmd, format!("construction plane `{name}` is not built (rolled back, suppressed or failed)")))?;(pl.origin, pl.normal(), None)}@@ -54,7 +54,7 @@ fn section(s: &mut Session, p: &Value) -> Result<Value> {};let length = |key: &str| -> Result<Option<f64>> {match expr(p, key) {- Some(e) => s.doc.eval(&e, solvecraft_doc::expr::Kind::Length).map(Some).map_err(|e| bad(cmd, format!("{key}: {e}"))),+ Some(e) => s.doc.eval(&e, solidcraft_doc::expr::Kind::Length).map(Some).map_err(|e| bad(cmd, format!("{key}: {e}"))),None => Ok(None),}};diff --git a/crates/engine/src/cmd/sheet.rs b/crates/engine/src/cmd/sheet.rsindex 58c8d2731d..20c478a31f 100644--- a/crates/engine/src/cmd/sheet.rs+++ b/crates/engine/src/cmd/sheet.rs@@ -2,10 +2,10 @@//! the flat pattern (outline, bend lines, bend table) and its DXF export.use serde_json::{Value, json};-use solvecraft_doc::FeatureKind;-use solvecraft_doc::expr::Kind;-use solvecraft_doc::sheet::{SheetBody, SheetRule};-use solvecraft_geom::{Vec2, Vec3};+use solidcraft_doc::FeatureKind;+use solidcraft_doc::expr::Kind;+use solidcraft_doc::sheet::{SheetBody, SheetRule};+use solidcraft_geom::{Vec2, Vec3};use super::CommandSpec;use super::features::{add_feature, check_expr, feature_sketch, profiles, sketch_id};@@ -157,7 +157,7 @@ fn fold(s: &mut Session, p: &Value) -> Result<Value> {let ss = st.sketch(sk).ok_or_else(|| bad(cmd, "no such sketch"))?;let ci = ss.sketch.curve_index(&c).ok_or_else(|| bad(cmd, format!("no curve `{c}` in the sketch")))?;let (a, b) = match ss.sketch.segs(ci).as_slice() {- [solvecraft_geom::Seg2::Line { a, b }] => (ss.plane.to_world(*a), ss.plane.to_world(*b)),+ [solidcraft_geom::Seg2::Line { a, b }] => (ss.plane.to_world(*a), ss.plane.to_world(*b)),_ => return Err(bad(cmd, "the fold line must be a sketch line")),};(Some(sk), Some(c), a, b)@@ -323,7 +323,7 @@ fn flat_pattern(s: &mut Session, p: &Value) -> Result<Value> {pub fn flat_dxf(sh: &SheetBody) -> Result<String> {let regions = sh.flat_regions()?;let pockets = sh.machining()?;- let pocket_layer = |p: &solvecraft_doc::sheet::SheetPocket| {+ let pocket_layer = |p: &solidcraft_doc::sheet::SheetPocket| {let side = if p.z0 == 0.0 {"BOTTOM"} else if p.z1 == sh.t {@@ -384,9 +384,9 @@ pub fn flat_dxf(sh: &SheetBody) -> Result<String> {for (h, layer) in loops {// A circle is often represented by two semicircles. Keep the whole analytic// boundary as one CIRCLE rather than approximating outer boundaries with chords.- if let Some(solvecraft_geom::Seg2::Arc { center, radius, sweep, .. }) = h.segs.first() {- let total: f64 = h.segs.iter().filter_map(|s| if let solvecraft_geom::Seg2::Arc { sweep, .. } = s { Some(*sweep) } else { None }).sum();- let circular = h.segs.iter().all(|s| matches!(s, solvecraft_geom::Seg2::Arc { center: c, radius: r, sweep: a, .. } if c.dist(*center) < 1e-9 && (*r-*radius).abs() < 1e-9 && a.signum() == sweep.signum()));+ if let Some(solidcraft_geom::Seg2::Arc { center, radius, sweep, .. }) = h.segs.first() {+ let total: f64 = h.segs.iter().filter_map(|s| if let solidcraft_geom::Seg2::Arc { sweep, .. } = s { Some(*sweep) } else { None }).sum();+ let circular = h.segs.iter().all(|s| matches!(s, solidcraft_geom::Seg2::Arc { center: c, radius: r, sweep: a, .. } if c.dist(*center) < 1e-9 && (*r-*radius).abs() < 1e-9 && a.signum() == sweep.signum()));if circular && (total.abs() - std::f64::consts::TAU).abs() < 1e-9 {w(0, "CIRCLE");w(8, &layer);@@ -398,7 +398,7 @@ pub fn flat_dxf(sh: &SheetBody) -> Result<String> {}for seg in &h.segs {match *seg {- solvecraft_geom::Seg2::Arc { center, radius, start, sweep } => {+ solidcraft_geom::Seg2::Arc { center, radius, start, sweep } => {if (sweep.abs() - std::f64::consts::TAU).abs() < 1e-9 {w(0, "CIRCLE");w(8, &layer);@@ -438,7 +438,7 @@ fn export_dxf(s: &mut Session, p: &Value) -> Result<Value> {let sh = sheet_of(s, p, cmd)?;let text = flat_dxf(&sh)?;if let Some(path) = str_(p, "path").filter(|x| !x.trim().is_empty()) {- solvecraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;return Ok(json!({"path": path, "bends": sh.bends().len()}));}Ok(json!({"dxf": text, "bends": sh.bends().len()}))@@ -482,7 +482,7 @@ fn export_bend_table(s: &mut Session, p: &Value) -> Result<Value> {csv};if let Some(path) = str_(p, "path").filter(|x| !x.trim().is_empty()) {- solvecraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;return Ok(json!({"path": path, "format": format, "bends": sh.bends().len()}));}Ok(json!({"format": format, "text": text, "bends": sh.bends().len()}))diff --git a/crates/engine/src/cmd/sheet_tests.rs b/crates/engine/src/cmd/sheet_tests.rsindex 54d87cc0bb..bf1eafb343 100644--- a/crates/engine/src/cmd/sheet_tests.rs+++ b/crates/engine/src/cmd/sheet_tests.rs@@ -50,7 +50,7 @@ fn shallow_sheet_pocket_preserves_material_depth_export_undo_and_reopen() {assert_eq!(f["pockets"][0]["depth_mm"], 1.0);let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();assert!(dxf.contains("POCKET_BOTTOM_Z0.000000_TO_1.000000_MM"));- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 8);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 8);run(&mut s, "edit.undo", json!({}));assert!((volume(&mut s) - 15000.0).abs() < 1e-6);run(&mut s, "edit.redo", json!({}));@@ -59,10 +59,10 @@ fn shallow_sheet_pocket_preserves_material_depth_export_undo_and_reopen() {assert!((volume(&mut s) - 14900.0).abs() < 1e-6);let state = s.model.state();let body = &state.bodies[0].body;- assert!(!body.contains(solvecraft_geom::Vec3::new(25.0, 25.0, 0.5)));- assert!(body.contains(solvecraft_geom::Vec3::new(25.0, 25.0, 1.5)));+ assert!(!body.contains(solidcraft_geom::Vec3::new(25.0, 25.0, 0.5)));+ assert!(body.contains(solidcraft_geom::Vec3::new(25.0, 25.0, 1.5)));}- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!((volume(&mut reopened) - 14900.0).abs() < 1e-6);assert_eq!(flat(&mut reopened)["pockets"], f["pockets"]);}@@ -81,7 +81,7 @@ fn planar_sheet_intersection_retains_exact_outline_and_islands() {assert_eq!(flat(&mut s)["flat_size_mm"], json!([10.0, 10.0, 2.5]));}let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 4);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 4);let mut imported = Session::default();run(&mut imported, "sketch.insert_dxf", json!({"name":"Retained","text":dxf}));run(&mut imported, "sketch.finish", json!({}));@@ -212,26 +212,26 @@ fn intersect_preserves_both_material_regions_of_a_logical_ring_sheet() {let area: f64 = regions.iter().map(|r| r.area()).sum();assert!((area - (900.0 - PI * 75.0)).abs() < 1e-8, "area={area}");let body = &state.bodies[0].body;- assert!(body.contains(solvecraft_geom::Vec3::new(50.0, 30.0, 1.0)));- assert!(!body.contains(solvecraft_geom::Vec3::new(57.0, 30.0, 1.0)));- assert!(body.contains(solvecraft_geom::Vec3::new(64.0, 30.0, 1.0)));- assert!(!body.contains(solvecraft_geom::Vec3::new(70.0, 30.0, 1.0)));+ assert!(body.contains(solidcraft_geom::Vec3::new(50.0, 30.0, 1.0)));+ assert!(!body.contains(solidcraft_geom::Vec3::new(57.0, 30.0, 1.0)));+ assert!(body.contains(solidcraft_geom::Vec3::new(64.0, 30.0, 1.0)));+ assert!(!body.contains(solidcraft_geom::Vec3::new(70.0, 30.0, 1.0)));assert!((volume(&mut s) - (900.0 - PI * 75.0) * 2.5).abs() < 0.2);}let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 6);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 6);}#[test]fn machining_a_folded_parallel_panel_preserves_its_pocket_on_unfold() {- use solvecraft_doc::{apply_point, apply_vector};- use solvecraft_geom::Vec3;+ use solidcraft_doc::{apply_point, apply_vector};+ use solidcraft_geom::Vec3;let mut s = Session::default();base(&mut s, 100.0, 60.0);run(&mut s, "sheet.flange", json!({"edges":[[50,0,2.5]],"height":20}));let sh = s.model.state().sheets[0].clone();let points = sh.panel(&sh.flanges[0]).outer.polyline(1e-3);- let c = points.iter().copied().fold(solvecraft_geom::Vec2::ZERO, |sum, p| sum + p) / (points.len() as f64);+ let c = points.iter().copied().fold(solidcraft_geom::Vec2::ZERO, |sum, p| sum + p) / (points.len() as f64);let w = sh.world(Some(0));let origin = apply_point(&w, Vec3::ZERO);let x = apply_vector(&w, Vec3::X);@@ -268,8 +268,8 @@ fn flipped_sheet_pocket_keeps_depth_in_the_local_thickness_direction() {}assert!((volume(&mut s) - 14900.0).abs() < 1e-6);let state = s.model.state();- assert!(!state.bodies[0].body.contains(solvecraft_geom::Vec3::new(25.0, 25.0, -0.5)));- assert!(state.bodies[0].body.contains(solvecraft_geom::Vec3::new(25.0, 25.0, -1.5)));+ assert!(!state.bodies[0].body.contains(solidcraft_geom::Vec3::new(25.0, 25.0, -0.5)));+ assert!(state.bodies[0].body.contains(solidcraft_geom::Vec3::new(25.0, 25.0, -1.5)));}}@@ -300,10 +300,10 @@ fn multiple_profile_intersect_keeps_tool_union_for_solids_and_sheet_groups() {}let state = s.model.state();for x in [25.0, 65.0] {- assert!(state.bodies.iter().any(|b| b.body.contains(solvecraft_geom::Vec3::new(x, 25.0, 1.0))));+ assert!(state.bodies.iter().any(|b| b.body.contains(solidcraft_geom::Vec3::new(x, 25.0, 1.0))));}- assert!(!state.bodies.iter().any(|b| b.body.contains(solvecraft_geom::Vec3::new(50.0, 25.0, 1.0))));- assert!(state.bodies.iter().any(|b| b.name == "Control" && b.body.contains(solvecraft_geom::Vec3::new(205.0, 5.0, 5.0))));+ assert!(!state.bodies.iter().any(|b| b.body.contains(solidcraft_geom::Vec3::new(50.0, 25.0, 1.0))));+ assert!(state.bodies.iter().any(|b| b.name == "Control" && b.body.contains(solidcraft_geom::Vec3::new(205.0, 5.0, 5.0))));}}@@ -322,14 +322,14 @@ fn deleting_sheet_material_prunes_cosmetic_threads_and_undo_restores_them() {assert!(s.model.state().bodies.is_empty());assert!(s.model.state().sheets.is_empty());assert!(s.model.state().threads.is_empty());- assert!(solvecraft_doc::world_state(&s.doc, &s.model.state()).threads.is_empty());+ assert!(solidcraft_doc::world_state(&s.doc, &s.model.state()).threads.is_empty());run(&mut s, "edit.undo", json!({}));assert_eq!(s.model.state().threads.len(), 1);}#[test]fn sheet_pocket_transfer_keeps_local_depth_world_pose_and_history() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;fn check(s: &Session, name: &str, owner: u64, local_origin: Vec3, local_y: Vec3, transferred: bool) {let state = s.model.state();let mb = state.body(name).unwrap();@@ -341,8 +341,8 @@ fn sheet_pocket_transfer_keeps_local_depth_world_pose_and_history() {assert!(sh.frame.y.dist(local_y) < 1e-8);assert_eq!(sh.pockets.len(), 1);assert_eq!((sh.pockets[0].z0, sh.pockets[0].z1), (0.0, 1.0));- let cut = sh.frame.to_world(solvecraft_geom::Vec2::new(25.0, 25.0)) + sh.frame.normal() * 0.5;- let floor = sh.frame.to_world(solvecraft_geom::Vec2::new(25.0, 25.0)) + sh.frame.normal() * 1.5;+ let cut = sh.frame.to_world(solidcraft_geom::Vec2::new(25.0, 25.0)) + sh.frame.normal() * 0.5;+ let floor = sh.frame.to_world(solidcraft_geom::Vec2::new(25.0, 25.0)) + sh.frame.normal() * 1.5;assert!(!mb.body.contains(cut));assert!(mb.body.contains(floor));let world = s.world_state();@@ -352,7 +352,7 @@ fn sheet_pocket_transfer_keeps_local_depth_world_pose_and_history() {assert!(bounds.max.dist(Vec3::new(100.0, 60.0, 2.5)) < 1e-6, "{bounds:?}");assert!(!body.contains(Vec3::new(25.0, 25.0, 0.5)));assert!(body.contains(Vec3::new(25.0, 25.0, 1.5)));- assert!((solvecraft_kernel::measure(body).unwrap().volume - 14900.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 14900.0).abs() < 1e-6);}let mut s = Session::default();base(&mut s, 100.0, 60.0);@@ -381,7 +381,7 @@ fn sheet_pocket_transfer_keeps_local_depth_world_pose_and_history() {assert_eq!(f["pockets"][0]["side"], "bottom");assert_eq!(f["pockets"][0]["depth_mm"], 1.0);}- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());check(&reopened, &name, component, origin, y, true);run(&mut reopened, "component.activate", json!({"component":component}));run(&mut reopened, "sheet.unfold", json!({"body":name}));@@ -789,7 +789,7 @@ fn malformed_fold_points_are_rejected_atomically() {#[test]fn flat_dxf_preserves_exact_cutout_entities() {- use solvecraft_geom::{Loop2, Region2, Seg2, Vec2};+ use solidcraft_geom::{Loop2, Region2, Seg2, Vec2};let mut s = Session::default();base(&mut s, 100.0, 60.0);let mut sh = s.model.state().sheets[0].clone();@@ -800,9 +800,9 @@ fn flat_dxf_preserves_exact_cutout_entities() {let dxf = super::flat_dxf(&sh).unwrap();assert_eq!(dxf.matches("0\nCIRCLE\n").count(), 1, "{dxf}");assert!(!dxf.contains("0\nARC\n"), "a full circle must not become a zero-length ARC");- let read = solvecraft_io::read_dxf(&dxf).unwrap();+ let read = solidcraft_io::read_dxf(&dxf).unwrap();assert_eq!(read.len(), 5);- assert!(read.iter().any(|g| matches!(g, solvecraft_io::Geom2::Circle(c, r) if *c == Vec2::new(40.0, 30.0) && (*r - 5.0).abs() < 1e-9)));+ assert!(read.iter().any(|g| matches!(g, solidcraft_io::Geom2::Circle(c, r) if *c == Vec2::new(40.0, 30.0) && (*r - 5.0).abs() < 1e-9)));sh.holes[0].outer = Loop2 {segs: vec![Seg2::Line { a: Vec2::new(10.0, 10.0), b: Vec2::new(30.0, 10.0) },@@ -813,9 +813,9 @@ fn flat_dxf_preserves_exact_cutout_entities() {assert_eq!(dxf.matches("0\nLINE\n").count(), 5, "four outline lines and one exact cutout line");assert_eq!(dxf.matches("0\nARC\n").count(), 1);assert!(dxf.contains("50\n0.000000\n51\n180.000000\n"));- let read = solvecraft_io::read_dxf(&dxf).unwrap();+ let read = solidcraft_io::read_dxf(&dxf).unwrap();assert_eq!(read.len(), 6);- assert!(read.iter().any(|g| matches!(g, solvecraft_io::Geom2::Arc { c, a, b } if *c == Vec2::new(20.0, 10.0) && a.dist(Vec2::new(30.0, 10.0)) < 1e-9 && b.dist(Vec2::new(10.0, 10.0)) < 1e-9)));+ assert!(read.iter().any(|g| matches!(g, solidcraft_io::Geom2::Arc { c, a, b } if *c == Vec2::new(20.0, 10.0) && a.dist(Vec2::new(30.0, 10.0)) < 1e-9 && b.dist(Vec2::new(10.0, 10.0)) < 1e-9)));}// A profile chosen by a point outside its inner loop must keep that inner loop through@@ -833,7 +833,7 @@ fn inherited_base_profile_holes_survive_every_sheet_state() {let f = flat(&mut s);assert_eq!(f["cutouts"].as_array().map(Vec::len), Some(1));let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 8);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 8);let mut reopened = Session::default();run(&mut reopened, "sketch.insert_dxf", json!({"text": dxf, "name": "Blank"}));run(&mut reopened, "sketch.finish", json!({}));@@ -861,7 +861,7 @@ fn edge_notch_uses_the_same_material_boundary_in_solid_flat_and_dxf() {assert_eq!(f["outline"][0].as_array().map(Vec::len), Some(8));assert_eq!(f["cutouts"].as_array().map(Vec::len), Some(0));let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 8);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 8);let mut reopened = Session::default();run(&mut reopened, "sketch.insert_dxf", json!({"text": dxf, "name": "Blank"}));run(&mut reopened, "sketch.finish", json!({}));@@ -890,8 +890,8 @@ fn inherited_round_hole_survives_flange_and_unfold_in_flipped_frames() {let sh = s.model.state().sheets[0].clone();let regions = sh.flat_regions().unwrap();assert_eq!(regions[0].holes[0].segs.len(), 2);- assert!(regions[0].holes[0].segs.iter().all(|s| matches!(s, solvecraft_geom::Seg2::Arc { radius, .. } if (*radius - 5.0).abs() < 1e-9)));- let expected = regions.iter().map(solvecraft_geom::Region2::area).sum::<f64>() * 2.5;+ assert!(regions[0].holes[0].segs.iter().all(|s| matches!(s, solidcraft_geom::Seg2::Arc { radius, .. } if (*radius - 5.0).abs() < 1e-9)));+ let expected = regions.iter().map(solidcraft_geom::Region2::area).sum::<f64>() * 2.5;run(&mut s, "sheet.unfold", json!({}));assert!((volume(&mut s) - expected).abs() < 0.1);run(&mut s, "sheet.refold", json!({}));@@ -1028,7 +1028,7 @@ fn tiny_cut_inside_exact_circle_survives_unfold_refold_and_dxf() {assert!((regions[0].holes[0].signed_area().abs() - 2.5e-9).abs() < 1e-13);assert_eq!(s.model.state().bodies.len(), 1);let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();- assert_eq!(solvecraft_io::read_dxf(&dxf).unwrap().len(), 5);+ assert_eq!(solidcraft_io::read_dxf(&dxf).unwrap().len(), 5);if stage == "sheet.unfold" && initially_flat {run(&mut s, "sheet.refold", json!({}));}@@ -1070,8 +1070,8 @@ fn unrelated_box_cut_preserves_logical_ring_sheet_compound() {assert_eq!(s.model.state().bodies.len(), 2);let state = s.model.state();let body = &state.bodies.iter().find(|b| b.name == sheet_name).unwrap().body;- assert!(body.contains(solvecraft_geom::Vec3::new(50.0, 30.0, 1.25)));- assert!(!body.contains(solvecraft_geom::Vec3::new(57.0, 30.0, 1.25)));+ assert!(body.contains(solidcraft_geom::Vec3::new(50.0, 30.0, 1.25)));+ assert!(!body.contains(solidcraft_geom::Vec3::new(57.0, 30.0, 1.25)));}}@@ -1106,9 +1106,9 @@ fn specialized_sheet_cuts_respect_component_and_explicit_participants() {fn ring_cut_preserves_retained_island_through_unfold_and_refold() {fn material_probes(s: &Session) {let body = &s.model.state().bodies[0].body;- assert!(body.contains(solvecraft_geom::Vec3::new(50.0, 30.0, 1.25)));- assert!(!body.contains(solvecraft_geom::Vec3::new(57.0, 30.0, 1.25)));- assert!(body.contains(solvecraft_geom::Vec3::new(65.0, 30.0, 1.25)));+ assert!(body.contains(solidcraft_geom::Vec3::new(50.0, 30.0, 1.25)));+ assert!(!body.contains(solidcraft_geom::Vec3::new(57.0, 30.0, 1.25)));+ assert!(body.contains(solidcraft_geom::Vec3::new(65.0, 30.0, 1.25)));}let mut s = Session::default();base(&mut s, 100.0, 60.0);@@ -1126,9 +1126,9 @@ fn ring_cut_preserves_retained_island_through_unfold_and_refold() {material_probes(&s);assert_eq!(flat(&mut s)["outline"].as_array().map(Vec::len), Some(2));let regions = s.model.state().sheets[0].flat_regions().unwrap();- assert!(regions.iter().any(|r| r.contains(solvecraft_geom::Vec2::new(50.0, 30.0))));- assert!(!regions.iter().any(|r| r.contains(solvecraft_geom::Vec2::new(57.0, 30.0))));- assert!(regions.iter().any(|r| r.contains(solvecraft_geom::Vec2::new(65.0, 30.0))));+ assert!(regions.iter().any(|r| r.contains(solidcraft_geom::Vec2::new(50.0, 30.0))));+ assert!(!regions.iter().any(|r| r.contains(solidcraft_geom::Vec2::new(57.0, 30.0))));+ assert!(regions.iter().any(|r| r.contains(solidcraft_geom::Vec2::new(65.0, 30.0))));let dxf = run(&mut s, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();let mut reopened = Session::default();run(&mut reopened, "sketch.insert_dxf", json!({"text": dxf, "name": "RingBlank"}));@@ -1144,7 +1144,7 @@ fn ring_cut_preserves_retained_island_through_unfold_and_refold() {}fn retained_depth_check(s: &mut Session, want: f64, z0: f64, z1: f64) {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;assert!((volume(s) - want).abs() < 1e-6, "{} vs {want}", volume(s));let state = s.model.state();assert_eq!(state.sheets.len(), 1);@@ -1157,8 +1157,8 @@ fn retained_depth_check(s: &mut Session, want: f64, z0: f64, z1: f64) {assert!((bounds.min.z - z0).abs() < 1e-8 && (bounds.max.z - z1).abs() < 1e-8, "{bounds:?}");}-fn depth_step_reopen(s: &mut Session, suffix: &str, want: f64, inside: solvecraft_geom::Vec3, outside: solvecraft_geom::Vec3) {- let path = std::env::temp_dir().join(format!("solvecraft-depth-intersect-{suffix}-{}.step", std::process::id()));+fn depth_step_reopen(s: &mut Session, suffix: &str, want: f64, inside: solidcraft_geom::Vec3, outside: solidcraft_geom::Vec3) {+ let path = std::env::temp_dir().join(format!("solidcraft-depth-intersect-{suffix}-{}.step", std::process::id()));run(s, "file.export", json!({"path":path.to_string_lossy()}));let mut imported = Session::default();run(&mut imported, "doc.open", json!({"path":path.to_string_lossy()}));@@ -1192,7 +1192,7 @@ fn dxf_outline_only(text: &str) -> String {#[test]fn partial_depth_intersect_retains_bottom_top_and_middle_material_through_history_and_exports() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;for (offset, z0, z1, layers) in [(0.0, 0.0, 1.0, vec![("top", 1.0, 2.5)]),(1.5, 1.5, 2.5, vec![("bottom", 0.0, 1.5)]),@@ -1218,7 +1218,7 @@ fn partial_depth_intersect_retains_bottom_top_and_middle_material_through_historassert!(dxf.contains(&format!("POCKET_{}_Z{a:.6}_TO_{b:.6}_MM", side.to_uppercase())));}let outline = dxf_outline_only(&dxf);- assert_eq!(solvecraft_io::read_dxf(&outline).unwrap().len(), 4);+ assert_eq!(solidcraft_io::read_dxf(&outline).unwrap().len(), 4);let mut outline_import = Session::default();run(&mut outline_import, "sketch.insert_dxf", json!({"text":outline,"name":"Outline"}));run(&mut outline_import, "sketch.finish", json!({}));@@ -1232,7 +1232,7 @@ fn partial_depth_intersect_retains_bottom_top_and_middle_material_through_historretained_depth_check(&mut s, 100.0, z0, z1);assert_eq!(flat(&mut s)["pockets"], exported["pockets"]);}- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());retained_depth_check(&mut reopened, 100.0, z0, z1);depth_step_reopen(&mut s, &format!("offset{offset}"), 100.0, Vec3::new(25.0, 25.0, (z0 + z1) * 0.5), Vec3::new(25.0, 25.0, z1 + 0.1));}@@ -1240,7 +1240,7 @@ fn partial_depth_intersect_retains_bottom_top_and_middle_material_through_histor#[test]fn partial_depth_intersect_preserves_prior_pockets_and_actual_interval_intersections() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = Session::default();base(&mut s, 100.0, 60.0);rectangle_tool(&mut s, "OldPocket", [20.0, 20.0], [25.0, 30.0]);@@ -1267,14 +1267,14 @@ fn partial_depth_intersect_preserves_prior_pockets_and_actual_interval_intersectassert!((volume(&mut s) - 25.0).abs() < 1e-6);run(&mut s, "sheet.unfold", json!({}));assert!((volume(&mut s) - 25.0).abs() < 1e-6);- let mut cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!((volume(&mut cold) - 25.0).abs() < 1e-6);depth_step_reopen(&mut s, "prior", 25.0, Vec3::new(22.0, 25.0, 1.125), Vec3::new(22.0, 25.0, 0.75));}#[test]fn partial_depth_intersect_keeps_disconnected_tool_islands_and_annular_curves() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = Session::default();base(&mut s, 100.0, 60.0);rectangle_tool(&mut s, "Islands", [20.0, 20.0], [30.0, 30.0]);@@ -1316,7 +1316,7 @@ fn partial_depth_intersect_keeps_disconnected_tool_islands_and_annular_curves()}let dxf = run(&mut ring, "sheet.export_dxf", json!({}))["dxf"].as_str().unwrap().to_string();assert!(dxf.contains("POCKET_TOP_Z1.000000_TO_2.500000_MM"));- assert_eq!(solvecraft_io::read_dxf(&dxf_outline_only(&dxf)).unwrap().len(), 2);+ assert_eq!(solidcraft_io::read_dxf(&dxf_outline_only(&dxf)).unwrap().len(), 2);}#[test]@@ -1336,7 +1336,7 @@ fn partial_depth_intersect_deletes_material_already_removed_by_a_pocket_atomical#[test]fn partial_depth_intersect_flipped_tool_and_transferred_sheet_keep_depth_side_and_world_pose() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut flipped = Session::default();base(&mut flipped, 100.0, 60.0);run(&mut flipped, "sketch.create", json!({"name":"FlippedTool","plane":{"origin":[0,0,2.5],"x_dir":[1,0,0],"y_dir":[0,-1,0]}}));@@ -1376,24 +1376,24 @@ fn partial_depth_intersect_flipped_tool_and_transferred_sheet_keep_depth_side_anassert!(!body.contains(Vec3::new(25.0, 25.0, 2.0)));let bounds = world.body(&name).unwrap().mesh().bounds();assert!(before.min.dist(bounds.min) < 1e-8 && before.max.dist(bounds.max) < 1e-8);- assert!((solvecraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);}- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());let reopened_world = reopened.world_state();let body = &reopened_world.body(&name).unwrap().body;assert!(body.contains(Vec3::new(25.0, 25.0, 1.0)));- assert!((solvecraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);run(&mut reopened, "timeline.edit", json!({"feature":"RetainSlab","set":{"extent":{"distance":"1.5"}}}));let world = reopened.world_state();let body = &world.body(&name).unwrap().body;- assert!((solvecraft_kernel::measure(body).unwrap().volume - 150.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 150.0).abs() < 1e-6);assert!(body.contains(Vec3::new(25.0, 25.0, 1.75)));assert!(!body.contains(Vec3::new(25.0, 25.0, 2.25)));}#[test]fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;for (angle, translate) in [(37.0, [30.0, 20.0, 10.0]), (121.0, [12345.678, 98765.432, 4321.123])] {let mut s = Session::default();base(&mut s, 100.0, 60.0);@@ -1410,7 +1410,7 @@ fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets(run(&mut s, "sketch.create", json!({"name":"WorldTool","plane":{"origin":[0,0,0],"x_dir":[1,0,0],"y_dir":[0,1,0]}}));run(&mut s, "sketch.rectangle.two_point", json!({"p0":[20,20],"p1":[30,30]}));run(&mut s, "sketch.finish", json!({}));- let mut tool_session = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut tool_session = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());run(&mut tool_session, "solid.extrude", json!({"sketch":"WorldTool","distance":2.5,"body_name":"CapWitness"}));let witness_state = tool_session.model.state();let witness = &witness_state.body("CapWitness").unwrap().body;@@ -1419,7 +1419,7 @@ fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets(assert_eq!(sources.len(), witness.face_count());let mut cap_count = 0;for (index, source) in sources.iter().enumerate() {- if let Some(solvecraft_kernel::FaceSource::CertifiedExtrudeCap { high, plane, .. }) = source {+ if let Some(solidcraft_kernel::FaceSource::CertifiedExtrudeCap { high, plane, .. }) = source {cap_count += 1;let current = witness.planar_face(index).unwrap();assert!(current.normal().cross(tool_plane.normal()).len() < 1e-10);@@ -1436,12 +1436,12 @@ fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets(assert!(s.model.state().sheets[0].pockets.is_empty(), "full gauge must not acquire roundoff-depth pockets");let world = s.world_state();let body = &world.body(&name).unwrap().body;- assert!((solvecraft_kernel::measure(body).unwrap().volume - 250.0).abs() < 1e-5);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 250.0).abs() < 1e-5);assert!(body.contains(Vec3::new(25.0, 25.0, 0.1)));assert!(body.contains(Vec3::new(25.0, 25.0, 2.4)));assert!(!body.contains(Vec3::new(10.0, 25.0, 1.0)));}- let mut cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(cold.model.state().sheets[0].pockets.is_empty());assert!(flat(&mut cold)["pockets"].as_array().unwrap().is_empty());run(&mut s, "timeline.edit", json!({"feature":"PostTransferRetain","set":{"extent":{"distance":"1","start_offset":"0.5"}}}));@@ -1452,16 +1452,16 @@ fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets(assert_eq!(s.model.state().sheets[0].pockets.len(), 2);let world = s.world_state();let body = &world.body(&name).unwrap().body;- let measured = solvecraft_kernel::measure(body).unwrap().volume;+ let measured = solidcraft_kernel::measure(body).unwrap().volume;assert!((measured - 100.0).abs() < 1e-5, "retained volume {measured}");assert!(body.contains(Vec3::new(25.0, 25.0, 1.0)));assert!(!body.contains(Vec3::new(25.0, 25.0, 0.1)));assert!(!body.contains(Vec3::new(25.0, 25.0, 2.4)));}- let cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());let world = cold.world_state();let body = &world.body(&name).unwrap().body;- assert!((solvecraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-5);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-5);assert!(body.contains(Vec3::new(25.0, 25.0, 1.0)));assert!(!body.contains(Vec3::new(25.0, 25.0, 0.1)));}@@ -1469,7 +1469,7 @@ fn partial_depth_intersect_full_gauge_in_rotated_frames_does_not_invent_pockets(#[test]fn partial_depth_intersect_planar_to_object_retains_current_target_depth() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = Session::default();base(&mut s, 100.0, 60.0);let name = s.model.state().sheets[0].body.clone();@@ -1482,15 +1482,15 @@ fn partial_depth_intersect_planar_to_object_retains_current_target_depth() {}let state = s.model.state();let body = &state.body(&name).unwrap().body;- assert!((solvecraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(body).unwrap().volume - 100.0).abs() < 1e-6);assert!(body.contains(Vec3::new(25.0, 25.0, 1.0)));assert!(!body.contains(Vec3::new(25.0, 25.0, 0.1)));assert!(!body.contains(Vec3::new(25.0, 25.0, 2.0)));assert_eq!(state.sheets[0].pockets.len(), 2);- assert!((solvecraft_kernel::measure(&state.body("Roof").unwrap().body).unwrap().volume - 100.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&state.body("Roof").unwrap().body).unwrap().volume - 100.0).abs() < 1e-6);}- let cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());- assert!((solvecraft_kernel::measure(&cold.model.state().body(&name).unwrap().body).unwrap().volume - 100.0).abs() < 1e-6);+ let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ assert!((solidcraft_kernel::measure(&cold.model.state().body(&name).unwrap().body).unwrap().volume - 100.0).abs() < 1e-6);}#[test]@@ -1510,14 +1510,14 @@ fn partial_depth_intersect_curved_to_object_refuses_unrepresentable_depth_atomicrun(&mut s, command, json!({"body":name}));}let state = s.model.state();- assert!((solvecraft_kernel::measure(&state.body(&name).unwrap().body).unwrap().volume - 15000.0).abs() < 1e-6);+ assert!((solidcraft_kernel::measure(&state.body(&name).unwrap().body).unwrap().volume - 15000.0).abs() < 1e-6);assert!(state.sheets[0].pockets.is_empty());}}#[test]fn partial_depth_intersect_curved_to_object_preserves_current_trimmed_cap_footprint() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let mut s = Session::default();base(&mut s, 100.0, 60.0);let name = s.model.state().sheets[0].body.clone();@@ -1525,11 +1525,11 @@ fn partial_depth_intersect_curved_to_object_preserves_current_trimmed_cap_footprrun(&mut s, "solid.box", json!({"corner":[19,19,1],"length":12,"width":12,"height":1,"body_name":"StopPlate"}));run(&mut s, "solid.combine", json!({"target":"CurvedRoof","tools":["StopPlate"],"operation":"join"}));rectangle_tool(&mut s, "Tool", [20.0, 20.0], [30.0, 30.0]);- let mut tool_session = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut tool_session = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());run(&mut tool_session, "solid.extrude", json!({"sketch":"Tool","to":[27,25,10],"body_name":"TrimWitness"}));let ts = tool_session.model.state();let witness = &ts.body("TrimWitness").unwrap().body;- assert!((solvecraft_kernel::measure(witness).unwrap().volume - (100.0 - 4.0 * std::f64::consts::PI)).abs() < 0.01);+ assert!((solidcraft_kernel::measure(witness).unwrap().volume - (100.0 - 4.0 * std::f64::consts::PI)).abs() < 0.01);assert!(witness.contains(Vec3::new(21.0, 21.0, 0.5)));assert!(!witness.contains(Vec3::new(25.0, 25.0, 0.5)));run(&mut s, "solid.extrude", json!({"sketch":"Tool","to":[27,25,10],"operation":"intersect","participants":[name]}));@@ -1539,7 +1539,7 @@ fn partial_depth_intersect_curved_to_object_preserves_current_trimmed_cap_footpr}let state = s.model.state();let body = &state.body(&name).unwrap().body;- let measured = solvecraft_kernel::measure(body).unwrap().volume;+ let measured = solidcraft_kernel::measure(body).unwrap().volume;assert!((measured - (100.0 - 4.0 * std::f64::consts::PI)).abs() < 0.01);let area: f64 = state.sheets[0].flat_regions().unwrap().iter().map(|r| r.area()).sum();assert!((area - (100.0 - 4.0 * std::f64::consts::PI)).abs() < 1e-8);@@ -1547,19 +1547,19 @@ fn partial_depth_intersect_curved_to_object_preserves_current_trimmed_cap_footprassert!(!body.contains(Vec3::new(25.0, 25.0, 0.5)));assert!(!body.contains(Vec3::new(21.0, 21.0, 1.5)));}- let cold = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(!cold.model.state().body(&name).unwrap().body.contains(Vec3::new(25.0, 25.0, 0.5)));let dxf = run(&mut s, "sheet.export_dxf", json!({"body":name}))["dxf"].as_str().unwrap().to_string();assert!(dxf.contains("POCKET_TOP_Z1.000000_TO_2.500000_MM"));let outline = dxf_outline_only(&dxf);- assert_eq!(solvecraft_io::read_dxf(&outline).unwrap().len(), 5);+ assert_eq!(solidcraft_io::read_dxf(&outline).unwrap().len(), 5);let mut outline_import = Session::default();run(&mut outline_import, "sketch.insert_dxf", json!({"text":outline,"name":"Outline"}));run(&mut outline_import, "sketch.finish", json!({}));run(&mut outline_import, "solid.extrude", json!({"distance":1,"profiles":[{"point":[21,21]}]}));assert!((volume(&mut outline_import) - (100.0 - 4.0 * std::f64::consts::PI)).abs() < 0.01);assert!(!outline_import.model.state().bodies[0].body.contains(Vec3::new(25.0, 25.0, 0.5)));- let path = std::env::temp_dir().join(format!("solvecraft-current-trim-cap-{}.step", std::process::id()));+ let path = std::env::temp_dir().join(format!("solidcraft-current-trim-cap-{}.step", std::process::id()));run(&mut s, "file.export", json!({"path":path.to_string_lossy(),"bodies":[name]}));let mut imported = Session::default();run(&mut imported, "doc.open", json!({"path":path.to_string_lossy()}));@@ -1594,7 +1594,7 @@ fn partial_depth_intersect_sub_extrusion_resolution_layers_refuse_atomically() {assert!(error.contains("resolution") || error.contains("distance is zero") || error.contains("sheet machining"), "{error}");assert_eq!(s.doc.to_json(), before);assert!(s.model.state().sheets[0].pockets.is_empty());- assert!((solvecraft_kernel::measure(&s.world_state().body(&name).unwrap().body).unwrap().volume - 15000.0).abs() < 1e-5);+ assert!((solidcraft_kernel::measure(&s.world_state().body(&name).unwrap().body).unwrap().volume - 15000.0).abs() < 1e-5);}}diff --git a/crates/engine/src/cmd/sketch.rs b/crates/engine/src/cmd/sketch.rsindex c901995a07..6888bd1660 100644--- a/crates/engine/src/cmd/sketch.rs+++ b/crates/engine/src/cmd/sketch.rs@@ -1,9 +1,9 @@//! Sketch commands: create/edit/finish sketches, draw curves, constraints and dimensions.use serde_json::{Value, json};-use solvecraft_doc::{FeatureKind, PlaneRef, expr::Kind};-use solvecraft_geom::{Plane, Vec2, Vec3};-use solvecraft_sketch::{Analysis, Budget, ConstraintKind, CurveKind, Hold, Sketch, SolveReport, solve, solve_with};+use solidcraft_doc::{FeatureKind, PlaneRef, expr::Kind};+use solidcraft_geom::{Plane, Vec2, Vec3};+use solidcraft_sketch::{Analysis, Budget, ConstraintKind, CurveKind, Hold, Sketch, SolveReport, solve, solve_with};use super::{CommandSpec, in_sketch};use crate::params::{bad, bool_, expr, num, req_vec2, str_, string_list, vec2, vec3};@@ -222,7 +222,7 @@ pub(super) fn edit<T>(p: &Value,cmd: &str,strict: bool,- f: impl FnOnce(&mut Sketch, &mut solvecraft_doc::Document) -> Result<T>,+ f: impl FnOnce(&mut Sketch, &mut solidcraft_doc::Document) -> Result<T>,) -> Result<(T, Value)> {let id = target_sketch(s, p, cmd)?;let (out, rep) = edit_solved(s, id, strict, |sk, doc| Ok((f(sk, doc)?, Left::Unsolved)))?;@@ -262,7 +262,7 @@ pub(super) fn edit_solved<T>(s: &mut Session,id: u64,strict: bool,- f: impl FnOnce(&mut Sketch, &mut solvecraft_doc::Document) -> Result<(T, Left)>,+ f: impl FnOnce(&mut Sketch, &mut solidcraft_doc::Document) -> Result<(T, Left)>,) -> Result<(T, Option<SolveReport>)> {let mut doc = (*s.doc).clone();let mut sk = doc.sketch(id)?.clone();@@ -333,7 +333,7 @@ pub(super) fn counted_solve(/// Inside an `edit` closure: solve the sketch for the document's parameter values from its/// stored solved state, as the edit's own solve does, for commands that work on the current/// geometry.-pub(super) fn solve_current(sk: &mut Sketch, doc: &solvecraft_doc::Document) -> Result<SolveReport> {+pub(super) fn solve_current(sk: &mut Sketch, doc: &solidcraft_doc::Document) -> Result<SolveReport> {let stored = sk.driving_values();let (values, _) = doc.param_values();Ok(doc.solve_sketch(&values, sk, &stored)?)@@ -345,7 +345,7 @@ pub(super) fn solve_current(sk: &mut Sketch, doc: &solvecraft_doc::Document) ->pub(super) mod solve_counts {use std::cell::Cell;- use solvecraft_sketch::Analysis;+ use solidcraft_sketch::Analysis;thread_local! {static COUNTS: Cell<(usize, usize)> = const { Cell::new((0, 0)) };@@ -395,7 +395,7 @@ pub(super) fn draw(s: &mut Session,p: &Value,cmd: &str,- f: impl FnOnce(&mut Sketch, &mut solvecraft_doc::Document) -> Result<(Vec<String>, Vec<String>)>,+ f: impl FnOnce(&mut Sketch, &mut solidcraft_doc::Document) -> Result<(Vec<String>, Vec<String>)>,) -> Result<((Vec<String>, Vec<String>), Value)> {edit(s, p, cmd, false, |sk, doc| {let first = sk.points.len();@@ -497,7 +497,7 @@ pub(crate) fn created(before: Option<&Sketch>, after: &Sketch) -> Value {let points: Vec<&str> = after.points.iter().map(|x| x.id.as_str()).filter(new).collect();let curves: Vec<&str> = after.curves.iter().map(|x| x.id.as_str()).filter(new).collect();let (dims, cons): (Vec<_>, Vec<_>) = after.constraints.iter().filter(|c| new(&c.id.as_str())).partition(|c| c.kind.is_dimension());- let ids = |v: Vec<&solvecraft_sketch::Constraint>| v.into_iter().map(|c| c.id.clone()).collect::<Vec<_>>();+ let ids = |v: Vec<&solidcraft_sketch::Constraint>| v.into_iter().map(|c| c.id.clone()).collect::<Vec<_>>();let mut out = json!({"points": points, "curves": curves, "constraints": ids(cons), "dimensions": ids(dims)});let wires: Vec<&str> = after.wires.iter().map(|x| x.id.as_str()).filter(new).collect();if !wires.is_empty()@@ -515,7 +515,7 @@ pub(super) fn result(sk_out: (Vec<String>, Vec<String>), info: Value) -> Value {// ---------------------------------------------------------------------------------------------// Sketch lifecycle-pub(crate) fn author_path_for_rebind(s: &Session, feature: &solvecraft_doc::Feature, p: &Value, cmd: &str) -> Result<Vec<u64>> {+pub(crate) fn author_path_for_rebind(s: &Session, feature: &solidcraft_doc::Feature, p: &Value, cmd: &str) -> Result<Vec<u64>> {let mut saved = None;if let FeatureKind::Sketch { plane, .. } = &feature.kind {let mut plane = plane;@@ -553,7 +553,7 @@ pub(crate) fn author_path_for_rebind(s: &Session, feature: &solvecraft_doc::Featif feature.component != 0 && path.is_empty() {return Err(bad(cmd, "a component sketch needs an explicit complete author_path"));}- solvecraft_doc::EmbossFace::component_frame(&s.placed_document(), feature.component, &path)?;+ solidcraft_doc::EmbossFace::component_frame(&s.placed_document(), feature.component, &path)?;Ok(path)}@@ -581,7 +581,7 @@ pub(super) fn plane_ref(s: &Session, p: &Value, cmd: &str) -> Result<PlaneRef> {}/// Does triangle set of face `fi` contain point `p` (within `tol` of the face plane)?-pub(super) fn face_contains(m: &solvecraft_geom::Mesh, fi: usize, p: Vec3, tol: f64) -> bool {+pub(super) fn face_contains(m: &solidcraft_geom::Mesh, fi: usize, p: Vec3, tol: f64) -> bool {m.triangles.iter().zip(&m.tri_face).filter(|(_, f)| **f as usize == fi).any(|(t, _)| {let Some([a, b, c]) = m.tri(t) else { return false };let n = (b - a).cross(c - a);@@ -672,7 +672,7 @@ fn edit_sketch(s: &mut Session, p: &Value) -> Result<Value> {_ => None,};if let Some(path) = authored_path {- solvecraft_doc::EmbossFace::component_frame(&s.placed_document(), component, &path)+ solidcraft_doc::EmbossFace::component_frame(&s.placed_document(), component, &path).map_err(|error| bad("sketch.edit", format!("{error}; explicitly rebind the author placement before editing")))?;s.active_component = component;s.active_occurrence_path = (!path.is_empty()).then_some(path);@@ -1282,7 +1282,7 @@ pub(super) fn apply_in_order(sk: &mut Sketch, rep: &SolveReport, first: &[Ent],const TEMP: &str = "__keep_size";for (h, extra) in tries {let mut trial = sk.clone();- trial.constraints.extend(extra.into_iter().map(|kind| solvecraft_sketch::Constraint {+ trial.constraints.extend(extra.into_iter().map(|kind| solidcraft_sketch::Constraint {id: TEMP.into(),kind,param: None,@@ -1764,7 +1764,7 @@ fn measured(is_angle: bool, v: f64) -> (f64, &'static str) {fn solved_measure(s: &Session, p: &Value, cmd: &str) -> Option<(f64, &'static str)> {let sk = s.doc.sketch(target_sketch(s, p, cmd).ok()?).ok()?;let k = &sk.constraints.last()?.kind;- Some(measured(k.is_angle(), solvecraft_sketch::measure_dimension(sk, k)?))+ Some(measured(k.is_angle(), solidcraft_sketch::measure_dimension(sk, k)?))}/// The type of a dimension between `a` and `b` (two points or a line's ends). `auto` takes it@@ -1793,8 +1793,8 @@ fn auto_orientation(ty: &str, a: Vec2, b: Vec2, text_at: Option<Vec2>) -> &str {/// dimension so it follows the geometry.fn place_text(sk: &mut Sketch, id: &str, at: Option<Vec2>) {let Some(i) = sk.constraints.iter().position(|c| c.id == id) else { return };- let text = match (at, sk.constraints.get(i).and_then(|c| solvecraft_sketch::dim_frame(sk, &c.kind))) {- (Some(at), Some(f)) => Some(solvecraft_sketch::encode_text(&f, at)),+ let text = match (at, sk.constraints.get(i).and_then(|c| solidcraft_sketch::dim_frame(sk, &c.kind))) {+ (Some(at), Some(f)) => Some(solidcraft_sketch::encode_text(&f, at)),_ => None,};if let Some(c) = sk.constraints.get_mut(i) {@@ -1827,7 +1827,7 @@ fn diameter_about(sk: &Sketch, l: usize, ty: &str) -> bool {fn arc_len(sk: &Sketch, c: usize) -> Option<f64> {match sk.segs(c).first()? {- solvecraft_geom::Seg2::Arc { radius, sweep, .. } if matches!(sk.curves.get(c)?.kind, CurveKind::Arc { .. }) => Some(radius * sweep),+ solidcraft_geom::Seg2::Arc { radius, sweep, .. } if matches!(sk.curves.get(c)?.kind, CurveKind::Arc { .. }) => Some(radius * sweep),_ => None,}}@@ -1948,7 +1948,7 @@ fn sketch_delete(s: &mut Session, p: &Value) -> Result<Value> {&& topology.roles.iter()- .any(|role| !role.retired && role.kind == solvecraft_sketch::OffsetRoleKind::Arc && !removed.contains(role.output.as_str()))+ .any(|role| !role.retired && role.kind == solidcraft_sketch::OffsetRoleKind::Arc && !removed.contains(role.output.as_str())){return Err(bad(cmd, "break the offset association before deleting only part of its curved boundary"));}@@ -2011,7 +2011,7 @@ fn drag_frame(s: &mut Session, p: &Value, live: bool) -> Result<(Value, Option<clet sk = s.doc.sketch(id)?;let moves: Vec<Vec2> = d.moving.iter().filter_map(|&(q, was)| Some(sk.point(q)? - was)).collect();let at = from + moves.iter().fold(Vec2::ZERO, |a, m| a + *m) * (1.0 / moves.len().max(1) as f64);- let rep = rep.or_else(|| last.map(|last| SolveReport { status: solvecraft_sketch::SolveStatus::Solved, failing: Vec::new(), ..last }));+ let rep = rep.or_else(|| last.map(|last| SolveReport { status: solidcraft_sketch::SolveStatus::Solved, failing: Vec::new(), ..last }));let out = json!({"sketch": rep.as_ref().map(report_json), "reached": d.reached, "at": [at.x, at.y]});Ok((out, rep.filter(|_| live).map(|report| crate::LiveEdit { sketch: id, report })))}@@ -2048,7 +2048,7 @@ fn drag_end(s: &mut Session, p: &Value) -> Result<Value> {}/// The Sketch Palette options of a sketch, by their palette names (true = shown / on).-fn options_json(v: &solvecraft_sketch::SketchView) -> Value {+fn options_json(v: &solidcraft_sketch::SketchView) -> Value {json!({"show_profile": !v.hide_profile,"show_points": !v.hide_points,diff --git a/crates/engine/src/cmd/sketch_3d.rs b/crates/engine/src/cmd/sketch_3d.rsindex bdd6566577..07f865c5bf 100644--- a/crates/engine/src/cmd/sketch_3d.rs+++ b/crates/engine/src/cmd/sketch_3d.rs@@ -3,8 +3,8 @@//! drawn and snapped to, movable point by point, and usable as sweep and pipe paths.use serde_json::{Value, json};-use solvecraft_geom::Vec3;-use solvecraft_sketch::WireSpace;+use solidcraft_geom::Vec3;+use solidcraft_sketch::WireSpace;use super::sketch::{edit, target_sketch};use super::{CommandSpec, in_sketch};@@ -29,26 +29,26 @@ pub static COMMANDS: &[CommandSpec] = &[fn points(cmd: &str, p: &Value, min: usize) -> Result<Vec<Vec3>> {let a = p.get("points").and_then(Value::as_array).ok_or_else(|| bad(cmd, "`points` must list [x,y,z] points"))?;- if a.len() < min || a.len() > solvecraft_sketch::MAX_FIT_POINTS {- return Err(bad(cmd, format!("`points` needs {min} to {} points", solvecraft_sketch::MAX_FIT_POINTS)));+ if a.len() < min || a.len() > solidcraft_sketch::MAX_FIT_POINTS {+ return Err(bad(cmd, format!("`points` needs {min} to {} points", solidcraft_sketch::MAX_FIT_POINTS)));}a.iter().map(|v| vec3(v).ok_or_else(|| bad(cmd, "a point must be [x, y, z]"))).collect()}-fn needs_3d(sk: &solvecraft_sketch::Sketch, cmd: &str) -> Result<()> {+fn needs_3d(sk: &solidcraft_sketch::Sketch, cmd: &str) -> Result<()> {if sk.view.three_d { Ok(()) } else { Err(bad(cmd, "turn on 3D Sketch (sketch.options sketch_3d: true) to draw off the sketch plane")) }}/// World command inputs belong to the target sketch's owner, which may differ from the/// active component when a script supplies an explicit sketch.-fn inverse_owner_frame(s: &Session, p: &Value, cmd: &str) -> Result<solvecraft_doc::Mat> {+fn inverse_owner_frame(s: &Session, p: &Value, cmd: &str) -> Result<solidcraft_doc::Mat> {let id = target_sketch(s, p, cmd)?;let owner = s.doc.feature(id).map(|f| f.component).ok_or_else(|| bad(cmd, "target sketch is missing"))?;if owner != 0 && owner != s.active_component {if s.doc.occurrences.len() > 100_000 {return Err(bad(cmd, "sketch owner placement expansion exceeds supported bounds"));}- let mut children: std::collections::BTreeMap<u64, Vec<&solvecraft_doc::Occurrence>> = std::collections::BTreeMap::new();+ let mut children: std::collections::BTreeMap<u64, Vec<&solidcraft_doc::Occurrence>> = std::collections::BTreeMap::new();for occurrence in &s.doc.occurrences {children.entry(occurrence.parent).or_default().push(occurrence);}@@ -72,13 +72,13 @@ fn inverse_owner_frame(s: &Session, p: &Value, cmd: &str) -> Result<solvecraft_d}}let frame = if owner == s.active_component { s.active_component_frame() } else { s.placed_document().component_transform(owner) };- solvecraft_doc::mat_inverse(&frame).ok_or_else(|| bad(cmd, "the sketch owner placement is not invertible"))+ solidcraft_doc::mat_inverse(&frame).ok_or_else(|| bad(cmd, "the sketch owner placement is not invertible"))}fn line3d(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "sketch.line3d";let inverse = inverse_owner_frame(s, p, cmd)?;- let pts: Vec<Vec3> = points(cmd, p, 2)?.into_iter().map(|at| solvecraft_doc::apply_point(&inverse, at)).collect();+ let pts: Vec<Vec3> = points(cmd, p, 2)?.into_iter().map(|at| solidcraft_doc::apply_point(&inverse, at)).collect();let (ids, info) = edit(s, p, cmd, false, |sk, _| {needs_3d(sk, cmd)?;pts.windows(2).map(|w| sk.add_drawn_wire_in(w, WireSpace::Component).map_err(Into::into)).collect::<Result<Vec<String>>>()@@ -89,7 +89,7 @@ fn line3d(s: &mut Session, p: &Value) -> Result<Value> {fn spline3d(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "sketch.spline3d";let inverse = inverse_owner_frame(s, p, cmd)?;- let pts: Vec<Vec3> = points(cmd, p, 2)?.into_iter().map(|at| solvecraft_doc::apply_point(&inverse, at)).collect();+ let pts: Vec<Vec3> = points(cmd, p, 2)?.into_iter().map(|at| solidcraft_doc::apply_point(&inverse, at)).collect();let (id, info) = edit(s, p, cmd, false, |sk, _| {needs_3d(sk, cmd)?;Ok(sk.add_drawn_wire_in(&pts, WireSpace::Component)?)@@ -100,7 +100,7 @@ fn spline3d(s: &mut Session, p: &Value) -> Result<Value> {fn point3d(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "sketch.point3d";let inverse = inverse_owner_frame(s, p, cmd)?;- let at = solvecraft_doc::apply_point(&inverse, req_vec3(cmd, p, "point")?);+ let at = solidcraft_doc::apply_point(&inverse, req_vec3(cmd, p, "point")?);let (id, info) = edit(s, p, cmd, false, |sk, _| {needs_3d(sk, cmd)?;Ok(sk.add_drawn_wire_in(&[at], WireSpace::Component)?)@@ -116,7 +116,7 @@ fn move3d(s: &mut Session, p: &Value) -> Result<Value> {Some(v) => v.as_u64().and_then(|v| usize::try_from(v).ok())- .filter(|v| *v < solvecraft_sketch::MAX_FIT_POINTS)+ .filter(|v| *v < solidcraft_sketch::MAX_FIT_POINTS).ok_or_else(|| bad(cmd, "`index` must be a fit point index below 500"))?,};let parse = |name| p.get(name).map(|v| vec3(v).ok_or_else(|| bad(cmd, format!("`{name}` must be [x,y,z]")))).transpose();@@ -133,12 +133,12 @@ fn move3d(s: &mut Session, p: &Value) -> Result<Value> {let to = match (to, by) {(Some(t), _) => {if drawn.space == WireSpace::Component {- solvecraft_doc::apply_point(&inverse, t)+ solidcraft_doc::apply_point(&inverse, t)} else {t}}- (None, Some(d)) => from + if drawn.space == WireSpace::Component { solvecraft_doc::apply_vector(&inverse, d) } else { d },+ (None, Some(d)) => from + if drawn.space == WireSpace::Component { solidcraft_doc::apply_vector(&inverse, d) } else { d },_ => return Err(bad(cmd, "give `to` or `by`")),};Ok(sk.move_drawn_point(&wire, index, to)?)diff --git a/crates/engine/src/cmd/sketch_3d_frame_tests.rs b/crates/engine/src/cmd/sketch_3d_frame_tests.rsindex 12f2a0dd09..1528a36ea5 100644--- a/crates/engine/src/cmd/sketch_3d_frame_tests.rs+++ b/crates/engine/src/cmd/sketch_3d_frame_tests.rs@@ -1,7 +1,7 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_geom::Vec3;-use solvecraft_sketch::WireSpace;+use solidcraft_geom::Vec3;+use solidcraft_sketch::WireSpace;fn run(s: &mut Session, cmd: &str, params: Value) -> Value {s.execute(cmd, ¶ms).unwrap_or_else(|e| panic!("{cmd}: {e}"))@@ -57,7 +57,7 @@ fn wire_frame_second_occurrence_world_inputs_move_and_reopen() {run(&mut s, "edit.redo", json!({}));run(&mut s, "sketch.move3d", json!({"wire":point,"to":[18,33,46]}));near(s.doc.sketch(sketch).unwrap().wires.iter().find(|w| w.id == point).unwrap().fit[0], Vec3::new(3.0, 2.0, 6.0));- let restored = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let restored = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(restored.sketch(sketch).unwrap().wires, s.doc.sketch(sketch).unwrap().wires);// Same definition at the first placement has the local geometry; selected second is exact.run(&mut s, "component.activate", json!({"component":component,"occurrence":first,"path":[first]}));@@ -144,18 +144,18 @@ fn wire_frame_include_other_component_refresh_break_lost_and_reopen() {run(&mut s, "sketch.break_link", json!({"link":link}));assert_eq!(s.doc.sketch(sketch).unwrap().wires[0].space, WireSpace::Component);assert!(s.doc.sketch(sketch).unwrap().wires[0].link.is_none());- let restored = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let restored = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(restored.sketch(sketch).unwrap().wires[0], s.doc.sketch(sketch).unwrap().wires[0]);run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);// Lost references retain the last coordinates and explicit marker, with no guessing.let sk = s.doc_mut().sketch_mut(sketch).unwrap();- sk.links.iter_mut().find(|l| l.id == link).unwrap().source = solvecraft_sketch::LinkSource::Edge { body: "Missing".into(), at: Vec3::ZERO };+ sk.links.iter_mut().find(|l| l.id == link).unwrap().source = solidcraft_sketch::LinkSource::Edge { body: "Missing".into(), at: Vec3::ZERO };run(&mut s, "sketch.line", json!({"points":[[2,0],[3,0]]}));let sk = s.doc.sketch(sketch).unwrap();assert!(sk.link(&link).unwrap().lost);assert_eq!(sk.wires[0], initial);- let restored = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let restored = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();assert_eq!(restored.sketch(sketch).unwrap().wires[0], initial);}@@ -180,7 +180,7 @@ fn wire_frame_pipe_component_and_world_paths_have_analytic_volume_and_position()let body = world.bodies.last().unwrap();// Property measurement uses fine adaptive tessellation; the viewport mesh alone// undershoots a small circular profile by about 0.64% at its display chord tolerance.- let measure = solvecraft_kernel::measure(&body.body).unwrap();+ let measure = solidcraft_kernel::measure(&body.body).unwrap();assert!((measure.volume - 40.0 * std::f64::consts::PI).abs() < 0.05, "{}", measure.volume);let bounds = body.mesh().bounds();near((bounds.min + bounds.max) / 2.0, Vec3::new(17.0, 32.0, 50.0));@@ -212,17 +212,17 @@ fn wire_frame_wide_owner_graph_has_bounded_indexed_traversal() {// A legal wide assembly used to force one whole occurrence scan for each leaf.let doc = s.doc_mut();for i in 0..9998u64 {- doc.components.push(solvecraft_doc::Component { id: 10_000 + i, name: format!("Sibling{i}"), parent: 0 });- doc.occurrences.push(solvecraft_doc::Occurrence {+ doc.components.push(solidcraft_doc::Component { id: 10_000 + i, name: format!("Sibling{i}"), parent: 0 });+ doc.occurrences.push(solidcraft_doc::Occurrence {id: 100_000 + i,component: 10_000 + i,parent: 0,name: format!("Sibling{i}"),- transform: solvecraft_doc::IDENTITY,+ transform: solidcraft_doc::IDENTITY,grounded: false,});}- assert_eq!(super::inverse_owner_frame(&s, &json!({"sketch":target}), "sketch.point3d").unwrap(), solvecraft_doc::IDENTITY);+ assert_eq!(super::inverse_owner_frame(&s, &json!({"sketch":target}), "sketch.point3d").unwrap(), solidcraft_doc::IDENTITY);}#[test]@@ -241,7 +241,7 @@ fn wire_frame_cross_owner_sweep_follows_world_path_edit_undo_and_reopen() {let check = |s: &Session, length: f64| {let world = s.world_state();let body = world.bodies.last().unwrap();- let measure = solvecraft_kernel::measure(&body.body).unwrap();+ let measure = solidcraft_kernel::measure(&body.body).unwrap();assert!((measure.volume - 4.0 * std::f64::consts::PI * length).abs() < 0.05, "{}", measure.volume);near(measure.centroid, Vec3::new(17.0, 32.0, 45.0 + length / 2.0));};@@ -253,7 +253,7 @@ fn wire_frame_cross_owner_sweep_follows_world_path_edit_undo_and_reopen() {run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), saved);check(&s, 10.0);- let mut reopened = Session { doc: solvecraft_doc::format::read(&saved).unwrap().into(), ..Default::default() };+ let mut reopened = Session { doc: solidcraft_doc::format::read(&saved).unwrap().into(), ..Default::default() };reopened.refresh();check(&reopened, 10.0);}@@ -284,7 +284,7 @@ fn wire_frame_three_owner_sweep_profile_move_invalidates_warm_cache() {let state = session.world_state();let body = state.bodies.last().unwrap();assert_eq!(body.component, consumer["component"].as_u64().unwrap());- let result = solvecraft_kernel::measure(&body.body).unwrap();+ let result = solidcraft_kernel::measure(&body.body).unwrap();assert!((result.volume - 40.0 * std::f64::consts::PI).abs() < 0.05, "{}", result.volume);near(result.centroid, Vec3::new(x, 7.0, 10.0));result@@ -301,7 +301,7 @@ fn wire_frame_three_owner_sweep_profile_move_invalidates_warm_cache() {assert_eq!(s.doc.component_transform(path_owner["component"].as_u64().unwrap()), fixed_path);assert_eq!(s.doc.component_transform(consumer["component"].as_u64().unwrap()), fixed_consumer);let warm = measure(&s, 7.0);- let mut cold = Session { doc: solvecraft_doc::format::read(&s.doc.to_json()).unwrap().into(), ..Default::default() };+ let mut cold = Session { doc: solidcraft_doc::format::read(&s.doc.to_json()).unwrap().into(), ..Default::default() };cold.refresh();let reopened = measure(&cold, 7.0);near(warm.centroid, reopened.centroid);diff --git a/crates/engine/src/cmd/sketch_canvas.rs b/crates/engine/src/cmd/sketch_canvas.rsindex 3b34abf166..b884e78487 100644--- a/crates/engine/src/cmd/sketch_canvas.rs+++ b/crates/engine/src/cmd/sketch_canvas.rs@@ -1,8 +1,8 @@//! Canvases (reference images on planes) and decals (images on planar faces).use serde_json::{Value, json};-use solvecraft_doc::canvas::{Canvas, MAX_CANVAS_BYTES, base64_decode, base64_encode, image_info};-use solvecraft_geom::Vec2;+use solidcraft_doc::canvas::{Canvas, MAX_CANVAS_BYTES, base64_decode, base64_encode, image_info};+use solidcraft_geom::Vec2;use super::CommandSpec;use crate::params::{bad, bool_, num, str_, vec2};@@ -31,7 +31,7 @@ fn image_bytes(p: &Value, cmd: &str) -> Result<Vec<u8>> {base64_decode(d).ok_or_else(|| bad(cmd, "`data` is not base64"))?} else {let path = str_(p, "path").filter(|x| !x.trim().is_empty() && x.len() < 4096).ok_or_else(|| bad(cmd, "give `path` or `data`"))?;- solvecraft_io::vfs::read(path, MAX_CANVAS_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?+ solidcraft_io::vfs::read(path, MAX_CANVAS_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?};if b.len() > MAX_CANVAS_BYTES {return Err(bad(cmd, "the image is too large"));@@ -158,7 +158,7 @@ fn delete_canvas(s: &mut Session, p: &Value) -> Result<Value> {#[cfg(test)]mod tests {use serde_json::json;- use solvecraft_doc::canvas::base64_encode;+ use solidcraft_doc::canvas::base64_encode;use crate::Session;@@ -183,7 +183,7 @@ mod tests {assert!((s.doc.canvases[0].width - 200.0).abs() < 1e-9);s.execute("canvas.edit", &json!({"canvas": "Canvas1", "opacity": 0.8, "angle": 90})).unwrap();// Undo-able and saved with the design.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.canvases, s.doc.canvases);s.execute("canvas.delete", &json!({"canvas": id})).unwrap();assert!(s.doc.canvases.is_empty());diff --git a/crates/engine/src/cmd/sketch_constraints.rs b/crates/engine/src/cmd/sketch_constraints.rsindex 670f8d09df..7acd97f994 100644--- a/crates/engine/src/cmd/sketch_constraints.rs+++ b/crates/engine/src/cmd/sketch_constraints.rs@@ -2,8 +2,8 @@//! inference for interactive tools.use serde_json::{Value, json};-use solvecraft_geom::Vec2;-use solvecraft_sketch::{ConstraintKind, CurveKind, Sketch};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{ConstraintKind, CurveKind, Sketch};use super::sketch::{add_c, dof_now, edit, reject_redundant};use super::{CommandSpec, in_sketch};@@ -120,7 +120,7 @@ const MAX_TRIALS: usize = 2000;/// Add `k` if it removes a degree of freedom and the sketch still solves; else leave the/// sketch as it was. Returns the new dof when kept.-fn try_add(sk: &mut Sketch, doc: &mut solvecraft_doc::Document, k: ConstraintKind, dof: usize, dim: bool) -> Option<usize> {+fn try_add(sk: &mut Sketch, doc: &mut solidcraft_doc::Document, k: ConstraintKind, dof: usize, dim: bool) -> Option<usize> {let saved = sk.clone();let param = if dim {let v = k.value()?;@@ -136,7 +136,7 @@ fn try_add(sk: &mut Sketch, doc: &mut solvecraft_doc::Document, k: ConstraintKinreturn None;}let mut trial = sk.clone();- let rep = solvecraft_sketch::solve(&mut trial);+ let rep = solidcraft_sketch::solve(&mut trial);if rep.ok() && rep.dof < dof {*sk = trial;return Some(rep.dof);@@ -148,7 +148,7 @@ fn try_add(sk: &mut Sketch, doc: &mut solvecraft_doc::Document, k: ConstraintKinNone}-fn run_auto(sk: &mut Sketch, doc: &mut solvecraft_doc::Document, p: &Value, datum: usize) -> (Vec<String>, usize) {+fn run_auto(sk: &mut Sketch, doc: &mut solidcraft_doc::Document, p: &Value, datum: usize) -> (Vec<String>, usize) {use ConstraintKind::*;let tol = num(p, "tolerance").filter(|t| *t > 0.0).unwrap_or(0.01);let atol = num(p, "angle_tolerance").filter(|t| *t > 0.0).unwrap_or(1.0).to_radians();@@ -156,7 +156,7 @@ fn run_auto(sk: &mut Sketch, doc: &mut solvecraft_doc::Document, p: &Value, datulet n0 = sk.constraints.len();let mut dof = dof_now(sk);let mut trials = 0;- let mut attempt = |sk: &mut Sketch, doc: &mut solvecraft_doc::Document, k: ConstraintKind, dim: bool, dof: &mut usize| {+ let mut attempt = |sk: &mut Sketch, doc: &mut solidcraft_doc::Document, k: ConstraintKind, dim: bool, dof: &mut usize| {if *dof == 0 || trials >= MAX_TRIALS {return;}@@ -284,7 +284,7 @@ fn guess(sk: &Sketch, ents: &[String], cmd: &str) -> Result<ConstraintKind> {sk.resolve_point(r).map(|p| (Some(p), None)).ok_or_else(|| bad(cmd, format!("unknown sketch entity `{r}`")))};let line_dir = |c: usize| match sk.shape(c) {- Some(solvecraft_sketch::Shape::Line { a, b }) => (b - a).normalized(),+ Some(solidcraft_sketch::Shape::Line { a, b }) => (b - a).normalized(),_ => None,};let round = |c: usize| matches!(sk.curves.get(c).map(|c| &c.kind), Some(CurveKind::Circle { .. } | CurveKind::Arc { .. }));@@ -313,7 +313,7 @@ fn guess(sk: &Sketch, ents: &[String], cmd: &str) -> Result<ConstraintKind> {if cross < 0.2 {// Parallel; on one line → collinear.let off = match (sk.shape(x), sk.shape(y)) {- (Some(solvecraft_sketch::Shape::Line { a, .. }), Some(solvecraft_sketch::Shape::Line { a: b0, .. })) => {+ (Some(solidcraft_sketch::Shape::Line { a, .. }), Some(solidcraft_sketch::Shape::Line { a: b0, .. })) => {u.cross(b0 - a).abs()}_ => f64::INFINITY,diff --git a/crates/engine/src/cmd/sketch_constraints_tests.rs b/crates/engine/src/cmd/sketch_constraints_tests.rsindex e600fd7267..5070d57c84 100644--- a/crates/engine/src/cmd/sketch_constraints_tests.rs+++ b/crates/engine/src/cmd/sketch_constraints_tests.rs@@ -1,5 +1,5 @@use serde_json::{Value, json};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::Session;@@ -20,7 +20,7 @@ fn new_sketch() -> Session {s}-fn sketch(s: &Session) -> solvecraft_sketch::Sketch {+fn sketch(s: &Session) -> solidcraft_sketch::Sketch {s.model.state().sketch(s.active_sketch.unwrap()).unwrap().sketch.clone()}@@ -97,7 +97,7 @@ fn curvature_polygon_arc_length_linear_diameter() {let sk = sketch(&s);let ai = sk.curve_index(&a).unwrap();let len = match sk.segs(ai)[0] {- solvecraft_geom::Seg2::Arc { radius, sweep, .. } => radius * sweep,+ solidcraft_geom::Seg2::Arc { radius, sweep, .. } => radius * sweep,_ => 0.0,};assert!((len - 20.0).abs() < 1e-6, "{len}");diff --git a/crates/engine/src/cmd/sketch_corner_tests.rs b/crates/engine/src/cmd/sketch_corner_tests.rsindex b34ea4c39e..aca7378404 100644--- a/crates/engine/src/cmd/sketch_corner_tests.rs+++ b/crates/engine/src/cmd/sketch_corner_tests.rs@@ -23,7 +23,7 @@ fn curves(r: &Value) -> Vec<String> {r["curves"].as_array().map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect()).unwrap_or_default()}-fn sk(s: &Session) -> solvecraft_sketch::Sketch {+fn sk(s: &Session) -> solidcraft_sketch::Sketch {s.model.state().sketch(s.active_sketch.unwrap()).unwrap().sketch.clone()}@@ -132,9 +132,9 @@ fn a_fillet_keeps_the_dimensions_of_its_corner_on_a_virtual_sharp() {// The virtual corner sits where the corner was, and the part keeps its size.let k = sk(&s);let vc = k.point(k.point_index(&corner).unwrap()).unwrap();- assert!(vc.dist(solvecraft_geom::Vec2::new(0.0, 100.0)) < 1e-6, "{vc:?}");+ assert!(vc.dist(solidcraft_geom::Vec2::new(0.0, 100.0)) < 1e-6, "{vc:?}");let top_end = k.point(k.resolve_point("top.end").unwrap()).unwrap();- assert!(top_end.dist(solvecraft_geom::Vec2::new(-80.0, 100.0)) < 1e-6, "{top_end:?}");+ assert!(top_end.dist(solidcraft_geom::Vec2::new(-80.0, 100.0)) < 1e-6, "{top_end:?}");let (lo, hi) = k.bounds().unwrap();assert!((hi.x - lo.x - 80.0).abs() < 1e-6 && (hi.y - lo.y - 100.0).abs() < 1e-6, "{lo:?} {hi:?}");// It is drawn with extension lines from both lines' ends to it.@@ -150,7 +150,7 @@ fn a_fillet_keeps_the_dimensions_of_its_corner_on_a_virtual_sharp() {assert!((hi.x - lo.x - 90.0).abs() < 1e-6 && (hi.y - lo.y - 120.0).abs() < 1e-6, "{lo:?} {hi:?}");// It is kept in the design file, and undo and redo take it away and bring it back.let id = s.active_sketch.unwrap();- let doc = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let doc = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(doc.sketch(id).unwrap(), s.doc.sketch(id).unwrap());run(&mut s, "edit.undo", json!({}));run(&mut s, "edit.undo", json!({}));diff --git a/crates/engine/src/cmd/sketch_create.rs b/crates/engine/src/cmd/sketch_create.rsindex 92d61a9934..0cf9478db7 100644--- a/crates/engine/src/cmd/sketch_create.rs+++ b/crates/engine/src/cmd/sketch_create.rs@@ -2,8 +2,8 @@//! arc slots.use serde_json::{Value, json};-use solvecraft_geom::Vec2;-use solvecraft_sketch::{ConstraintKind, CurveKind, LinkKind, LinkSource, Sketch};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{ConstraintKind, CurveKind, LinkKind, LinkSource, Sketch};use super::sketch::{add_c, circumcircle, edit, ids_of, mark_construction, req_parg, result, slot};use super::{CommandSpec, in_sketch};@@ -92,7 +92,7 @@ fn text_source(p: &Value, cmd: &str, old: Option<(String, Vec2, f64, f64)>) -> Rif text.trim().is_empty() {return Err(bad(cmd, "`text` must not be empty"));}- if text.chars().count() > solvecraft_sketch::MAX_TEXT_CHARS {+ if text.chars().count() > solidcraft_sketch::MAX_TEXT_CHARS {return Err(bad(cmd, "text too long"));}let at = p.get("at").and_then(crate::params::vec2).unwrap_or(at0);@@ -136,7 +136,7 @@ fn edit_text(s: &mut Session, p: &Value) -> Result<Value> {};let src = text_source(p, cmd, Some(old))?;let LinkSource::Text { text, at, height, angle } = &src else { return Err(bad(cmd, "text")) };- let geom = solvecraft_sketch::text_geometry(text, *at, *height, *angle)?;+ let geom = solidcraft_sketch::text_geometry(text, *at, *height, *angle)?;sk.set_link_source(&l, src.clone());sk.update_link(&l, &geom)?;let curves = ids_of(&sk, &sk.link_curves(&l));@@ -231,7 +231,7 @@ fn ellipse(s: &mut Session, p: &Value) -> Result<Value> {fn point_list(sk: &mut Sketch, p: &Value, cmd: &str) -> Result<Vec<usize>> {let list = p.get("points").and_then(Value::as_array).ok_or_else(|| bad(cmd, "`points` must be a list"))?;- if list.len() < 2 || list.len() > solvecraft_sketch::MAX_SPLINE_POINTS {+ if list.len() < 2 || list.len() > solidcraft_sketch::MAX_SPLINE_POINTS {return Err(bad(cmd, "a spline needs 2 to 500 points"));}let mut out = Vec::new();@@ -359,9 +359,9 @@ fn leaving_dir(sk: &Sketch, ci: usize, pi: usize) -> Option<Vec2> {CurveKind::Spline { ref pts, control, periodic, .. } => {let q: Vec<Vec2> = pts.iter().filter_map(|i| sk.point(*i)).collect();if pts.last() == Some(&pi) {- solvecraft_sketch::spline_end_tangent_mode(&q, control, periodic, true)+ solidcraft_sketch::spline_end_tangent_mode(&q, control, periodic, true)} else if pts.first() == Some(&pi) {- solvecraft_sketch::spline_end_tangent_mode(&q, control, periodic, false).map(|t| -t)+ solidcraft_sketch::spline_end_tangent_mode(&q, control, periodic, false).map(|t| -t)} else {None}@@ -441,7 +441,7 @@ fn tangent_circle(s: &mut Session, p: &Value, cmd: &str, n: usize, radius: Optiolet (out, info) = edit(s, p, cmd, true, |sk, doc| {let cs = tangent_curves(sk, p, cmd, n)?;let r0 = match &radius {- Some(e) => doc.eval(e, solvecraft_doc::expr::Kind::Length).map_err(|e| bad(cmd, format!("radius: {e}")))?,+ Some(e) => doc.eval(e, solidcraft_doc::expr::Kind::Length).map_err(|e| bad(cmd, format!("radius: {e}")))?,None => guess_radius(sk, &cs, near),};if !(r0 > 1e-9 && r0 < 1e8) {@@ -564,7 +564,7 @@ pub(super) fn solve_new_only(sk: &mut Sketch, first_new: usize) {p.fixed = true;}}- if solvecraft_sketch::solve(&mut trial).ok() {+ if solidcraft_sketch::solve(&mut trial).ok() {for (p, t) in sk.points.iter_mut().zip(&trial.points).skip(first_new) {p.pos = t.pos;}diff --git a/crates/engine/src/cmd/sketch_dimensioned.rs b/crates/engine/src/cmd/sketch_dimensioned.rsindex f9ed36c9b3..7f04d8838b 100644--- a/crates/engine/src/cmd/sketch_dimensioned.rs+++ b/crates/engine/src/cmd/sketch_dimensioned.rs@@ -1,6 +1,6 @@//! Shape creation and its typed driving dimensions form one command and one undo step.use serde_json::{Value, json};-use solvecraft_doc::expr::Kind;+use solidcraft_doc::expr::Kind;use crate::{Result, Session,diff --git a/crates/engine/src/cmd/sketch_dimensioned_tests.rs b/crates/engine/src/cmd/sketch_dimensioned_tests.rsindex 7161c63f13..b949794c46 100644--- a/crates/engine/src/cmd/sketch_dimensioned_tests.rs+++ b/crates/engine/src/cmd/sketch_dimensioned_tests.rs@@ -1,6 +1,6 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_sketch::ConstraintKind;+use solidcraft_sketch::ConstraintKind;fn run(s: &mut Session, command: &str, params: Value) -> Value {s.execute(command, ¶ms).unwrap_or_else(|error| panic!("{command} {params}: {error}"))@@ -10,7 +10,7 @@ fn session() -> Session {run(&mut s, "sketch.create", json!({"plane":"XY"}));s}-fn sketch(s: &Session) -> solvecraft_sketch::Sketch {+fn sketch(s: &Session) -> solidcraft_sketch::Sketch {s.model.state().sketch(s.active_sketch.unwrap()).unwrap().sketch.clone()}fn draw(s: &mut Session, command: &str, params: Value, dimensions: Value) -> Value {@@ -22,7 +22,7 @@ fn close(a: f64, b: f64) {fn measure(s: &Session, kind: fn(&ConstraintKind) -> bool) -> f64 {let sk = sketch(s);let c = sk.constraints.iter().find(|c| kind(&c.kind)).unwrap();- solvecraft_sketch::measure_dimension(&sk, &c.kind).unwrap()+ solidcraft_sketch::measure_dimension(&sk, &c.kind).unwrap()}#[test]@@ -41,7 +41,7 @@ fn typed_line_angle_survives_quadrants_move_reopen_and_one_undo() {close(measure(&s, |k| matches!(k, ConstraintKind::Length { .. })), 10.0);}let encoded = serde_json::to_value(&*s.doc).unwrap();- let doc: solvecraft_doc::Document = serde_json::from_value(encoded).unwrap();+ let doc: solidcraft_doc::Document = serde_json::from_value(encoded).unwrap();let mut reopened = Session { doc: std::sync::Arc::new(doc), active_sketch: s.active_sketch, ..Session::default() };reopened.refresh();close(measure(&reopened, |k| matches!(k, ConstraintKind::LineAngle { .. })), 90f64.to_radians());@@ -161,7 +161,7 @@ fn dimensioned_authoring_uses_selected_occurrence_and_keeps_local_geometry() {assert_eq!(s.active_occurrence_path, Some(vec![second]));let sk = sketch(&s);let line = sk.curve_index(out["curves"][0].as_str().unwrap()).unwrap();- let solvecraft_sketch::CurveKind::Line { a, b } = sk.curves[line].kind else { panic!("line") };+ let solidcraft_sketch::CurveKind::Line { a, b } = sk.curves[line].kind else { panic!("line") };close(sk.points[a].pos.x, 0.0);close(sk.points[b].pos.x, 5.0 / std::f64::consts::SQRT_2);}diff --git a/crates/engine/src/cmd/sketch_drag.rs b/crates/engine/src/cmd/sketch_drag.rsindex 0c82a2fd8b..189dd597bb 100644--- a/crates/engine/src/cmd/sketch_drag.rs+++ b/crates/engine/src/cmd/sketch_drag.rs@@ -14,8 +14,8 @@use std::f64::consts::{PI, TAU};-use solvecraft_geom::Vec2;-use solvecraft_sketch::{Analysis, Budget, ConstraintKind, CurveKind, Hold, Sketch};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{Analysis, Budget, ConstraintKind, CurveKind, Hold, Sketch};use super::{Ent, Left, counted_solve};diff --git a/crates/engine/src/cmd/sketch_drag_live_tests.rs b/crates/engine/src/cmd/sketch_drag_live_tests.rsindex e13670a4d6..268b7d6bab 100644--- a/crates/engine/src/cmd/sketch_drag_live_tests.rs+++ b/crates/engine/src/cmd/sketch_drag_live_tests.rs@@ -2,7 +2,7 @@//! rank analysis, and evaluates nothing after it; the gesture's end evaluates the model once.use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use super::solve_counts;use crate::Session;@@ -49,12 +49,12 @@ fn body_contains(s: &Session, p: Vec3) -> bool {s.model.state().bodies.first().expect("a body").body.contains(p)}-fn pt(s: &Session, id: &str) -> solvecraft_geom::Vec2 {+fn pt(s: &Session, id: &str) -> solidcraft_geom::Vec2 {let sk = s.active_sketch.and_then(|i| s.doc.sketch(i).ok()).expect("sketch mode");sk.resolve_point(id).and_then(|i| sk.point(i)).expect("the point")}-fn corner(s: &Session) -> solvecraft_geom::Vec2 {+fn corner(s: &Session) -> solidcraft_geom::Vec2 {let id = s.active_sketch.expect("sketch mode");let st = s.world_state();let sk = &st.sketch(id).expect("the shown sketch").sketch;@@ -73,7 +73,7 @@ fn a_live_frame_solves_once_and_leaves_the_features_after_the_sketch_stale() {assert_eq!(r["sketch"]["solved"], json!(true));assert_eq!(r["sketch"]["dof"], json!(2), "the degrees of freedom from before the drag");// The sketch shows its new place; the extrude keeps its last result.- assert!(corner(&s).dist(solvecraft_geom::Vec2::new(4.0, 5.0)) < 1e-9);+ assert!(corner(&s).dist(solidcraft_geom::Vec2::new(4.0, 5.0)) < 1e-9);let result = s.model.result(extrude).expect("the extrude's result");assert!(result.stale);assert!(s.model.state().bodies.first().expect("a body").body.same(&body), "the body is not rebuilt");@@ -100,7 +100,7 @@ fn the_drag_end_evaluates_once_to_the_scripted_drags_result() {assert!(live.model.result(extrude).is_some_and(|r| !r.stale && r.error.is_none()));// One undo step for the gesture is the UI's business; each frame is still undoable.run(&mut live, "edit.undo", json!({}));- assert!(corner(&live).dist(solvecraft_geom::Vec2::new(3.0, 5.0)) < 1e-9);+ assert!(corner(&live).dist(solidcraft_geom::Vec2::new(3.0, 5.0)) < 1e-9);}#[test]@@ -150,7 +150,7 @@ fn a_drag_reports_how_far_the_geometry_followed() {assert_eq!(r["reached"], json!(0.0), "{r}");let moved = pt(&s, "l1.end") - before;let at = crate::params::vec2(&r["at"]).expect("`at`");- assert!(at.dist(solvecraft_geom::Vec2::new(25.0, 10.0) + moved) < 1e-9 && at.y < 20.0, "{r}");+ assert!(at.dist(solidcraft_geom::Vec2::new(25.0, 10.0) + moved) < 1e-9 && at.y < 20.0, "{r}");let to = 40 + 10 * usize::from(live);let r = run(&mut s, "sketch.drag", json!({"entity": "l2", "from": [25, to - 10], "to": [25, to]}));assert_eq!((&r["reached"], &r["at"]), (&json!(1.0), &json!([25.0, to as f64])), "{r}");@@ -170,7 +170,7 @@ fn a_live_drag_of_a_lone_sketch_shows_it_without_evaluating() {assert_eq!(s.evaluations, 0);assert_eq!(solve_counts::take(), (2, 0));// The free rectangle's corner moves alone; its profile follows.- assert!(corner(&s).dist(solvecraft_geom::Vec2::new(3.0, 5.0)) < 1e-9);+ assert!(corner(&s).dist(solidcraft_geom::Vec2::new(3.0, 5.0)) < 1e-9);let st = s.model.state();let profile = st.sketches[0].profiles.first().expect("a profile");assert!((profile.area - 22.0 * 15.0).abs() < 1e-9, "{}", profile.area);@@ -199,8 +199,8 @@ fn the_grab_follows_the_points_that_move() {run(&mut s, "sketch.line", json!({"points": [[10, 10], [30, 10]]}));run(&mut s, "sketch.constraint.fix", json!({"entities": ["l1.start"]}));ui_frames(&mut s, "l1", [20.0, 10.0], &[[0.0, 1.0]; 6]);- assert!(pt(&s, "l1.end").dist(solvecraft_geom::Vec2::new(30.0, 16.0)) < 1e-9, "{:?}", pt(&s, "l1.end"));- assert!(pt(&s, "l1.start").dist(solvecraft_geom::Vec2::new(10.0, 10.0)) < 1e-12);+ assert!(pt(&s, "l1.end").dist(solidcraft_geom::Vec2::new(30.0, 16.0)) < 1e-9, "{:?}", pt(&s, "l1.end"));+ assert!(pt(&s, "l1.start").dist(solidcraft_geom::Vec2::new(10.0, 10.0)) < 1e-12);}#[test]@@ -219,7 +219,7 @@ fn a_query_during_a_live_drag_does_not_evaluate_the_model() {assert_eq!(s.evaluations, 0);}-fn sketch_of(s: &Session) -> solvecraft_sketch::Sketch {+fn sketch_of(s: &Session) -> solidcraft_sketch::Sketch {s.active_sketch.and_then(|i| s.doc.sketch(i).ok()).cloned().expect("sketch mode")}@@ -232,7 +232,7 @@ fn a_live_frame_solves_the_dimensions_current_values() {let param = sk.constraints.iter()- .find(|c| matches!(c.kind, solvecraft_sketch::ConstraintKind::Length { l, .. } if l == l1))+ .find(|c| matches!(c.kind, solidcraft_sketch::ConstraintKind::Length { l, .. } if l == l1)).and_then(|c| c.param.clone()).expect("l1's dimension");if let Some(p) = s.doc_mut().params.iter_mut().find(|p| p.name == param) {diff --git a/crates/engine/src/cmd/sketch_face.rs b/crates/engine/src/cmd/sketch_face.rsindex b71e02835a..94f0f0f965 100644--- a/crates/engine/src/cmd/sketch_face.rs+++ b/crates/engine/src/cmd/sketch_face.rs@@ -2,8 +2,8 @@use crate::params::{bad, vec3};use crate::{Result, Session};use serde_json::Value;-use solvecraft_doc::{EmbossFace, PlaneRef, apply_point, apply_vector, mat_inverse, mat_mul};-use solvecraft_geom::Plane;+use solidcraft_doc::{EmbossFace, PlaneRef, apply_point, apply_vector, mat_inverse, mat_mul};+use solidcraft_geom::Plane;pub(in crate::cmd) fn is_face(p: &Value) -> bool {p.get("plane").and_then(|plane| plane.get("face")).is_some()@@ -144,10 +144,10 @@ fn capture_impl(s: &Session, value: &Value, cmd: &str, internal: bool) -> Resultreturn Ok(PlaneRef::Custom { plane });}let at = apply_point(&author_inverse, point);- let name = solvecraft_doc::naming::face_names(body).get(index).cloned();+ let name = solidcraft_doc::naming::face_names(body).get(index).cloned();let anchor = match doc.capture_face_anchor(body, index, &plane, &path, s.active_component, &author_path) {Ok(anchor) => Some(Box::new(anchor)),- Err(solvecraft_doc::DocError::Invalid(message))+ Err(solidcraft_doc::DocError::Invalid(message))if internal&& matches!(message.as_str(),@@ -166,7 +166,7 @@ fn capture_impl(s: &Session, value: &Value, cmd: &str, internal: bool) -> Result}/// The sole durable face attachment beneath an offset/angle wrapper.-pub(in crate::cmd) fn anchor(mut plane: &PlaneRef) -> Option<&solvecraft_doc::FaceAnchor> {+pub(in crate::cmd) fn anchor(mut plane: &PlaneRef) -> Option<&solidcraft_doc::FaceAnchor> {loop {match plane {PlaneRef::Offset { base, .. } | PlaneRef::AtAngle { base, .. } => plane = base,@@ -176,7 +176,7 @@ pub(in crate::cmd) fn anchor(mut plane: &PlaneRef) -> Option<&solvecraft_doc::Fa}}-pub(in crate::cmd) fn anchor_mut(mut plane: &mut PlaneRef) -> Option<&mut solvecraft_doc::FaceAnchor> {+pub(in crate::cmd) fn anchor_mut(mut plane: &mut PlaneRef) -> Option<&mut solidcraft_doc::FaceAnchor> {loop {match plane {PlaneRef::Offset { base, .. } | PlaneRef::AtAngle { base, .. } => plane = base,diff --git a/crates/engine/src/cmd/sketch_face_tests.rs b/crates/engine/src/cmd/sketch_face_tests.rsindex e2798552ba..4d9b276e7b 100644--- a/crates/engine/src/cmd/sketch_face_tests.rs+++ b/crates/engine/src/cmd/sketch_face_tests.rs@@ -1,6 +1,6 @@use crate::Session;use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;fn run(s: &mut Session, command: &str, params: Value) -> Value {s.execute(command, ¶ms).unwrap_or_else(|error| panic!("{command} {params}: {error}"))@@ -41,7 +41,7 @@ fn exact_selected_base_follows_height_and_never_retargets_control() {assert!(s.model.state().body("Badge").is_none());assert!((s.world_state().body("Control").unwrap().mesh().bounds().max.z - 30.).abs() < 1e-6);let before = s.doc.to_json();- let reopened = Session::new(solvecraft_doc::Document::from_json(&before).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&before).unwrap());assert!(reopened.model.result(sketch).unwrap().error.is_some());}#[test]@@ -69,7 +69,7 @@ fn explicit_rebind_preserves_geometry_dimensions_context_and_one_undo() {assert_eq!(s.doc.to_json(), before);assert!(s.model.result(id).unwrap().error.is_some());run(&mut s, "edit.redo", json!({}));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!((reopened.model.state().sketch(id).unwrap().plane.origin.z - 30.).abs() < 1e-6);}#[test]@@ -84,7 +84,7 @@ fn unsupported_face_has_explicit_fixed_alternative_and_no_live_projection() {assert_eq!(s.doc.to_json(), before);pick["fixed"] = json!(true);let id = run(&mut s, "sketch.create", json!({"plane":pick}))["sketch"].as_u64().unwrap();- assert!(matches!(s.doc.feature(id).unwrap().kind, solvecraft_doc::FeatureKind::Sketch { plane: solvecraft_doc::PlaneRef::Custom { .. }, .. }));+ assert!(matches!(s.doc.feature(id).unwrap().kind, solidcraft_doc::FeatureKind::Sketch { plane: solidcraft_doc::PlaneRef::Custom { .. }, .. }));assert!(s.doc.sketch(id).unwrap().links.is_empty());}#[test]@@ -130,7 +130,7 @@ fn default_certified_borders_follow_width_and_height_with_stable_entities() {let max_y = sketch.sketch.points.iter().map(|point| point.pos.y).fold(f64::NEG_INFINITY, f64::max);let min_y = sketch.sketch.points.iter().map(|point| point.pos.y).fold(f64::INFINITY, f64::min);assert!(((max_x - min_x) * (max_y - min_y) - 160.).abs() < 1e-5);- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.state().sketch(id).unwrap().sketch.links.iter().all(|link| !link.lost));}@@ -175,7 +175,7 @@ fn exact_nested_source_and_cross_owner_pending_paths_capture_only_involved_positlet before = s.doc.to_json();let pending = s.pending_moves.clone();let id = run(&mut s, "sketch.create", json!({"plane":pick,"project_edges":false}))["sketch"].as_u64().unwrap();- let solvecraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(id).unwrap().kind else { panic!("not sketch") };+ let solidcraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(id).unwrap().kind else { panic!("not sketch") };let anchor = super::anchor(plane).unwrap();assert_eq!(anchor.path, vec![second, child_occ]);assert_eq!(anchor.author_path, vec![author["occurrence"].as_u64().unwrap()]);@@ -186,7 +186,7 @@ fn exact_nested_source_and_cross_owner_pending_paths_capture_only_involved_positassert_eq!(s.doc.to_json(), before);assert_eq!(s.pending_moves, pending);run(&mut s, "edit.redo", json!({}));- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&saved).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&saved).unwrap());assert!(reopened.model.result(id).unwrap().error.is_none());run(&mut reopened, "component.activate", json!({"component":0}));let original = reopened.doc.to_json();@@ -225,7 +225,7 @@ fn fixed_rebind_freezes_current_resized_borders_and_only_detaches_auto_links() {visible.curves.iter().map(|curve| curve.id.clone()).collect::<Vec<_>>());assert_eq!(fixed.points.iter().map(|point| point.pos).collect::<Vec<_>>(), visible.points.iter().map(|point| point.pos).collect::<Vec<_>>());- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.result(id).unwrap().error.is_none());run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);@@ -249,13 +249,13 @@ fn strict_anchor_timeline_copy_remaps_producer_and_refuses_external_translation_let pasted = run(&mut s, "timeline.paste", json!({"translate":[30,0,0]}));assert!(pasted["errors"].as_array().unwrap().is_empty(), "{pasted}");let new_id = pasted["pasted"][1]["id"].as_u64().unwrap();- let solvecraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(new_id).unwrap().kind else { panic!("not sketch") };+ let solidcraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(new_id).unwrap().kind else { panic!("not sketch") };let anchor = super::anchor(plane).unwrap();assert_ne!(anchor.target.origin_feature, s.doc.find_feature("BaseFeature").unwrap().id);assert_ne!(anchor.target.body, "Base");assert!(s.model.state().sketch(new_id).unwrap().sketch.links.iter().all(|link| !link.lost));assert!(s.model.state().sketch(id).unwrap().sketch.links.iter().all(|link| !link.lost));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.result(new_id).unwrap().error.is_none());}@@ -274,10 +274,10 @@ fn strict_anchor_deep_clone_is_independent_and_rename_preserves_certified_projec.doc.features.iter()- .find(|feature| feature.component == owner && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. }))+ .find(|feature| feature.component == owner && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap();let new_id = new_feature.id;- let solvecraft_doc::FeatureKind::Sketch { plane, .. } = &new_feature.kind else { panic!("not sketch") };+ let solidcraft_doc::FeatureKind::Sketch { plane, .. } = &new_feature.kind else { panic!("not sketch") };let anchor = super::anchor(plane).unwrap();let body = anchor.target.body.clone();assert_eq!(anchor.component, owner);@@ -287,7 +287,7 @@ fn strict_anchor_deep_clone_is_independent_and_rename_preserves_certified_projecrun(&mut s, "body.rename", json!({"body":body,"name":"Independent"}));assert!(s.model.result(new_id).unwrap().error.is_none());assert!(s.model.state().sketch(new_id).unwrap().sketch.links.iter().all(|link| !link.lost));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.result(new_id).unwrap().error.is_none());}@@ -308,7 +308,7 @@ fn legacy_or_fixed_rebind_needs_explicit_author_path_for_repeated_owner() {assert!(error.to_string().contains("ambiguous"), "{error}");assert_eq!(s.doc.to_json(), before);run(&mut s, "sketch.redefine", json!({"sketch":id,"plane":pick,"author_path":[second]}));- let solvecraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(id).unwrap().kind else { panic!("not sketch") };+ let solidcraft_doc::FeatureKind::Sketch { plane, .. } = &s.doc.feature(id).unwrap().kind else { panic!("not sketch") };assert_eq!(super::anchor(plane).unwrap().author_path, vec![second]);assert_eq!(s.active_component, 0);}@@ -370,12 +370,12 @@ fn freezing_rebuilt_arc_borders_keeps_authored_dimension_entity_indices() {let dimension = frozen.constraints.iter()- .find(|constraint| matches!(constraint.kind, solvecraft_sketch::ConstraintKind::Radius { c, .. } if c == circle_index))+ .find(|constraint| matches!(constraint.kind, solidcraft_sketch::ConstraintKind::Radius { c, .. } if c == circle_index)).unwrap();- assert!((solvecraft_sketch::measure_dimension(frozen, &dimension.kind).unwrap() - 2.).abs() < 1e-6);+ assert!((solidcraft_sketch::measure_dimension(frozen, &dimension.kind).unwrap() - 2.).abs() < 1e-6);assert_eq!(frozen.curves.iter().map(|curve| &curve.id).collect::<Vec<_>>(), visible.curves.iter().map(|curve| &curve.id).collect::<Vec<_>>());assert!(s.model.result(id).unwrap().error.is_none());- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.result(id).unwrap().error.is_none());run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);@@ -388,21 +388,21 @@ fn angled_attachment_tracks_source_plane_and_reopens() {let pick = top_pick(&s, "Base");let id = run(&mut s, "sketch.create", json!({"plane":pick,"project_edges":false}))["sketch"].as_u64().unwrap();run(&mut s, "sketch.finish", json!({}));- let solvecraft_doc::FeatureKind::Sketch { plane, .. } = &mut s.doc_mut().feature_mut(id).unwrap().kind else { panic!("not sketch") };- *plane = solvecraft_doc::PlaneRef::AtAngle { base: Box::new(plane.clone()), axis_origin: Vec3::ZERO, axis_dir: Vec3::X, angle: "90 deg".into() };+ let solidcraft_doc::FeatureKind::Sketch { plane, .. } = &mut s.doc_mut().feature_mut(id).unwrap().kind else { panic!("not sketch") };+ *plane = solidcraft_doc::PlaneRef::AtAngle { base: Box::new(plane.clone()), axis_origin: Vec3::ZERO, axis_dir: Vec3::X, angle: "90 deg".into() };s.refresh();let height = s.doc.find_feature("BaseFeature").unwrap().param_names[2].clone();run(&mut s, "parameters.change", json!({"name":height,"expression":"20 mm"}));let placed = s.model.state().sketch(id).unwrap().plane;assert!((placed.origin.y + 20.).abs() < 1e-6);assert!(placed.origin.z.abs() < 1e-6);- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert_eq!(reopened.model.state().sketch(id).unwrap().plane, placed);}#[test]fn rounded_enclosure_shell_side_and_floor_attach_through_width_wall_and_reopen() {- use solvecraft_doc::{FeatureKind, config::FaceCertificate, face_anchor::plane_face_anchor};+ use solidcraft_doc::{FeatureKind, config::FaceCertificate, face_anchor::plane_face_anchor};let mut s = Session::default();for (name, expression) in [("width", "80 mm"), ("depth", "60 mm"), ("height", "30 mm"), ("wall", "2 mm")] {run(&mut s, "parameters.add", json!({"name":name,"expression":expression}));@@ -463,7 +463,7 @@ fn rounded_enclosure_shell_side_and_floor_attach_through_width_wall_and_reopen()}run(&mut s, "parameters.change", json!({"name":"width","expression":"100 mm"}));run(&mut s, "parameters.change", json!({"name":"wall","expression":"3 mm"}));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());for session in [&s, &reopened] {for id in [side, floor] {let result = session.model.result(id).unwrap();@@ -481,7 +481,7 @@ fn rounded_enclosure_shell_side_and_floor_attach_through_width_wall_and_reopen()assert!(state.sketch(floor).unwrap().plane.normal().dot(Vec3::Z) > 0.999);let mesh = state.body("Case").unwrap().body.tessellate_with(1e-4, true).unwrap();let case = &state.body("Case").unwrap().body;- let corners: Vec<_> = (0..case.face_count()).filter(|i| matches!(solvecraft_kernel::face_surface(case, *i), Some(solvecraft_kernel::FaceSurface::Cylinder { radius, .. }) if (radius - 6.).abs() < 1e-6)).collect();+ let corners: Vec<_> = (0..case.face_count()).filter(|i| matches!(solidcraft_kernel::face_surface(case, *i), Some(solidcraft_kernel::FaceSurface::Cylinder { radius, .. }) if (radius - 6.).abs() < 1e-6)).collect();assert_eq!(corners.len(), 4, "later port/boss features must not subdivide untouched outer corners");for index in corners {let points: Vec<_> = mesh@@ -498,7 +498,7 @@ fn rounded_enclosure_shell_side_and_floor_attach_through_width_wall_and_reopen()assert!(!mesh.contains(Vec3::new(49., 0., 12.)), "USB must remain open after resize/reopen");assert!(mesh.contains(Vec3::new(49., 15., 12.)), "adjacent right wall remains solid");assert!(mesh.contains(Vec3::new(-49., 0., 12.)), "opposite wall must stay solid");- let seed = state.sketch(floor).unwrap().plane.to_world(solvecraft_geom::Vec2::new(40., 20.)) + Vec3::Z * 6.;+ let seed = state.sketch(floor).unwrap().plane.to_world(solidcraft_geom::Vec2::new(40., 20.)) + Vec3::Z * 6.;assert!(mesh.contains(seed), "seed boss starts on current floor");for shift in [Vec3::ZERO, Vec3::new(-80., 0., 0.), Vec3::new(0., -40., 0.), Vec3::new(-80., -40., 0.)] {assert!(mesh.contains(seed + shift), "each patterned boss must survive resize/reopen at {:?}", seed + shift);@@ -525,14 +525,14 @@ fn offset_rectangle_pocket_has_one_logical_outer_wall_and_closed_face_projectionrun(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"sketch":control_sketch,"distance":10,"operation":"new","body_name":"Control"}));let untouched = s.model.state().body("Control").unwrap().body.clone();- let before_control = solvecraft_kernel::step_export(&[&untouched], "control snapshot").unwrap();+ let before_control = solidcraft_kernel::step_export(&[&untouched], "control snapshot").unwrap();let pick = top_pick(&s, "Stock");let pocket = run(&mut s, "sketch.create", json!({"plane":pick}))["sketch"].as_u64().unwrap();let side = {let state = s.model.state();let sk = &state.sketch(pocket).unwrap().sketch;let curve = sk.curves.iter().find(|c| c.id == "l1").unwrap();- let solvecraft_sketch::CurveKind::Line { a, b } = curve.kind else { panic!() };+ let solidcraft_sketch::CurveKind::Line { a, b } = curve.kind else { panic!() };sk.point(a).unwrap() + sk.point(b).unwrap()};let outer = run(&mut s, "sketch.offset", json!({"curves":["l1"],"distance":0.3425231845240546,"side":[side.x,side.y]}))["curves"].clone();@@ -541,7 +541,7 @@ fn offset_rectangle_pocket_has_one_logical_outer_wall_and_closed_face_projectionrun(&mut s, "solid.extrude", json!({"sketch":pocket,"profiles":[{"curves":inner}],"distance":-9,"operation":"cut"}));let control = s.model.state().body("Control").unwrap().body.clone();assert!(control.same(&untouched), "a separate body crossing the cutter end plane remains the exact same solid");- assert_eq!(solvecraft_kernel::step_export(&[&control], "control snapshot").unwrap(), before_control);+ assert_eq!(solidcraft_kernel::step_export(&[&control], "control snapshot").unwrap(), before_control);let state = s.model.state();let body = state.body("Stock").unwrap();let display = body.body.display_mesh(0.01).unwrap();@@ -556,7 +556,7 @@ fn offset_rectangle_pocket_has_one_logical_outer_wall_and_closed_face_projectionassert_eq!(display.surface_patch(face.index).len(), 1);let attached = run(&mut s, "sketch.create", json!({"plane":{"body":"Stock","index":face.index,"face":[30,0,0.5]}}))["sketch"].as_u64().unwrap();run(&mut s, "sketch.finish", json!({}));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());for session in [&s, &reopened] {let result = session.model.result(attached).unwrap();assert!(result.error.is_none(), "{:?}", result.error);diff --git a/crates/engine/src/cmd/sketch_freeform.rs b/crates/engine/src/cmd/sketch_freeform.rsindex 699d672efa..cd47682c77 100644--- a/crates/engine/src/cmd/sketch_freeform.rs+++ b/crates/engine/src/cmd/sketch_freeform.rs@@ -3,8 +3,8 @@//! stays exact; the pieces replace the original curve.use serde_json::{Value, json};-use solvecraft_geom::{Seg2, Vec2};-use solvecraft_sketch::{ConstraintKind, CurveKind, Sketch};+use solidcraft_geom::{Seg2, Vec2};+use solidcraft_sketch::{ConstraintKind, CurveKind, Sketch};use super::sketch::add_c;use crate::Result;@@ -163,7 +163,7 @@ fn add_pieces(sk: &mut Sketch, segs: &[Seg2], start: Option<usize>, end: Option<CurveKind::Conic { a: prev, b: to, apex: x, rho: w / (1.0 + w) }}Seg2::Bezier { n, p } => {- let k = (n as usize).clamp(1, solvecraft_geom::MAX_BEZIER_DEGREE);+ let k = (n as usize).clamp(1, solidcraft_geom::MAX_BEZIER_DEGREE);let mut pts = vec![prev];for q in p.iter().take(k).skip(1) {pts.push(sk.add_point(*q, None)?);diff --git a/crates/engine/src/cmd/sketch_fuzz_tests.rs b/crates/engine/src/cmd/sketch_fuzz_tests.rsindex 4d76cc8133..8e42b98bca 100644--- a/crates/engine/src/cmd/sketch_fuzz_tests.rs+++ b/crates/engine/src/cmd/sketch_fuzz_tests.rs@@ -94,7 +94,7 @@ fn random_sketch_editing_never_breaks() {}}// The design round-trips.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back, *s.doc, "seed {seed}");}}diff --git a/crates/engine/src/cmd/sketch_ids_tests.rs b/crates/engine/src/cmd/sketch_ids_tests.rsindex 65063ba0ce..76605670e3 100644--- a/crates/engine/src/cmd/sketch_ids_tests.rs+++ b/crates/engine/src/cmd/sketch_ids_tests.rs@@ -3,7 +3,7 @@//! new geometry right away; ids are never reused after a delete.use serde_json::{Value, json};-use solvecraft_sketch::{CurveKind, Sketch};+use solidcraft_sketch::{CurveKind, Sketch};use crate::Session;diff --git a/crates/engine/src/cmd/sketch_import.rs b/crates/engine/src/cmd/sketch_import.rsindex d44d071299..69fb8fa4cb 100644--- a/crates/engine/src/cmd/sketch_import.rs+++ b/crates/engine/src/cmd/sketch_import.rs@@ -3,9 +3,9 @@use std::collections::HashMap;use serde_json::{Value, json};-use solvecraft_geom::Vec2;-use solvecraft_io::{Geom2, MAX_DRAWING_BYTES};-use solvecraft_sketch::{CurveKind, LinkKind, LinkSource, Sketch};+use solidcraft_geom::Vec2;+use solidcraft_io::{Geom2, MAX_DRAWING_BYTES};+use solidcraft_sketch::{CurveKind, LinkKind, LinkSource, Sketch};use super::CommandSpec;use super::sketch::{edit, ids_of};@@ -34,7 +34,7 @@ fn source_text(p: &Value, cmd: &str) -> Result<String> {return Ok(t.to_string());}let path = str_(p, "path").filter(|x| !x.trim().is_empty() && x.len() < 4096).ok_or_else(|| bad(cmd, "give `path` or `text`"))?;- let bytes = solvecraft_io::vfs::read(path, MAX_DRAWING_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ let bytes = solidcraft_io::vfs::read(path, MAX_DRAWING_BYTES).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;Ok(String::from_utf8_lossy(&bytes).to_string())}@@ -79,7 +79,7 @@ fn add_geometry(sk: &mut Sketch, geom: &[Geom2], f: &dyn Fn(Vec2) -> Vec2, k: f6Geom2::Ellipse { c, major, minor } => Some(CurveKind::Ellipse { c: pt(sk, *c)?, m: pt(sk, *major)?, r: minor * k }),Geom2::Spline { pts, control, degree } => {let mut idx = Vec::new();- for p in pts.iter().take(solvecraft_sketch::MAX_SPLINE_POINTS) {+ for p in pts.iter().take(solidcraft_sketch::MAX_SPLINE_POINTS) {let i = pt(sk, *p)?;if idx.last() != Some(&i) {idx.push(i);@@ -107,7 +107,7 @@ fn add_geometry(sk: &mut Sketch, geom: &[Geom2], f: &dyn Fn(Vec2) -> Vec2, k: f6fn insert(s: &mut Session, p: &Value, cmd: &str, svg: bool) -> Result<Value> {let text = source_text(p, cmd)?;- let geom = if svg { solvecraft_io::read_svg(&text) } else { solvecraft_io::read_dxf(&text) }.map_err(|e| bad(cmd, e.to_string()))?;+ let geom = if svg { solidcraft_io::read_svg(&text) } else { solidcraft_io::read_dxf(&text) }.map_err(|e| bad(cmd, e.to_string()))?;if geom.is_empty() {return Err(bad(cmd, "the drawing has no geometry SolidCraft reads"));}@@ -180,9 +180,9 @@ fn export_dxf(s: &mut Session, p: &Value) -> Result<Value> {}}}- let text = solvecraft_io::write_dxf(&geom);+ let text = solidcraft_io::write_dxf(&geom);if let Some(path) = str_(p, "path").filter(|x| !x.trim().is_empty()) {- solvecraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;+ solidcraft_io::vfs::write(path, text.as_bytes()).map_err(|e| EngineError::Other(format!("{path}: {e}")))?;return Ok(json!({"path": path, "entities": geom.len()}));}Ok(json!({"dxf": text, "entities": geom.len()}))diff --git a/crates/engine/src/cmd/sketch_inspect.rs b/crates/engine/src/cmd/sketch_inspect.rsindex 7a112ff88b..b387218b30 100644--- a/crates/engine/src/cmd/sketch_inspect.rs+++ b/crates/engine/src/cmd/sketch_inspect.rs@@ -2,7 +2,7 @@//! centre of mass of bodies.use serde_json::{Value, json};-use solvecraft_geom::{Seg2, Vec2, Vec3};+use solidcraft_geom::{Seg2, Vec2, Vec3};use super::CommandSpec;use crate::params::{bad, num, string_list, vec3};@@ -147,7 +147,7 @@ fn min_of(teeth: &[(Vec3, f64, Vec3)]) -> Option<(f64, Vec3)> {}/// The face of a body at `at` (nearest triangle): (body index, face index).-fn face_at(st: &solvecraft_doc::ModelState, at: Vec3) -> Option<(usize, u32)> {+fn face_at(st: &solidcraft_doc::ModelState, at: Vec3) -> Option<(usize, u32)> {let mut best: Option<(f64, usize, u32)> = None;for (bi, b) in st.bodies.iter().enumerate() {let m = b.mesh();@@ -184,7 +184,7 @@ fn closest_on_triangle(p: Vec3, a: Vec3, b: Vec3, c: Vec3) -> Vec3 {/// Smallest radius of curvature over a face of a mesh, from the turn of the vertex normals/// along each triangle side: (radius, where).-fn face_min_radius(m: &solvecraft_geom::Mesh, face: u32) -> Option<(f64, Vec3)> {+fn face_min_radius(m: &solidcraft_geom::Mesh, face: u32) -> Option<(f64, Vec3)> {let mut best: Option<(f64, Vec3)> = None;for (ti, t) in m.triangles.iter().enumerate() {if m.tri_face.get(ti) != Some(&face) {@@ -294,7 +294,7 @@ fn isocurves(s: &mut Session, p: &Value) -> Result<Value> {let at = vec3(v).ok_or_else(|| bad(cmd, "`faces` must list points [x,y,z]"))?;let (bi, f) = face_at(&st, at).ok_or_else(|| bad(cmd, "no face there"))?;let m = st.bodies.get(bi).map(|b| b.mesh()).ok_or_else(|| bad(cmd, "body"))?;- for w in solvecraft_doc::iso_grid(&m, f, at, count) {+ for w in solidcraft_doc::iso_grid(&m, f, at, count) {out.push(w.iter().map(|q| [q.x, q.y, q.z]).collect::<Vec<_>>());}}diff --git a/crates/engine/src/cmd/sketch_modify.rs b/crates/engine/src/cmd/sketch_modify.rsindex 365f2a0c48..a36a85d1cc 100644--- a/crates/engine/src/cmd/sketch_modify.rs+++ b/crates/engine/src/cmd/sketch_modify.rs@@ -4,9 +4,9 @@use std::f64::consts::TAU;use serde_json::{Value, json};-use solvecraft_doc::ProfileSel;-use solvecraft_geom::Vec2;-use solvecraft_sketch::{ConstraintKind, Curve, CurveKind, Shape, Sketch, intersections};+use solidcraft_doc::ProfileSel;+use solidcraft_geom::Vec2;+use solidcraft_sketch::{ConstraintKind, Curve, CurveKind, Shape, Sketch, intersections};use super::sketch::{add_c, edit, ids_of, solve_current};use super::{CommandSpec, in_sketch};@@ -451,8 +451,8 @@ fn extend(s: &mut Session, p: &Value) -> Result<Value> {}pin(sk, end, oi)?;let before = sk.points.iter().map(|p| p.pos).collect::<Vec<_>>();- let hold = solvecraft_sketch::Hold { points: (0..sk.points.len()).filter(|i| *i != end).collect(), radii: (0..sk.curves.len()).collect() };- if !solvecraft_sketch::solve_with(sk, &hold, None, solvecraft_sketch::Analysis::Full, None).ok()+ let hold = solidcraft_sketch::Hold { points: (0..sk.points.len()).filter(|i| *i != end).collect(), radii: (0..sk.curves.len()).collect() };+ if !solidcraft_sketch::solve_with(sk, &hold, None, solidcraft_sketch::Analysis::Full, None).ok()|| sk.point(end).is_none_or(|point| point.dist(q) > TOL)|| sk.points.iter().enumerate().any(|(i, point)| i != end && point.pos.dist(before[i]) > TOL){@@ -602,7 +602,7 @@ fn fillet(s: &mut Session, p: &Value) -> Result<Value> {None => vec![p.clone()],};let (out, info) = edit(s, p, cmd, false, |sk, doc| {- let r = doc.eval(&r_expr, solvecraft_doc::expr::Kind::Length).map_err(|e| bad(cmd, format!("radius: {e}")))?;+ let r = doc.eval(&r_expr, solidcraft_doc::expr::Kind::Length).map_err(|e| bad(cmd, format!("radius: {e}")))?;if !(r > 1e-9 && r < 1e8) {return Err(bad(cmd, "radius must be positive"));}@@ -958,7 +958,7 @@ fn offset(s: &mut Session, p: &Value) -> Result<Value> {}let ci = sk.add_circle(cc, nr, Some(c), None)?;made.push(ci);- sk.offsets.push(solvecraft_sketch::OffsetChain {+ sk.offsets.push(solidcraft_sketch::OffsetChain {sources: vec![(ids[0].clone(), true)],outputs: ids_of(sk, &made),distance: r - nr,@@ -1014,7 +1014,7 @@ fn offset(s: &mut Session, p: &Value) -> Result<Value> {.map(|topology| topology.roles.clone()).ok_or_else(|| bad(cmd, "new offset association is missing"))?;for (source, role) in sources.iter().zip(&roles) {- if role.kind == solvecraft_sketch::OffsetRoleKind::Line {+ if role.kind == solidcraft_sketch::OffsetRoleKind::Line {let a = sk.curve_index(&source.0).ok_or_else(|| bad(cmd, "offset source line vanished"))?;let b = sk.curve_index(&role.output).ok_or_else(|| bad(cmd, "offset output line vanished"))?;cons.push(add_c(sk, ConstraintKind::Parallel { a, b })?);@@ -1106,7 +1106,7 @@ fn offset(s: &mut Session, p: &Value) -> Result<Value> {let outputs = ids_of(sk, &made);if pieces.iter().all(|p| !matches!(p, Piece::Free(_))) {let sources = order.iter().filter_map(|(i, forward)| sk.curves.get(*i).map(|c| (c.id.clone(), *forward))).collect();- sk.offsets.push(solvecraft_sketch::OffsetChain { sources, outputs: outputs.clone(), distance: d, closed, topology: None });+ sk.offsets.push(solidcraft_sketch::OffsetChain { sources, outputs: outputs.clone(), distance: d, closed, topology: None });sk.refresh_offsets()?;}Ok((outputs, cons, None))@@ -1172,7 +1172,7 @@ fn break_offset(s: &mut Session, p: &Value) -> Result<Value> {/// A broken logical boundary becomes ordinary geometry. Keep downstream features/// on that exact current boundary while other associations retain their full roles.-fn freeze_offset_profiles(doc: &mut solvecraft_doc::Document, sketch: u64, boundary: &Sketch, association: &str) -> Result<()> {+fn freeze_offset_profiles(doc: &mut solidcraft_doc::Document, sketch: u64, boundary: &Sketch, association: &str) -> Result<()> {let cmd = "sketch.offset.break";let mut groups = std::collections::BTreeMap::new();let mut work = 0usize;diff --git a/crates/engine/src/cmd/sketch_modify_tests.rs b/crates/engine/src/cmd/sketch_modify_tests.rsindex a453db76ea..35f48539b4 100644--- a/crates/engine/src/cmd/sketch_modify_tests.rs+++ b/crates/engine/src/cmd/sketch_modify_tests.rs@@ -1,6 +1,6 @@use serde_json::{Value, json};-use solvecraft_geom::Vec2;-use solvecraft_sketch::CurveKind;+use solidcraft_geom::Vec2;+use solidcraft_sketch::CurveKind;use crate::Session;@@ -15,7 +15,7 @@ fn ids(v: &Value) -> Vec<String> {v.as_array().map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect()).unwrap_or_default()}-fn sketch(s: &Session) -> solvecraft_sketch::Sketch {+fn sketch(s: &Session) -> solidcraft_sketch::Sketch {let id = s.active_sketch.unwrap();s.model.state().sketch(id).unwrap().sketch.clone()}@@ -63,7 +63,7 @@ fn explicit_freeform_break_preserves_exact_geometry_and_undo() {}}let encoded = serde_json::to_value(&after).unwrap();- let restored: solvecraft_sketch::Sketch = serde_json::from_value(encoded).unwrap();+ let restored: solidcraft_sketch::Sketch = serde_json::from_value(encoded).unwrap();assert_eq!(restored.curves.len(), after.curves.len());run(&mut s, "edit.undo", json!({}));assert!(sketch(&s).curve_index(&id).is_some());@@ -120,7 +120,7 @@ fn analytic_trim_and_break_use_freeform_cutters() {let sk = sketch(&s);for id in ids(&out["curves"]) {let shape = sk.shape(sk.curve_index(&id).unwrap()).unwrap();- assert!(matches!(shape, solvecraft_sketch::Shape::Line { a, b } if (a.y - 5.0).abs() < 1e-6 && (b.y - 5.0).abs() < 1e-6));+ assert!(matches!(shape, solidcraft_sketch::Shape::Line { a, b } if (a.y - 5.0).abs() < 1e-6 && (b.y - 5.0).abs() < 1e-6));}let mut s = new_sketch();@@ -144,7 +144,7 @@ fn trim_extend_break() {let sk = sketch(&s);let sh = sk.shape(sk.curve_index(&h).unwrap()).unwrap();assert!(- matches!(sh, solvecraft_sketch::Shape::Line { a, b } if a.dist(Vec2::new(0.0, 0.0)) < 1e-9 && b.dist(Vec2::new(10.0, 0.0)) < 1e-9),+ matches!(sh, solidcraft_sketch::Shape::Line { a, b } if a.dist(Vec2::new(0.0, 0.0)) < 1e-9 && b.dist(Vec2::new(10.0, 0.0)) < 1e-9),"{sh:?}");// Trim the lower half of the vertical line: the original id survives on the upper piece.@@ -198,7 +198,7 @@ fn exact_extend_ellipse_preserves_support_target_and_history() {assert!(end.dist(Vec2::new(expected_x, y)) < 1e-7, "exact ellipse contact {end:?}");assert_eq!(sk.exact_segs(0).unwrap(), target);let persisted = s.doc.to_json();- let reopened = solvecraft_doc::format::read(&persisted).unwrap();+ let reopened = solidcraft_doc::format::read(&persisted).unwrap();assert_eq!(reopened.to_json(), persisted);run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);@@ -645,7 +645,7 @@ fn certified_offset_follows_dimension_drag_reopen_break_and_undo() {run(&mut s, "sketch.drag", json!({"entity":ellipse,"from":[0,0],"to":[4,3]}));verify(&s);let mut reopened = Session {- doc: std::sync::Arc::new(solvecraft_doc::format::read(&s.doc.to_json()).unwrap()),+ doc: std::sync::Arc::new(solidcraft_doc::format::read(&s.doc.to_json()).unwrap()),active_sketch: s.active_sketch,..Session::default()};@@ -677,7 +677,7 @@ fn certified_offset_delete_output_undo_reopen_and_refuse_dependent_source() {assert!(sk.curve_index(&id).is_none());assert!(sk.curve_index("e1").is_some());let deleted = s.doc.to_json();- let reopened = solvecraft_doc::format::read(&deleted).unwrap();+ let reopened = solidcraft_doc::format::read(&deleted).unwrap();assert_eq!(reopened.to_json(), deleted);run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), attached);@@ -706,7 +706,7 @@ fn periodic_closed_offset_chain_break_drag_reopen_and_material_volume() {let check = |session: &Session| {let sk = sketch(session);assert_eq!(sk.freeform_offsets.iter().map(|r| r.certificate).collect::<Vec<_>>(), [2, 2]);- assert_eq!(solvecraft_sketch::find_profiles(&sk).len(), 3);+ assert_eq!(solidcraft_sketch::find_profiles(&sk).len(), 3);for id in [&a, &b] {assert!(matches!(sk.curves[sk.curve_index(id).unwrap()].kind, CurveKind::Spline { periodic: true, .. }));}@@ -719,7 +719,7 @@ fn periodic_closed_offset_chain_break_drag_reopen_and_material_volume() {run(&mut s, "parameters.change", json!({"name":"d1","expression":12}));check(&s);let mut reopened =- Session { doc: solvecraft_doc::format::read(&s.doc.to_json()).unwrap().into(), active_sketch: s.active_sketch, ..Default::default() };+ Session { doc: solidcraft_doc::format::read(&s.doc.to_json()).unwrap().into(), active_sketch: s.active_sketch, ..Default::default() };reopened.refresh();check(&reopened);let attached = reopened.doc.to_json();@@ -736,12 +736,12 @@ fn periodic_closed_offset_chain_break_drag_reopen_and_material_volume() {let indices = moved.curves[moved.curve_index(&b).unwrap()].kind.point_ids();assert_eq!(moved.point(indices[0]), moved.point(*indices.last().unwrap()));assert!(moved.point(indices[0]).unwrap().dist(from) > 0.1);- assert_eq!(solvecraft_doc::format::read(&reopened.doc.to_json()).unwrap().to_json(), reopened.doc.to_json());+ assert_eq!(solidcraft_doc::format::read(&reopened.doc.to_json()).unwrap().to_json(), reopened.doc.to_json());run(&mut reopened, "edit.undo", json!({}));run(&mut reopened, "edit.undo", json!({}));assert_eq!(reopened.doc.to_json(), attached);// An independent ring area multiplied by height probes actual profile material.- let regions = solvecraft_sketch::find_profiles(&sketch(&s));+ let regions = solidcraft_sketch::find_profiles(&sketch(&s));let selected = regions.iter().enumerate().min_by(|(_, x), (_, y)| x.area.total_cmp(&y.area)).unwrap();let n = 4096;let h = std::f64::consts::TAU / n as f64;@@ -767,7 +767,7 @@ fn periodic_closed_offset_chain_break_drag_reopen_and_material_volume() {run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"sketch":sketch_id,"profiles":[selected.0],"distance":3,"operation":"new"}));let state = s.world_state();- let volume = solvecraft_kernel::measure(&state.bodies.last().unwrap().body).unwrap().volume;+ let volume = solidcraft_kernel::measure(&state.bodies.last().unwrap().body).unwrap().volume;assert!((volume - expected).abs() < 0.05, "{volume} vs {expected}");}@@ -780,7 +780,7 @@ fn periodic_fit_creator_keeps_legacy_and_refuses_hostile_intent_atomically() {let i = sk.curve_index(&id).unwrap();assert!(matches!(sk.curves[i].kind, CurveKind::Spline { periodic: true, .. }));sk.validate_periodic_splines().unwrap();- assert_eq!(solvecraft_sketch::find_profiles(&sk).len(), 1);+ assert_eq!(solidcraft_sketch::find_profiles(&sk).len(), 1);let before = s.doc.to_json();let history = s.undo.len();for (cmd, p) in [@@ -822,7 +822,7 @@ fn analytic_offset_partial_delete_releases_survivors_preserves_source_and_undo()}assert!(sk.curve_index("l1").is_some());let saved = s.doc.to_json();- assert_eq!(solvecraft_doc::format::read(&saved).unwrap().to_json(), saved);+ assert_eq!(solidcraft_doc::format::read(&saved).unwrap().to_json(), saved);run(&mut s, "edit.undo", json!({}));assert_eq!(s.doc.to_json(), before);}@@ -835,7 +835,7 @@ fn periodic_offset_extrusion_survives_post_extrude_span_changes_and_cold_reopen(let a = run(&mut s, "sketch.offset", json!({"curves":["e1"],"distance":-1,"chain":false}))["curves"][0].as_str().unwrap().to_string();run(&mut s, "sketch.offset", json!({"curves":[a],"distance":-0.5,"chain":false}));let sk_id = s.active_sketch.unwrap();- let initial = solvecraft_sketch::find_profiles(&sketch(&s));+ let initial = solidcraft_sketch::find_profiles(&sketch(&s));let (index, ring) = initial.iter().enumerate().min_by(|(_, a), (_, b)| a.area.total_cmp(&b.area)).unwrap();let initial_count = ring.outer_curves.len();let boundary = ring.whole_curve_boundaries().unwrap();@@ -887,21 +887,21 @@ fn periodic_offset_extrusion_survives_post_extrude_span_changes_and_cold_reopen(let body = &state.bodies[0].body;for (distance, material) in [(1.25, true), (0.5, false), (1.75, false)] {let point = ellipse + normal * distance;- assert_eq!(body.contains(solvecraft_geom::Vec3::new(point.x, point.y, 1.5)), material);+ assert_eq!(body.contains(solidcraft_geom::Vec3::new(point.x, point.y, 1.5)), material);}// Repeat at the exact major-axis seam as a physical material control.for (distance, material) in [(1.25, true), (0.5, false), (1.75, false)] {let point = centre + u * (major + distance);assert_eq!(ring.region.contains(point), material);- assert_eq!(body.contains(solvecraft_geom::Vec3::new(point.x, point.y, 1.5)), material);+ assert_eq!(body.contains(solidcraft_geom::Vec3::new(point.x, point.y, 1.5)), material);}- let volume = solvecraft_kernel::measure(body).unwrap().volume;+ let volume = solidcraft_kernel::measure(body).unwrap().volume;assert!((volume - expected).abs() < 0.05, "{major}: {volume} vs independent {expected}");- let mut cold = Session { doc: solvecraft_doc::format::read(&s.doc.to_json()).unwrap().into(), ..Default::default() };+ let mut cold = Session { doc: solidcraft_doc::format::read(&s.doc.to_json()).unwrap().into(), ..Default::default() };cold.refresh();let cold_state = cold.world_state();assert_eq!(cold_state.bodies.len(), 1);- let cold_volume = solvecraft_kernel::measure(&cold_state.bodies[0].body).unwrap().volume;+ let cold_volume = solidcraft_kernel::measure(&cold_state.bodies[0].body).unwrap().volume;assert!((cold_volume - volume).abs() < 1e-8);let edited = s.doc.to_json();run(&mut s, "edit.undo", json!({}));diff --git a/crates/engine/src/cmd/sketch_perf_tests.rs b/crates/engine/src/cmd/sketch_perf_tests.rsindex a3c172c88b..0f97b4acb2 100644--- a/crates/engine/src/cmd/sketch_perf_tests.rs+++ b/crates/engine/src/cmd/sketch_perf_tests.rs@@ -1,4 +1,4 @@-//! Timings for large sketches (run with `cargo test -p solvecraft-engine --release sketch_perf -- --ignored --nocapture`;+//! Timings for large sketches (run with `cargo test -p solidcraft-engine --release sketch_perf -- --ignored --nocapture`;//! numbers are recorded in docs/perf.md).use std::time::Instant;@@ -19,8 +19,8 @@ fn big(n: usize) -> Session {let id = s.active_sketch.unwrap();let mut doc = (*s.doc).clone();let sk = doc.sketch_mut(id).unwrap();- use solvecraft_geom::Vec2;- use solvecraft_sketch::ConstraintKind::*;+ use solidcraft_geom::Vec2;+ use solidcraft_sketch::ConstraintKind::*;let side = (n as f64).sqrt().ceil() as usize;for k in 0..n {let (x, y) = ((k % side) as f64 * 30.0, (k / side) as f64 * 30.0);@@ -54,10 +54,10 @@ fn sketch_perf() {let entities = sk.curves.len() + sk.points.len();let t = Instant::now();let mut k = sk.clone();- let rep = solvecraft_sketch::solve(&mut k);+ let rep = solidcraft_sketch::solve(&mut k);let solve = ms(t);let t = Instant::now();- let prof = solvecraft_sketch::find_profiles(&k);+ let prof = solidcraft_sketch::find_profiles(&k);let profiles = ms(t);let ss = s.model.state().sketch(id).unwrap().clone();let t = Instant::now();diff --git a/crates/engine/src/cmd/sketch_project.rs b/crates/engine/src/cmd/sketch_project.rsindex 4605b24e97..49f8baf143 100644--- a/crates/engine/src/cmd/sketch_project.rs+++ b/crates/engine/src/cmd/sketch_project.rs@@ -4,10 +4,10 @@//! normal geometry.use serde_json::{Value, json};-use solvecraft_doc::project::resolve;-use solvecraft_doc::{Document, FeatureKind};-use solvecraft_geom::{Plane, Vec3};-use solvecraft_sketch::{ConstraintKind, LinkKind, LinkSource, Sketch};+use solidcraft_doc::project::resolve;+use solidcraft_doc::{Document, FeatureKind};+use solidcraft_geom::{Plane, Vec3};+use solidcraft_sketch::{ConstraintKind, LinkKind, LinkSource, Sketch};use super::{CommandSpec, in_sketch};use crate::params::{bad, bool_, str_, vec3};@@ -141,7 +141,7 @@ fn placed_candidate<'a>(s: &Session, doc: &'a Document) -> std::borrow::Cow<'a,std::borrow::Cow::Owned(placed)}-fn owner_frame(s: &Session, doc: &Document, comp: u64) -> solvecraft_doc::Mat {+fn owner_frame(s: &Session, doc: &Document, comp: u64) -> solidcraft_doc::Mat {if comp == s.active_component { s.active_component_frame() } else { doc.component_transform(comp) }}@@ -157,19 +157,19 @@ pub(super) fn refresh(s: &Session, doc: &Document, id: u64, sk: &mut Sketch) ->let st = s.model.state_before(id);let comp = doc.feature(id).map(|f| f.component).unwrap_or(0);let attachment = doc.feature(id).and_then(|feature| match &feature.kind {- solvecraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),+ solidcraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),_ => None,});let st = match attachment {- Some(anchor) => solvecraft_doc::state_in_face_anchor_frame(&doc, &st, anchor, comp),- None => Ok(solvecraft_doc::state_in_frame_at(&doc, &st, comp, owner_frame(s, &doc, comp))),+ Some(anchor) => solidcraft_doc::state_in_face_anchor_frame(&doc, &st, anchor, comp),+ None => Ok(solidcraft_doc::state_in_frame_at(&doc, &st, comp, owner_frame(s, &doc, comp))),};let Ok(st) = st else {return vec!["lost face attachment; reattach explicitly".into()];};match attachment {- Some(anchor) => solvecraft_doc::project::refresh_face_anchor_links(&doc, &vals, &st, &plane, sk, anchor),- None => solvecraft_doc::project::refresh_links(&doc, &vals, &st, &plane, sk),+ Some(anchor) => solidcraft_doc::project::refresh_face_anchor_links(&doc, &vals, &st, &plane, sk, anchor),+ None => solidcraft_doc::project::refresh_links(&doc, &vals, &st, &plane, sk),}}@@ -182,21 +182,21 @@ pub(super) fn add_link(s: &Session, doc: &Document, id: u64, sk: &mut Sketch, ki// The model as the sketch's component sees it.let comp = doc.feature(id).map(|f| f.component).unwrap_or(0);let attachment = doc.feature(id).and_then(|feature| match &feature.kind {- solvecraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),+ solidcraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),_ => None,});let st = match attachment {- Some(anchor) => solvecraft_doc::state_in_face_anchor_frame(&doc, &st, anchor, comp),- None => Ok(solvecraft_doc::state_in_frame_at(&doc, &st, comp, owner_frame(s, &doc, comp))),+ Some(anchor) => solidcraft_doc::state_in_face_anchor_frame(&doc, &st, anchor, comp),+ None => Ok(solidcraft_doc::state_in_frame_at(&doc, &st, comp, owner_frame(s, &doc, comp))),};let st = st?;let r = resolve(&doc, &vals, &st, &plane, kind, &src)?;let name = if let LinkSource::Face { body, at } = &r.source {st.body(body).and_then(|body| {if let Some(index) = r.face_index {- solvecraft_doc::naming::face_names(body).get(index).filter(|name| !name.is_empty()).cloned()+ solidcraft_doc::naming::face_names(body).get(index).filter(|name| !name.is_empty()).cloned()} else {- solvecraft_doc::naming::face_name_at_body(body, *at)+ solidcraft_doc::naming::face_name_at_body(body, *at)}})} else {@@ -312,7 +312,7 @@ fn spun_profile(s: &mut Session, p: &Value) -> Result<Value> {let st = s.model.state();let ss = st.sketch(id).ok_or_else(|| EngineError::Other("the sketch is not evaluated".into()))?;let ci = ss.sketch.curve_index(axis).ok_or_else(|| bad(cmd, format!("unknown curve `{axis}`")))?;- let Some(solvecraft_sketch::Shape::Line { a, b }) = ss.sketch.shape(ci) else { return Err(bad(cmd, "the axis must be a line")) };+ let Some(solidcraft_sketch::Shape::Line { a, b }) = ss.sketch.shape(ci) else { return Err(bad(cmd, "the axis must be a line")) };let (wa, wb) = (ss.plane.to_world(a), ss.plane.to_world(b));(wa, wb - wa)}@@ -417,7 +417,7 @@ pub(super) fn snap_points(s: &mut Session, p: &Value, cmd: &str) -> Result<Valuelet (c, xy) = t.rsplit_once(':')?;let n: Vec<f64> = xy.split(',').filter_map(|x| x.trim().parse().ok()).collect();match n[..] {- [x, y] if x.is_finite() && y.is_finite() => Some((c.to_string(), solvecraft_geom::Vec2::new(x, y))),+ [x, y] if x.is_finite() && y.is_finite() => Some((c.to_string(), solidcraft_geom::Vec2::new(x, y))),_ => None,}});@@ -444,7 +444,7 @@ pub(super) fn snap_points(s: &mut Session, p: &Value, cmd: &str) -> Result<Value} else if let Some(line) = mid {// "mid:<line>": a new point at the line's midpoint, kept there.let l = sk.curve_index(&line).ok_or_else(|| bad(cmd, format!("unknown curve `{line}`")))?;- let Some(solvecraft_sketch::Shape::Line { a, b }) = sk.shape(l) else { return Err(bad(cmd, format!("`{line}` is not a line"))) };+ let Some(solidcraft_sketch::Shape::Line { a, b }) = sk.shape(l) else { return Err(bad(cmd, format!("`{line}` is not a line"))) };let pi = sk.add_point((a + b) * 0.5, None)?;sk.add_constraint(ConstraintKind::Midpoint { p: pi, l }, None)?;sk.points.get(pi).map(|q| q.id.clone()).unwrap_or_default()@@ -493,9 +493,9 @@ pub(super) fn project_internal_face(s: &mut Session, id: u64, body: &str, index:let plane = sketch_plane(&doc, id)?;let raw = s.model.state_before(id);let component = doc.feature(id).map(|feature| feature.component).unwrap_or(0);- let state = solvecraft_doc::state_in_frame_at(&doc, &raw, component, owner_frame(s, &doc, component));- let resolved = solvecraft_doc::project::resolve_face_indices(&state, &plane, LinkKind::Project, body, &[index])?;- let face_name = state.body(body).and_then(|body| solvecraft_doc::naming::face_names(body).get(index).cloned());+ let state = solidcraft_doc::state_in_frame_at(&doc, &raw, component, owner_frame(s, &doc, component));+ let resolved = solidcraft_doc::project::resolve_face_indices(&state, &plane, LinkKind::Project, body, &[index])?;+ let face_name = state.body(body).and_then(|body| solidcraft_doc::naming::face_names(body).get(index).cloned());let mut sk = doc.sketch(id)?.clone();let link = sk.add_link_with_wires(LinkKind::Project, resolved.source, &resolved.geom, &resolved.wires)?;if let Some(entry) = sk.links.iter_mut().find(|entry| entry.id == link) {@@ -512,7 +512,7 @@ pub(super) fn auto_project_face(s: &mut Session, id: u64, _at: Vec3) -> Result<Olet Some(anchor) = doc.feature(id).and_then(|feature| match &feature.kind {- solvecraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),+ solidcraft_doc::FeatureKind::Sketch { plane, .. } => super::sketch::face::anchor(plane),_ => None,}).cloned()@@ -521,9 +521,9 @@ pub(super) fn auto_project_face(s: &mut Session, id: u64, _at: Vec3) -> Result<O};let raw = s.model.state_before(id);let author = doc.feature(id).map(|feature| feature.component).unwrap_or(0);- let state = solvecraft_doc::state_in_face_anchor_frame(&doc, &raw, &anchor, author)?;+ let state = solidcraft_doc::state_in_face_anchor_frame(&doc, &raw, &anchor, author)?;let plane = doc.resolve_face_anchor(&anchor, author, &raw)?;- let resolved = solvecraft_doc::project::resolve_anchored_face(&doc, &state, &plane, LinkKind::Project, &anchor)?;+ let resolved = solidcraft_doc::project::resolve_anchored_face(&doc, &state, &plane, LinkKind::Project, &anchor)?;let mut sk = doc.sketch(id)?.clone();let link = sk.add_link_with_wires(LinkKind::Project, resolved.source, &resolved.geom, &resolved.wires)?;if let Some(link) = sk.links.iter_mut().find(|entry| entry.id == link) {diff --git a/crates/engine/src/cmd/sketch_project_tests.rs b/crates/engine/src/cmd/sketch_project_tests.rsindex 12565ea422..cf1dc905b3 100644--- a/crates/engine/src/cmd/sketch_project_tests.rs+++ b/crates/engine/src/cmd/sketch_project_tests.rs@@ -33,13 +33,13 @@ fn manual_projection_captures_the_requested_coincident_body_producer() {let sk = &state.sketch(id).unwrap().sketch;assert!(!sk.links[0].lost);assert_eq!(sk.links[0].face_name, Some(format!("F{producer}:+z")));- assert!(matches!(&sk.links[0].source,solvecraft_sketch::LinkSource::Face{body,at} if body=="Target" && (at.z-20.).abs()<1e-6));+ assert!(matches!(&sk.links[0].source,solidcraft_sketch::LinkSource::Face{body,at} if body=="Target" && (at.z-20.).abs()<1e-6));assert!(sk.points.iter().any(|point| point.pos.x > 19.));assert!(sk.points.iter().any(|point| point.pos.y > 19.));assert!((session.world_state().body("Control").unwrap().mesh().bounds().max.z - 10.).abs() < 1e-6);};verify(&s);- verify(&Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));+ verify(&Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()));}#[test]@@ -48,19 +48,19 @@ fn initial_projection_retains_selected_face_when_closest_point_lands_on_shared_erun(&mut s, "solid.box", json!({"length":20,"width":20,"height":10,"body_name":"Target"}));let state = s.model.state();let body = state.body("Target").unwrap();- let source = solvecraft_sketch::LinkSource::Face { body: "Target".into(), at: solvecraft_geom::Vec3::new(-0.1, 5., 10.5) };- let resolved = solvecraft_doc::project::resolve(+ let source = solidcraft_sketch::LinkSource::Face { body: "Target".into(), at: solidcraft_geom::Vec3::new(-0.1, 5., 10.5) };+ let resolved = solidcraft_doc::project::resolve(&s.doc,&std::collections::BTreeMap::new(),&state,- &solvecraft_geom::Plane::XY,- solvecraft_sketch::LinkKind::Project,+ &solidcraft_geom::Plane::XY,+ solidcraft_sketch::LinkKind::Project,&source,).unwrap();let index = resolved.face_index.unwrap();- let expected = solvecraft_doc::naming::face_names(body)[index].clone();- let solvecraft_sketch::LinkSource::Face { at, .. } = resolved.source else { panic!("not face") };+ let expected = solidcraft_doc::naming::face_names(body)[index].clone();+ let solidcraft_sketch::LinkSource::Face { at, .. } = resolved.source else { panic!("not face") };assert!(at.x.abs() < 1e-6 && (at.z - 10.).abs() < 1e-6, "closestpoint must be on shared top/wall edge: {at:?}");let plane = body.body.face_plane(index).unwrap();let id = run(&mut s, "sketch.create", json!({"plane":{"origin":plane.origin,"x_dir":plane.x,"y_dir":plane.y}}))["sketch"].as_u64().unwrap();@@ -71,7 +71,7 @@ fn initial_projection_retains_selected_face_when_closest_point_lands_on_shared_eassert_eq!(sk.links[0].face_name, Some(expected));assert!(!sk.links[0].lost);assert_eq!(sk.curves.len(), 4);- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert_eq!(reopened.model.state().sketch(id).unwrap().sketch.curves, sk.curves);}@@ -83,7 +83,7 @@ fn box_part(s: &mut Session) {let l = ids(&r["curves"]);let sk = s.doc.sketch(s.active_sketch.unwrap()).unwrap();let start = match sk.curves[0].kind {- solvecraft_sketch::CurveKind::Line { a, .. } => sk.points[a].id.clone(),+ solidcraft_sketch::CurveKind::Line { a, .. } => sk.points[a].id.clone(),_ => panic!(),};run(s, "sketch.constraint.coincident", json!({"a": start, "b": "origin"}));@@ -446,7 +446,7 @@ fn sweeps_and_pipes_follow_3d_sketch_curves() {// A sweep of a square profile drawn square to the curve at its start.let (a, b) = (pts[0], pts[1]);let t = (b - a).normalized().unwrap();- let x = t.cross(solvecraft_geom::Vec3::Z).normalized().unwrap();+ let x = t.cross(solidcraft_geom::Vec3::Z).normalized().unwrap();let y = t.cross(x);run(&mut s, "sketch.create", json!({"plane": {"origin": [a.x, a.y, a.z], "x_dir": [x.x, x.y, x.z], "y_dir": [y.x, y.y, y.z]}}));run(&mut s, "sketch.rectangle.two_point", json!({"p0": [-1, -1], "p1": [1, 1]}));@@ -488,11 +488,11 @@ fn project_and_include_from_other_bodies() {run(&mut s, "sketch.finish", json!({}));// Widen the second box: the projection follows (its far edge is at 70).run(&mut s, "parameters.change", json!({"name": "w", "expression": "20 mm"}));- let id = s.doc.features.iter().find(|f| matches!(f.kind, solvecraft_doc::FeatureKind::Sketch { .. })).unwrap().id;+ let id = s.doc.features.iter().find(|f| matches!(f.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap().id;let si = run(&mut s, "sketch.inspect", json!({"sketch": id}));assert!(xs(&si).iter().any(|x| (x - 70.0).abs() < 1e-6), "{:?}", xs(&si));// Remove the cylinder: its silhouette and edge are lost, with a warning and no error.- let cyl = s.doc.features.iter().find(|f| matches!(f.kind, solvecraft_doc::FeatureKind::Cylinder { .. })).unwrap().id;+ let cyl = s.doc.features.iter().find(|f| matches!(f.kind, solidcraft_doc::FeatureKind::Cylinder { .. })).unwrap().id;run(&mut s, "timeline.delete", json!({"feature": cyl}));let t = run(&mut s, "document.inspect", json!({}));let row = t["timeline"].as_array().unwrap().iter().find(|r| r["id"] == json!(id)).cloned().unwrap();diff --git a/crates/engine/src/cmd/sketch_support.rs b/crates/engine/src/cmd/sketch_support.rsindex 28498d613a..1a3208ef29 100644--- a/crates/engine/src/cmd/sketch_support.rs+++ b/crates/engine/src/cmd/sketch_support.rs@@ -1,7 +1,7 @@//! Bounded roots on exact curve pieces against an infinite line or complete circle.//! Rational pieces are intersected in homogeneous coordinates, without sampled chords.-use solvecraft_geom::{Seg2, Vec2};-use solvecraft_sketch::{Shape, intersections};+use solidcraft_geom::{Seg2, Vec2};+use solidcraft_sketch::{Shape, intersections};use crate::{Result, params::bad};diff --git a/crates/engine/src/cmd/sketch_ux_tests.rs b/crates/engine/src/cmd/sketch_ux_tests.rsindex 2e0f43c11b..89f35ef8d6 100644--- a/crates/engine/src/cmd/sketch_ux_tests.rs+++ b/crates/engine/src/cmd/sketch_ux_tests.rs@@ -2,7 +2,7 @@//! which entity moves when a two-entity constraint is applied.use serde_json::{Value, json};-use solvecraft_sketch::{DimFrame, Sketch, dim_frame, dim_layout};+use solidcraft_sketch::{DimFrame, Sketch, dim_frame, dim_layout};use crate::Session;@@ -53,7 +53,7 @@ fn every_dimension_kind_has_a_drawable_frame() {let mut kinds = Vec::new();for c in dims {let f = dim_frame(&sk, &c.kind).unwrap_or_else(|| panic!("no frame for {c:?}"));- let l = dim_layout(&f, None, 0.1, solvecraft_geom::Vec2::new(1.0, 0.5));+ let l = dim_layout(&f, None, 0.1, solidcraft_geom::Vec2::new(1.0, 0.5));assert!(!l.lines.is_empty() && !l.arrows.is_empty(), "{c:?}");assert!(l.text.is_finite());kinds.push(std::mem::discriminant(&f));@@ -80,10 +80,10 @@ fn dimension_text_is_stored_relative_to_the_dimension_and_follows_it() {let f = dim_frame(&sk, &c.kind).expect("frame");dim_layout(&f, c.text, 0.1, Default::default()).text};- assert!(text(&s).dist(solvecraft_geom::Vec2::new(20.0, -8.0)) < 1e-9);+ assert!(text(&s).dist(solidcraft_geom::Vec2::new(20.0, -8.0)) < 1e-9);// Moved by the parameter name; then the line moves and the text goes with it.run(&mut s, "sketch.dimension_text", json!({"dimension": param, "at": [30, 12]}));- assert!(text(&s).dist(solvecraft_geom::Vec2::new(30.0, 12.0)) < 1e-9);+ assert!(text(&s).dist(solidcraft_geom::Vec2::new(30.0, 12.0)) < 1e-9);run(&mut s, "sketch.move_point", json!({"point": "l1.start", "to": [0, 10]}));run(&mut s, "sketch.move_point", json!({"point": "l1.end", "to": [40, 10]}));// Still 10 along and 12 across from the middle of the (moved) line.@@ -114,7 +114,7 @@ fn deleting_a_dimension_frees_its_parameter() {// ---------------------------------------------------------------------------------------------// Fix / Unfix-fn pt(s: &Session, id: &str) -> solvecraft_geom::Vec2 {+fn pt(s: &Session, id: &str) -> solidcraft_geom::Vec2 {let sk = sketch(s);sk.resolve_point(id).and_then(|i| sk.point(i)).unwrap_or_else(|| panic!("no point {id}"))}@@ -163,7 +163,7 @@ fn fixing_curves_holds_their_points_and_radius() {assert!(si["curves"].as_array().is_some_and(|c| c.iter().all(|c| c["fixed"] == true)), "{si}");// A fixed circle keeps centre and radius; a dimension on it conflicts.run(&mut s, "sketch.move_point", json!({"point": "c1.center", "to": [0, 0]}));- assert_eq!(pt(&s, "c1.center"), solvecraft_geom::Vec2::new(10.0, 10.0));+ assert_eq!(pt(&s, "c1.center"), solidcraft_geom::Vec2::new(10.0, 10.0));assert!(s.execute("sketch.dimension", &json!({"entities": ["c1"], "value": 20})).is_err());let r0 = sketch(&s).radius(0);assert_eq!(r0, Some(5.0));@@ -272,7 +272,7 @@ fn projected_geometry_can_become_construction() {// Two-entity constraints: the first pick stays, the second moves/// Positions of an entity's points (and its radius).-fn snap(s: &Session, id: &str) -> (Vec<solvecraft_geom::Vec2>, Option<f64>) {+fn snap(s: &Session, id: &str) -> (Vec<solidcraft_geom::Vec2>, Option<f64>) {let sk = sketch(s);if let Some(i) = sk.curve_index(id) {let pts = sk.curves[i].kind.point_ids().into_iter().filter_map(|p| sk.point(p)).collect();@@ -281,7 +281,7 @@ fn snap(s: &Session, id: &str) -> (Vec<solvecraft_geom::Vec2>, Option<f64>) {(vec![pt(s, id)], None)}-fn same(a: &(Vec<solvecraft_geom::Vec2>, Option<f64>), b: &(Vec<solvecraft_geom::Vec2>, Option<f64>)) -> bool {+fn same(a: &(Vec<solidcraft_geom::Vec2>, Option<f64>), b: &(Vec<solidcraft_geom::Vec2>, Option<f64>)) -> bool {a.0.len() == b.0.len() && a.0.iter().zip(&b.0).all(|(p, q)| p.dist(*q) < 1e-9) && a.1.zip(b.1).is_none_or(|(x, y)| (x - y).abs() < 1e-9)}@@ -413,7 +413,7 @@ fn point_constraints_keep_the_first_pick() {let (a0, l0) = (snap(&s, "p1"), snap(&s, "l1"));run(&mut s, "sketch.constraint.symmetry", json!({"a": "p1", "b": "p2", "line": "l1"}));assert!(same(&snap(&s, "p1"), &a0) && same(&snap(&s, "l1"), &l0));- assert!(pt(&s, "p2").dist(solvecraft_geom::Vec2::new(3.0, -7.0)) < 1e-6, "{:?}", pt(&s, "p2"));+ assert!(pt(&s, "p2").dist(solidcraft_geom::Vec2::new(3.0, -7.0)) < 1e-6, "{:?}", pt(&s, "p2"));}#[test]@@ -468,7 +468,7 @@ fn palette_options_are_kept_with_each_sketch() {let first = s.active_sketch.expect("sketch");run(&mut s, "sketch.finish", json!({}));run(&mut s, "sketch.create", json!({"plane": "XZ"}));- assert_eq!(sketch(&s).view, solvecraft_sketch::SketchView::default());+ assert_eq!(sketch(&s).view, solidcraft_sketch::SketchView::default());let o = run(&mut s, "sketch.options", json!({"sketch": first}));assert_eq!(o["options"]["show_dimensions"], false);// Saved with the design.@@ -489,8 +489,8 @@ fn drag(s: &mut Session, e: &str, from: [f64; 2], to: [f64; 2]) {run(s, "sketch.drag", json!({"entity": e, "from": from, "to": to}));}-fn v(x: f64, y: f64) -> solvecraft_geom::Vec2 {- solvecraft_geom::Vec2::new(x, y)+fn v(x: f64, y: f64) -> solidcraft_geom::Vec2 {+ solidcraft_geom::Vec2::new(x, y)}#[test]@@ -610,7 +610,7 @@ fn arm_drags(links: Links) -> (usize, usize) {let v3 = v2 + v(b * (th1 + bend).cos(), b * (th1 + bend).sin());let (tr, tt) = (lo + rnd() * (hi - lo), rnd() * TAU);let to = o + v(tr * tt.cos(), tr * tt.sin());- let clear = |p: solvecraft_geom::Vec2| (lo..=hi).contains(&p.dist(o));+ let clear = |p: solidcraft_geom::Vec2| (lo..=hi).contains(&p.dist(o));if !(0..=100).all(|i| clear(v3 + (to - v3) * (i as f64 / 100.0))) {continue;}@@ -697,13 +697,13 @@ fn hanging_triangle_flips(n: usize) -> usize {let v3 = v2 + v(b * (th1 + bend).cos(), b * (th1 + bend).sin());let (tr, tt) = (lo + rnd() * (hi - lo), rnd() * TAU);let to = o + v(tr * tt.cos(), tr * tt.sin());- let clear = |p: solvecraft_geom::Vec2| (lo..=hi).contains(&p.dist(o));+ let clear = |p: solidcraft_geom::Vec2| (lo..=hi).contains(&p.dist(o));if !(0..=100).all(|i| clear(v3 + (to - v3) * (i as f64 / 100.0))) {continue;}kept += 1;let turn = rnd() * TAU;- let u = solvecraft_geom::Vec2::from_angle(turn);+ let u = solidcraft_geom::Vec2::from_angle(turn);let normal = u.perp() * if rnd() < 0.5 { 1.0 } else { -1.0 };let (tq, tr) = (v3 + u * 3.9, v3 + u * 1.95 + normal * (4.0f64 - 1.95 * 1.95).sqrt());{@@ -821,7 +821,7 @@ fn the_step_cap_leaves_the_plan_and_is_restored() {/// Stored (counter-clockwise) sweep of an arc, degrees in [0, 360).fn sweep_deg(s: &Session, arc: &str) -> f64 {let sk = sketch(s);- let Some(solvecraft_sketch::CurveKind::Arc { c, a, b }) = sk.curve_index(arc).map(|i| sk.curves[i].kind.clone()) else { panic!("no arc {arc}") };+ let Some(solidcraft_sketch::CurveKind::Arc { c, a, b }) = sk.curve_index(arc).map(|i| sk.curves[i].kind.clone()) else { panic!("no arc {arc}") };let (c, a, b) = (sk.points[c].pos, sk.points[a].pos, sk.points[b].pos);((b - c).angle() - (a - c).angle()).rem_euclid(std::f64::consts::TAU).to_degrees()}@@ -893,11 +893,11 @@ fn a_dragged_fillet_stays_in_its_corner() {run(&mut s, "sketch.constraint.fix", json!({"entities": ["l1.start"]}));run(&mut s, "sketch.constraint.horizontal_vertical", json!({"line": "l1", "mode": "horizontal"}));let sk0 = sketch(&s);- let arc = sk0.curves.iter().position(|c| matches!(c.kind, solvecraft_sketch::CurveKind::Arc { .. })).expect("fillet arc");+ let arc = sk0.curves.iter().position(|c| matches!(c.kind, solidcraft_sketch::CurveKind::Arc { .. })).expect("fillet arc");let arc_id = sk0.curves[arc].id.clone();let inside = |s: &Session| {let sk = sketch(s);- let side = |p: solvecraft_geom::Vec2, a: solvecraft_geom::Vec2, b: solvecraft_geom::Vec2| (b - a).cross(p - a).signum();+ let side = |p: solidcraft_geom::Vec2, a: solidcraft_geom::Vec2, b: solidcraft_geom::Vec2| (b - a).cross(p - a).signum();let c = sk.center(arc).expect("centre");let (p0, k1, k2, p3) = (pt(s, "l1.start"), pt(s, "l1.end"), pt(s, "l2.start"), pt(s, "l2.end"));let r = sk.radius(arc).unwrap_or(0.0);@@ -1029,7 +1029,7 @@ fn the_drag_step_counts_every_held_size_but_the_dragged_length() {run(&mut s, "sketch.line", json!({"points": [[100, 100], [100, 110]], "ids": ["la"]}));run(&mut s, "sketch.line", json!({"points": [[100.05, 120], [110, 120]], "ids": ["lb"], "connect": false}));run(&mut s, "sketch.dimension", json!({"entities": ["la.start", "lb.start"], "type": "horizontal", "value": 0.05}));- assert!(sketch(&s).constraints.iter().any(|c| matches!(c.kind, solvecraft_sketch::ConstraintKind::DistanceX { .. })));+ assert!(sketch(&s).constraints.iter().any(|c| matches!(c.kind, solidcraft_sketch::ConstraintKind::DistanceX { .. })));let steps = drag_steps(&s, "la.start", [100.0, 100.0], [101.0, 100.0]);drag(&mut s, "la.start", [100.0, 100.0], [101.0, 100.0]);let (a, b) = (pt(&s, "la.start"), pt(&s, "lb.start"));@@ -1047,7 +1047,7 @@ fn a_circle_centred_on_a_dragged_end_does_not_set_the_step() {run(&mut s, "sketch.constraint.fix", json!({"entities": ["la.start"]}));run(&mut s, "sketch.dimension", json!({"entities": ["la"], "value": 20}));run(&mut s, "sketch.circle.center", json!({"center": [120, 100], "radius": 0.01}));- assert!(sketch(&s).constraints.iter().any(|c| matches!(c.kind, solvecraft_sketch::ConstraintKind::Coincident { .. })));+ assert!(sketch(&s).constraints.iter().any(|c| matches!(c.kind, solidcraft_sketch::ConstraintKind::Coincident { .. })));let steps = drag_steps(&s, "la.end", [120.0, 100.0], [120.0, 101.0]);eprintln!("1 mm drag next to a 0.01 mm circle on the end: {steps} steps");assert_eq!(steps, 1);@@ -1208,8 +1208,8 @@ fn three_d_curves_need_the_option_and_move_joined() {let sk = sketch(&s);let w = &sk.wires[sk.wire_index(&sid).expect("spline")];assert!(w.pts.len() > 10);- assert!(w.pts.first().expect("p").dist(solvecraft_geom::Vec3::new(10.0, 0.0, 10.0)) < 1e-12);- assert!(w.pts.last().expect("p").dist(solvecraft_geom::Vec3::new(20.0, 0.0, 20.0)) < 1e-12);+ assert!(w.pts.first().expect("p").dist(solidcraft_geom::Vec3::new(10.0, 0.0, 10.0)) < 1e-12);+ assert!(w.pts.last().expect("p").dist(solidcraft_geom::Vec3::new(20.0, 0.0, 20.0)) < 1e-12);// The shared corner moves for both lines (and the spline that starts there).let r = run(&mut s, "sketch.move3d", json!({"wire": ids[1], "index": 1, "by": [0, 0, 5]}));assert_eq!(r["moved"], 2);@@ -1253,7 +1253,7 @@ fn pipe_and_sweep_follow_3d_sketch_curves() {/// past that above or below them the horizontal distance, beside them the vertical one (#257).#[test]fn auto_dimension_orientation_follows_where_its_text_is_placed() {- use solvecraft_sketch::ConstraintKind;+ use solidcraft_sketch::ConstraintKind;// The ends of a 30 × 40 line: 50 long, and the slope keeps "across" and "past" distinct.let dimension = |end: [f64; 2], entities: Value, extra: Value| {let mut s = new_sketch();@@ -1331,7 +1331,7 @@ fn hung_elbow_side(s: &Session) -> f64 {}/// The hand of `hung_arm` swung by `angle` about the shoulder.-fn hung_hand_target(s: &Session, angle: f64, scale: f64) -> solvecraft_geom::Vec2 {+fn hung_hand_target(s: &Session, angle: f64, scale: f64) -> solidcraft_geom::Vec2 {let (b, h) = (pt(s, "ab.end"), pt(s, "eh.end"));let r = h - b;let (c, si) = (angle.cos(), angle.sin());diff --git a/crates/engine/src/cmd/surface.rs b/crates/engine/src/cmd/surface.rsindex 23ff4ada3f..0f430c9031 100644--- a/crates/engine/src/cmd/surface.rs+++ b/crates/engine/src/cmd/surface.rs@@ -2,7 +2,7 @@//! solids).use serde_json::Value;-use solvecraft_doc::{FaceAt, FeatureKind, PlaneRef, ProfileSel, expr::Kind};+use solidcraft_doc::{FaceAt, FeatureKind, PlaneRef, ProfileSel, expr::Kind};use super::CommandSpec;use super::features::{add_feature, check_expr, feature_sketch, operation, plane_param, profiles};@@ -34,7 +34,7 @@ pub static COMMANDS: &[CommandSpec] = &[fn patch(s: &mut Session, p: &Value) -> Result<Value> {let cmd = "surface.patch";- let edges: Vec<solvecraft_geom::Vec3> = p.get("edges").and_then(Value::as_array).map(|a| a.iter().filter_map(vec3).collect()).unwrap_or_default();+ let edges: Vec<solidcraft_geom::Vec3> = p.get("edges").and_then(Value::as_array).map(|a| a.iter().filter_map(vec3).collect()).unwrap_or_default();if !edges.is_empty() {if edges.len() > 10_000 {return Err(bad(cmd, "too many edges"));@@ -88,7 +88,7 @@ fn extend(s: &mut Session, p: &Value) -> Result<Value> {if s.model.state().body(&body).is_none() {return Err(bad(cmd, format!("no body `{body}`")));}- let edges: Vec<solvecraft_geom::Vec3> = p.get("edges").and_then(Value::as_array).map(|a| a.iter().filter_map(vec3).collect()).unwrap_or_default();+ let edges: Vec<solidcraft_geom::Vec3> = p.get("edges").and_then(Value::as_array).map(|a| a.iter().filter_map(vec3).collect()).unwrap_or_default();if edges.is_empty() || edges.len() > 10_000 {return Err(bad(cmd, "`edges` must list points on the edges to extend"));}@@ -126,7 +126,7 @@ mod tests {}fn volume(s: &Session, name: &str) -> f64 {let st = s.world_state();- solvecraft_kernel::measure(&st.body(name).unwrap().body).unwrap().volume+ solidcraft_kernel::measure(&st.body(name).unwrap().body).unwrap().volume}/// A rectangle patched, trimmed by a plane and thickened; a box's faces stitched back.diff --git a/crates/engine/src/cmd/surface_analysis.rs b/crates/engine/src/cmd/surface_analysis.rsindex d917534d05..f90d4c4400 100644--- a/crates/engine/src/cmd/surface_analysis.rs+++ b/crates/engine/src/cmd/surface_analysis.rs@@ -2,7 +2,7 @@//! View state only: no geometry changes and no undo step.use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use super::CommandSpec;use crate::params::{bad, bool_, num, vec3};@@ -109,7 +109,7 @@ mod tests {s.execute("inspect.environment_map", &json!({})).unwrap();assert_eq!(s.analysis, Some(SurfaceAnalysis::Environment));s.execute("inspect.accessibility", &json!({"direction": [0, 0, -3]})).unwrap();- assert_eq!(s.analysis, Some(SurfaceAnalysis::Access { dir: solvecraft_geom::Vec3::new(0.0, 0.0, -1.0) }));+ assert_eq!(s.analysis, Some(SurfaceAnalysis::Access { dir: solidcraft_geom::Vec3::new(0.0, 0.0, -1.0) }));s.execute("inspect.curvature_map", &json!({"clear": true})).unwrap();assert_eq!(s.analysis, None);assert_eq!(s.undo.len(), undo, "no undo steps");diff --git a/crates/engine/src/construct_tests.rs b/crates/engine/src/construct_tests.rsindex 511ae5202b..373fe2b817 100644--- a/crates/engine/src/construct_tests.rs+++ b/crates/engine/src/construct_tests.rs@@ -2,7 +2,7 @@//! 40 × 30 × 20 box at the origin, a cylinder, a sphere and a torus.use serde_json::{Value, json};-use solvecraft_geom::{Plane, Vec3};+use solidcraft_geom::{Plane, Vec3};use crate::Session;use crate::view::{construction_axes, construction_planes, construction_points};@@ -236,7 +236,7 @@ fn construction_on_a_3d_wire_ignores_its_sketch_plane_and_follows_edits() {let updated = plane(&s, "BridgePlane");assert!(near(updated.origin, Vec3::new(30.0, 27.5, 25.0)), "{updated:?}");assert!(parallel(updated.normal(), Vec3::new(40.0, 15.0, 30.0)));- let restored = solvecraft_doc::format::read(&s.doc.to_json()).unwrap();+ let restored = solidcraft_doc::format::read(&s.doc.to_json()).unwrap();let mut cold = Session { doc: restored.into(), ..Default::default() };cold.refresh();assert!(near(plane(&cold, "BridgePlane").origin, updated.origin));@@ -349,7 +349,7 @@ fn ambiguous_plane_aliases_refuse_without_document_or_history_changes() {let cut = run(&mut s, "inspect.section", json!({"plane":id}));assert_eq!(cut["section"]["origin"], json!([0.0, 0.0, 19.05]));run(&mut s, "parameters.change", json!({"name":"height","expression":"25.4 mm"}));- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());let old = run(&mut reopened, "sketch.inspect", json!({"sketch":"Sketch1"}));assert_eq!(old["plane"]["origin"], json!([0.0, 0.0, 0.0]), "saved origin reference is not reinterpreted");let linked = run(&mut reopened, "sketch.inspect", json!({"sketch":"Sketch2"}));@@ -380,7 +380,7 @@ fn disambiguated_top_plane_pocket_survives_undo_and_cold_reopen() {assert_eq!(s.doc.to_json(), before);run(&mut s, "edit.redo", json!({}));assert_eq!(s.doc.to_json(), saved);- let mut reopened = Session::new(solvecraft_doc::Document::from_json(&saved).unwrap());+ let mut reopened = Session::new(solidcraft_doc::Document::from_json(&saved).unwrap());let measured = run(&mut reopened, "inspect.measure", json!({}));assert!((measured["total"]["volume_mm3"].as_f64().unwrap() - expected).abs() < 1e-6, "{measured}");}diff --git a/crates/engine/src/crash.rs b/crates/engine/src/crash.rsindex fc2725f503..7d22af3a44 100644--- a/crates/engine/src/crash.rs+++ b/crates/engine/src/crash.rs@@ -3,8 +3,8 @@//!//! - **Panics** are caught by a hook. One inside a command becomes a report with the design as//! it was before the command and the command itself, so `solidcraft-cli run replay.json --in-//! design.solvecraft` reproduces it. Panics the third-party kernel raises (and-//! `solvecraft_kernel::guard` turns into errors) are reported the same way, marked recovered.+//! design.solidcraft` reproduces it. Panics the third-party kernel raises (and+//! `solidcraft_kernel::guard` turns into errors) are reported the same way, marked recovered.//! - **Crashes no hook sees** (an abort, a stack overflow, a segfault, the process being killed)//! are found at the next start: every running app keeps a small, locked command journal; a//! journal nobody holds any more belongs to an app that died. Its report carries the design@@ -18,7 +18,7 @@//! reports, [`MAX_TOTAL_BYTES`] on disk, nothing older than [`MAX_AGE_DAYS`] days.//!//! Reports are folders `crashes/<time>-<signature>/` holding `report.json`, and when known-//! `design.solvecraft` and `replay.json`. Nothing is ever sent anywhere.+//! `design.solidcraft` and `replay.json`. Nothing is ever sent anywhere.use std::backtrace::Backtrace;use std::cell::{Cell, RefCell};@@ -30,7 +30,7 @@ use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};use std::sync::{Mutex, OnceLock};use serde_json::{Value, json};-use solvecraft_doc::Document;+use solidcraft_doc::Document;use crate::Session;@@ -53,7 +53,7 @@ const RECENT: usize = 32;const MAX_FRAMES: usize = 60;const MAX_MESSAGE: usize = 2000;/// The report format.-pub const FORMAT: &str = "solvecraft-crash/1";+pub const FORMAT: &str = "solidcraft-crash/1";/// What the app is (shown in every report).#[derive(Clone, Debug, Default)]@@ -79,7 +79,7 @@ pub struct Summary {pub version: String,/// The report's folder.pub path: String,- /// `replay.json` and `design.solvecraft` are there: the crash can be replayed.+ /// `replay.json` and `design.solidcraft` are there: the crash can be replayed.pub replayable: bool,}@@ -114,16 +114,16 @@ pub fn enabled() -> bool {STATE.get().is_some()}-/// The crash folder, next to the recovery folder. `SOLVECRAFT_CRASH_DIR` overrides it.+/// The crash folder, next to the recovery folder. `SOLIDCRAFT_CRASH_DIR` overrides it.pub fn default_dir() -> Option<PathBuf> {if let Some(s) = STATE.get() {return Some(s.dir.clone());}// Tests never touch the user's real crash folder.if cfg!(test) {- return Some(std::env::temp_dir().join(format!("solvecraft-test-crashes-{}", std::process::id())));+ return Some(std::env::temp_dir().join(format!("solidcraft-test-crashes-{}", std::process::id())));}- if let Some(d) = std::env::var_os("SOLVECRAFT_CRASH_DIR").filter(|d| !d.is_empty()) {+ if let Some(d) = solidcraft_geom::env::var_os("CRASH_DIR").filter(|d| !d.is_empty()) {return Some(PathBuf::from(d));}crate::recovery::default_dir().and_then(|d| d.parent().map(|p| p.join("crashes")))@@ -355,7 +355,7 @@ fn hook(info: &std::panic::PanicHookInfo<'_>) -> bool {let message = limited(info.payload_as_str().unwrap_or("(not a text message)"), MAX_MESSAGE);let location = info.location().map_or_else(|| "(unknown)".to_string(), |l| format!("{}:{}", l.file(), l.line()));let sig = signature(&location, &message);- let recovered = solvecraft_kernel::guarded();+ let recovered = solidcraft_kernel::guarded();let in_command = IN_COMMAND.with(Cell::get) > 0;// Already reported (this run or before): count it, nothing else.let repeat = match state.known.lock() {@@ -467,7 +467,7 @@ pub(crate) fn command_done(let pending: Vec<Panic> = PENDING.with(|q| std::mem::take(&mut *q.borrow_mut()));for p in pending {let kind = if p.recovered { "kernel_panic_recovered" } else { "command_panic" };- let design = solvecraft_io::write_design(before);+ let design = solidcraft_io::write_design(before);let replay = json!({ "commands": [{ "command": id, "params": params }] });let recent = if journaled { state.journal_path.as_deref().map(|p| read_journal(p).recent).unwrap_or_default() } else { Vec::new() };let extra = Extra {@@ -786,8 +786,8 @@ fn write_report(state: &State, kind: &str, p: Option<&Panic>, extra: Extra) -> Olet mut notes = extra.notes;if let Some(d) = &extra.design {if d.len() <= MAX_DESIGN_BYTES {- if solvecraft_io::write_atomic(&folder.join("design.solvecraft"), d, false).is_ok() {- files.insert("design".into(), json!("design.solvecraft"));+ if solidcraft_io::write_atomic(&folder.join("design.solidcraft"), d, false).is_ok() {+ files.insert("design".into(), json!("design.solidcraft"));}} else {notes.push(format!("the design is larger than {} MB and was not copied", MAX_DESIGN_BYTES >> 20));@@ -795,7 +795,7 @@ fn write_report(state: &State, kind: &str, p: Option<&Panic>, extra: Extra) -> O}if let Some(r) = &extra.replay&& let Ok(b) = serde_json::to_vec_pretty(r)- && solvecraft_io::write_atomic(&folder.join("replay.json"), &b, false).is_ok()+ && solidcraft_io::write_atomic(&folder.join("replay.json"), &b, false).is_ok(){files.insert("replay".into(), json!("replay.json"));}@@ -828,7 +828,7 @@ fn write_report(state: &State, kind: &str, p: Option<&Panic>, extra: Extra) -> O"notes": notes,});let bytes = serde_json::to_vec_pretty(&report).ok()?;- solvecraft_io::write_atomic(&folder.join("report.json"), &bytes, false).ok()?;+ solidcraft_io::write_atomic(&folder.join("report.json"), &bytes, false).ok()?;prune(&state.dir, t);return Some(id);}@@ -846,7 +846,7 @@ fn bump(dir: &Path, id: &str, n: u64) {v["count"] = json!(count);v["last_seen"] = json!(utc(now()));if let Ok(b) = serde_json::to_vec_pretty(&v) {- let _ = solvecraft_io::write_atomic(&path, &b, false);+ let _ = solidcraft_io::write_atomic(&path, &b, false);}}@@ -951,7 +951,7 @@ pub fn read(dir: &Path, id: &str) -> std::result::Result<Value, String> {let folder = dir.join(id);let mut v = read_report_file(&folder.join("report.json")).ok_or_else(|| format!("no crash report `{id}`"))?;v["path"] = json!(folder.to_string_lossy());- for (k, f) in [("design_path", "design.solvecraft"), ("replay_path", "replay.json")] {+ for (k, f) in [("design_path", "design.solidcraft"), ("replay_path", "replay.json")] {if folder.join(f).is_file() {v[k] = json!(folder.join(f).to_string_lossy());}diff --git a/crates/engine/src/crash_tests.rs b/crates/engine/src/crash_tests.rsindex ffd23e942d..765951e15b 100644--- a/crates/engine/src/crash_tests.rs+++ b/crates/engine/src/crash_tests.rs@@ -2,7 +2,7 @@ use super::*;use crate::Session;fn fresh_dir(name: &str) -> PathBuf {- let d = std::env::temp_dir().join(format!("solvecraft-crash-test-{name}-{}", std::process::id()));+ let d = std::env::temp_dir().join(format!("solidcraft-crash-test-{name}-{}", std::process::id()));let _ = fs::remove_dir_all(&d);d}@@ -12,10 +12,10 @@ fn build() -> Build {}/// The child half of the process tests: does nothing unless a parent asks, then installs the-/// hook and crashes the way `SOLVECRAFT_CRASH_CHILD` says.+/// hook and crashes the way `SOLIDCRAFT_CRASH_CHILD` says.#[test]fn child() {- let (Some(dir), Some(mode)) = (std::env::var_os("SOLVECRAFT_CRASH_CHILD_DIR"), std::env::var("SOLVECRAFT_CRASH_CHILD").ok()) else {+ let (Some(dir), Some(mode)) = (solidcraft_geom::env::var_os("CRASH_CHILD_DIR"), solidcraft_geom::env::var("CRASH_CHILD")) else {return;};let fresh = install(PathBuf::from(dir), build());@@ -58,9 +58,9 @@ fn child() {fn run_child(dir: &Path, mode: &str) -> (String, bool) {let out = std::process::Command::new(std::env::current_exe().unwrap()).args(["--exact", "crash::tests::child", "--test-threads=1", "--nocapture"])- .env("SOLVECRAFT_CRASH_CHILD_DIR", dir)- .env("SOLVECRAFT_CRASH_CHILD", mode)- .env("SOLVECRAFT_CRASH_TEST", "1")+ .env("SOLIDCRAFT_CRASH_CHILD_DIR", dir)+ .env("SOLIDCRAFT_CRASH_CHILD", mode)+ .env("SOLIDCRAFT_CRASH_TEST", "1").env("RUST_BACKTRACE", "0").output().unwrap();@@ -96,7 +96,7 @@ fn a_command_panic_is_reported_once_with_the_design_and_the_command() {assert!(!bt.iter().any(|f| f.as_str().unwrap().contains("crash::hook")), "the hook's own frames are dropped: {bt:?}");assert_eq!(v["recent_commands"][0]["command"], "solid.box");// The design from before the command, and the command: together they reproduce the crash.- let design = solvecraft_io::read_design(&fs::read(v["design_path"].as_str().unwrap()).unwrap()).unwrap();+ let design = solidcraft_io::read_design(&fs::read(v["design_path"].as_str().unwrap()).unwrap()).unwrap();assert_eq!(design.features.len(), 1);let replay: Value = serde_json::from_slice(&fs::read(v["replay_path"].as_str().unwrap()).unwrap()).unwrap();assert_eq!(replay["commands"], json!([{"command": "diagnostics.crash_test", "params": {"mode": "panic"}}]));@@ -167,7 +167,7 @@ fn a_journal_reads_back_its_base_commands_and_the_one_in_flight() {r#"{"base":"new"}"#,r#"{"run":"solid.box","params":{"length":1}}"#,r#"{"ok":true}"#,- r#"{"base":{"autosave":"/tmp/a.solvecraft"}}"#,+ r#"{"base":{"autosave":"/tmp/a.solidcraft"}}"#,r#"{"run":"solid.fillet","params":{"radius":1}}"#,r#"{"ok":false,"error":"no edges"}"#,"not json",@@ -178,7 +178,7 @@ fn a_journal_reads_back_its_base_commands_and_the_one_in_flight() {fs::write(&p, lines.join("\n")).unwrap();let j = read_journal(&p);assert_eq!(j.header["version"], "1.0");- assert_eq!(j.base, json!({"autosave": "/tmp/a.solvecraft"}));+ assert_eq!(j.base, json!({"autosave": "/tmp/a.solidcraft"}));assert_eq!(j.replay, vec![json!({"command": "solid.shell", "params": {"thickness": 1}})], "failed commands change nothing");assert_eq!(j.recent.len(), 2);assert_eq!(j.recent[0]["error"], "no edges");@@ -274,9 +274,9 @@ fn dates_are_formatted_in_utc() {fn backtraces_lose_the_panic_machinery_and_the_home_folder() {let home = std::env::var("HOME").unwrap_or_else(|_| "/home/u".into());let bt = format!(- " 0: std::backtrace::Backtrace::force_capture\n at /rustc/abc123/library/std/src/backtrace.rs:312:13\n 1: hook\n 1: {{closure#3}}\n 1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call\n 2: std::panicking::rust_panic_with_hook\n 3: core::panicking::panic_fmt\n 4: solvecraft_kernel::fillet::blend\n at {home}/src/kernel/fillet.rs:10:5\n 5: do_call<F>\n at /rustc/abc/library/std/src/panicking.rs:1:1\n 5: std::sys::backtrace::__rust_begin_short_backtrace\n 6: main"+ " 0: std::backtrace::Backtrace::force_capture\n at /rustc/abc123/library/std/src/backtrace.rs:312:13\n 1: hook\n 1: {{closure#3}}\n 1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call\n 2: std::panicking::rust_panic_with_hook\n 3: core::panicking::panic_fmt\n 4: solidcraft_kernel::fillet::blend\n at {home}/src/kernel/fillet.rs:10:5\n 5: do_call<F>\n at /rustc/abc/library/std/src/panicking.rs:1:1\n 5: std::sys::backtrace::__rust_begin_short_backtrace\n 6: main");- assert_eq!(frames(&bt), ["solvecraft_kernel::fillet::blend (~/src/kernel/fillet.rs:10:5)"]);+ assert_eq!(frames(&bt), ["solidcraft_kernel::fillet::blend (~/src/kernel/fillet.rs:10:5)"]);}#[test]diff --git a/crates/engine/src/extent_tests.rs b/crates/engine/src/extent_tests.rsindex cb6c3fe3e0..1396c6a331 100644--- a/crates/engine/src/extent_tests.rs+++ b/crates/engine/src/extent_tests.rs@@ -87,13 +87,13 @@ fn revolve_to_a_cylinder_follows_it() {}let st = s.model.state();let (arc, post) = (st.body("Arc").unwrap(), st.body("Post").unwrap());- let overlap = solvecraft_kernel::boolean(&arc.body, &post.body, solvecraft_kernel::BoolOp::Intersect)+ let overlap = solidcraft_kernel::boolean(&arc.body, &post.body, solidcraft_kernel::BoolOp::Intersect).ok().flatten()- .map(|b| solvecraft_kernel::measure(&b).map(|m| m.volume).unwrap_or(0.0))+ .map(|b| solidcraft_kernel::measure(&b).map(|m| m.volume).unwrap_or(0.0)).unwrap_or(0.0);assert!(overlap < 1e-3, "no overlap: {overlap}");- let v = solvecraft_kernel::measure(&arc.body).unwrap().volume;+ let v = solidcraft_kernel::measure(&arc.body).unwrap().volume;let full = PI * (225.0 - 100.0) * 5.0;// The post is at a quarter turn one way (three quarters the other): the ring stops// short of the post's centre line, within its half-width of it.diff --git a/crates/engine/src/frames.rs b/crates/engine/src/frames.rsindex 1698f65f0e..eca978763e 100644--- a/crates/engine/src/frames.rs+++ b/crates/engine/src/frames.rs@@ -10,8 +10,8 @@//! without moved components).use serde_json::{Map, Value};-use solvecraft_doc::{Mat, apply_point, apply_vector, is_identity, map_point_expr, mat_inverse};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Mat, apply_point, apply_vector, is_identity, map_point_expr, mat_inverse};+use solidcraft_geom::Vec3;use crate::Session;@@ -337,14 +337,14 @@ pub fn to_local(s: &Session, id: &str, params: &Value) -> Option<Value> {// component is active. Body-relative picks still use the picked body's frame.let mut context = s.scratch();context.active_component = feature.component;- if let solvecraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &feature.kind {+ if let solidcraft_doc::FeatureKind::Emboss { face: Some(face), .. } = &feature.kind {context.active_occurrence_path = (!face.author_path.is_empty()).then(|| face.author_path.clone());}let mut inner = to_local(&context, cmd, params.get("params")?)?;// An untouched explicit axis is displayed in world coordinates by Edit// Feature. Keep its exact saved values instead of an affine round trip.if cmd == "solid.revolve"- && let solvecraft_doc::FeatureKind::Revolve { axis: solvecraft_doc::AxisRef::Line { origin, dir }, .. } = &feature.kind+ && let solidcraft_doc::FeatureKind::Revolve { axis: solidcraft_doc::AxisRef::Line { origin, dir }, .. } = &feature.kind{let frame = context.active_component_frame();let displayed = serde_json::json!({"origin":pt(apply_point(&frame,*origin)),"dir":pt(apply_vector(&frame,*dir))});@@ -353,8 +353,8 @@ pub fn to_local(s: &Session, id: &str, params: &Value) -> Option<Value> {}}let points = match (&feature.kind, cmd) {- (solvecraft_doc::FeatureKind::Revolve { to, .. }, "solid.revolve") => [("to", *to), ("from", None)],- (solvecraft_doc::FeatureKind::Extrude { extent, .. }, "solid.extrude") => [("to", extent.to), ("from", extent.from)],+ (solidcraft_doc::FeatureKind::Revolve { to, .. }, "solid.revolve") => [("to", *to), ("from", None)],+ (solidcraft_doc::FeatureKind::Extrude { extent, .. }, "solid.extrude") => [("to", extent.to), ("from", extent.from)],_ => [("to", None), ("from", None)],};for (key, point) in points {@@ -383,7 +383,7 @@ pub fn to_local(s: &Session, id: &str, params: &Value) -> Option<Value> {let key = params.get("sketch").and_then(|value| value.as_str().map(str::to_string).or_else(|| value.as_u64().map(|id| id.to_string())))?;let feature = s.doc.find_feature(&key)?;let path = crate::cmd::author_path_for_rebind(s, feature, params, id).ok()?;- let frame = solvecraft_doc::EmbossFace::component_frame(&s.placed_document(), feature.component, &path).ok()?;+ let frame = solidcraft_doc::EmbossFace::component_frame(&s.placed_document(), feature.component, &path).ok()?;command_frames.active = frame;command_frames.sketch = frame;}diff --git a/crates/engine/src/frames_tests.rs b/crates/engine/src/frames_tests.rsindex f1eec1208f..16a2d8f360 100644--- a/crates/engine/src/frames_tests.rs+++ b/crates/engine/src/frames_tests.rs@@ -2,7 +2,7 @@//! world land in the component's own frame (user bug #4).use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Session;@@ -190,7 +190,7 @@ fn canvases_move_with_their_component() {let root = s.doc.canvases.iter().find(|c| c.name == "Root").unwrap();assert!(near(s.doc.canvas_plane(&vals, root).unwrap().origin, Vec3::ZERO));// The component survives a save and reopen.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.canvases, s.doc.canvases);}diff --git a/crates/engine/src/fuzz.rs b/crates/engine/src/fuzz.rsindex 73f5a279f6..ede0d55c03 100644--- a/crates/engine/src/fuzz.rs+++ b/crates/engine/src/fuzz.rs@@ -1,4 +1,4 @@-//! Random modelling sessions for robustness testing (`solvecraft-cli fuzz`, docs/robustness.md).+//! Random modelling sessions for robustness testing (`solidcraft-cli fuzz`, docs/robustness.md).//!//! A seeded generator builds realistic feature sequences: a base (box, extruded sketch profile//! with an arc, revolved section), then joins and cuts of boxes, cylinders and spheres placed on@@ -8,9 +8,9 @@use serde::Serialize;use serde_json::{Value, json};-use solvecraft_geom::Vec3;-use solvecraft_kernel::fuzz::Rng;-pub use solvecraft_kernel::fuzz::{BoolCase, boolean_case, boolean_shapes};+use solidcraft_geom::Vec3;+use solidcraft_kernel::fuzz::Rng;+pub use solidcraft_kernel::fuzz::{BoolCase, boolean_case, boolean_shapes};use crate::{EngineError, Session};@@ -64,19 +64,19 @@ pub struct Run {pub unsupported: Vec<(String, String)>,/// Steps whose generated parameters a command refused.pub rejected: usize,- pub boolean_fallbacks: std::collections::BTreeMap<solvecraft_kernel::BooleanStrategy, usize>,+ pub boolean_fallbacks: std::collections::BTreeMap<solidcraft_kernel::BooleanStrategy, usize>,pub boolean_reports_truncated: bool,}impl Run {- /// The commands as a script for `solvecraft-cli run`.+ /// The commands as a script for `solidcraft-cli run`.pub fn script(&self) -> Value {Value::Array(self.steps.iter().flat_map(|s| s.commands.iter().map(|(c, p)| json!({"command": c, "params": p}))).collect())}}fn total_volume(s: &Session) -> f64 {- s.model.state().bodies.iter().filter_map(|b| solvecraft_kernel::measure(&b.body).ok()).map(|m| m.volume).sum()+ s.model.state().bodies.iter().filter_map(|b| solidcraft_kernel::measure(&b.body).ok()).map(|m| m.volume).sum()}fn classify(e: &EngineError) -> Outcome {diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rsindex 26310b90c5..1a38ba676d 100644--- a/crates/engine/src/lib.rs+++ b/crates/engine/src/lib.rs@@ -1,4 +1,4 @@-//! The SolveCraft engine.+//! The SolidCraft engine.//!//! Every user-visible action is a command with a stable, dotted, lower-case id//! (`solid.extrude`, `sketch.create`, `solid.fillet`, `timeline.rollback`). Commands take JSON@@ -22,16 +22,16 @@ use std::sync::Arc;use serde::{Deserialize, Serialize};use serde_json::Value;-use solvecraft_doc::{Document, Model, ModelState};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Document, Model, ModelState};+use solidcraft_geom::Vec3;pub use cmd::{CommandInfo, CommandSpec, auto_operation, command_specs, find_command};-pub use solvecraft_doc as doc;-pub use solvecraft_geom as geom;-pub use solvecraft_io as io;-pub use solvecraft_kernel as kernel;-pub use solvecraft_render as render;-pub use solvecraft_sketch as sketch;+pub use solidcraft_doc as doc;+pub use solidcraft_geom as geom;+pub use solidcraft_io as io;+pub use solidcraft_kernel as kernel;+pub use solidcraft_render as render;+pub use solidcraft_sketch as sketch;/// Longest accepted request line on the JSON-lines channels (MCP over stdio and the control/// server over loopback), so both refuse runaway input at the same size.@@ -52,23 +52,23 @@ pub enum EngineError {Internal(String, String),}-impl From<solvecraft_doc::DocError> for EngineError {- fn from(e: solvecraft_doc::DocError) -> Self {+impl From<solidcraft_doc::DocError> for EngineError {+ fn from(e: solidcraft_doc::DocError) -> Self {EngineError::Other(e.to_string())}}-impl From<solvecraft_sketch::SketchError> for EngineError {- fn from(e: solvecraft_sketch::SketchError) -> Self {+impl From<solidcraft_sketch::SketchError> for EngineError {+ fn from(e: solidcraft_sketch::SketchError) -> Self {EngineError::Other(e.to_string())}}-impl From<solvecraft_kernel::KernelError> for EngineError {- fn from(e: solvecraft_kernel::KernelError) -> Self {+impl From<solidcraft_kernel::KernelError> for EngineError {+ fn from(e: solidcraft_kernel::KernelError) -> Self {EngineError::Other(e.to_string())}}-impl From<solvecraft_io::IoError> for EngineError {- fn from(e: solvecraft_io::IoError) -> Self {+impl From<solidcraft_io::IoError> for EngineError {+ fn from(e: solidcraft_io::IoError) -> Self {EngineError::Other(e.to_string())}}@@ -146,7 +146,7 @@ pub struct Snapshot {pub label: String,pub doc: Arc<Document>,pub active_sketch: Option<u64>,- pub pending_moves: std::collections::BTreeMap<u64, solvecraft_doc::Mat>,+ pub pending_moves: std::collections::BTreeMap<u64, solidcraft_doc::Mat>,}/// What some commands would make, evaluated on a scratch copy of a session@@ -164,15 +164,15 @@ pub struct Preview {#[derive(Clone)]struct WorldCache {doc: Arc<Document>,- model: Arc<solvecraft_doc::ModelState>,- pending_moves: std::collections::BTreeMap<u64, solvecraft_doc::Mat>,+ model: Arc<solidcraft_doc::ModelState>,+ pending_moves: std::collections::BTreeMap<u64, solidcraft_doc::Mat>,active_component: u64,active_occurrence_path: Option<Vec<u64>>,- world: Arc<solvecraft_doc::ModelState>,+ world: Arc<solidcraft_doc::ModelState>,}impl WorldCache {- fn matches(&self, session: &Session, model: &Arc<solvecraft_doc::ModelState>) -> bool {+ fn matches(&self, session: &Session, model: &Arc<solidcraft_doc::ModelState>) -> bool {Arc::ptr_eq(&self.doc, &session.doc)&& Arc::ptr_eq(&self.model, model)&& self.pending_moves == session.pending_moves@@ -203,11 +203,11 @@ pub struct Session {/// The placement used when authoring shared component geometry.pub active_occurrence_path: Option<Vec<u64>>,/// Occurrence moves not captured yet (Capture Position keeps them, a recompute drops them).- pub pending_moves: std::collections::BTreeMap<u64, solvecraft_doc::Mat>,+ pub pending_moves: std::collections::BTreeMap<u64, solidcraft_doc::Mat>,world_cache: std::sync::Mutex<Option<WorldCache>>,occurrence_visibility_cache: std::sync::Mutex<Option<occurrences::VisibilityCache>>,/// Features copied with `timeline.copy` (pasted by `timeline.paste`).- pub clipboard: Vec<solvecraft_doc::Feature>,+ pub clipboard: Vec<solidcraft_doc::Feature>,/// Section Analysis: a view cut by a plane (origin, unit normal; the normal side is hidden).pub section: Option<(Vec3, Vec3)>,/// Surface analysis shading the model (zebra, draft, curvature map).@@ -233,7 +233,7 @@ pub struct LiveEdit {/// What the frame's solve found: a full solve's report, or, when the sketch was solved/// without a rank analysis, its last report's degrees of freedom and determined flags (a/// drag does not change them; the evaluation at the gesture's end brings them up to date).- pub report: solvecraft_sketch::SolveReport,+ pub report: solidcraft_sketch::SolveReport,}/// The design, active sketch, pending positions and undo history at an `edit.checkpoint`.@@ -242,7 +242,7 @@ pub(crate) struct Checkpoint {pub id: u64,pub doc: Arc<Document>,pub active_sketch: Option<u64>,- pub pending_moves: std::collections::BTreeMap<u64, solvecraft_doc::Mat>,+ pub pending_moves: std::collections::BTreeMap<u64, solidcraft_doc::Mat>,pub undo: Vec<Snapshot>,pub redo: Vec<Snapshot>,}@@ -352,7 +352,7 @@ impl Session {/// Re-evaluate the model after a document change./// The model placed in the world through component occurrences (and uncaptured moves): what/// to display, measure, pick and export. The same as `model.state()` without components.- pub fn world_state(&self) -> Arc<solvecraft_doc::ModelState> {+ pub fn world_state(&self) -> Arc<solidcraft_doc::ModelState> {let st = self.model.state();if self.doc.occurrences.is_empty() {return st;@@ -364,7 +364,7 @@ impl Session {return cached.world.clone();}let mut w = if self.pending_moves.is_empty() {- solvecraft_doc::world_state(&self.doc, &st)+ solidcraft_doc::world_state(&self.doc, &st)} else {let mut d = (*self.doc).clone();for o in &mut d.occurrences {@@ -372,27 +372,27 @@ impl Session {o.transform = *m;}}- solvecraft_doc::world_state(&d, &st)+ solidcraft_doc::world_state(&d, &st)};// Sketch definitions are displayed once, at the placement currently being authored.if self.active_occurrence_path.is_some() && self.active_component != 0 {- let first = self.occurrence_placement(&self.doc.first_path(self.active_component)).map(|p| p.world).unwrap_or(solvecraft_doc::IDENTITY);- if let Some(inverse) = solvecraft_doc::mat_inverse(&first) {- let delta = solvecraft_doc::mat_mul(&self.active_component_frame(), &inverse);+ let first = self.occurrence_placement(&self.doc.first_path(self.active_component)).map(|p| p.world).unwrap_or(solidcraft_doc::IDENTITY);+ if let Some(inverse) = solidcraft_doc::mat_inverse(&first) {+ let delta = solidcraft_doc::mat_mul(&self.active_component_frame(), &inverse);for sketch in w.sketches.iter_mut().filter(|sk| self.doc.feature(sk.feature).is_some_and(|f| f.component == self.active_component)) {let sketch = Arc::make_mut(sketch);let plane = sketch.plane;- if let Some(mapped) = solvecraft_geom::Plane::new(- solvecraft_doc::apply_point(&delta, plane.origin),- solvecraft_doc::apply_vector(&delta, plane.x),- solvecraft_doc::apply_vector(&delta, plane.y),+ if let Some(mapped) = solidcraft_geom::Plane::new(+ solidcraft_doc::apply_point(&delta, plane.origin),+ solidcraft_doc::apply_vector(&delta, plane.x),+ solidcraft_doc::apply_vector(&delta, plane.y),) {sketch.plane = mapped;}for wire in &mut sketch.sketch.wires {- if wire.space == solvecraft_doc::sketch::WireSpace::Component {+ if wire.space == solidcraft_doc::sketch::WireSpace::Component {for point in wire.pts.iter_mut().chain(&mut wire.fit) {- *point = solvecraft_doc::apply_point(&delta, *point);+ *point = solidcraft_doc::apply_point(&delta, *point);}}}@@ -798,6 +798,6 @@ pub(crate) type SketchValues = std::collections::BTreeMap<u64, std::collections:/// The values of a sketch's driving dimensions that come from parameters: what a value edit/// changes in it (as opposed to geometry it projects or links from upstream).-fn own_values(sk: &solvecraft_sketch::Sketch) -> std::collections::BTreeMap<String, f64> {+fn own_values(sk: &solidcraft_sketch::Sketch) -> std::collections::BTreeMap<String, f64> {sk.constraints.iter().filter(|c| c.param.is_some() && !c.driven).filter_map(|c| Some((c.id.clone(), c.kind.value()?))).collect()}diff --git a/crates/engine/src/licences.rs b/crates/engine/src/licences.rsindex b01c731349..5ff64b967a 100644--- a/crates/engine/src/licences.rs+++ b/crates/engine/src/licences.rs@@ -1,5 +1,5 @@-//! SolveCraft's licence texts and the third-party licences, built into every program so a single-//! downloaded executable carries them (Help ▸ About ▸ Licences, `solvecraft-cli licences`).+//! SolidCraft's licence texts and the third-party licences, built into every program so a single+//! downloaded executable carries them (Help ▸ About ▸ Licences, `solidcraft-cli licences`).//! THIRD-PARTY-LICENSES.txt is written by `cargo xtask licences` and checked by `cargo xtask ci`.pub const LICENSE_MIT: &str = include_str!("../../../LICENSE-MIT");diff --git a/crates/engine/src/naming_history_tests.rs b/crates/engine/src/naming_history_tests.rsindex bdd808a7ab..2932a6c7f6 100644--- a/crates/engine/src/naming_history_tests.rs+++ b/crates/engine/src/naming_history_tests.rs@@ -4,7 +4,7 @@//! names again by sampling geometry could do.use serde_json::{Value, json};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Session;@@ -40,8 +40,8 @@ fn body_at(s: &Session, p: [f64; 3]) -> Option<String> {fn names(s: &Session, body: &str) -> Vec<(String, bool)> {let state = s.model.state();let b = state.body(body).unwrap_or_else(|| panic!("body {body}"));- let names = solvecraft_doc::naming::face_names(b);- names.iter().enumerate().map(|(i, n)| (n.clone(), solvecraft_doc::naming::face_name_exact(b, i))).collect()+ let names = solidcraft_doc::naming::face_names(b);+ names.iter().enumerate().map(|(i, n)| (n.clone(), solidcraft_doc::naming::face_name_exact(b, i))).collect()}/// A 40 x 30 x 10 block ("Block": sketch lines l1 bottom, l2 right, l3 top, l4 left).@@ -230,7 +230,7 @@ fn a_name_of_a_body_without_history_is_found_by_geometry_and_says_so_once_it_movrun(&mut s, "solid.replace_face", json!({"faces": [[20, 15, 10]], "target": {"origin": [0, 0, 12], "normal": [0, 0, 1]}, "name": "Lift"}));let state = s.model.state();let body = state.bodies.first().unwrap();- assert!((0..solvecraft_doc::naming::face_names(body).len()).all(|i| !solvecraft_doc::naming::face_name_exact(body, i)));+ assert!((0..solidcraft_doc::naming::face_names(body).len()).all(|i| !solidcraft_doc::naming::face_name_exact(body, i)));run(&mut s, "solid.fillet", json!({"edges": [[40, 15, 12]], "radius": 2, "name": "Round"}));// Where it was picked, the pick and the name agree: nothing to say.assert_eq!(warning(&s, "Round"), None);@@ -263,7 +263,7 @@ fn a_sketch_on_a_certified_face_survives_a_fillet_and_a_cut_upstream_of_it() {assert!((top(&s) - 14.0).abs() < 1e-6);let state = s.model.state();let body = state.bodies.first().unwrap();- assert!((0..solvecraft_doc::naming::face_names(body).len()).all(|i| solvecraft_doc::naming::face_name_exact(body, i)));+ assert!((0..solidcraft_doc::naming::face_names(body).len()).all(|i| solidcraft_doc::naming::face_name_exact(body, i)));change(&mut s, "h", "16 mm");for f in ["Corner", "Hole", "Top", "Peg"] {assert_eq!(error(&s, f), None, "{f}");diff --git a/crates/engine/src/occurrences.rs b/crates/engine/src/occurrences.rsindex 70a59c3d52..8ed49188ea 100644--- a/crates/engine/src/occurrences.rs+++ b/crates/engine/src/occurrences.rs@@ -1,6 +1,6 @@//! Exact placement identity and session view/authoring state.use crate::{EngineError, Result, Sel, Session};-use solvecraft_doc::{IDENTITY, Mat, mat_mul};+use solidcraft_doc::{IDENTITY, Mat, mat_mul};#[derive(Clone, Debug)]pub struct OccurrenceBody {@@ -33,7 +33,7 @@ pub(crate) struct VisibilityCache {impl Session {/// Document with uncaptured occurrence positions applied, without changing saved geometry.- pub fn placed_document(&self) -> std::borrow::Cow<'_, solvecraft_doc::Document> {+ pub fn placed_document(&self) -> std::borrow::Cow<'_, solidcraft_doc::Document> {if self.pending_moves.is_empty() {return std::borrow::Cow::Borrowed(&self.doc);}diff --git a/crates/engine/src/params.rs b/crates/engine/src/params.rsindex aa271a3d49..4a7ff06986 100644--- a/crates/engine/src/params.rs+++ b/crates/engine/src/params.rs@@ -1,7 +1,7 @@//! Helpers to read hostile JSON parameters.use serde_json::Value;-use solvecraft_geom::{Vec2, Vec3};+use solidcraft_geom::{Vec2, Vec3};use crate::{EngineError, Result};diff --git a/crates/engine/src/pattern_suppress_tests.rs b/crates/engine/src/pattern_suppress_tests.rsindex 5af88297b5..0627f772d8 100644--- a/crates/engine/src/pattern_suppress_tests.rs+++ b/crates/engine/src/pattern_suppress_tests.rs@@ -13,7 +13,7 @@ fn run(s: &mut Session, id: &str, p: Value) -> Value {}fn volume(s: &Session, body: &str) -> f64 {- s.model.state().body(body).map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).unwrap_or(0.0)+ s.model.state().body(body).map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).unwrap_or(0.0)}#[test]@@ -45,22 +45,22 @@ fn enclosure_datums_follow_wall_height_and_board_depth_with_material_proofs() {assert!(s.model.results.iter().all(|result| result.error.is_none()));for (name, z) in [("PCB standoff", 2.5), ("Lid boss", 2.5), ("Lid lip", 30.), ("Lid screw", 34.)] {let feature =- s.doc.features.iter().find(|feature| feature.name == name && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. })).unwrap();+ s.doc.features.iter().find(|feature| feature.name == name && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap();assert!((s.model.state().sketch(feature.id).unwrap().plane.origin.z - z).abs() < 1e-6);}let usb =- s.doc.features.iter().find(|feature| feature.name == "USB" && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. })).unwrap();+ s.doc.features.iter().find(|feature| feature.name == "USB" && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap();assert!((s.model.state().sketch(usb.id).unwrap().plane.origin.y + 35.5).abs() < 1e-6);let assert_material = |session: &Session| {let state = session.world_state();let case = state.body("Case").unwrap().mesh();let lid = state.body("Lid").unwrap().mesh();- assert!(case.contains(solvecraft_geom::Vec3::new(-24.5, -21.5, 7.)));- assert!(!case.contains(solvecraft_geom::Vec3::new(-26.5, -21.5, 7.)));- assert!(!case.contains(solvecraft_geom::Vec3::new(-10., -35.25, 11.35)));- assert!(case.contains(solvecraft_geom::Vec3::new(-10., -35.25, 15.)));+ assert!(case.contains(solidcraft_geom::Vec3::new(-24.5, -21.5, 7.)));+ assert!(!case.contains(solidcraft_geom::Vec3::new(-26.5, -21.5, 7.)));+ assert!(!case.contains(solidcraft_geom::Vec3::new(-10., -35.25, 11.35)));+ assert!(case.contains(solidcraft_geom::Vec3::new(-10., -35.25, 15.)));assert!(- lid.contains(solvecraft_geom::Vec3::new(0., 32.2, 29.)),+ lid.contains(solidcraft_geom::Vec3::new(0., 32.2, 29.)),"lid bounds {:?}; lip {:?}; probes {:?}",lid.bounds(),session@@ -71,30 +71,30 @@ fn enclosure_datums_follow_wall_height_and_board_depth_with_material_proofs() {.doc.features.iter()- .find(|feature| feature.name == "Lid lip" && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. }))+ .find(|feature| feature.name == "Lid lip" && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap().id).unwrap().sketch.links,- (20..35).map(|y| (y, lid.contains(solvecraft_geom::Vec3::new(0., f64::from(y) + 0.2, 29.)))).collect::<Vec<_>>()+ (20..35).map(|y| (y, lid.contains(solidcraft_geom::Vec3::new(0., f64::from(y) + 0.2, 29.)))).collect::<Vec<_>>());- assert!(!lid.contains(solvecraft_geom::Vec3::new(0., 32.9, 29.)));- assert!(!lid.contains(solvecraft_geom::Vec3::new(-33.5, -28.5, 32.)));- assert!(lid.contains(solvecraft_geom::Vec3::new(-31.5, -28.5, 32.)));+ assert!(!lid.contains(solidcraft_geom::Vec3::new(0., 32.9, 29.)));+ assert!(!lid.contains(solidcraft_geom::Vec3::new(-33.5, -28.5, 32.)));+ assert!(lid.contains(solidcraft_geom::Vec3::new(-31.5, -28.5, 32.)));};assert_material(&s);- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.results.iter().all(|result| result.error.is_none()));assert_material(&reopened);}#[test]fn enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen() {- use solvecraft_doc::FeatureKind;- use solvecraft_geom::{Vec2, Vec3};- use solvecraft_sketch::CurveKind;+ use solidcraft_doc::FeatureKind;+ use solidcraft_geom::{Vec2, Vec3};+ use solidcraft_sketch::CurveKind;let mut s = Session::default();let script: Value = serde_json::from_str(include_str!("../../../examples/acceptance/sensor_enclosure.json")).unwrap();@@ -139,10 +139,10 @@ fn enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen}}assert_eq!(corners.len(), 4);- let regions = solvecraft_doc::select_profiles(solved, profiles).unwrap();+ let regions = solidcraft_doc::select_profiles(solved, profiles).unwrap();assert_eq!(regions.len(), 1);assert!((regions[0].area() - 332.570619298295).abs() < 1e-7, "area {}", regions[0].area());- let ring = solvecraft_kernel::extrude(&solved.plane, ®ions, 0., 2.).unwrap();+ let ring = solidcraft_kernel::extrude(&solved.plane, ®ions, 0., 2.).unwrap();assert_eq!(ring.len(), 1);let precise_ring = ring[0].tessellate(1e-6).unwrap();let bounds = precise_ring.bounds();@@ -160,14 +160,14 @@ fn enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen.segs.iter().map(|segment| match segment {- solvecraft_geom::Seg2::Arc { radius, sweep, .. } => radius.abs() * sweep.abs(),- solvecraft_geom::Seg2::Line { .. } => 0.,+ solidcraft_geom::Seg2::Arc { radius, sweep, .. } => radius.abs() * sweep.abs(),+ solidcraft_geom::Seg2::Line { .. } => 0.,other => panic!("unexpected ring boundary {other:?}"),}).sum::<f64>();assert!((arc_perimeter - std::f64::consts::TAU * 0.8).abs() < 1e-8);assert_eq!(regions[0].holes.len(), 1);- assert!(regions[0].holes[0].segs.iter().all(|segment| matches!(segment, solvecraft_geom::Seg2::Line { .. })));+ assert!(regions[0].holes[0].segs.iter().all(|segment| matches!(segment, solidcraft_geom::Seg2::Line { .. })));// Body::tessellate floors the requested sag tolerance at size * 1e-6.// Only the outer arcs incur chord error: their tolerance-wide boundary// strip bounds the volume error without changing CAD or export tolerances.@@ -199,7 +199,7 @@ fn enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen};check(&s);let saved = s.doc.to_json();- let reopened = Session::new(solvecraft_doc::Document::from_json(&saved).unwrap());+ let reopened = Session::new(solidcraft_doc::Document::from_json(&saved).unwrap());check(&reopened);assert_eq!(reopened.doc.to_json(), saved);}diff --git a/crates/engine/src/profile_curves_tests.rs b/crates/engine/src/profile_curves_tests.rsindex dc1d6c65e6..f0168807d7 100644--- a/crates/engine/src/profile_curves_tests.rs+++ b/crates/engine/src/profile_curves_tests.rs@@ -4,7 +4,7 @@use serde_json::{Value, json};use crate::Session;-use solvecraft_doc::{FeatureKind, ProfileSel};+use solidcraft_doc::{FeatureKind, ProfileSel};fn run(s: &mut Session, id: &str, p: Value) -> Value {match s.execute(id, &p) {@@ -68,7 +68,7 @@ fn a_profile_picked_by_curves_follows_a_parameter_change() {if let Some(f) = s.doc_mut().feature_mut(id)&& let FeatureKind::Extrude { profiles, .. } = &mut f.kind{- *profiles = ProfileSel::Points { points: vec![solvecraft_geom::Vec2::new(25.0, 10.0)] };+ *profiles = ProfileSel::Points { points: vec![solidcraft_geom::Vec2::new(25.0, 10.0)] };}s.refresh();assert!((volumes(&s)[0] - 6000.0).abs() < 1.0);@@ -99,7 +99,7 @@ fn explicit_curve_pick_normalizes_repeats_before_save_and_parameter_edit() {run(&mut s, "solid.extrude", json!({"sketch":"Tray","profiles":[{"curves":["top","bottom","div","left","bottom","top"]}],"distance":10}));let ProfileSel::Curves { loops } = extrude_kind(&s) else { panic!("{:?}", extrude_kind(&s)) };assert_eq!(loops, vec![vec!["top", "bottom", "div", "left"]]);- let mut reopened = Session::new(solvecraft_doc::format::read(&s.doc.to_json()).unwrap());+ let mut reopened = Session::new(solidcraft_doc::format::read(&s.doc.to_json()).unwrap());run(&mut reopened, "parameters.change", json!({"name":"split","expression":"20 mm"}));assert_eq!(last_error(&reopened), None);assert!((volumes(&reopened)[0] - 4000.0).abs() < 1.0);@@ -116,7 +116,7 @@ fn repeated_explicit_curve_ids_do_not_count_split_graph_spans() {run(&mut s, "solid.extrude", json!({"sketch":"S","profiles":[{"curves":["d","a","a","a","c","b"]}],"distance":2}));let ProfileSel::Curves { loops } = extrude_kind(&s) else { panic!("{:?}", extrude_kind(&s)) };assert_eq!(loops, vec![vec!["d", "a", "c", "b"]]);- let reopened = Session::new(solvecraft_doc::format::read(&s.doc.to_json()).unwrap());+ let reopened = Session::new(solidcraft_doc::format::read(&s.doc.to_json()).unwrap());assert_eq!(last_error(&reopened), None);assert!((volumes(&reopened)[0] - 200.0).abs() < 1e-3);}@@ -187,7 +187,7 @@ fn curve_picks_save_load_and_edit() {json!({"sketch": "Tray", "profiles": [{"curves": ["left", "bottom", "div", "top"]}], "distance": 10, "name": "Bay"}),);let text = serde_json::to_string(&*s.doc).unwrap();- let doc = solvecraft_doc::format::read(&text).unwrap();+ let doc = solidcraft_doc::format::read(&text).unwrap();let mut t = Session::new(doc);assert_eq!(extrude_kind(&t), extrude_kind(&s));run(&mut t, "parameters.change", json!({"name": "split", "expression": "20 mm"}));@@ -201,6 +201,6 @@ fn curve_picks_save_load_and_edit() {// An old design's point pick still loads and evaluates.let old = text.replace(r#"{"type":"curves","loops":[["left","bottom","div","top"]]}"#, r#"{"type":"points","points":[[25.0,10.0]]}"#);assert_ne!(old, text);- let t = Session::new(solvecraft_doc::format::read(&old).unwrap());+ let t = Session::new(solidcraft_doc::format::read(&old).unwrap());assert!((volumes(&t)[0] - 6000.0).abs() < 1.0, "{:?}", volumes(&t));}diff --git a/crates/engine/src/profile_refs_tests.rs b/crates/engine/src/profile_refs_tests.rsindex 4354cbbf55..dd38479e66 100644--- a/crates/engine/src/profile_refs_tests.rs+++ b/crates/engine/src/profile_refs_tests.rs@@ -48,8 +48,8 @@ fn bodies(s: &Session) -> Vec<(String, f64)> {fn a_port_picked_by_index_stays_a_cut_after_a_width_change() {let mut s = enclosure();let f = s.doc.features.last().unwrap();- let solvecraft_doc::FeatureKind::Extrude { profiles, .. } = &f.kind else { panic!("{:?}", f.kind) };- assert!(matches!(profiles, solvecraft_doc::ProfileSel::Curves { .. }), "stored by curves: {profiles:?}");+ let solidcraft_doc::FeatureKind::Extrude { profiles, .. } = &f.kind else { panic!("{:?}", f.kind) };+ assert!(matches!(profiles, solidcraft_doc::ProfileSel::Curves { .. }), "stored by curves: {profiles:?}");let before = bodies(&s);assert_eq!(before.len(), 1, "{before:?}");run(&mut s, "parameters.change", json!({"name": "width", "expression": "100 mm"}));@@ -63,14 +63,14 @@ fn a_port_picked_by_index_stays_a_cut_after_a_width_change() {assert!((s.model.state().sketch(port).unwrap().plane.origin.x - 50.).abs() < 1e-6);let world = s.world_state();let mesh = world.body("Enclosure").unwrap().mesh();- assert!(!mesh.contains(solvecraft_geom::Vec3::new(49., 0., 12.)));- assert!(mesh.contains(solvecraft_geom::Vec3::new(49., 0., 20.)));- let reopened = Session::new(solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap());+ assert!(!mesh.contains(solidcraft_geom::Vec3::new(49., 0., 12.)));+ assert!(mesh.contains(solidcraft_geom::Vec3::new(49., 0., 20.)));+ let reopened = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap());assert!(reopened.model.result(id).unwrap().error.is_none());let world = reopened.world_state();let mesh = world.body("Enclosure").unwrap().mesh();- assert!(!mesh.contains(solvecraft_geom::Vec3::new(49., 0., 12.)));- assert!(mesh.contains(solvecraft_geom::Vec3::new(49., 0., 20.)));+ assert!(!mesh.contains(solidcraft_geom::Vec3::new(49., 0., 12.)));+ assert!(mesh.contains(solidcraft_geom::Vec3::new(49., 0., 20.)));}/// A pick the sketch no longer has is an error on the feature, never a different profile.@@ -88,7 +88,7 @@ fn a_lost_profile_is_an_error_not_another_pick() {// Delete the picked circle: the extrude fails with a message instead of taking the square.let sk = s.doc.find_feature("S").unwrap().id;let picked = match &s.doc.features.last().unwrap().kind {- solvecraft_doc::FeatureKind::Extrude { profiles: solvecraft_doc::ProfileSel::Curves { loops }, .. } => loops[0].clone(),+ solidcraft_doc::FeatureKind::Extrude { profiles: solidcraft_doc::ProfileSel::Curves { loops }, .. } => loops[0].clone(),k => panic!("{k:?}"),};run(&mut s, "sketch.edit", json!({"sketch": sk}));diff --git a/crates/engine/src/recovery.rs b/crates/engine/src/recovery.rsindex 22988f5432..fcff6c45d6 100644--- a/crates/engine/src/recovery.rs+++ b/crates/engine/src/recovery.rs@@ -1,6 +1,6 @@//! Autosave and crash recovery.//!-//! A running app keeps one recovery entry in the recovery folder: `<id>.solvecraft` (the design+//! A running app keeps one recovery entry in the recovery folder: `<id>.solidcraft` (the design//! as of the last autosave), `<id>.json` (its file path, name and time) and `<id>.lock`, which//! the app holds locked while it runs. Autosaves are written atomically, only when the design//! has unsaved changes it hasn't written yet; a design with nothing unsaved has no entry. An@@ -13,28 +13,41 @@ use std::sync::Arc;use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};use serde::{Deserialize, Serialize};-use solvecraft_doc::Document;+use solidcraft_doc::Document;use crate::{EngineError, Result, Session};-/// The recovery folder: `SOLVECRAFT_RECOVERY_DIR`, else the platform's per-user data folder.+/// The recovery folder: `SOLIDCRAFT_RECOVERY_DIR`, else the platform's per-user data folder.pub fn default_dir() -> Option<PathBuf> {// Tests never touch the user's real recovery folder.if cfg!(test) {- return Some(std::env::temp_dir().join(format!("solvecraft-test-recovery-{}", std::process::id())));+ return Some(std::env::temp_dir().join(format!("solidcraft-test-recovery-{}", std::process::id())));}- if let Some(d) = std::env::var_os("SOLVECRAFT_RECOVERY_DIR").filter(|d| !d.is_empty()) {+ if let Some(d) = solidcraft_geom::env::var_os("RECOVERY_DIR").filter(|d| !d.is_empty()) {return Some(PathBuf::from(d));}let env = |k: &str| std::env::var_os(k).filter(|d| !d.is_empty()).map(PathBuf::from);- let base = if cfg!(windows) {- env("LOCALAPPDATA")?.join("SolveCraft")+ let root = if cfg!(windows) {+ env("LOCALAPPDATA")?} else if cfg!(target_os = "macos") {- env("HOME")?.join("Library/Application Support/SolveCraft")+ env("HOME")?.join("Library/Application Support")} else {- env("XDG_DATA_HOME").or_else(|| env("HOME").map(|h| h.join(".local/share")))?.join("solvecraft")+ env("XDG_DATA_HOME").or_else(|| env("HOME").map(|h| h.join(".local/share")))?};- Some(base.join("recovery"))+ let (dir, legacy) = dirs_under(&root, cfg!(windows) || cfg!(target_os = "macos"));+ // Compatibility shim (docs/compatibility.md): autosaves made before the rename are copied+ // to the new folder on first launch; the old folder is left as it was.+ if let Err(e) = solidcraft_io::adopt_legacy_dir(&dir, &legacy) {+ log::warn!("recovery: could not copy {} to {}: {e}", legacy.display(), dir.display());+ }+ Some(dir)+}++/// The recovery folder under the per-user data `root`, and the folder earlier releases used.+/// Windows and macOS name the app's folder in title case, other systems in lower case.+fn dirs_under(root: &Path, title_case: bool) -> (PathBuf, PathBuf) {+ let (name, legacy) = if title_case { ("SolidCraft", "SolveCraft") } else { ("solidcraft", "solvecraft") };+ (root.join(name).join("recovery"), root.join(legacy).join("recovery"))}/// What an entry's `<id>.json` holds.@@ -57,6 +70,14 @@ fn valid_id(id: &str) -> bool {!id.is_empty() && id.len() <= 64 && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-')}+/// An entry's design: `<id>.solidcraft`, or `<id>.solvecraft` for an autosave copied from a+/// pre-rename recovery folder (compatibility shim, docs/compatibility.md).+fn design_file(dir: &Path, id: &str) -> PathBuf {+ let current = file(dir, id, solidcraft_io::DESIGN_EXT);+ let legacy = file(dir, id, solidcraft_io::LEGACY_DESIGN_EXT);+ if !current.is_file() && legacy.is_file() { legacy } else { current }+}+fn file(dir: &Path, id: &str, ext: &str) -> PathBuf {dir.join(format!("{id}.{ext}"))}@@ -73,7 +94,7 @@ pub fn orphans(dir: &Path) -> Vec<Entry> {return None;}let entry: Entry = serde_json::from_slice(&fs::read(&p).ok()?).ok()?;- if !valid_id(&entry.id) || !file(dir, &entry.id, "solvecraft").is_file() {+ if !valid_id(&entry.id) || !design_file(dir, &entry.id).is_file() {return None;}// Held by a running app: not an orphan.@@ -100,16 +121,16 @@ pub fn load(dir: &Path, id: &str) -> Result<(Document, Entry)> {.ok().and_then(|b| serde_json::from_slice(&b).ok()).ok_or_else(|| EngineError::Other(format!("no recovered design `{id}`")))?;- let path = file(dir, id, "solvecraft");- let bytes = solvecraft_io::vfs::read(&path.to_string_lossy(), solvecraft_io::MAX_DESIGN_BYTES)+ let path = design_file(dir, id);+ let bytes = solidcraft_io::vfs::read(&path.to_string_lossy(), solidcraft_io::MAX_DESIGN_BYTES).map_err(|e| EngineError::Other(format!("recovered design `{id}`: {e}")))?;- Ok((solvecraft_io::read_design(&bytes)?, entry))+ Ok((solidcraft_io::read_design(&bytes)?, entry))}/// Delete an entry.pub fn remove(dir: &Path, id: &str) {if valid_id(id) {- for ext in ["json", "solvecraft", "lock"] {+ for ext in ["json", solidcraft_io::DESIGN_EXT, solidcraft_io::LEGACY_DESIGN_EXT, "lock"] {let _ = fs::remove_file(file(dir, id, ext));}}@@ -158,7 +179,7 @@ impl Autosaver {self.last_at = Instant::now();if !s.is_dirty() {if self.has_entry {- for ext in ["json", "solvecraft"] {+ for ext in ["json", "solidcraft"] {let _ = fs::remove_file(file(&self.dir, &self.id, ext));}self.has_entry = false;@@ -172,15 +193,15 @@ impl Autosaver {return Ok(false);}let io = |e: std::io::Error| EngineError::Other(format!("autosave: {e}"));- solvecraft_io::write_atomic(&file(&self.dir, &self.id, "solvecraft"), &solvecraft_io::write_design(&s.doc), false).map_err(io)?;+ solidcraft_io::write_atomic(&file(&self.dir, &self.id, "solidcraft"), &solidcraft_io::write_design(&s.doc), false).map_err(io)?;let entry =Entry { id: self.id.clone(), path: s.path.clone(), name: s.doc.name.clone(), saved_at: unix_now(), features: s.doc.features.len() };let meta = serde_json::to_vec_pretty(&entry).map_err(|e| EngineError::Other(e.to_string()))?;- solvecraft_io::write_atomic(&file(&self.dir, &self.id, "json"), &meta, false).map_err(io)?;+ solidcraft_io::write_atomic(&file(&self.dir, &self.id, "json"), &meta, false).map_err(io)?;self.last = Some(s.doc.clone());self.has_entry = true;// Crash replays start from this autosave from here.- crate::crash::rebased(s, Some(&file(&self.dir, &self.id, "solvecraft")), true);+ crate::crash::rebased(s, Some(&file(&self.dir, &self.id, solidcraft_io::DESIGN_EXT)), true);Ok(true)}@@ -202,11 +223,37 @@ impl Autosaver {#[cfg(test)]mod tests {+ #[test]+ fn autosave_from_a_legacy_folder_is_listed_and_loads() {+ let d = std::env::temp_dir().join(format!("solidcraft-recovery-legacy-{}", std::process::id()));+ let _ = fs::remove_dir_all(&d);+ fs::create_dir_all(&d).unwrap();+ let id = "1-2-3";+ let doc = Document::default();+ fs::write(d.join(format!("{id}.solvecraft")), solidcraft_io::write_design(&doc)).unwrap();+ let entry = Entry { id: id.into(), path: Some("/d/part.solvecraft".into()), name: "part".into(), saved_at: 1, features: 0 };+ fs::write(d.join(format!("{id}.json")), serde_json::to_vec(&entry).unwrap()).unwrap();+ assert_eq!(orphans(&d).iter().map(|e| e.id.as_str()).collect::<Vec<_>>(), [id]);+ let (_, loaded) = load(&d, id).unwrap();+ assert_eq!(loaded, entry);+ remove(&d, id);+ assert!(orphans(&d).is_empty() && !d.join(format!("{id}.solvecraft")).exists());+ let _ = fs::remove_dir_all(&d);+ }++ #[test]+ fn recovery_dirs_and_their_legacy_names() {+ let (dir, legacy) = super::dirs_under(Path::new("/data"), false);+ assert_eq!((dir.as_path(), legacy.as_path()), (Path::new("/data/solidcraft/recovery"), Path::new("/data/solvecraft/recovery")));+ let (dir, legacy) = super::dirs_under(Path::new("/data"), true);+ assert_eq!((dir.as_path(), legacy.as_path()), (Path::new("/data/SolidCraft/recovery"), Path::new("/data/SolveCraft/recovery")));+ }+use super::*;use serde_json::json;fn dir(tag: &str) -> PathBuf {- let d = std::env::temp_dir().join(format!("solvecraft-recovery-{tag}-{}", std::process::id()));+ let d = std::env::temp_dir().join(format!("solidcraft-recovery-{tag}-{}", std::process::id()));let _ = fs::remove_dir_all(&d);d}@@ -259,7 +306,7 @@ mod tests {assert!(a.tick(&s, false).unwrap());s.mark_saved();a.tick(&s, false).unwrap();- assert!(!file(&d, &a.id, "solvecraft").exists());+ assert!(!file(&d, &a.id, "solidcraft").exists());a.close(&s);assert_eq!(fs::read_dir(&d).unwrap().count(), 0);// Closing with unsaved changes keeps them for the next launch.diff --git a/crates/engine/src/sample.rs b/crates/engine/src/sample.rsindex dc50b6b2be..2e95267b17 100644--- a/crates/engine/src/sample.rs+++ b/crates/engine/src/sample.rs@@ -1,4 +1,4 @@-//! A sample design (used by `solvecraft --sample` and demos): a parametric plate with rounded+//! A sample design (used by `solidcraft --sample` and demos): a parametric plate with rounded//! corners, two holes and a boss.use serde_json::{Value, json};@@ -147,14 +147,14 @@ mod tests {.doc.features.iter()- .find(|feature| feature.name == "Boss" && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. }))+ .find(|feature| feature.name == "Boss" && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap().id;let bore = session.doc.features.iter()- .find(|feature| feature.name == "Bore" && matches!(feature.kind, solvecraft_doc::FeatureKind::Sketch { .. }))+ .find(|feature| feature.name == "Bore" && matches!(feature.kind, solidcraft_doc::FeatureKind::Sketch { .. })).unwrap().id;session.execute("parameters.change", &serde_json::json!({"name":"thickness","expression":"12 mm"})).unwrap();@@ -164,17 +164,17 @@ mod tests {let world = session.world_state();let plate = world.body("Plate").unwrap().mesh();assert!((plate.bounds().max.z - 26.).abs() < 1e-6);- assert!(plate.contains(solvecraft_geom::Vec3::new(5., 25., 10.)));- assert!(plate.contains(solvecraft_geom::Vec3::new(40., 35., 24.)));- assert!(!plate.contains(solvecraft_geom::Vec3::new(40., 25., 24.)));- assert!(!plate.contains(solvecraft_geom::Vec3::new(40., 25., 2.)));- assert!(plate.contains(solvecraft_geom::Vec3::new(40., 35., 2.)));- let reopened = crate::Session::new(solvecraft_doc::Document::from_json(&session.doc.to_json()).unwrap());+ assert!(plate.contains(solidcraft_geom::Vec3::new(5., 25., 10.)));+ assert!(plate.contains(solidcraft_geom::Vec3::new(40., 35., 24.)));+ assert!(!plate.contains(solidcraft_geom::Vec3::new(40., 25., 24.)));+ assert!(!plate.contains(solidcraft_geom::Vec3::new(40., 25., 2.)));+ assert!(plate.contains(solidcraft_geom::Vec3::new(40., 35., 2.)));+ let reopened = crate::Session::new(solidcraft_doc::Document::from_json(&session.doc.to_json()).unwrap());assert!((reopened.model.state().sketch(bore).unwrap().plane.origin.z - 26.).abs() < 1e-6);let reopened_world = reopened.world_state();let reopened_plate = reopened_world.body("Plate").unwrap().mesh();- assert!(!reopened_plate.contains(solvecraft_geom::Vec3::new(40., 25., 2.)));- assert!(reopened_plate.contains(solvecraft_geom::Vec3::new(40., 35., 2.)));+ assert!(!reopened_plate.contains(solidcraft_geom::Vec3::new(40., 25., 2.)));+ assert!(reopened_plate.contains(solidcraft_geom::Vec3::new(40., 35., 2.)));}/// Every built-in sample builds without a failing feature or joint.diff --git a/crates/engine/src/split_face_tests.rs b/crates/engine/src/split_face_tests.rsindex 051d4228ab..1bf0cbfe70 100644--- a/crates/engine/src/split_face_tests.rs+++ b/crates/engine/src/split_face_tests.rs@@ -71,7 +71,7 @@ fn export_keeps_split_faces_through_later_features() {run(&mut s, "solid.fillet", json!({"edges": [[20, 0, 0]], "radius": 2}));let (f, _) = faces_volume(&mut s, "B");assert_eq!(f, 8);- let dir = std::env::temp_dir().join(format!("solvecraft-split-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-split-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let step = dir.join("split.step");run(&mut s, "file.export", json!({"path": step.to_string_lossy()}));diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rsindex 52d1e6279e..4442b18743 100644--- a/crates/engine/src/tests.rs+++ b/crates/engine/src/tests.rs@@ -55,13 +55,13 @@ fn join_extrude_from_a_chamfered_top_face() {run(&mut s, "solid.chamfer", json!({"edges": [[10, 0, 20]], "distance": "bevel"}));let base = volume(&mut s);let id = run(&mut s, "sketch.create", json!({"plane": {"face": [0, 0, 20]}}))["sketch"].as_u64().unwrap();- let solvecraft_doc::FeatureKind::Sketch { plane: solvecraft_doc::PlaneRef::Face { anchor: Some(anchor), .. }, sketch } =+ let solidcraft_doc::FeatureKind::Sketch { plane: solidcraft_doc::PlaneRef::Face { anchor: Some(anchor), .. }, sketch } =&s.doc.feature(id).unwrap().kindelse {panic!("the chamfered cap retains its exact original construction support");};assert_eq!(anchor.target.origin_feature, source);- assert!(matches!(anchor.target.certificate, Some(solvecraft_doc::config::FaceCertificate::ExtrudeCap { high: true, .. })));+ assert!(matches!(anchor.target.certificate, Some(solidcraft_doc::config::FaceCertificate::ExtrudeCap { high: true, .. })));assert!(!sketch.links.is_empty());assert!(sketch.links.iter().all(|link| link.auto_face && !link.lost));// The default linked cap outline is radius8; no explicit fixed plane or@@ -74,7 +74,7 @@ fn join_extrude_from_a_chamfered_top_face() {run(&mut s, "parameters.change", json!({"name":"height","expression":format!("{height} mm")}));run(&mut s, "parameters.change", json!({"name":"bevel","expression":format!("{bevel} mm")}));let expected = PI * (100. * height - (10. * bevel * bevel - bevel * bevel * bevel / 3.) + (10. - bevel) * (10. - bevel) * 5.);- let loaded = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let loaded = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();let mut cold = Session::new(loaded);let warm_volume = volume(&mut s);let cold_volume = volume(&mut cold);@@ -88,10 +88,10 @@ fn join_extrude_from_a_chamfered_top_face() {assert!((solved.plane.origin.z - height).abs() < 1e-8);assert!(solved.sketch.links.iter().all(|link| link.auto_face && !link.lost));let body = &state.bodies[0];- assert!(body.body.contains(solvecraft_geom::Vec3::new(0., 0., height + 4.)));- assert!(!body.body.contains(solvecraft_geom::Vec3::new(0., 0., height + 6.)));- assert!(body.body.contains(solvecraft_geom::Vec3::new(10. - bevel - 0.5, 0., height + 4.)));- assert!(!body.body.contains(solvecraft_geom::Vec3::new(10. - bevel + 0.5, 0., height + 4.)));+ assert!(body.body.contains(solidcraft_geom::Vec3::new(0., 0., height + 4.)));+ assert!(!body.body.contains(solidcraft_geom::Vec3::new(0., 0., height + 6.)));+ assert!(body.body.contains(solidcraft_geom::Vec3::new(10. - bevel - 0.5, 0., height + 4.)));+ assert!(!body.body.contains(solidcraft_geom::Vec3::new(10. - bevel + 0.5, 0., height + 4.)));}}}@@ -256,7 +256,7 @@ fn box_fillet_cut_part() {let l: Vec<String> = r["curves"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_string()).collect();let corner = s.doc.sketch(s.active_sketch.unwrap()).unwrap().curves[0].clone();let start = match corner.kind {- solvecraft_sketch::CurveKind::Line { a, .. } => s.doc.sketch(s.active_sketch.unwrap()).unwrap().points[a].id.clone(),+ solidcraft_sketch::CurveKind::Line { a, .. } => s.doc.sketch(s.active_sketch.unwrap()).unwrap().points[a].id.clone(),_ => panic!(),};run(&mut s, "sketch.constraint.coincident", json!({"a": start, "b": "origin"}));@@ -293,7 +293,7 @@ fn box_fillet_cut_part() {assert!(rel(volume(&mut s), expect2) < 5e-4);// Export STL and STEP.- let dir = std::env::temp_dir().join(format!("solvecraft-test-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-test-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let stl = dir.join("part.stl");run(&mut s, "file.export", json!({"path": stl.to_string_lossy()}));@@ -301,7 +301,7 @@ fn box_fillet_cut_part() {let step = dir.join("part.step");run(&mut s, "file.export", json!({"path": step.to_string_lossy()}));assert!(std::fs::read_to_string(&step).unwrap().contains("ISO-10303-21"));- let design = dir.join("part.solvecraft");+ let design = dir.join("part.solidcraft");run(&mut s, "file.save_as", json!({"path": design.to_string_lossy()}));let mut s2 = Session::default();run(&mut s2, "doc.open", json!({"path": design.to_string_lossy()}));@@ -610,7 +610,7 @@ fn sample_edges_chain_and_faces() {let chain = m.tangent_chain(e, 2f64.to_radians());// The plate's top outline: 4 lines and 4 corner arcs (a boolean may leave an edge twice,// once per face; count distinct ones).- let mut mids: Vec<solvecraft_geom::Vec3> = Vec::new();+ let mut mids: Vec<solidcraft_geom::Vec3> = Vec::new();for i in &chain {let p = &m.edges[*i];let mid = p[p.len() / 2];@@ -707,7 +707,7 @@ fn timeline_edits_reresolve_references() {/// A 40 × 30 × 20 box exported to a STEP file in a fresh temp directory.fn step_box_file(tag: &str) -> std::path::PathBuf {- let dir = std::env::temp_dir().join(format!("solvecraft-step-{tag}-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-step-{tag}-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let mut s = Session::default();run(&mut s, "solid.box", json!({"length": 40, "width": 30, "height": 20}));@@ -756,7 +756,7 @@ fn step_open_then_model_on_it() {// The design saves and reopens without the STEP file.let before = volume(&mut s);- let design = p.with_extension("solvecraft");+ let design = p.with_extension("solidcraft");run(&mut s, "file.save_as", json!({"path": design.to_string_lossy()}));std::fs::remove_file(&p).unwrap();let mut s2 = Session::default();@@ -802,8 +802,8 @@ fn step_insert_shell_and_errors() {assert_eq!(*d.doc, *before);}-fn body_volume(st: &solvecraft_doc::ModelState) -> f64 {- st.bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum()+fn body_volume(st: &solidcraft_doc::ModelState) -> f64 {+ st.bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).sum()}/// Previews evaluate on a scratch copy: the document, undo history and model are untouched.@@ -1048,7 +1048,7 @@ fn extrude_a_body_face() {/// solid features.#[test]fn threemf_export_open_insert() {- let dir = std::env::temp_dir().join(format!("solvecraft-3mf-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-3mf-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let mut s = Session::default();run(&mut s, "solid.box", json!({"length": 40, "width": 30, "height": 20}));@@ -1124,12 +1124,12 @@ fn holes_at_sketch_points_threads_and_components() {assert_eq!(r["components"].as_array().map(|a| a.len()), Some(1));// Saved and loaded with the components.let text = s.doc.to_json();- let back = solvecraft_doc::Document::from_json(&text).unwrap();+ let back = solidcraft_doc::Document::from_json(&text).unwrap();assert_eq!(back.components.len(), 2);let assigned = r["components"][0]["component"].as_u64().unwrap();let transfer = r["components"][0]["feature"].as_u64().unwrap();assert!(- matches!(&back.feature(transfer).unwrap().kind, solvecraft_doc::FeatureKind::BodyTransfer { bodies, to, .. } if bodies == &["Shaft"] && *to == assigned)+ matches!(&back.feature(transfer).unwrap().kind, solidcraft_doc::FeatureKind::BodyTransfer { bodies, to, .. } if bodies == &["Shaft"] && *to == assigned));let reopened = Session::new(back);assert_eq!(reopened.model.state().body("Shaft").unwrap().component, assigned);@@ -1284,11 +1284,11 @@ fn components_occurrences_and_world_placement() {assert_eq!(s.world_state().body("Base").unwrap().component, 0);run(&mut s, "timeline.roll_to", json!({}));// Saved and loaded; older designs get occurrences.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.occurrences.len(), s.doc.occurrences.len());let mut old: serde_json::Value = serde_json::from_str(&s.doc.to_json()).unwrap();old.as_object_mut().unwrap().remove("occurrences");- let migrated = solvecraft_doc::Document::from_json(&old.to_string()).unwrap();+ let migrated = solidcraft_doc::Document::from_json(&old.to_string()).unwrap();assert_eq!(migrated.occurrences.len(), migrated.components.len());}@@ -1325,7 +1325,7 @@ fn feature_inputs_are_parameters() {assert!(rel(volume(&mut s), 24.0 * 12.0 * 25.4) < 1e-9);assert!(s.execute("parameters.import", &json!({"text": "name,expression\nw,1/"})).is_err());// Saved and reloaded, the names stay.- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.features[0].param_names, s.doc.features[0].param_names);}@@ -1345,15 +1345,15 @@ fn rolling_back_and_forward_leaves_no_projection_warnings() {}/// Export STEP, validate the file, read it back: no warnings, same volume, area and faces.-fn step_round_trip(s: &mut Session, tag: &str) -> solvecraft_kernel::StepImport {- let p = std::env::temp_dir().join(format!("solvecraft-steprt-{tag}-{}.step", std::process::id()));+fn step_round_trip(s: &mut Session, tag: &str) -> solidcraft_kernel::StepImport {+ let p = std::env::temp_dir().join(format!("solidcraft-steprt-{tag}-{}.step", std::process::id()));run(s, "file.export", json!({"path": p.to_string_lossy()}));let text = std::fs::read_to_string(&p).unwrap();let _ = std::fs::remove_file(&p);- solvecraft_kernel::step_validate(&text).unwrap();- assert_eq!(solvecraft_kernel::step_orientation_errors(&text).unwrap(), Vec::<String>::new());+ solidcraft_kernel::step_validate(&text).unwrap();+ assert_eq!(solidcraft_kernel::step_orientation_errors(&text).unwrap(), Vec::<String>::new());assert!(text.contains("AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF"));- let imp = solvecraft_kernel::step_import(&text).unwrap();+ let imp = solidcraft_kernel::step_import(&text).unwrap();assert!(imp.warnings.is_empty(), "{:?}", imp.warnings);imp}@@ -1367,7 +1367,7 @@ fn sample_plate_step_round_trip() {assert_eq!(imp.bodies.len(), st.bodies.len());for (a, b) in st.bodies.iter().zip(&imp.bodies) {assert_eq!(a.name, b.name);- let (ma, mb) = (solvecraft_kernel::measure(&a.body).unwrap(), solvecraft_kernel::measure(&b.body).unwrap());+ let (ma, mb) = (solidcraft_kernel::measure(&a.body).unwrap(), solidcraft_kernel::measure(&b.body).unwrap());assert!(rel(mb.volume, ma.volume) < 1e-4, "{} vs {}", mb.volume, ma.volume);assert!(rel(mb.area, ma.area) < 1e-4, "{} vs {}", mb.area, ma.area);assert!(b.file_faces <= a.body.face_count() && b.file_faces >= ma.merged.faces.min(a.body.face_count()));@@ -1389,13 +1389,13 @@ fn material_and_appearance_colours_export_to_step() {assert!(s.execute("appearance.assign", &json!({"bodies": ["RedAbs"], "color": "#12"})).is_err());let rgb = |c: [u8; 3]| c.map(|x| x as f32 / 255.0);let want =- [("BrassBox", Some(rgb(solvecraft_doc::material_color("Brass").unwrap()))), ("RedAbs", Some(rgb([0xd0, 0x1c, 0x1c]))), ("Plain", None)];+ [("BrassBox", Some(rgb(solidcraft_doc::material_color("Brass").unwrap()))), ("RedAbs", Some(rgb([0xd0, 0x1c, 0x1c]))), ("Plain", None)];let same = |a: Option<[f32; 3]>, b: Option<[f32; 3]>| match (a, b) {(Some(a), Some(b)) => a.iter().zip(b).all(|(x, y)| (x - y).abs() < 1e-3),(None, None) => true,_ => false,};- let check = |imp: &solvecraft_kernel::StepImport| {+ let check = |imp: &solidcraft_kernel::StepImport| {for (name, c) in want {let b = imp.bodies.iter().find(|b| b.name == name).unwrap_or_else(|| panic!("no body {name}"));assert!(same(b.body.color(), c), "{name}: {:?} vs {c:?}", b.body.color());@@ -1403,7 +1403,7 @@ fn material_and_appearance_colours_export_to_step() {};check(&step_round_trip(&mut s, "colours"));// Open the export and export again: the file's colours are kept.- let p = std::env::temp_dir().join(format!("solvecraft-colours-{}.step", std::process::id()));+ let p = std::env::temp_dir().join(format!("solidcraft-colours-{}.step", std::process::id()));run(&mut s, "file.export", json!({"path": p.to_string_lossy()}));let mut s2 = Session::default();run(&mut s2, "doc.open", json!({"path": p.to_string_lossy()}));@@ -1429,7 +1429,7 @@ fn face_colours_and_opacity_export() {assert_eq!(paint.faces[0].face, top);assert!((paint.faces[0].color[0] - 1.0).abs() < 1e-3 && paint.faces[0].color[1].abs() < 1e-3, "{paint:?}");// Opened again, the face keeps its colour (shown and exported).- let p = std::env::temp_dir().join(format!("solvecraft-facecol-{}.step", std::process::id()));+ let p = std::env::temp_dir().join(format!("solidcraft-facecol-{}.step", std::process::id()));run(&mut s, "file.export", json!({"path": p.to_string_lossy()}));let mut s2 = Session::default();run(&mut s2, "doc.open", json!({"path": p.to_string_lossy()}));@@ -1448,8 +1448,8 @@ fn iges_export_and_open() {run(&mut s, "solid.box", json!({"length": 40, "width": 30, "height": 5, "body_name": "Plate"}));run(&mut s, "solid.cylinder", json!({"radius": 4, "height": 20, "base": [10, 10, 5], "body_name": "Pin"}));run(&mut s, "appearance.assign", json!({"bodies": ["Pin"], "color": "#ff0000"}));- let want: Vec<f64> = s.world_state().bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).collect();- let p = std::env::temp_dir().join(format!("solvecraft-iges-{}.igs", std::process::id()));+ let want: Vec<f64> = s.world_state().bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).collect();+ let p = std::env::temp_dir().join(format!("solidcraft-iges-{}.igs", std::process::id()));run(&mut s, "file.export", json!({"path": p.to_string_lossy()}));let mut s2 = Session::default();run(&mut s2, "doc.open", json!({"path": p.to_string_lossy()}));@@ -1458,7 +1458,7 @@ fn iges_export_and_open() {let names: Vec<&str> = st.bodies.iter().map(|b| b.name.as_str()).collect();assert_eq!(names, ["Plate", "Pin"]);for (b, v) in st.bodies.iter().zip(&want) {- assert!(rel(solvecraft_kernel::measure(&b.body).unwrap().volume, *v) < 1e-4);+ assert!(rel(solidcraft_kernel::measure(&b.body).unwrap().volume, *v) < 1e-4);}assert_eq!(st.bodies[1].body.color(), Some([1.0, 0.0, 0.0]));}@@ -1473,7 +1473,7 @@ fn split_body_by_a_face() {run(&mut s, "solid.split_body", json!({"body": "Block", "tool": {"body": "Tool", "point": [9, 10, 10]}}));let st = s.world_state();let mut v: Vec<f64> =- st.bodies.iter().filter(|b| b.name.starts_with("Block")).map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).collect();+ st.bodies.iter().filter(|b| b.name.starts_with("Block")).map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).collect();v.sort_by(f64::total_cmp);let core = PI * 16.0 * 30.0;assert!(v.len() == 2 && rel(v[0], core) < 1e-3 && rel(v[1], 6000.0 - core) < 1e-3, "{v:?}");@@ -1488,12 +1488,12 @@ fn chord_and_variable_fillets() {run(&mut s, "solid.box", json!({"length": 10, "width": 20, "height": 30, "body_name": "B"}));run(&mut s, "solid.fillet", json!({"edges": [[10, 10, 30]], "radius": 4, "type": "chord"}));let r = 4.0 / 2f64.sqrt();- let v = solvecraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;+ let v = solidcraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;assert!(rel(v, 6000.0 - (1.0 - PI / 4.0) * r * r * 20.0) < 1e-4, "{v}");let mut s = Session::default();run(&mut s, "solid.box", json!({"length": 10, "width": 20, "height": 30, "body_name": "B"}));run(&mut s, "solid.fillet", json!({"edges": [[10, 10, 30]], "radius": 2, "type": "variable", "radius2": 5, "start": [10, 0, 30]}));- let v = solvecraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;+ let v = solidcraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;let removed = (1.0 - PI / 4.0) * 20.0 * (4.0 + 10.0 + 25.0) / 3.0;assert!(rel(v, 6000.0 - removed) < 1e-4, "{v}");assert!(s.execute("solid.fillet", &json!({"edges": [[10, 10, 30]], "radius": 2, "type": "variable"})).is_err());@@ -1506,7 +1506,7 @@ fn chord_and_variable_fillets() {"solid.fillet",json!({"edges": [[10, 10, 30]], "radius": 2, "type": "variable", "radius2": 2, "start": [10, 0, 30], "mid": [[0.5, "waist"]]}),);- let vol = |s: &Session| solvecraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;+ let vol = |s: &Session| solidcraft_kernel::measure(&s.world_state().body("B").unwrap().body).unwrap().volume;let removed = 2.0 * (1.0 - PI / 4.0) * 10.0 * (4.0 + 8.0 + 16.0) / 3.0;assert!(rel(vol(&s), 6000.0 - removed) < 1e-4, "{}", vol(&s));// The middle radius follows its parameter.@@ -1530,10 +1530,10 @@ fn components_export_as_step_assembly() {run(&mut s, "component.create", json!({"name": "Pin"}));run(&mut s, "solid.cylinder", json!({"radius": 2, "height": 10, "base": [5, 5, 5]}));run(&mut s, "occurrence.copy", json!({"component": "Pin", "translate": [20, 0, 0]}));- let want: f64 = s.world_state().bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum();+ let want: f64 = s.world_state().bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).sum();let imp = step_round_trip(&mut s, "asm");assert_eq!(imp.bodies.len(), 3, "{:?}", imp.bodies.iter().map(|b| &b.name).collect::<Vec<_>>());- let got: f64 = imp.bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum();+ let got: f64 = imp.bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).unwrap().volume).sum();assert!(rel(got, want) < 1e-4, "{got} vs {want}");let root = &imp.tree[0];assert_eq!(root.children.len(), 2);@@ -1543,7 +1543,7 @@ fn components_export_as_step_assembly() {.bodies.iter().filter(|b| b.path.last().is_some_and(|p| p == "Pin"))- .map(|b| solvecraft_kernel::measure(&b.body).unwrap().centroid.x)+ .map(|b| solidcraft_kernel::measure(&b.body).unwrap().centroid.x).collect();assert_eq!(xs.len(), 2);assert!(((xs[0] - xs[1]).abs() - 20.0).abs() < 1e-6, "{xs:?}");@@ -1607,7 +1607,7 @@ fn appearances_by_face_body_and_component() {assert_eq!(look(&mut s, "Shell")["appearance"]["name"], "Brass");// Saved and opened again.run(&mut s, "appearance.assign", json!({"faces": [[5, 5, 10]], "color": "#00ff00"}));- let back = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let back = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();assert_eq!(back.appearances, s.doc.appearances);assert!(s.execute("appearance.assign", &json!({"bodies": ["Shell"], "appearance": "Unobtainium"})).is_err());assert!(s.execute("appearance.assign", &json!({"color": "#ffffff"})).is_err(), "no target");@@ -1627,16 +1627,16 @@ fn cached_evaluation_matches_from_scratch() {);run(&mut s, "solid.box", json!({"corner": [-50, 0, 0], "length": 10, "width": 10, "height": 10, "body_name": "Side"}));let same = |s: &Session, what: &str| {- let mut fresh = solvecraft_doc::Model::new();+ let mut fresh = solidcraft_doc::Model::new();fresh.no_cache = true;fresh.evaluate(&s.doc);- let errs = |m: &solvecraft_doc::Model| m.results.iter().map(|r| (r.id, r.error.clone(), r.skipped)).collect::<Vec<_>>();+ let errs = |m: &solidcraft_doc::Model| m.results.iter().map(|r| (r.id, r.error.clone(), r.skipped)).collect::<Vec<_>>();assert_eq!(errs(&s.model), errs(&fresh), "{what}: feature results");- let shape = |st: &solvecraft_doc::ModelState| {+ let shape = |st: &solidcraft_doc::ModelState| {st.bodies.iter().map(|b| {- let m = solvecraft_kernel::measure(&b.body).unwrap();+ let m = solidcraft_kernel::measure(&b.body).unwrap();// Volume and area to 1e-9: two evaluations from scratch differ in the last// bits too (the kernel's tessellation is not bit-for-bit repeatable).(b.name.clone(), b.feature, (m.volume * 1e6).round(), (m.area * 1e6).round(), m.faces, m.edges, m.vertices, m.merged.faces)@@ -1647,14 +1647,14 @@ fn cached_evaluation_matches_from_scratch() {assert_eq!(s.model.state().sketches.len(), fresh.state().sketches.len(), "{what}: sketches");};// Two evaluations from scratch agree to the same precision.- let mut a = solvecraft_doc::Model::new();+ let mut a = solidcraft_doc::Model::new();a.no_cache = true;a.evaluate(&s.doc);- let mut b = solvecraft_doc::Model::new();+ let mut b = solidcraft_doc::Model::new();b.no_cache = true;b.evaluate(&s.doc);- let vols = |m: &solvecraft_doc::Model| {- m.state().bodies.iter().map(|x| (solvecraft_kernel::measure(&x.body).unwrap().volume * 1e6).round()).collect::<Vec<_>>()+ let vols = |m: &solidcraft_doc::Model| {+ m.state().bodies.iter().map(|x| (solidcraft_kernel::measure(&x.body).unwrap().volume * 1e6).round()).collect::<Vec<_>>()};assert_eq!(vols(&a), vols(&b));same(&s, "built");@@ -1859,14 +1859,14 @@ mod naming {run(&mut s, "edit.undo", json!({}));assert_eq!(attached(&s), Some(10.));assert!((top(&mut s) - 15.).abs() < 1e-6);- let reopened = solvecraft_doc::Document::from_json(&s.doc.to_json()).unwrap();- let mut model = solvecraft_doc::Model::new();+ let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();+ let mut model = solidcraft_doc::Model::new();model.evaluate(&reopened);assert_eq!(model.state().sketch(reopened.find_feature("Top").unwrap().id).unwrap().plane.origin.z, 10.);assert!((model.state().bodies[0].mesh().bounds().max.z - 15.).abs() < 1e-6);// A historical format-10 attachment uses its saved generic face name and no strong anchor.let mut old = (*s.doc).clone();- let solvecraft_doc::FeatureKind::Sketch { plane: solvecraft_doc::PlaneRef::Face { anchor, name, .. }, sketch } =+ let solidcraft_doc::FeatureKind::Sketch { plane: solidcraft_doc::PlaneRef::Face { anchor, name, .. }, sketch } =&mut old.features.iter_mut().find(|f| f.name == "Top").unwrap().kindelse {panic!("fixture must contain a face sketch");@@ -1878,8 +1878,8 @@ mod naming {link.face_name = name.clone();}}- old.format = "solvecraft/10".into();- let mut legacy = Session::new(solvecraft_doc::Document::from_json(&old.to_json()).unwrap());+ old.format = "solidcraft/10".into();+ let mut legacy = Session::new(solidcraft_doc::Document::from_json(&old.to_json()).unwrap());assert_eq!(attached(&legacy), Some(10.));assert!((top(&mut legacy) - 15.).abs() < 1e-6);// The upstream join consumes the certified body; new attachments cannot follow its substitute roof.@@ -1893,10 +1893,10 @@ mod naming {}assert_eq!(attached(&legacy), Some(10.), "historical weak naming retains its saved geometry behavior");assert!((top(&mut legacy) - 20.).abs() < 1e-6);- let legacy_reopened = Session::new(solvecraft_doc::Document::from_json(&legacy.doc.to_json()).unwrap());+ let legacy_reopened = Session::new(solidcraft_doc::Document::from_json(&legacy.doc.to_json()).unwrap());assert_eq!(attached(&legacy_reopened), Some(10.));assert!((legacy_reopened.model.state().bodies[0].mesh().bounds().max.z - 20.).abs() < 1e-6);- let solvecraft_doc::FeatureKind::Sketch { plane: solvecraft_doc::PlaneRef::Face { anchor, .. }, .. } =+ let solidcraft_doc::FeatureKind::Sketch { plane: solidcraft_doc::PlaneRef::Face { anchor, .. }, .. } =&legacy_reopened.doc.find_feature("Top").unwrap().kindelse {panic!("saved historical face reference must remain present");@@ -2171,7 +2171,7 @@ fn appearances_survive_later_features() {// Exported with a body colour and the red face, then opened: the colours come in as the// body's own; a hole afterwards keeps them.run(&mut s, "appearance.assign", json!({"bodies": ["B"], "color": "#2050c0"}));- let dir = std::env::temp_dir().join(format!("solvecraft-paint-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-paint-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let step = dir.join("painted.step");run(&mut s, "file.export", json!({"path": step.to_string_lossy()}));@@ -2192,10 +2192,10 @@ fn appearances_survive_later_features() {/// The original #2 RGB import acceptance, including later topology and placement edits.#[test]fn imported_rgb_appearances_survive_edits_reopen_and_step_export() {- let dir = std::env::temp_dir().join(format!("solvecraft-imported-rgb-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-imported-rgb-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let input = dir.join("rgb.step");- let saved = dir.join("edited.solvecraft");+ let saved = dir.join("edited.solidcraft");let output = dir.join("edited.step");let mut source = Session::default();for (name, x, color) in [("Red", 0, "#ff0000"), ("Green", 40, "#00ff00"), ("Blue", 80, "#0000ff")] {@@ -2380,7 +2380,7 @@ fn combine_keep_tools_and_new_component() {assert!(st.body("B").is_some(), "the tool is kept");let a = st.body("A").unwrap();assert_eq!(s.doc.body_component("A", a.feature), comp);- assert!(rel(solvecraft_kernel::measure(&a.body).unwrap().volume, 4000.0) < 1e-9);+ assert!(rel(solidcraft_kernel::measure(&a.body).unwrap().volume, 4000.0) < 1e-9);}/// Align with snap points: a box's vertex onto another's face centre, an edge midpoint onto a@@ -2491,13 +2491,13 @@ fn drawing_on_existing_points_connects_to_them() {fn computed_import_preserves_file_and_earlier_undo_history() {let mut s = Session::default();run(&mut s, "solid.box", json!({"length": 10, "width": 10, "height": 10}));- s.path = Some("existing.solvecraft".into());+ s.path = Some("existing.solidcraft".into());s.mark_saved();let saved = s.doc.clone();let mut computed = s.scratch();run(&mut computed, "solid.box", json!({"length": 5, "width": 5, "height": 5, "corner": [30, 0, 0]}));s.accept_computed(computed);- assert_eq!(s.path.as_deref(), Some("existing.solvecraft"));+ assert_eq!(s.path.as_deref(), Some("existing.solidcraft"));assert!(s.is_dirty());assert_eq!(s.model.state().bodies.len(), 2);run(&mut s, "edit.undo", json!({}));@@ -2536,7 +2536,7 @@ fn special_files_are_refused_by_every_file_command() {assert!(r.as_ref().is_err_and(|e| e.to_string().contains("not a regular file")), "{cmd}: {r:?}");}// The commands that check the extension first need a special file with the right name.- let dir = std::env::temp_dir().join(format!("solvecraft-special-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-special-{}", std::process::id()));let _ = std::fs::create_dir_all(&dir);for (cmd, name) in [("file.insert_step", "x.step"), ("file.insert_mesh", "x.3mf"), ("sketch.insert_dxf", "x.dxf")] {let p = dir.join(name);@@ -2777,12 +2777,12 @@ fn a_design_saved_before_format_14_keeps_generic_names_past_body_name() {run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"sketch": "R", "distance": "10", "operation": "new_body", "body_name": "Ribs"}));let mut legacy: Value = serde_json::from_str(&s.doc.to_json()).unwrap();- legacy["format"] = json!("solvecraft/13");+ legacy["format"] = json!("solidcraft/13");let extrude = legacy["features"].as_array_mut().unwrap().iter_mut().find(|f| f["type"] == "extrude").unwrap();extrude["body_names"] = json!(["Ribs"]);- let dir = std::env::temp_dir().join(format!("solvecraft-373-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-373-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();- let design = dir.join("ribs.solvecraft");+ let design = dir.join("ribs.solidcraft");std::fs::write(&design, legacy.to_string()).unwrap();let mut old = Session::default();run(&mut old, "doc.open", json!({"path": design.to_string_lossy()}));diff --git a/crates/engine/src/tests/boolean_diagnostics.rs b/crates/engine/src/tests/boolean_diagnostics.rsindex eaa542883b..ed391b1aa6 100644--- a/crates/engine/src/tests/boolean_diagnostics.rs+++ b/crates/engine/src/tests/boolean_diagnostics.rs@@ -1,5 +1,5 @@use super::*;-use solvecraft_kernel::BooleanStrategy;+use solidcraft_kernel::BooleanStrategy;#[test]fn boolean_retry_warning_and_details_survive_cache_undo_and_reopen() {@@ -41,7 +41,7 @@ fn boolean_retry_warning_and_details_survive_cache_undo_and_reopen() {run(&mut session, "edit.undo", json!({}));run(&mut session, "edit.redo", json!({}));assert_eq!(check(&session), original);- let reopened_doc = solvecraft_doc::Document::from_json(&session.doc.to_json()).unwrap();+ let reopened_doc = solidcraft_doc::Document::from_json(&session.doc.to_json()).unwrap();let reopened = Session::new(reopened_doc);assert_eq!(check(&reopened), original);// A later independent feature must not inherit the earlier retry's warning.diff --git a/crates/engine/src/tests/mesh_convert.rs b/crates/engine/src/tests/mesh_convert.rsindex 14193df7d3..993c7002de 100644--- a/crates/engine/src/tests/mesh_convert.rs+++ b/crates/engine/src/tests/mesh_convert.rs@@ -1,9 +1,9 @@use super::*;-use solvecraft_doc::{Document, FeatureKind, MeshData};-use solvecraft_geom::Vec3;+use solidcraft_doc::{Document, FeatureKind, MeshData};+use solidcraft_geom::Vec3;fn imported_box() -> Session {- let body = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();+ let body = solidcraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();let mesh = body.tessellate(0.01).unwrap();let mut doc = Document::default();doc.add_feature(@@ -78,7 +78,7 @@ fn exported_binary_stl_with_a_bore_reconstructs_analytic_faces() {run(&mut s, "sketch.circle.center", json!({"center":[10,10],"radius":4}));run(&mut s, "sketch.finish", json!({}));run(&mut s, "solid.extrude", json!({"sketch":"Section","profiles":[{"point":[30,10]}],"distance":15,"body_name":"Bracket"}));- let path = std::env::temp_dir().join(format!("solvecraft-mesh-convert-{}.stl", std::process::id()));+ let path = std::env::temp_dir().join(format!("solidcraft-mesh-convert-{}.stl", std::process::id()));run(&mut s, "file.save_mesh", json!({"path":path}));run(&mut s, "doc.open", json!({"path":path}));let name = s.model.state().bodies[0].name.clone();@@ -87,7 +87,7 @@ fn exported_binary_stl_with_a_bore_reconstructs_analytic_faces() {let body = &state.bodies[0].body;assert!(!body.is_mesh());assert!(body.validity().is_empty());- assert_eq!(solvecraft_kernel::measure(body).unwrap().merged.face_types.get("cylinder"), Some(&1));+ assert_eq!(solidcraft_kernel::measure(body).unwrap().merged.face_types.get("cylinder"), Some(&1));assert_eq!(body.faces(0.01).unwrap().len(), 10);std::fs::remove_file(path).unwrap();}diff --git a/crates/engine/src/tests/mirror_planes.rs b/crates/engine/src/tests/mirror_planes.rsindex a1b4ca98e0..af766e59cf 100644--- a/crates/engine/src/tests/mirror_planes.rs+++ b/crates/engine/src/tests/mirror_planes.rs@@ -9,7 +9,7 @@ use crate::*;fn min_x(s: &Session, body: &str) -> f64 {let b = s.model.state().body(body).map(|b| b.body.clone()).unwrap();- solvecraft_kernel::measure(&b).unwrap().bbox.min.x+ solidcraft_kernel::measure(&b).unwrap().bbox.min.x}#[test]diff --git a/crates/engine/src/tests/primitive_points.rs b/crates/engine/src/tests/primitive_points.rsindex 1c9b9e0a9c..55ab180d66 100644--- a/crates/engine/src/tests/primitive_points.rs+++ b/crates/engine/src/tests/primitive_points.rs@@ -9,7 +9,7 @@ use crate::*;fn bbox(s: &Session, body: &str) -> ([f64; 3], [f64; 3]) {let b = s.model.state().body(body).map(|b| b.body.clone()).unwrap();- let m = solvecraft_kernel::measure(&b).unwrap();+ let m = solidcraft_kernel::measure(&b).unwrap();([m.bbox.min.x, m.bbox.min.y, m.bbox.min.z], [m.bbox.max.x, m.bbox.max.y, m.bbox.max.z])}@@ -31,7 +31,7 @@ fn cylinder_base_expressions_follow_parameters() {// And it survives a save and reopen.let text = s.doc.to_json();assert!(text.contains("basin_width/2"), "{text}");- let s2 = Session::new(solvecraft_doc::Document::from_json(&text).unwrap());+ let s2 = Session::new(solidcraft_doc::Document::from_json(&text).unwrap());let (lo, _) = bbox(&s2, "Pin");assert!(near(lo, [25.0, 5.0, -2.0]), "{lo:?}");}diff --git a/crates/engine/src/tests/robustness.rs b/crates/engine/src/tests/robustness.rsindex 1d3e3c711e..a9de30d3a5 100644--- a/crates/engine/src/tests/robustness.rs+++ b/crates/engine/src/tests/robustness.rs@@ -1,4 +1,4 @@-//! Cases found by the robustness runs (`solvecraft-cli fuzz`, docs/robustness.md), cut down to+//! Cases found by the robustness runs (`solidcraft-cli fuzz`, docs/robustness.md), cut down to//! the steps that matter, and a fixed set of seeds that must keep running clean.use std::f64::consts::PI;@@ -114,7 +114,7 @@ fn samples_build_without_panics() {}fn total_volume(s: &Session) -> f64 {- s.model.state().bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).map(|m| m.volume).unwrap_or(0.0)).sum()+ s.model.state().bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).map(|m| m.volume).unwrap_or(0.0)).sum()}/// Volume of a box L×W×H with its vertical edges rounded (R) and its bottom loop filleteddiff --git a/crates/engine/src/tests/xz_plane.rs b/crates/engine/src/tests/xz_plane.rsindex 741a9008cb..82f428943b 100644--- a/crates/engine/src/tests/xz_plane.rs+++ b/crates/engine/src/tests/xz_plane.rs@@ -63,9 +63,9 @@ fn positive_extrude_from_xz_goes_plus_y() {#[test]fn format_5_xz_design_opens_where_it_was_saved() {- let dir = std::env::temp_dir().join(format!("solvecraft-xz78-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-xz78-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();- let path = dir.join("old-xz.solvecraft");+ let path = dir.join("old-xz.solidcraft");let mut s = Session::default();build(&mut s);run(&mut s, "file.save_as", json!({"path": path.to_string_lossy()}));@@ -73,7 +73,7 @@ fn format_5_xz_design_opens_where_it_was_saved() {// normal −Y), which is what a build before format 6 wrote and evaluated.let mut v: Value = serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();assert!(v.to_string().contains("\"XZ\""), "the saved design names the XZ plane");- v["format"] = Value::from("solvecraft/5");+ v["format"] = Value::from("solidcraft/5");std::fs::write(&path, v.to_string()).unwrap();let mut old = Session::default();@@ -86,10 +86,10 @@ fn format_5_xz_design_opens_where_it_was_saved() {expect(&bodies(&mut old), &want);// Saving the migrated design writes the current format and keeps the geometry.- let resaved = dir.join("resaved.solvecraft");+ let resaved = dir.join("resaved.solidcraft");run(&mut old, "file.save_as", json!({"path": resaved.to_string_lossy()}));let text = std::fs::read_to_string(&resaved).unwrap();- assert!(text.contains(&format!("\"solvecraft/{}\"", solvecraft_doc::format::FORMAT)), "resaved at the current format");+ assert!(text.contains(&format!("\"solidcraft/{}\"", solidcraft_doc::format::FORMAT)), "resaved at the current format");let mut again = Session::default();run(&mut again, "doc.open", json!({"path": resaved.to_string_lossy()}));expect(&bodies(&mut again), &want);diff --git a/crates/engine/src/view.rs b/crates/engine/src/view.rsindex ee1bed259a..8ea78f6a2f 100644--- a/crates/engine/src/view.rs+++ b/crates/engine/src/view.rs@@ -4,15 +4,15 @@use std::sync::Arc;-use solvecraft_geom::{Aabb3, Plane, Vec3};-use solvecraft_render::{Camera, Rgb, Scene, SceneLine, SceneMesh};-use solvecraft_sketch::Sketch;+use solidcraft_geom::{Aabb3, Plane, Vec3};+use solidcraft_render::{Camera, Rgb, Scene, SceneLine, SceneMesh};+use solidcraft_sketch::Sketch;use crate::{Sel, Session};/// Colours (shared with the GPU viewport).pub mod colors {- use solvecraft_render::Rgb;+ use solidcraft_render::Rgb;pub const BODY: Rgb = Rgb(176, 186, 198);pub const BODY_SELECTED: Rgb = Rgb(110, 170, 235);pub const EDGE: Rgb = Rgb(40, 44, 52);@@ -36,7 +36,7 @@ pub mod colors {pub const BG_TOP: Rgb = Rgb(240, 243, 247);pub const BG_BOTTOM: Rgb = Rgb(203, 210, 221);/// What the section cap is tinted toward.- pub const SECTION_CAP: Rgb = solvecraft_render::SECTION_CAP;+ pub const SECTION_CAP: Rgb = solidcraft_render::SECTION_CAP;}/// Bounds of everything visible.@@ -143,7 +143,7 @@ pub fn sketch_lines_with_sampler(/// constrained individually).pub fn sketch_point_visible(sk: &Sketch, i: usize) -> bool {match sk.points.get(i).and_then(|p| p.link.as_deref()) {- Some(l) => sk.link(l).is_none_or(|l| l.kind != solvecraft_sketch::LinkKind::Text),+ Some(l) => sk.link(l).is_none_or(|l| l.kind != solidcraft_sketch::LinkKind::Text),None => true,}}@@ -261,7 +261,7 @@ pub fn scene_with_section_and_sketch_sampler(/// Where the plane through `o` with normal `n` cuts a mesh: one segment per crossed triangle,/// nudged a hair to the kept side (so the clip leaves them drawn).-pub fn section_segments(m: &solvecraft_geom::Mesh, o: Vec3, n: Vec3) -> Vec<(Vec3, Vec3)> {+pub fn section_segments(m: &solidcraft_geom::Mesh, o: Vec3, n: Vec3) -> Vec<(Vec3, Vec3)> {let eps = 1e-4 * (1.0 + m.bounds().diagonal());let mut out = Vec::new();for t in &m.triangles {@@ -290,7 +290,7 @@ pub fn sketch_shown(s: &Session, id: u64) -> bool {/// Is a sketch used by a later feature?pub fn sketch_consumed(s: &Session, id: u64) -> bool {- use solvecraft_doc::FeatureKind;+ use solidcraft_doc::FeatureKind;s.doc.features.iter().any(|f| matches!(f.kind, FeatureKind::Extrude { sketch, .. } | FeatureKind::Revolve { sketch, .. } if sketch == id))}@@ -311,7 +311,7 @@ pub fn construction_planes(s: &Session) -> Vec<(u64, String, Plane)> {constructs(s).into_iter().filter_map(|(id, name, g)| match g {- solvecraft_doc::construct::ConstructGeom::Plane(p) => Some((id, name, p)),+ solidcraft_doc::construct::ConstructGeom::Plane(p) => Some((id, name, p)),_ => None,}).collect()@@ -322,7 +322,7 @@ pub fn construction_axes(s: &Session) -> Vec<(u64, String, Vec3, Vec3)> {constructs(s).into_iter().filter_map(|(id, name, g)| match g {- solvecraft_doc::construct::ConstructGeom::Axis { origin, dir } => Some((id, name, origin, dir)),+ solidcraft_doc::construct::ConstructGeom::Axis { origin, dir } => Some((id, name, origin, dir)),_ => None,}).collect()@@ -333,25 +333,25 @@ pub fn construction_points(s: &Session) -> Vec<(u64, String, Vec3)> {constructs(s).into_iter().filter_map(|(id, name, g)| match g {- solvecraft_doc::construct::ConstructGeom::Point(p) => Some((id, name, p)),+ solidcraft_doc::construct::ConstructGeom::Point(p) => Some((id, name, p)),_ => None,}).collect()}/// Construction geometry of unsuppressed features, shown where its component is placed.-fn constructs(s: &Session) -> Vec<(u64, String, solvecraft_doc::construct::ConstructGeom)> {- use solvecraft_doc::construct::ConstructGeom;+fn constructs(s: &Session) -> Vec<(u64, String, solidcraft_doc::construct::ConstructGeom)> {+ use solidcraft_doc::construct::ConstructGeom;let st = s.model.state();st.construct.iter().filter_map(|c| {let f = s.doc.feature(c.feature).filter(|f| !f.suppressed)?;let m = s.doc.component_transform(f.component);- if solvecraft_doc::is_identity(&m) {+ if solidcraft_doc::is_identity(&m) {return Some((c.feature, c.name.clone(), c.geom.clone()));}- let (pt, v) = (|p: Vec3| solvecraft_doc::apply_point(&m, p), |d: Vec3| solvecraft_doc::apply_vector(&m, d));+ let (pt, v) = (|p: Vec3| solidcraft_doc::apply_point(&m, p), |d: Vec3| solidcraft_doc::apply_vector(&m, d));let g = match &c.geom {ConstructGeom::Plane(p) => ConstructGeom::Plane(Plane::new(pt(p.origin), v(p.x), v(p.y)).unwrap_or(*p)),ConstructGeom::Axis { origin, dir } => ConstructGeom::Axis { origin: pt(*origin), dir: v(*dir) },@@ -382,7 +382,7 @@ mod tests {assert!(sc.meshes.iter().any(|m| m.color == Rgb(220, 60, 40)));assert!(sc.meshes.iter().any(|m| m.face_colors.iter().any(|(_, c)| *c == Rgb(40, 170, 80))));// And the rendered picture has the green top.- let img = solvecraft_render::render(&sc, &cam, 200, 140);+ let img = solidcraft_render::render(&sc, &cam, 200, 140);assert!(img.rgba.chunks(4).any(|p| p[1] > 120 && p[0] < 90 && p[2] < 110), "no green pixels");}@@ -392,7 +392,7 @@ mod tests {let mut s = Session::default();s.execute("solid.sphere", &json!({"diameter": 20})).unwrap();let cam = home_camera(&s);- let img = solvecraft_render::render(&scene(&s, &cam), &cam, 400, 400);+ let img = solidcraft_render::render(&scene(&s, &cam), &cam, 400, 400);let dark = img.rgba.chunks(4).filter(|p| p[0] < 70 && p[1] < 70 && p[2] < 75).count();assert!(dark > 40, "silhouette pixels: {dark}");}@@ -403,11 +403,11 @@ mod tests {let mut s = Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();let cam = home_camera(&s);- let whole = solvecraft_render::render(&scene(&s, &cam), &cam, 200, 140).rgba;+ let whole = solidcraft_render::render(&scene(&s, &cam), &cam, 200, 140).rgba;s.execute("inspect.section", &json!({"plane": {"origin": [0, 15, 0], "normal": [0, -1, 0]}})).unwrap();let sc = scene(&s, &cam);assert!(sc.clip.is_some());- let cut = solvecraft_render::render(&sc, &cam, 200, 140).rgba;+ let cut = solidcraft_render::render(&sc, &cam, 200, 140).rgba;let changed = whole.chunks(4).zip(cut.chunks(4)).filter(|(a, b)| a != b).count();assert!(changed > 500, "{changed} pixels changed");}@@ -429,7 +429,7 @@ mod tests {// A marker inside the body, behind the cut face.let red = Rgb(255, 0, 0);sc.lines.push(SceneLine { points: vec![Vec3::new(5.0, 25.0, 10.0), Vec3::new(35.0, 25.0, 10.0)], color: red, width: 3.0, on_top: false });- let img = solvecraft_render::render(&sc, &cam, 300, 220);+ let img = solidcraft_render::render(&sc, &cam, 300, 220);let px = || img.rgba.chunks(4);let marker = px().filter(|p| p[0] > 200 && p[1] < 60 && p[2] < 60).count();assert_eq!(marker, 0, "fov {fov}: the inside shows through the cut face");diff --git a/crates/engine/src/view_display_tests.rs b/crates/engine/src/view_display_tests.rsindex b666c9ad38..f717a82889 100644--- a/crates/engine/src/view_display_tests.rs+++ b/crates/engine/src/view_display_tests.rs@@ -1,7 +1,7 @@use super::*;use serde_json::json;-use solvecraft_geom::Vec2;-use solvecraft_sketch::{LinkGeom, LinkKind, LinkSource};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{LinkGeom, LinkKind, LinkSource};fn line(sk: &mut Sketch, y: f64) -> usize {sk.add_line(Vec2::new(0., y), Vec2::new(2., y), None, None, None).unwrap()diff --git a/crates/geom/Cargo.toml b/crates/geom/Cargo.tomlindex 0c1976ba2d..538cd41db3 100644--- a/crates/geom/Cargo.toml+++ b/crates/geom/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-geom"+name = "solidcraft-geom"description = "SolidCraft geometry foundation: vectors, planes, frames, meshes and their measures"version.workspace = trueedition.workspace = truediff --git a/crates/geom/src/env.rs b/crates/geom/src/env.rsnew file mode 100644index 0000000000..9e68bd231c--- /dev/null+++ b/crates/geom/src/env.rs@@ -0,0 +1,55 @@+//! SolidCraft's environment variables, read in one place.+//!+//! Every variable is `SOLIDCRAFT_<NAME>`. Compatibility shim (see docs/compatibility.md): when+//! it is unset, the same variable under the product's former prefix is read instead, so+//! scripts and service files written for earlier releases keep working.++use std::ffi::OsString;++/// The current prefix.+pub const PREFIX: &str = "SOLIDCRAFT_";+/// The former prefix, read only as a fallback.+pub const LEGACY_PREFIX: &str = "SOLVECRAFT_";++/// `SOLIDCRAFT_<name>`, else the legacy `SOLVECRAFT_<name>`. `name` is the part after the+/// prefix, e.g. `"RECOVERY_DIR"`.+pub fn var_os(name: &str) -> Option<OsString> {+ lookup(name, |k| std::env::var_os(k))+}++/// [`var_os`] as UTF-8; a value that is not valid UTF-8 counts as unset.+pub fn var(name: &str) -> Option<String> {+ var_os(name).and_then(|v| v.into_string().ok())+}++fn lookup(name: &str, get: impl Fn(&str) -> Option<OsString>) -> Option<OsString> {+ get(&format!("{PREFIX}{name}")).or_else(|| get(&format!("{LEGACY_PREFIX}{name}")))+}++#[cfg(test)]+mod tests {+ use super::*;+ use std::collections::HashMap;++ fn env(pairs: &[(&str, &str)]) -> impl Fn(&str) -> Option<OsString> {+ let m: HashMap<String, OsString> = pairs.iter().map(|(k, v)| ((*k).to_string(), OsString::from(*v))).collect();+ move |k| m.get(k).cloned()+ }++ #[test]+ fn new_prefix_wins_over_legacy() {+ let get = env(&[("SOLIDCRAFT_RECOVERY_DIR", "/new"), ("SOLVECRAFT_RECOVERY_DIR", "/old")]);+ assert_eq!(lookup("RECOVERY_DIR", get), Some(OsString::from("/new")));+ }++ #[test]+ fn legacy_prefix_is_the_fallback() {+ let get = env(&[("SOLVECRAFT_CONTROL_PORT", "4000")]);+ assert_eq!(lookup("CONTROL_PORT", get), Some(OsString::from("4000")));+ }++ #[test]+ fn unset_in_both_is_none() {+ assert_eq!(lookup("WAYLAND", env(&[("OTHER", "1")])), None);+ }+}diff --git a/crates/geom/src/lib.rs b/crates/geom/src/lib.rsindex de9b3b8bd8..ec9d519b46 100644--- a/crates/geom/src/lib.rs+++ b/crates/geom/src/lib.rs@@ -1,4 +1,4 @@-//! Geometry foundation for SolveCraft: 2D/3D vectors, sketch planes, axis-aligned boxes,+//! Geometry foundation for SolidCraft: 2D/3D vectors, sketch planes, axis-aligned boxes,//! triangle meshes with their measures (volume, area, centroid), and freeform surface maths//! (B-spline basis and NURBS surfaces in [`bspline`], T-splines in [`tspline`]). Units are//! millimetres.@@ -9,6 +9,7 @@#![forbid(unsafe_code)]pub mod bspline;+pub mod env;mod mesh;mod plane;mod profile;diff --git a/crates/io/Cargo.toml b/crates/io/Cargo.tomlindex 79740f4c88..bdff015f0b 100644--- a/crates/io/Cargo.toml+++ b/crates/io/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-io"+name = "solidcraft-io"description = "SolidCraft file formats: designs (JSON), STL, OBJ, STEP and 3MF"version.workspace = trueedition.workspace = true@@ -9,9 +9,9 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }-solvecraft-kernel = { workspace = true }-solvecraft-doc = { workspace = true }+solidcraft-geom = { workspace = true }+solidcraft-kernel = { workspace = true }+solidcraft-doc = { workspace = true }thiserror = { workspace = true }zip = { workspace = true }quick-xml = { workspace = true }diff --git a/crates/io/src/dxf.rs b/crates/io/src/dxf.rsindex 9c832bff08..5e1cb3622e 100644--- a/crates/io/src/dxf.rs+++ b/crates/io/src/dxf.rs@@ -6,7 +6,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::sketch2d::{Geom2, MAX_DRAWING_BYTES, MAX_ENTITIES, bulge_arc};use crate::{IoError, Result};diff --git a/crates/io/src/legacy_dir.rs b/crates/io/src/legacy_dir.rsnew file mode 100644index 0000000000..93f7bbffcf--- /dev/null+++ b/crates/io/src/legacy_dir.rs@@ -0,0 +1,94 @@+//! First-launch adoption of a pre-rename settings or data folder. Compatibility shim (see+//! docs/compatibility.md): when the current folder doesn't exist yet and the legacy one does,+//! the legacy folder is copied over. The legacy folder is never changed or deleted, so an older+//! release installed side by side keeps working.++use std::path::Path;++/// Most files and nesting copied from a legacy folder (it holds preferences, autosaves and+/// small caches; anything bigger is not ours).+const MAX_ENTRIES: usize = 10_000;+const MAX_DEPTH: usize = 8;++/// Copy `legacy` to `current` if `current` doesn't exist and `legacy` is a folder. Returns+/// whether a copy was made. Symbolic links are skipped. A copy that fails part way leaves what+/// was copied (the next launch sees `current` and doesn't try again) and reports the error.+pub fn adopt_legacy_dir(current: &Path, legacy: &Path) -> std::io::Result<bool> {+ if current.exists() || !legacy.is_dir() || current == legacy {+ return Ok(false);+ }+ let mut budget = MAX_ENTRIES;+ copy_tree(legacy, current, 0, &mut budget)?;+ Ok(true)+}++fn copy_tree(from: &Path, to: &Path, depth: usize, budget: &mut usize) -> std::io::Result<()> {+ std::fs::create_dir_all(to)?;+ if depth >= MAX_DEPTH {+ return Ok(());+ }+ for entry in std::fs::read_dir(from)? {+ let entry = entry?;+ if *budget == 0 {+ return Ok(());+ }+ *budget -= 1;+ let kind = entry.file_type()?;+ let target = to.join(entry.file_name());+ if kind.is_dir() {+ copy_tree(&entry.path(), &target, depth + 1, budget)?;+ } else if kind.is_file() {+ std::fs::copy(entry.path(), &target)?;+ }+ }+ Ok(())+}++#[cfg(test)]+mod tests {+ use super::*;++ fn scratch(tag: &str) -> std::path::PathBuf {+ let d = std::env::temp_dir().join(format!("solidcraft-legacy-dir-{tag}-{}", std::process::id()));+ let _ = std::fs::remove_dir_all(&d);+ std::fs::create_dir_all(&d).unwrap();+ d+ }++ #[test]+ fn copies_legacy_folder_once_and_keeps_it() {+ let d = scratch("copy");+ let old = d.join("solvecraft");+ std::fs::create_dir_all(old.join("recovery")).unwrap();+ std::fs::write(old.join("graphics.json"), "{\"msaa\":8}").unwrap();+ std::fs::write(old.join("recovery").join("a.solvecraft"), "x").unwrap();+ let new = d.join("solidcraft");+ assert!(adopt_legacy_dir(&new, &old).unwrap());+ assert_eq!(std::fs::read_to_string(new.join("graphics.json")).unwrap(), "{\"msaa\":8}");+ assert!(new.join("recovery").join("a.solvecraft").is_file());+ // The legacy folder is untouched.+ assert!(old.join("graphics.json").is_file() && old.join("recovery").join("a.solvecraft").is_file());+ // Once the current folder exists, nothing is copied again.+ std::fs::write(old.join("later.json"), "{}").unwrap();+ assert!(!adopt_legacy_dir(&new, &old).unwrap());+ assert!(!new.join("later.json").exists());+ let _ = std::fs::remove_dir_all(&d);+ }++ #[test]+ fn nothing_to_adopt() {+ let d = scratch("none");+ let new = d.join("solidcraft");+ assert!(!adopt_legacy_dir(&new, &d.join("missing")).unwrap());+ assert!(!new.exists());+ // An existing current folder is never overwritten.+ let old = d.join("solvecraft");+ std::fs::create_dir_all(&old).unwrap();+ std::fs::write(old.join("p.json"), "old").unwrap();+ std::fs::create_dir_all(&new).unwrap();+ std::fs::write(new.join("p.json"), "new").unwrap();+ assert!(!adopt_legacy_dir(&new, &old).unwrap());+ assert_eq!(std::fs::read_to_string(new.join("p.json")).unwrap(), "new");+ let _ = std::fs::remove_dir_all(&d);+ }+}diff --git a/crates/io/src/lib.rs b/crates/io/src/lib.rsindex d3bbdbc21f..a1b588eeff 100644--- a/crates/io/src/lib.rs+++ b/crates/io/src/lib.rs@@ -1,4 +1,4 @@-//! File formats. Designs are saved as JSON (`.solvecraft`): the parametric document only, the+//! File formats. Designs are saved as JSON (`.solidcraft`): the parametric document only, the//! model is recomputed on load. Bodies export as STL (binary or ASCII), OBJ, STEP and 3MF; STEP//! files import as a base feature (see [`step_import_feature`]), 3MF and STL files as mesh bodies//! (see [`mesh_import_feature`]).@@ -6,6 +6,7 @@#![forbid(unsafe_code)]mod dxf;+mod legacy_dir;pub mod safe_write;mod sketch2d;mod svg;@@ -13,6 +14,7 @@ mod threemf;pub mod vfs;pub use dxf::{read_dxf, write_dxf};+pub use legacy_dir::adopt_legacy_dir;pub use safe_write::{backup_path, write_atomic};pub use sketch2d::{Geom2, MAX_DRAWING_BYTES};pub use svg::read_svg;@@ -20,26 +22,36 @@ mod obj;pub use obj::read_obj;pub use threemf::{MAX_3MF_BYTES, MeshObject, model_xml, read_3mf, weld, write_3mf};-use solvecraft_doc::{Document, ModelState};-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_doc::{Document, ModelState};+use solidcraft_geom::{Mesh, Vec3};/// Design file extension.-pub const DESIGN_EXT: &str = "solvecraft";+pub const DESIGN_EXT: &str = "solidcraft";+/// The design extension of earlier releases. Compatibility shim (docs/compatibility.md): such+/// files still open everywhere a design opens; new designs are saved as [`DESIGN_EXT`].+pub const LEGACY_DESIGN_EXT: &str = "solvecraft";+/// Every extension a design file may have, current first.+pub const DESIGN_EXTS: [&str; 2] = [DESIGN_EXT, LEGACY_DESIGN_EXT];++/// Is this a design file name (`.solidcraft`, or the legacy extension), any case?+pub fn is_design_path(path: &str) -> bool {+ std::path::Path::new(path).extension().and_then(|e| e.to_str()).is_some_and(|e| DESIGN_EXTS.iter().any(|x| e.eq_ignore_ascii_case(x)))+}/// Largest design file we read.pub const MAX_DESIGN_BYTES: usize = 256 << 20;#[derive(Debug, thiserror::Error)]pub enum IoError {- #[error("unsupported format `{0}` (use stl, obj, step, 3mf or solvecraft)")]+ #[error("unsupported format `{0}` (use stl, obj, step, 3mf or solidcraft)")]Format(String),#[error("nothing to export: the design has no bodies")]Empty,#[error("{0}")]Invalid(String),#[error(transparent)]- Kernel(#[from] solvecraft_kernel::KernelError),+ Kernel(#[from] solidcraft_kernel::KernelError),#[error(transparent)]- Doc(#[from] solvecraft_doc::DocError),+ Doc(#[from] solidcraft_doc::DocError),}pub type Result<T> = std::result::Result<T, IoError>;@@ -65,7 +77,7 @@ pub fn is_iges_path(path: &str) -> bool {pub struct StepFeature {/// Timeline name: the root product's name, else the file name.pub name: String,- pub kind: solvecraft_doc::FeatureKind,+ pub kind: solidcraft_doc::FeatureKind,/// Body names from the file (solid names, else product names).pub body_names: Vec<String>,pub warnings: Vec<String>,@@ -81,8 +93,8 @@ pub fn step_import_feature(bytes: &[u8], file: &str) -> Result<StepFeature> {// (the feature keeps that STEP text).let text = String::from_utf8_lossy(bytes).into_owned();let (text, iges_warnings) =- if is_iges_path(file) { solvecraft_kernel::iges_to_step(&text).map_err(IoError::Invalid)? } else { (text, Vec::new()) };- let imp = solvecraft_kernel::step_import_shared(&text)?;+ if is_iges_path(file) { solidcraft_kernel::iges_to_step(&text).map_err(IoError::Invalid)? } else { (text, Vec::new()) };+ let imp = solidcraft_kernel::step_import_shared(&text)?;let stem = std::path::Path::new(file).file_stem().map(|s| s.to_string_lossy().to_string())@@ -99,7 +111,7 @@ pub fn step_import_feature(bytes: &[u8], file: &str) -> Result<StepFeature> {Ok(StepFeature {name,body_names: imp.bodies.iter().map(|b| b.name.clone()).collect(),- kind: solvecraft_doc::FeatureKind::Import { file: file_name, step: text, components: imp.tree.clone() },+ kind: solidcraft_doc::FeatureKind::Import { file: file_name, step: text, components: imp.tree.clone() },warnings: iges_warnings.into_iter().chain(imp.warnings.iter().cloned()).collect(),})}@@ -113,7 +125,7 @@ pub fn is_mesh_path(path: &str) -> bool {pub struct MeshFeature {/// Timeline name: the only mesh's name, else the file name.pub name: String,- pub kind: solvecraft_doc::FeatureKind,+ pub kind: solidcraft_doc::FeatureKind,pub body_names: Vec<String>,pub warnings: Vec<String>,}@@ -143,8 +155,8 @@ pub fn mesh_import_feature(bytes: &[u8], file: &str) -> Result<MeshFeature> {// Check every mesh now, so the command fails rather than the timeline.let mut meshes = Vec::with_capacity(objects.len());for o in &objects {- solvecraft_kernel::mesh_body(&o.positions, &o.triangles).map_err(|e| IoError::Invalid(format!("mesh `{}`: {e}", o.name)))?;- meshes.push(solvecraft_doc::MeshData {+ solidcraft_kernel::mesh_body(&o.positions, &o.triangles).map_err(|e| IoError::Invalid(format!("mesh `{}`: {e}", o.name)))?;+ meshes.push(solidcraft_doc::MeshData {name: o.name.clone(),positions: o.positions.iter().flat_map(|p| [p.x, p.y, p.z]).collect(),triangles: o.triangles.iter().flatten().copied().collect(),@@ -159,7 +171,7 @@ pub fn mesh_import_feature(bytes: &[u8], file: &str) -> Result<MeshFeature> {Ok(MeshFeature {name,body_names: objects.iter().map(|o| o.name.clone()).collect(),- kind: solvecraft_doc::FeatureKind::MeshImport { file: file_name, meshes },+ kind: solidcraft_doc::FeatureKind::MeshImport { file: file_name, meshes },warnings,})}@@ -187,14 +199,14 @@ impl Format {"step" | "stp" => Format::Step,"igs" | "iges" => Format::Iges,"3mf" => Format::ThreeMf,- "solvecraft" | "json" => Format::Design,+ "solidcraft" | "solvecraft" | "json" => Format::Design,_ => return Err(IoError::Format(ext)),})}}/// Fine export mesh for a body (chord tolerance 2e-4 of its size).-pub fn export_mesh(b: &solvecraft_kernel::Body) -> Result<Mesh> {+pub fn export_mesh(b: &solidcraft_kernel::Body) -> Result<Mesh> {Ok(b.tessellate((b.size() * 2e-4).max(1e-3))?)}@@ -263,7 +275,7 @@ pub fn obj(meshes: &[(String, Mesh)]) -> String {/// Export the given bodies of a model (all when `bodies` is empty) in a format.pub fn export(state: &ModelState, bodies: &[String], format: Format, name: &str) -> Result<Vec<u8>> {- let sel: Vec<&solvecraft_doc::ModelBody> = state.bodies.iter().filter(|b| bodies.is_empty() || bodies.contains(&b.name)).collect();+ let sel: Vec<&solidcraft_doc::ModelBody> = state.bodies.iter().filter(|b| bodies.is_empty() || bodies.contains(&b.name)).collect();if sel.is_empty() {return Err(IoError::Empty);}@@ -277,16 +289,16 @@ pub fn export(state: &ModelState, bodies: &[String], format: Format, name: &str)}}Format::Step => {- let bs: Vec<solvecraft_kernel::ExportBody> =- sel.iter().map(|b| solvecraft_kernel::ExportBody { name: b.name.clone(), body: &b.body, color: b.body.color() }).collect();- let header = solvecraft_kernel::StepHeader { file_name: format!("{name}.step"), ..Default::default() };- solvecraft_kernel::step_export_bodies(&bs, &header)?.into_bytes()+ let bs: Vec<solidcraft_kernel::ExportBody> =+ sel.iter().map(|b| solidcraft_kernel::ExportBody { name: b.name.clone(), body: &b.body, color: b.body.color() }).collect();+ let header = solidcraft_kernel::StepHeader { file_name: format!("{name}.step"), ..Default::default() };+ solidcraft_kernel::step_export_bodies(&bs, &header)?.into_bytes()}Format::Iges => {- let bs: Vec<solvecraft_kernel::ExportBody> =- sel.iter().map(|b| solvecraft_kernel::ExportBody { name: b.name.clone(), body: &b.body, color: b.body.color() }).collect();- let header = solvecraft_kernel::StepHeader { file_name: format!("{name}.igs"), ..Default::default() };- solvecraft_kernel::iges_export_bodies(&bs, &header)?.into_bytes()+ let bs: Vec<solidcraft_kernel::ExportBody> =+ sel.iter().map(|b| solidcraft_kernel::ExportBody { name: b.name.clone(), body: &b.body, color: b.body.color() }).collect();+ let header = solidcraft_kernel::StepHeader { file_name: format!("{name}.igs"), ..Default::default() };+ solidcraft_kernel::iges_export_bodies(&bs, &header)?.into_bytes()}Format::ThreeMf => {let objs: Vec<MeshObject> = sel@@ -311,7 +323,7 @@ pub fn export(state: &ModelState, bodies: &[String], format: Format, name: &str).collect::<Result<_>>()?;write_3mf(&objs)?}- Format::Design => return Err(IoError::Format("solvecraft (save the document instead)".into())),+ Format::Design => return Err(IoError::Format("solidcraft (save the document instead)".into())),})}@@ -319,7 +331,7 @@ pub fn export(state: &ModelState, bodies: &[String], format: Format, name: &str)/// the component's own frame (`local` is the model before placing occurrences), and an/// assembly occurrence per component occurrence.pub fn step_assembly(doc: &Document, local: &ModelState, name: &str) -> Result<Vec<u8>> {- use solvecraft_kernel::{ExportBody, ExportProduct};+ use solidcraft_kernel::{ExportBody, ExportProduct};let mut index: std::collections::HashMap<u64, usize> = std::collections::HashMap::new();index.insert(0, 0);let mut products = vec![ExportProduct { name: doc.name.clone(), bodies: Vec::new(), children: Vec::new() }];@@ -338,8 +350,8 @@ pub fn step_assembly(doc: &Document, local: &ModelState, name: &str) -> Result<Vp.children.push((child, o.transform, o.name.clone()));}}- let header = solvecraft_kernel::StepHeader { file_name: format!("{name}.step"), ..Default::default() };- Ok(solvecraft_kernel::step_export_products(&products, 0, &header)?.into_bytes())+ let header = solidcraft_kernel::StepHeader { file_name: format!("{name}.step"), ..Default::default() };+ Ok(solidcraft_kernel::step_export_products(&products, 0, &header)?.into_bytes())}/// Read a design file's bytes.@@ -425,8 +437,8 @@ pub const MAX_STL_TRIANGLES: usize = 20_000_000;#[cfg(test)]mod tests {use super::*;- use solvecraft_doc::{FeatureKind, Model, Operation, point_expr};- use solvecraft_geom::Vec3;+ use solidcraft_doc::{FeatureKind, Model, Operation, point_expr};+ use solidcraft_geom::Vec3;fn model() -> (Document, Model) {let mut doc = Document::new("t");@@ -472,11 +484,11 @@ mod tests {fn mesh_volume(bytes: &[u8]) -> f64 {let f = mesh_import_feature(bytes, "x.stl").unwrap();- let solvecraft_doc::FeatureKind::MeshImport { meshes, .. } = f.kind else { panic!() };+ let solidcraft_doc::FeatureKind::MeshImport { meshes, .. } = f.kind else { panic!() };let m = &meshes[0];let pos: Vec<Vec3> = m.positions.chunks(3).map(|c| Vec3::new(c[0], c[1], c[2])).collect();let tris: Vec<[u32; 3]> = m.triangles.chunks(3).map(|c| [c[0], c[1], c[2]]).collect();- solvecraft_kernel::measure(&solvecraft_kernel::mesh_body(&pos, &tris).unwrap()).unwrap().volume+ solidcraft_kernel::measure(&solidcraft_kernel::mesh_body(&pos, &tris).unwrap()).unwrap().volume}/// STL quirks: a binary header starting with "solid", a zero triangle count, garbage@@ -542,6 +554,10 @@ mod tests {assert!(step_import_feature(b"ISO-10303-21;", "x.step").is_err());assert!(step_import_feature(&[0xff, 0xfe, 0x00], "x.step").is_err());assert!(Format::from_name("a.dwg").is_err());+ // Compatibility shim: the legacy design extension is still a design.+ assert_eq!(Format::from_name("old.solvecraft").unwrap(), Format::Design);+ assert_eq!(Format::from_name("new.solidcraft").unwrap(), Format::Design);+ assert!(is_design_path("/d/old.SOLVECRAFT") && is_design_path("new.solidcraft") && !is_design_path("a.step"));assert!(read_stl(&[0u8; 10]).is_err());let mut fake = vec![0u8; 84];fake[80..84].copy_from_slice(&u32::MAX.to_le_bytes());@@ -624,7 +640,7 @@ mod tests {assert_eq!(a.name, b.name);assert!(b.body.is_mesh() && b.body.is_closed_mesh(), "{} is not watertight", b.name);let v_stl = stl_volume(&export(&st, std::slice::from_ref(&a.name), Format::StlBinary, "t").unwrap());- let v = solvecraft_kernel::measure(&b.body).unwrap().volume;+ let v = solidcraft_kernel::measure(&b.body).unwrap().volume;assert!((v - v_stl).abs() <= 1e-6 * v_stl.abs(), "{}: {v} vs {v_stl}", a.name);}// Mesh bodies export again (3MF, STL, OBJ) but not as STEP.diff --git a/crates/io/src/obj.rs b/crates/io/src/obj.rsindex 03cad1dc54..f09e4e8b03 100644--- a/crates/io/src/obj.rs+++ b/crates/io/src/obj.rs@@ -3,7 +3,7 @@//! are split into fans. Texture coordinates, normals and materials are ignored. The file is//! untrusted: counts are capped and bad lines become warnings.-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::threemf::MeshObject;use crate::{IoError, Result};diff --git a/crates/io/src/safe_write.rs b/crates/io/src/safe_write.rsindex 2f6fb41e81..a256758088 100644--- a/crates/io/src/safe_write.rs+++ b/crates/io/src/safe_write.rs@@ -114,7 +114,7 @@ mod tests {use super::*;fn dir(tag: &str) -> PathBuf {- let d = std::env::temp_dir().join(format!("solvecraft-safe-write-{tag}-{}", std::process::id()));+ let d = std::env::temp_dir().join(format!("solidcraft-safe-write-{tag}-{}", std::process::id()));let _ = fs::remove_dir_all(&d);fs::create_dir_all(&d).unwrap();d@@ -123,7 +123,7 @@ mod tests {#[test]fn replaces_and_keeps_a_backup() {let d = dir("bak");- let p = d.join("a.solvecraft");+ let p = d.join("a.solidcraft");write_atomic(&p, b"one", true).unwrap();assert!(!backup_path(&p).exists(), "nothing to back up the first time");write_atomic(&p, b"two", true).unwrap();@@ -139,7 +139,7 @@ mod tests {#[test]fn a_save_stopped_part_way_keeps_the_old_file() {let d = dir("stop");- let p = d.join("a.solvecraft");+ let p = d.join("a.solidcraft");write_atomic(&p, b"old", true).unwrap();for stop in [Step::TempWritten, Step::BackupWritten, Step::Replaced] {write_steps(&p, b"new content", true, Some(stop)).unwrap();@@ -160,7 +160,7 @@ mod tests {#[test]fn a_failed_write_leaves_the_target() {let d = dir("fail");- let p = d.join("missing-dir").join("a.solvecraft");+ let p = d.join("missing-dir").join("a.solidcraft");assert!(write_atomic(&p, b"x", true).is_err());assert!(!p.exists());let _ = fs::remove_dir_all(&d);diff --git a/crates/io/src/sketch2d.rs b/crates/io/src/sketch2d.rsindex 3edf811c6d..df0e587174 100644--- a/crates/io/src/sketch2d.rs+++ b/crates/io/src/sketch2d.rs@@ -1,7 +1,7 @@//! 2D drawing exchange for sketches: DXF (ASCII, read and write) and SVG (read). Readers produce//! plain 2D geometry in millimetres; the engine turns it into sketch curves.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;/// One imported 2D entity (millimetres, y up).#[derive(Clone, Debug, PartialEq)]diff --git a/crates/io/src/svg.rs b/crates/io/src/svg.rsindex 6206914ede..052935f0df 100644--- a/crates/io/src/svg.rs+++ b/crates/io/src/svg.rs@@ -5,7 +5,7 @@use quick_xml::Reader;use quick_xml::events::{BytesStart, Event};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::sketch2d::{Geom2, MAX_DRAWING_BYTES, MAX_ENTITIES};use crate::{IoError, Result};diff --git a/crates/io/src/threemf.rs b/crates/io/src/threemf.rsindex d790032718..4a513a3d4b 100644--- a/crates/io/src/threemf.rs+++ b/crates/io/src/threemf.rs@@ -12,7 +12,7 @@ use std::io::{Cursor, Read, Write};use quick_xml::Reader;use quick_xml::events::{BytesStart, Event};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::{IoError, Result};diff --git a/crates/io/src/vfs.rs b/crates/io/src/vfs.rsindex b1c2c343ac..493d68dd4d 100644--- a/crates/io/src/vfs.rs+++ b/crates/io/src/vfs.rs@@ -113,7 +113,7 @@ pub fn read_to_string(path: &str, max: usize) -> Result<String> {mod tests {#[test]fn files_round_trip() {- let dir = std::env::temp_dir().join(format!("solvecraft-vfs-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-vfs-{}", std::process::id()));let _ = std::fs::create_dir_all(&dir);let p = dir.join("a.txt").to_string_lossy().to_string();assert!(!super::exists(&p));@@ -140,7 +140,7 @@ mod tests {assert!(e.to_string().contains("not a regular file"), "{e}");assert!(super::read_to_string("/dev/zero", 1024).is_err());- let dir = std::env::temp_dir().join(format!("solvecraft-vfs-fifo-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-vfs-fifo-{}", std::process::id()));let _ = std::fs::create_dir_all(&dir);let fifo = dir.join("p");let made = std::process::Command::new("mkfifo").arg(&fifo).status().map(|s| s.success()).unwrap_or(false);diff --git a/crates/kernel/Cargo.toml b/crates/kernel/Cargo.tomlindex 9d9d776ec6..5bcb302b1b 100644--- a/crates/kernel/Cargo.toml+++ b/crates/kernel/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-kernel"+name = "solidcraft-kernel"description = "SolidCraft B-rep kernel boundary: solids, extrude/revolve/booleans/fillets, tessellation, measures and STEP, behind our own API (implemented with truck)"version.workspace = trueedition.workspace = true@@ -9,7 +9,7 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }+solidcraft-geom = { workspace = true }serde = { workspace = true }thiserror = { workspace = true }log = { workspace = true }diff --git a/crates/kernel/src/blend.rs b/crates/kernel/src/blend.rsindex 1e920e53e9..0d5a65e414 100644--- a/crates/kernel/src/blend.rs+++ b/crates/kernel/src/blend.rs@@ -9,7 +9,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3, v3};@@ -1177,7 +1177,7 @@ fn chamfer_tool_sides(cur: &Body, p: Vec3, s: f64, sides: Option<(ChamferSide, blet ext = (s * 2.0).max(size * 0.01) * (1.0 + 0.093 * (k % 5) as f64);// Cross-section at p0 - d*ext, in a plane with normal d.let base = f.p0 - f.d * ext;- let plane = solvecraft_geom::Plane::from_normal(base, f.d).ok_or_else(|| KernelError::Failed("chamfer plane".into()))?;+ let plane = solidcraft_geom::Plane::from_normal(base, f.d).ok_or_else(|| KernelError::Failed("chamfer plane".into()))?;let a = base + f.t1 * s1;let b = base + f.t2 * s2;let ab = (a - b).normalized().ok_or_else(|| KernelError::Failed("chamfer".into()))?;@@ -1194,15 +1194,15 @@ fn chamfer_tool_sides(cur: &Body, p: Vec3, s: f64, sides: Option<(ChamferSide, breturn Err(unsupported("chamfers ending at a concave corner"));}}- let loc: Vec<solvecraft_geom::Vec2> = [a_ext, b_ext, e_far].iter().map(|q| plane.to_local(*q)).collect();- let mut lp = solvecraft_geom::Loop2::polygon(&loc);+ let loc: Vec<solidcraft_geom::Vec2> = [a_ext, b_ext, e_far].iter().map(|q| plane.to_local(*q)).collect();+ let mut lp = solidcraft_geom::Loop2::polygon(&loc);// The chamfer plane is swept from the segment a → b: first, or last once turned round.let mut chamfer_segment = 0;if lp.signed_area() < 0.0 {lp = lp.reversed();chamfer_segment = lp.segs.len().saturating_sub(1);}- let region = solvecraft_geom::Region2 { outer: lp, holes: vec![] };+ let region = solidcraft_geom::Region2 { outer: lp, holes: vec![] };let body = crate::build::extrude(&plane, &[region], 0.0, len + 2.0 * ext)?.pop().ok_or_else(|| KernelError::Failed("chamfer tool".into()))?;let face = body.history().and_then(|h| h.faces.iter().position(|f| f.origins == [FaceOrigin::Profile { segment: chamfer_segment }]));Ok(Cutter { body, face, edge })@@ -1211,7 +1211,7 @@ fn chamfer_tool_sides(cur: &Body, p: Vec3, s: f64, sides: Option<(ChamferSide, b#[cfg(test)]mod tests {use super::*;- use solvecraft_geom::{Loop2, Plane, Region2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2};#[test]fn chamfer_extension_cannot_cross_a_hole_and_reenter_the_face() {diff --git a/crates/kernel/src/blend_corner.rs b/crates/kernel/src/blend_corner.rsindex 0180f2cb24..e71ca7b601 100644--- a/crates/kernel/src/blend_corner.rs+++ b/crates/kernel/src/blend_corner.rs@@ -17,7 +17,7 @@use std::collections::{HashMap, HashSet};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::blend::{plane_normal, unsupported, vtx};@@ -1142,7 +1142,7 @@ mod tests {#[test]fn sloped_basin_rim_fillets() {- use solvecraft_geom::{Loop2, Plane, Vec2};+ use solidcraft_geom::{Loop2, Plane, Vec2};let rectangle = |x0, y0, x1, y1| Loop2::polygon(&[Vec2::new(x0, y0), Vec2::new(x1, y0), Vec2::new(x1, y1), Vec2::new(x0, y1)]);let slab = box_solid(Vec3::ZERO, Vec3::new(100.0, 60.0, 30.0)).unwrap();let pocket =@@ -1170,7 +1170,7 @@ mod tests {#[test]fn sloped_rim_fillets_cannot_extend_outside_the_material() {- use solvecraft_geom::{Loop2, Plane, Vec2};+ use solidcraft_geom::{Loop2, Plane, Vec2};for margin in [0.5, 1.0] {let rectangle = |x0, y0, x1, y1| Loop2::polygon(&[Vec2::new(x0, y0), Vec2::new(x1, y0), Vec2::new(x1, y1), Vec2::new(x0, y1)]);let slab = box_solid(Vec3::ZERO, Vec3::new(100.0, 60.0, 30.0)).unwrap();@@ -1190,7 +1190,7 @@ mod tests {#[test]fn chamfers_meet_on_unequal_sloped_rim_walls() {- use solvecraft_geom::{Loop2, Plane, Vec2};+ use solidcraft_geom::{Loop2, Plane, Vec2};for margin in [1.0, 4.0] {let rectangle = |x0, y0, x1, y1| Loop2::polygon(&[Vec2::new(x0, y0), Vec2::new(x1, y0), Vec2::new(x1, y1), Vec2::new(x0, y1)]);let slab = box_solid(Vec3::ZERO, Vec3::new(100.0, 60.0, 30.0)).unwrap();@@ -1229,7 +1229,7 @@ mod tests {#[test]fn equal_slope_rim_loops_cannot_escape_the_face() {- use solvecraft_geom::{Loop2, Plane, Vec2};+ use solidcraft_geom::{Loop2, Plane, Vec2};let rectangle = |x0, y0, x1, y1| Loop2::polygon(&[Vec2::new(x0, y0), Vec2::new(x1, y0), Vec2::new(x1, y1), Vec2::new(x0, y1)]);let slab = box_solid(Vec3::ZERO, Vec3::new(100.0, 60.0, 30.0)).unwrap();let pocket =diff --git a/crates/kernel/src/blend_variable.rs b/crates/kernel/src/blend_variable.rsindex 02c5aa448a..798c2e7418 100644--- a/crates/kernel/src/blend_variable.rs+++ b/crates/kernel/src/blend_variable.rs@@ -9,7 +9,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::blend::{plane_normal, rebuild_face, unsupported, vtx};diff --git a/crates/kernel/src/body.rs b/crates/kernel/src/body.rsindex c523fe601b..5ca3adf6d8 100644--- a/crates/kernel/src/body.rs+++ b/crates/kernel/src/body.rs@@ -1,5 +1,5 @@use serde::Serialize;-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use truck_meshalgo::prelude::*;use truck_modeling as mt;@@ -42,12 +42,12 @@ pub struct Body {#[derive(Clone, Debug, PartialEq)]pub enum FaceSource {- ExtrudeSide { segment: solvecraft_geom::Seg2, plane: Option<solvecraft_geom::Plane>, coalesced: bool },- CertifiedExtrudeSide { producer: u64, sketch: u64, curve: String, plane: Option<solvecraft_geom::Plane> },- ExtrudeCap { high: bool, region: solvecraft_geom::Region2, plane: solvecraft_geom::Plane },- CertifiedExtrudeCap { producer: u64, sketch: u64, high: bool, outer: Vec<String>, holes: Vec<Vec<String>>, plane: solvecraft_geom::Plane },- Box { producer: Option<u64>, axis: u8, high: bool, plane: solvecraft_geom::Plane },- ShellPlanar { producer: Option<u64>, source: Box<FaceSource>, inner: bool, plane: solvecraft_geom::Plane },+ ExtrudeSide { segment: solidcraft_geom::Seg2, plane: Option<solidcraft_geom::Plane>, coalesced: bool },+ CertifiedExtrudeSide { producer: u64, sketch: u64, curve: String, plane: Option<solidcraft_geom::Plane> },+ ExtrudeCap { high: bool, region: solidcraft_geom::Region2, plane: solidcraft_geom::Plane },+ CertifiedExtrudeCap { producer: u64, sketch: u64, high: bool, outer: Vec<String>, holes: Vec<Vec<String>>, plane: solidcraft_geom::Plane },+ Box { producer: Option<u64>, axis: u8, high: bool, plane: solidcraft_geom::Plane },+ ShellPlanar { producer: Option<u64>, source: Box<FaceSource>, inner: bool, plane: solidcraft_geom::Plane },Imported { item: u64, face: u64, payload_sha256: Option<String>, producer: Option<u64> },}@@ -55,7 +55,7 @@ pub type CapSignature = (Vec<String>, Vec<Vec<String>>);type FaceSources = std::sync::Arc<Vec<Option<FaceSource>>>;impl FaceSource {- fn plane_mut(&mut self) -> Option<&mut solvecraft_geom::Plane> {+ fn plane_mut(&mut self) -> Option<&mut solidcraft_geom::Plane> {match self {Self::ExtrudeSide { plane, .. } | Self::CertifiedExtrudeSide { plane, .. } => plane.as_mut(),Self::ExtrudeCap { plane, .. } | Self::CertifiedExtrudeCap { plane, .. } | Self::Box { plane, .. } | Self::ShellPlanar { plane, .. } => {@@ -494,7 +494,7 @@ impl Body {}/// An exact construction/import plane; never inferred from tessellation.- pub fn face_plane(&self, index: usize) -> Option<solvecraft_geom::Plane> {+ pub fn face_plane(&self, index: usize) -> Option<solidcraft_geom::Plane> {if index >= 50_000 {return None;}@@ -510,7 +510,7 @@ impl Body {}/// Exact current planar surface for an explicitly fixed snapshot, without source lineage.- pub fn planar_face(&self, index: usize) -> Option<solvecraft_geom::Plane> {+ pub fn planar_face(&self, index: usize) -> Option<solidcraft_geom::Plane> {if index >= 50_000 {return None;}@@ -519,7 +519,7 @@ impl Body {mt::Surface::Plane(plane) => {let u = plane.u_axis();let v = plane.v_axis();- solvecraft_geom::Plane::new(from_p3(plane.origin()), Vec3::new(u.x, u.y, u.z), Vec3::new(v.x, v.y, v.z))+ solidcraft_geom::Plane::new(from_p3(plane.origin()), Vec3::new(u.x, u.y, u.z), Vec3::new(v.x, v.y, v.z))}_ => None,});@@ -610,7 +610,7 @@ impl Body {let mut sources = sources.as_ref().clone();for source in sources.iter_mut().flatten() {if let Some(plane) = source.plane_mut() {- *plane = solvecraft_geom::Plane::new(+ *plane = solidcraft_geom::Plane::new(vector(plane.origin) + translation,vector(plane.x),vector(plane.y) * if reflected { -1. } else { 1. },@@ -741,7 +741,7 @@ impl Body {/// Characteristic size (bounding box diagonal) for tolerances.pub fn size(&self) -> f64 {- let mut b = solvecraft_geom::Aabb3::EMPTY;+ let mut b = solidcraft_geom::Aabb3::EMPTY;if let Some(m) = &self.mesh {for p in &m.positions {b.add(*p);diff --git a/crates/kernel/src/body_lump_tests.rs b/crates/kernel/src/body_lump_tests.rsindex 8cbab6fa15..1480aea722 100644--- a/crates/kernel/src/body_lump_tests.rs+++ b/crates/kernel/src/body_lump_tests.rs@@ -224,7 +224,7 @@ fn shortcut_clearance_refuses_curved_contact_hidden_between_mesh_vertices() {}fn certified_lump_witness() -> Body {- use solvecraft_geom::{Loop2, Plane, Region2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2};// The current trimmed lower prism: a rectangular tool with a circular stop// removed. Its cap footprint differs materially from the original sketch.let region = Region2 {diff --git a/crates/kernel/src/boolean_diagnostics.rs b/crates/kernel/src/boolean_diagnostics.rsindex c33bb3412e..ba357b7f5c 100644--- a/crates/kernel/src/boolean_diagnostics.rs+++ b/crates/kernel/src/boolean_diagnostics.rs@@ -158,7 +158,7 @@ mod tests {#[test]fn exact_operations_and_failed_calls_have_no_retry_report() {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;let body = crate::box_solid(Vec3::ZERO, Vec3::new(10., 10., 10.)).unwrap();let other = crate::box_solid(Vec3::new(5., 0., 0.), Vec3::new(15., 10., 10.)).unwrap();let (result, diagnostics) = capture_boolean_diagnostics(|| crate::boolean(&body, &other, crate::BoolOp::Union));diff --git a/crates/kernel/src/boolean_history_tests.rs b/crates/kernel/src/boolean_history_tests.rsindex 900fe78c20..8e5d6e914c 100644--- a/crates/kernel/src/boolean_history_tests.rs+++ b/crates/kernel/src/boolean_history_tests.rs@@ -4,7 +4,7 @@use std::collections::BTreeSet;-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::body::Body;use crate::history::{Change, EdgeOrigin, FaceOrigin, History, Side};@@ -427,7 +427,7 @@ fn faceted_tool() {/// sewn as one face (coalesced), which comes from the operand walls under it in every slab.#[test]fn coalesced_stepped_walls() {- use solvecraft_geom::{Loop2, Plane, Region2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2};for curved in [true, false] {let (outer, inner) = if curved {(Loop2::circle(Vec2::ZERO, 10.0), Loop2::circle(Vec2::ZERO, 5.0))@@ -475,12 +475,12 @@ fn regularized_step_cut() {fn bore_union_of_a_bore_in_two_arcs_has_no_history() {let hole = crate::cylinder(Vec3::new(50.0, 40.0, -5.0), Vec3::Z, 10.0, 30.0).unwrap();let floor = boolean(&boxed(0.0, 0.0, 0.0, 100.0, 80.0, 10.0), &hole, BoolOp::Cut).unwrap().unwrap();- let centre = solvecraft_geom::Vec2::new(50.0, 40.0);- let annulus = solvecraft_geom::Region2 {- outer: solvecraft_geom::Loop2::circle(centre, 20.0),- holes: vec![solvecraft_geom::Loop2::circle(centre, 10.0).reversed()],+ let centre = solidcraft_geom::Vec2::new(50.0, 40.0);+ let annulus = solidcraft_geom::Region2 {+ outer: solidcraft_geom::Loop2::circle(centre, 20.0),+ holes: vec![solidcraft_geom::Loop2::circle(centre, 10.0).reversed()],};- let ring = crate::extrude(&solvecraft_geom::Plane::XY, &[annulus], -5.0, 2.0).unwrap().remove(0);+ let ring = crate::extrude(&solidcraft_geom::Plane::XY, &[annulus], -5.0, 2.0).unwrap().remove(0);let r = crate::coplanar::bore_union(&floor, &ring, &|_| true).expect("the bores are recut");assert!(r.history().is_none());}diff --git a/crates/kernel/src/boolean_record.rs b/crates/kernel/src/boolean_record.rsindex 2f3060a193..8c7673aa20 100644--- a/crates/kernel/src/boolean_record.rs+++ b/crates/kernel/src/boolean_record.rs@@ -7,7 +7,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling as mt;use crate::Result;diff --git a/crates/kernel/src/bore_guard.rs b/crates/kernel/src/bore_guard.rsindex d173aacced..533cb85a1f 100644--- a/crates/kernel/src/bore_guard.rs+++ b/crates/kernel/src/bore_guard.rs@@ -3,7 +3,7 @@//! cylinder recut from silently removing an additional material boundary that//! the fallback's coarse material samples do not see.use crate::body::{Body, from_p3};-use solvecraft_geom::{Plane, Seg2, Vec3};+use solidcraft_geom::{Plane, Seg2, Vec3};use std::collections::HashSet;use truck_modeling as mt;diff --git a/crates/kernel/src/bore_union_tests.rs b/crates/kernel/src/bore_union_tests.rsindex 2dd199d05a..54915b5a8f 100644--- a/crates/kernel/src/bore_union_tests.rs+++ b/crates/kernel/src/bore_union_tests.rs@@ -1,6 +1,6 @@#![allow(clippy::unwrap_used, clippy::panic)]use crate::*;-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};fn fixture() -> (Body, Body, Vec3, f64) {let slope = 1f64.to_radians().tan();@@ -62,7 +62,7 @@ fn thin_connected_web_between_bore_stations_survives_union() {let direct = crate::coplanar::bore_union(&target, &ring, &accept);eprintln!("direct fallback result={}", direct.is_some());let public = boolean(&target, &ring, BoolOp::Union);- if let Ok(dir) = std::env::var("SOLVECRAFT_BORE_AUDIT_DIR") {+ if let Ok(dir) = solidcraft_geom::env::var("BORE_AUDIT_DIR").ok_or(()) {let dir = std::path::Path::new(&dir);std::fs::create_dir_all(dir).unwrap();std::fs::write(dir.join("target-with-web.step"), step_export(&[&target], "target with web").unwrap()).unwrap();diff --git a/crates/kernel/src/build.rs b/crates/kernel/src/build.rsindex fa3f432915..ade9ef80ac 100644--- a/crates/kernel/src/build.rs+++ b/crates/kernel/src/build.rs@@ -1,7 +1,7 @@//! Building bodies: extrude and revolve planar regions, primitives.use mt::builder;-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};use truck_modeling as mt;use crate::body::{Body, Solid, from_p3, p3, v3};@@ -136,7 +136,7 @@ fn region_ok(r: &Region2) -> Result<()> {}Seg2::Cubic { p0, p1, p2, p3 } => p0.is_finite() && p1.is_finite() && p2.is_finite() && p3.is_finite(),Seg2::Conic { a, apex, b, w } => a.is_finite() && apex.is_finite() && b.is_finite() && w.is_finite() && w > 1e-9,- Seg2::Bezier { n, p } => (4..=solvecraft_geom::MAX_BEZIER_DEGREE as u8).contains(&n) && p.iter().all(|q| q.is_finite()),+ Seg2::Bezier { n, p } => (4..=solidcraft_geom::MAX_BEZIER_DEGREE as u8).contains(&n) && p.iter().all(|q| q.is_finite()),};if !ok {return Err(KernelError::Invalid("non-finite profile".into()));diff --git a/crates/kernel/src/coplanar.rs b/crates/kernel/src/coplanar.rsindex fdd6d12e6e..cd2816b647 100644--- a/crates/kernel/src/coplanar.rs+++ b/crates/kernel/src/coplanar.rs@@ -13,7 +13,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3, v3};@@ -232,14 +232,14 @@ fn slab_beyond(n: Vec3, d: f64, depth: f64, extent: f64) -> Result<Body> {let u = n.any_perp();let w = n.cross(u);let o = n * d;- let pl = solvecraft_geom::Plane::new(o, u, w).ok_or_else(|| KernelError::Failed("slab plane".into()))?;- let sq = solvecraft_geom::Loop2::polygon(&[- solvecraft_geom::Vec2::new(-extent, -extent),- solvecraft_geom::Vec2::new(extent, -extent),- solvecraft_geom::Vec2::new(extent, extent),- solvecraft_geom::Vec2::new(-extent, extent),+ let pl = solidcraft_geom::Plane::new(o, u, w).ok_or_else(|| KernelError::Failed("slab plane".into()))?;+ let sq = solidcraft_geom::Loop2::polygon(&[+ solidcraft_geom::Vec2::new(-extent, -extent),+ solidcraft_geom::Vec2::new(extent, -extent),+ solidcraft_geom::Vec2::new(extent, extent),+ solidcraft_geom::Vec2::new(-extent, extent),]);- let r = solvecraft_geom::Region2 { outer: sq, holes: vec![] };+ let r = solidcraft_geom::Region2 { outer: sq, holes: vec![] };crate::extrude(&pl, &[r], 0.0, depth)?.pop().ok_or_else(|| KernelError::Failed("slab".into()))}diff --git a/crates/kernel/src/curveblend.rs b/crates/kernel/src/curveblend.rsindex 1a78504120..758852b44e 100644--- a/crates/kernel/src/curveblend.rs+++ b/crates/kernel/src/curveblend.rs@@ -8,7 +8,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Solid, from_p3, p3};diff --git a/crates/kernel/src/delete_face.rs b/crates/kernel/src/delete_face.rsindex 9620fda1c8..3da5f11316 100644--- a/crates/kernel/src/delete_face.rs+++ b/crates/kernel/src/delete_face.rs@@ -11,7 +11,7 @@use std::collections::{BTreeSet, HashMap};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3};@@ -301,7 +301,7 @@ pub fn delete_faces(body: &Body, faces: &[usize]) -> Result<Body> {#[cfg(test)]mod tests {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;use super::delete_faces;use crate::{BoolOp, boolean, box_solid, chamfer, cylinder, fillet};diff --git a/crates/kernel/src/emboss.rs b/crates/kernel/src/emboss.rsindex fec9639fb5..92c076a066 100644--- a/crates/kernel/src/emboss.rs+++ b/crates/kernel/src/emboss.rs@@ -5,7 +5,7 @@ use crate::numbered::NumberedRegion;use crate::offset::{Surf, surf_of};use crate::record::Operand;use crate::{KernelError, Result, guard};-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};use truck_modeling::{self as mt, Transformed, builder};fn fail(s: &str) -> KernelError {diff --git a/crates/kernel/src/face_source_tests.rs b/crates/kernel/src/face_source_tests.rsindex 1851b35b63..506b31086f 100644--- a/crates/kernel/src/face_source_tests.rs+++ b/crates/kernel/src/face_source_tests.rs@@ -1,5 +1,5 @@use crate::{FaceSource, extrude, transform_matrix};-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};fn assert_exact_planes(body: &crate::Body) {let mesh = body.tessellate(0.001).unwrap();diff --git a/crates/kernel/src/freeform.rs b/crates/kernel/src/freeform.rsindex bb6555a19b..c860332d10 100644--- a/crates/kernel/src/freeform.rs+++ b/crates/kernel/src/freeform.rs@@ -1,7 +1,7 @@//! Free-form profile edges: Béziers (cubic and higher) as B-spline curves and conics as rational quadratic//! NURBS curves (exact ellipses, parabolas and hyperbolas from sketches).-use solvecraft_geom::{Plane, Seg2};+use solidcraft_geom::{Plane, Seg2};use truck_modeling as mt;use crate::body::p3;@@ -21,7 +21,7 @@ pub(crate) fn edge(plane: &Plane, s: &Seg2, a: &mt::Vertex, b: &mt::Vertex) -> OSome(mt::Edge::new(a, b, mt::Curve::NurbsCurve(curve)))}Seg2::Bezier { n, ref p } => {- let inner = p.get(1..(n as usize).clamp(1, solvecraft_geom::MAX_BEZIER_DEGREE))?;+ let inner = p.get(1..(n as usize).clamp(1, solidcraft_geom::MAX_BEZIER_DEGREE))?;Some(mt::builder::bezier(a, b, inner.iter().map(|q| p3(plane.to_world(*q))).collect()))}Seg2::Line { .. } | Seg2::Arc { .. } => None,diff --git a/crates/kernel/src/fuzz.rs b/crates/kernel/src/fuzz.rsindex 8f8af63f34..d02678b01c 100644--- a/crates/kernel/src/fuzz.rs+++ b/crates/kernel/src/fuzz.rs@@ -1,9 +1,9 @@-//! Robustness checks on random inputs (`solvecraft-cli fuzz`, docs/robustness.md): a small+//! Robustness checks on random inputs (`solidcraft-cli fuzz`, docs/robustness.md): a small//! seeded random generator, and the boolean volume identity on random pairs of primitives//! placed on a coarse grid, so coincident faces and tangencies come up often.use serde::Serialize;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::{Body, BoolOp, boolean, box_solid, cylinder, measure, sphere, torus};diff --git a/crates/kernel/src/heal.rs b/crates/kernel/src/heal.rsindex 52fefac9cc..52da22e2d0 100644--- a/crates/kernel/src/heal.rs+++ b/crates/kernel/src/heal.rs@@ -3,7 +3,7 @@use std::collections::{BTreeSet, HashMap};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Solid, from_p3};diff --git a/crates/kernel/src/helix.rs b/crates/kernel/src/helix.rsindex 127808598b..26eec48301 100644--- a/crates/kernel/src/helix.rs+++ b/crates/kernel/src/helix.rs@@ -1,7 +1,7 @@//! Helical sweeps (coils, springs) and lofts to a point (pyramids, cones).use mt::builder;-use solvecraft_geom::{Loop2, Mesh, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Mesh, Plane, Region2, Seg2, Vec2, Vec3};use truck_modeling as mt;use crate::body::{Body, Solid, p3};@@ -118,7 +118,7 @@ fn smooth_helix(plane: &Plane, profile: &NumberedLoop, o: Vec3, k: Vec3, pitch:}let n = ((turns * STATIONS_PER_TURN).ceil() as usize).clamp(4, 4800);let total = std::f64::consts::TAU * turns;- let at = |i: usize, q: solvecraft_geom::Vec2| {+ let at = |i: usize, q: solidcraft_geom::Vec2| {let a = total * i as f64 / n as f64;let w = plane.to_world(q);o + rot(w - o, k, a) + k * (pitch * a / std::f64::consts::TAU)@@ -251,7 +251,7 @@ pub fn loft_to_point(plane: &Plane, lp: &Loop2, apex: Vec3) -> Result<Body> {#[cfg(test)]mod tests {use super::*;- use solvecraft_geom::Vec2;+ use solidcraft_geom::Vec2;#[test]fn coil_volume_is_section_times_helix_length() {diff --git a/crates/kernel/src/history_tests.rs b/crates/kernel/src/history_tests.rsindex 86471d760d..ec563f313f 100644--- a/crates/kernel/src/history_tests.rs+++ b/crates/kernel/src/history_tests.rs@@ -1,4 +1,4 @@-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use super::{Change, EdgeOrigin, EdgeProv, FaceOrigin, FaceProv, History, Side};use crate::{Body, box_solid, transform};diff --git a/crates/kernel/src/iges_in/tests.rs b/crates/kernel/src/iges_in/tests.rsindex 04fe04112c..c071ada373 100644--- a/crates/kernel/src/iges_in/tests.rs+++ b/crates/kernel/src/iges_in/tests.rs@@ -1,6 +1,6 @@use super::*;use crate::{Body, BoolOp, ExportBody, StepHeader, boolean, box_solid, cylinder, fillet, iges_export_bodies, measure, sphere, torus};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;fn rel(a: f64, b: f64) -> f64 {(a - b).abs() / b.abs().max(1e-9)@@ -146,7 +146,7 @@ fn trimmed_surfaces_sew_into_a_solid() {fn a_drill_point_round_trips_through_iges() {// A blind hole with a cone tip: the tip's face closes at its apex (its seam runs out to the// apex and straight back).- use solvecraft_geom::{Loop2, Plane, Region2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2};let plate = box_solid(Vec3::new(-20.0, -15.0, 0.0), Vec3::new(20.0, 15.0, 10.0)).unwrap();let profile =Region2 { outer: Loop2::polygon(&[Vec2::new(0.0, 2.0), Vec2::new(4.0, 5.0), Vec2::new(4.0, 11.0), Vec2::new(0.0, 11.0)]), holes: vec![] };diff --git a/crates/kernel/src/lib.rs b/crates/kernel/src/lib.rsindex accc86fe68..ec231d65ab 100644--- a/crates/kernel/src/lib.rs+++ b/crates/kernel/src/lib.rs@@ -1,6 +1,6 @@//! The B-rep kernel boundary.//!-//! Everything SolveCraft does with solids goes through this crate: building bodies from planar+//! Everything SolidCraft does with solids goes through this crate: building bodies from planar//! regions (extrude, revolve) and primitives, booleans, fillets and chamfers, tessellation,//! measurement and STEP export and import. The implementation uses the `truck` crates (Apache-2.0; see//! `plan/adr/0001-geometry-kernel.md`) plus our own local operations (edge fillets anddiff --git a/crates/kernel/src/lip.rs b/crates/kernel/src/lip.rsindex 7a53698a19..599a65250b 100644--- a/crates/kernel/src/lip.rs+++ b/crates/kernel/src/lip.rs@@ -3,7 +3,7 @@//! directly from the body's faces (the band's walls continue the walls below, which a boolean//! union can't join: their faces would coincide).-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3, v3};diff --git a/crates/kernel/src/loopblend.rs b/crates/kernel/src/loopblend.rsindex c5d488e469..4b9f5b1807 100644--- a/crates/kernel/src/loopblend.rs+++ b/crates/kernel/src/loopblend.rs@@ -7,7 +7,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Solid, from_p3, p3, v3};diff --git a/crates/kernel/src/measure.rs b/crates/kernel/src/measure.rsindex 7c4b73801b..0f2e2e78a6 100644--- a/crates/kernel/src/measure.rs+++ b/crates/kernel/src/measure.rs@@ -1,5 +1,5 @@use serde::Serialize;-use solvecraft_geom::{Aabb3, Mesh, Vec3};+use solidcraft_geom::{Aabb3, Mesh, Vec3};use crate::Result;use crate::body::Body;diff --git a/crates/kernel/src/mesh_convert.rs b/crates/kernel/src/mesh_convert.rsindex ce342dfca6..6ea13565c3 100644--- a/crates/kernel/src/mesh_convert.rs+++ b/crates/kernel/src/mesh_convert.rs@@ -3,7 +3,7 @@use std::collections::BTreeMap;-use solvecraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};use crate::{Body, KernelError, Result};@@ -72,7 +72,7 @@ fn weld(mesh: &crate::meshbody::TriMesh, tolerance: f64) -> Result<Body> {if mesh.triangles.len() > MAX_TRIANGLES || mesh.positions.len() > MAX_TRIANGLES * 3 {return Err(invalid("mesh exceeds the conversion budget"));}- let bounds = mesh.positions.iter().fold(solvecraft_geom::Aabb3::EMPTY, |mut b, p| {+ let bounds = mesh.positions.iter().fold(solidcraft_geom::Aabb3::EMPTY, |mut b, p| {b.add(*p);b});@@ -131,7 +131,7 @@ fn weld(mesh: &crate::meshbody::TriMesh, tolerance: f64) -> Result<Body> {fn extrusion(mesh: &crate::meshbody::TriMesh, axis: Vec3, tolerance: f64) -> Result<Option<Body>> {let (lo, hi) = mesh.positions.iter().map(|p| p.dot(axis)).fold((f64::INFINITY, f64::NEG_INFINITY), |(lo, hi), h| (lo.min(h), hi.max(h)));let height = hi - lo;- let bounds = mesh.positions.iter().fold(solvecraft_geom::Aabb3::EMPTY, |mut b, p| {+ let bounds = mesh.positions.iter().fold(solidcraft_geom::Aabb3::EMPTY, |mut b, p| {b.add(*p);b});@@ -226,7 +226,7 @@ fn extrusion(mesh: &crate::meshbody::TriMesh, axis: Vec3, tolerance: f64) -> Res}let p = plane.to_local(*p);if !boundary_segments.iter().any(|&(a, b)| {- solvecraft_geom::Seg2::Line { a, b }.point_at(solvecraft_geom::Seg2::Line { a, b }.closest_param(p)).dist(p) <= epsilon * 3.+ solidcraft_geom::Seg2::Line { a, b }.point_at(solidcraft_geom::Seg2::Line { a, b }.closest_param(p)).dist(p) <= epsilon * 3.}) {return Ok(None);}@@ -377,7 +377,7 @@ fn fit_loop(points: &[Vec2], tolerance: f64, epsilon: f64) -> Loop2 {}let remove = (0..n).find(|&i| {let (Some(a), Some(b), Some(c)) = (points.get((i + n - 1) % n), points.get(i), points.get((i + 1) % n)) else { return false };- let edge = solvecraft_geom::Seg2::Line { a: *a, b: *c };+ let edge = solidcraft_geom::Seg2::Line { a: *a, b: *c };edge.point_at(edge.closest_param(*b)).dist(*b) <= linear_tolerance});let Some(index) = remove else { break };diff --git a/crates/kernel/src/meshbody.rs b/crates/kernel/src/meshbody.rsindex 0d96b99b9e..718f2489f4 100644--- a/crates/kernel/src/meshbody.rs+++ b/crates/kernel/src/meshbody.rs@@ -4,7 +4,7 @@use std::collections::HashMap;use std::sync::Arc;-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::body::Body;use crate::{KernelError, Result};diff --git a/crates/kernel/src/modify_history_tests.rs b/crates/kernel/src/modify_history_tests.rsindex eab98323d2..e6e1896f03 100644--- a/crates/kernel/src/modify_history_tests.rs+++ b/crates/kernel/src/modify_history_tests.rs@@ -2,7 +2,7 @@//! face and edge origin checked against the geometry of the operands (in tests only: the history//! itself is recorded, never sampled), and the exact origins asserted where the outcome is known.-use solvecraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};use crate::body::Body;use crate::boolean_record::tests::{self, Reach, changes, to_edge, to_face};diff --git a/crates/kernel/src/numbered.rs b/crates/kernel/src/numbered.rsindex 3c895b2d26..2fbb48f7f1 100644--- a/crates/kernel/src/numbered.rs+++ b/crates/kernel/src/numbered.rs@@ -6,7 +6,7 @@use std::collections::BTreeSet;-use solvecraft_geom::{Loop2, Region2, Seg2};+use solidcraft_geom::{Loop2, Region2, Seg2};/// The loops of `regions` in profile order: each region's outer loop, then its holes.pub(crate) fn profile_loops(regions: &[Region2]) -> impl Iterator<Item = &Loop2> {diff --git a/crates/kernel/src/offset.rs b/crates/kernel/src/offset.rsindex b8225c595f..66f006d5a8 100644--- a/crates/kernel/src/offset.rs+++ b/crates/kernel/src/offset.rs@@ -9,7 +9,7 @@use std::collections::HashMap;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3};@@ -1056,7 +1056,7 @@ pub(crate) fn offset_body(b: &Body, shift: impl Fn(usize, Vec3) -> f64) -> Resul/// outward normal by −h·tan(angle), so planes tilt and cylinders become cones. The other/// faces must be caps square to `pull`; the topology is kept, and the result's history is over/// `[b]` (each face and edge the one it was moved from).-pub(crate) fn draft_walls(b: &Body, chosen: &[usize], neutral: &solvecraft_geom::Plane, pull: Vec3, angle: f64) -> Result<Body> {+pub(crate) fn draft_walls(b: &Body, chosen: &[usize], neutral: &solidcraft_geom::Plane, pull: Vec3, angle: f64) -> Result<Body> {let faces: Vec<mt::Face> = b.solid.face_iter().cloned().collect();let size = b.size();let tol = (size * 1e-7).max(1e-9);diff --git a/crates/kernel/src/ops.rs b/crates/kernel/src/ops.rsindex 50abc25c3d..6ca87e09eb 100644--- a/crates/kernel/src/ops.rs+++ b/crates/kernel/src/ops.rs@@ -1,7 +1,7 @@//! Operations on bodies: booleans and rigid transforms.use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling as mt;use std::collections::HashMap;@@ -51,7 +51,7 @@ fn halton(mut i: usize, b: usize) -> f64 {/// Fraction of sample points where `result` disagrees with `op` applied to `a` and `b`/// (membership by ray parity). Samples cover the overlap box densely and the union box lightly.-fn mismatch(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh, result: &solvecraft_geom::Mesh, op: BoolOp) -> Option<f64> {+fn mismatch(a: &solidcraft_geom::Mesh, b: &solidcraft_geom::Mesh, result: &solidcraft_geom::Mesh, op: BoolOp) -> Option<f64> {if a.triangles.len() + b.triangles.len() + result.triangles.len() > 60_000 {return None;}@@ -64,7 +64,7 @@ fn mismatch(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh, result: &solve// operands' boundaries, where ray parity cannot classify membership reliably.let gap = all.diagonal().max(1.0) * 1e-9;if hi.x - lo.x > gap && hi.y - lo.y > gap && hi.z - lo.z > gap {- boxes.push((solvecraft_geom::Aabb3 { min: lo, max: hi }, 900));+ boxes.push((solidcraft_geom::Aabb3 { min: lo, max: hi }, 900));}let (ia_idx, ib_idx, ir_idx) = (a.inside_index(), b.inside_index(), result.inside_index());let (mut n, mut bad) = (0usize, 0usize);@@ -89,12 +89,12 @@ fn mismatch(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh, result: &solve/// How one body sits relative to another, from sample points: (fraction of `b`'s samples/// inside `a`, fraction of `a`'s samples inside `b`).-fn overlap(a: &solvecraft_geom::Mesh, b: &solvecraft_geom::Mesh) -> Option<(f64, f64)> {+fn overlap(a: &solidcraft_geom::Mesh, b: &solidcraft_geom::Mesh) -> Option<(f64, f64)> {if a.triangles.len() + b.triangles.len() > 80_000 {return None;}let (ia, ib) = (a.inside_index(), b.inside_index());- let frac = |inner: &solvecraft_geom::Mesh, inner_i: &solvecraft_geom::InsideIndex, outer_i: &solvecraft_geom::InsideIndex| -> Option<f64> {+ let frac = |inner: &solidcraft_geom::Mesh, inner_i: &solidcraft_geom::InsideIndex, outer_i: &solidcraft_geom::InsideIndex| -> Option<f64> {let bx = inner.bounds();let s = bx.size();let (mut n, mut hit) = (0usize, 0usize);@@ -120,8 +120,8 @@ fn trivial(a: &Body,b: &Body,op: BoolOp,- ma: &solvecraft_geom::Mesh,- mb: &solvecraft_geom::Mesh,+ ma: &solidcraft_geom::Mesh,+ mb: &solidcraft_geom::Mesh,counts: &[(usize, usize)],) -> Option<Option<Body>> {let (b_in_a, a_in_b) = overlap(ma, mb)?;@@ -286,14 +286,14 @@ fn planar_surfaces_match(a: &Body, b: &Body, result: &Body) -> bool {/// Smallest side of the box where the bodies' vertex boxes overlap (infinite when they don't).fn meeting_size(a: &Body, b: &Body) -> f64 {let bbox = |x: &Body| {- let mut bb = solvecraft_geom::Aabb3::EMPTY;+ let mut bb = solidcraft_geom::Aabb3::EMPTY;for v in x.solid.vertex_iter() {bb.add(from_p3(v.point()));}bb};let (ba, bb) = (bbox(a), bbox(b));- let s = solvecraft_geom::Aabb3 { min: ba.min.max(bb.min), max: ba.max.min(bb.max) }.size();+ let s = solidcraft_geom::Aabb3 { min: ba.min.max(bb.min), max: ba.max.min(bb.max) }.size();if s.x > 0.0 && s.y > 0.0 && s.z > 0.0 { s.x.min(s.y).min(s.z) } else { f64::INFINITY }}@@ -660,7 +660,7 @@ pub fn union_apart(bodies: &[Body]) -> Result<Option<Body>> {return Ok(None);}let pad = Vec3::new(1.0, 1.0, 1.0) * (2.0 * tol);- boxes.push(solvecraft_geom::Aabb3 { min: bb.min - pad, max: bb.max + pad });+ boxes.push(solidcraft_geom::Aabb3 { min: bb.min - pad, max: bb.max + pad });}// Sweep along x: only boxes whose x ranges overlap are compared.let mut order: Vec<usize> = (0..boxes.len()).collect();@@ -851,7 +851,7 @@ pub fn transform(body: &Body, translate: Vec3, origin: Vec3, axis: Vec3, angle:/// Split a body with a plane: the parts on the positive and the negative side of the plane/// (only the non-empty ones).-pub fn split_by_plane(body: &Body, plane: &solvecraft_geom::Plane) -> Result<Vec<Body>> {+pub fn split_by_plane(body: &Body, plane: &solidcraft_geom::Plane) -> Result<Vec<Body>> {let mut out = Vec::new();for positive in [true, false] {out.extend(half_space(body, plane, positive)?);@@ -861,26 +861,26 @@ pub fn split_by_plane(body: &Body, plane: &solvecraft_geom::Plane) -> Result<Vec/// The part of a body on one side of a plane (`None` when nothing is there): its intersection/// with [`half_box`] (whose history it carries, over the body and the box).-pub(crate) fn half_space(body: &Body, plane: &solvecraft_geom::Plane, positive: bool) -> Result<Option<Body>> {+pub(crate) fn half_space(body: &Body, plane: &solidcraft_geom::Plane, positive: bool) -> Result<Option<Body>> {boolean(body, &half_box(body, plane, positive)?, BoolOp::Intersect)}/// A box covering everything of `body` on one side of a plane, its start cap in the plane.-pub(crate) fn half_box(body: &Body, plane: &solvecraft_geom::Plane, positive: bool) -> Result<Body> {+pub(crate) fn half_box(body: &Body, plane: &solidcraft_geom::Plane, positive: bool) -> Result<Body> {body.require_brep("split")?;let size = body.size();- let mut bb = solvecraft_geom::Aabb3::EMPTY;+ let mut bb = solidcraft_geom::Aabb3::EMPTY;for v in body.solid.vertex_iter() {bb.add(crate::body::from_p3(v.point()));}let reach = (bb.diagonal() + plane.origin.dist(bb.center())) * 2.0 + size;let c = plane.to_local(bb.center());- let sq = solvecraft_geom::Region2 {- outer: solvecraft_geom::Loop2::polygon(&[- solvecraft_geom::Vec2::new(c.x - reach, c.y - reach),- solvecraft_geom::Vec2::new(c.x + reach, c.y - reach),- solvecraft_geom::Vec2::new(c.x + reach, c.y + reach),- solvecraft_geom::Vec2::new(c.x - reach, c.y + reach),+ let sq = solidcraft_geom::Region2 {+ outer: solidcraft_geom::Loop2::polygon(&[+ solidcraft_geom::Vec2::new(c.x - reach, c.y - reach),+ solidcraft_geom::Vec2::new(c.x + reach, c.y - reach),+ solidcraft_geom::Vec2::new(c.x + reach, c.y + reach),+ solidcraft_geom::Vec2::new(c.x - reach, c.y + reach),]),holes: vec![],};diff --git a/crates/kernel/src/planar_regularize.rs b/crates/kernel/src/planar_regularize.rsindex 79593d2b4a..b899ff87f7 100644--- a/crates/kernel/src/planar_regularize.rs+++ b/crates/kernel/src/planar_regularize.rs@@ -3,7 +3,7 @@use super::{Body, from_p3};use crate::history::FaceOrigin;use crate::{Result, guard};-use solvecraft_geom::Plane;+use solidcraft_geom::Plane;use std::collections::{BTreeMap, HashMap, HashSet};use std::sync::Arc;use truck_modeling as mt;@@ -83,8 +83,8 @@ fn merged_face(faces: &[&mt::Face], members: &[usize], plane: Plane, eligible: &let edge = boundary.get(index)?.clone();let da = from_p3(edge.front().point()) - origin;let db = from_p3(edge.back().point()) - origin;- let a = solvecraft_geom::Vec2::new(da.dot(plane.x), da.dot(plane.y));- let b = solvecraft_geom::Vec2::new(db.dot(plane.x), db.dot(plane.y));+ let a = solidcraft_geom::Vec2::new(da.dot(plane.x), da.dot(plane.y));+ let b = solidcraft_geom::Vec2::new(db.dot(plane.x), db.dot(plane.y));let term = a.cross(b);area += term;magnitude += term.abs();@@ -200,7 +200,7 @@ impl Body {.and_then(|source| {if generated {match source {- super::FaceSource::ExtrudeSide { segment: solvecraft_geom::Seg2::Line { .. }, plane: Some(p), .. } => Some(*p),+ super::FaceSource::ExtrudeSide { segment: solidcraft_geom::Seg2::Line { .. }, plane: Some(p), .. } => Some(*p),_ => None,}} else {@@ -327,7 +327,7 @@ mod tests {#[test]fn alternate_adjacency_path_cannot_remove_protected_internal_edge() {let vertices: Vec<_> =- (0..9).map(|i| mt::builder::vertex(super::super::p3(solvecraft_geom::Vec3::new((i % 3) as f64, (i / 3) as f64, 0.)))).collect();+ (0..9).map(|i| mt::builder::vertex(super::super::p3(solidcraft_geom::Vec3::new((i % 3) as f64, (i / 3) as f64, 0.)))).collect();let mut edges = HashMap::<(usize, usize), mt::Edge>::new();let mut faces = Vec::new();for (x, y) in [(0, 0), (1, 0), (0, 1), (1, 1)] {diff --git a/crates/kernel/src/planar_sources.rs b/crates/kernel/src/planar_sources.rsindex 7faa92eb16..f51352b66c 100644--- a/crates/kernel/src/planar_sources.rs+++ b/crates/kernel/src/planar_sources.rs@@ -2,7 +2,7 @@//! No tessellated face names, centroids, or nearest-plane choices are used.use super::{Body, FaceSource, from_p3};use crate::{KernelError, Result, guard};-use solvecraft_geom::{Plane, Vec3};+use solidcraft_geom::{Plane, Vec3};use std::sync::Arc;use truck_modeling as mt;@@ -463,7 +463,7 @@ mod tests {#[test]fn pocket_cut_removes_internal_wall_faces_in_actual_topology() {- use solvecraft_geom::{Loop2, Region2, Vec2};+ use solidcraft_geom::{Loop2, Region2, Vec2};let region = Region2 {outer: Loop2::polygon(&[Vec2::new(-30., -27.), Vec2::new(30., -27.), Vec2::new(30., 27.), Vec2::new(-30., 27.)]),holes: vec![],diff --git a/crates/kernel/src/polybool.rs b/crates/kernel/src/polybool.rsindex 8b0016e2bc..35b9d819d6 100644--- a/crates/kernel/src/polybool.rs+++ b/crates/kernel/src/polybool.rs@@ -5,7 +5,7 @@use std::collections::{BTreeSet, HashMap};-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, edge_order, from_p3, p3};@@ -415,17 +415,17 @@ fn sliced_planar_boolean(a: &Body, b: &Body, op: BoolOp) -> Option<Result<Optionlet tol = (a.size() * 1e-3).max(1e-3);let infos = a.faces(tol).ok()?;let mesh = a.tessellate(tol).ok()?;- let mut curved: HashMap<u32, solvecraft_geom::Aabb3> = HashMap::new();+ let mut curved: HashMap<u32, solidcraft_geom::Aabb3> = HashMap::new();for (t, fi) in mesh.triangles.iter().zip(&mesh.tri_face) {if infos.get(*fi as usize)?.plane_normal.is_some() {continue;}- let bx = curved.entry(*fi).or_insert(solvecraft_geom::Aabb3::EMPTY);+ let bx = curved.entry(*fi).or_insert(solidcraft_geom::Aabb3::EMPTY);for p in mesh.tri(t)? {bx.add(p);}}- let mut tool = solvecraft_geom::Aabb3::EMPTY;+ let mut tool = solidcraft_geom::Aabb3::EMPTY;for p in pb.iter().flat_map(|p| &p.v) {tool.add(*p);}@@ -481,7 +481,7 @@ fn sliced_planar_boolean(a: &Body, b: &Body, op: BoolOp) -> Option<Result<Optionlet mut outside: Vec<Traced> = Vec::new();for (slot, (cut, keep_positive)) in [(2, (lo, true)), (4, (hi, false))] {let Some(x) = cut else { continue };- let plane = solvecraft_geom::Plane::new(axis * x, u, w).ok_or_else(|| fail("plane"))?;+ let plane = solidcraft_geom::Plane::new(axis * x, u, w).ok_or_else(|| fail("plane"))?;let (away, kept) = (crate::ops::half_box(&middle.0, &plane, !keep_positive)?, crate::ops::half_box(&middle.0, &plane, keep_positive)?);let (h_away, h_kept) = (recorded::kept(&away, slot, n), recorded::kept(&kept, slot + 1, n));if let Some(o) = crate::ops::boolean(&middle.0, &away, BoolOp::Intersect)? {diff --git a/crates/kernel/src/polyhedron.rs b/crates/kernel/src/polyhedron.rsindex abe8f561e8..9f6d53786b 100644--- a/crates/kernel/src/polyhedron.rs+++ b/crates/kernel/src/polyhedron.rs@@ -5,7 +5,7 @@use std::collections::HashMap;-use solvecraft_geom::{Plane, Vec3};+use solidcraft_geom::{Plane, Vec3};use truck_modeling::{self as mt, builder};use crate::body::{Body, Solid, from_p3, p3, v3};diff --git a/crates/kernel/src/prism.rs b/crates/kernel/src/prism.rsindex f4b410af20..1c17d03728 100644--- a/crates/kernel/src/prism.rs+++ b/crates/kernel/src/prism.rs@@ -6,7 +6,7 @@//! Stepped extrusions (case floors and walls) use sections between every cap level, so a//! circular boss can meet the rim without shifting either operand off its exact plane.-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};use truck_modeling as mt;use crate::body::{Body, from_p3};diff --git a/crates/kernel/src/prism_curve.rs b/crates/kernel/src/prism_curve.rsindex b71add6f2b..6e303a1cb7 100644--- a/crates/kernel/src/prism_curve.rs+++ b/crates/kernel/src/prism_curve.rs@@ -1,7 +1,7 @@//! Whole-span certificates for analytic planar prism boundaries.//! Samples propose a circle; only positive rational Bernstein bounds accept it.use crate::body::from_p3;-use solvecraft_geom::{Plane, Seg2, Vec2};+use solidcraft_geom::{Plane, Seg2, Vec2};use truck_modeling::{self as mt, BoundedCurve, Invertible, ParametricCurve};const MAX_DEGREE: usize = 32;@@ -334,7 +334,7 @@ mod tests {let cap = builder::try_attach_plane(&[wire]).unwrap();let body = crate::body::Body::new(builder::tsweep(&cap, mt::Vector3::new(0., 0., 1.))).unwrap();assert!(body.validity().is_empty());- let tool = crate::box_solid(solvecraft_geom::Vec3::new(-1., -4., 0.5), solvecraft_geom::Vec3::new(12., 7., 1.)).unwrap();+ let tool = crate::box_solid(solidcraft_geom::Vec3::new(-1., -4., 0.5), solidcraft_geom::Vec3::new(12., 7., 1.)).unwrap();assert!(crate::prism::prism_boolean(&body, &tool, crate::BoolOp::Cut).is_none(),"an actual extruded aliased spline cap must reach the generic route"diff --git a/crates/kernel/src/prism_lineage.rs b/crates/kernel/src/prism_lineage.rsindex fdca95a49d..f82cd5f149 100644--- a/crates/kernel/src/prism_lineage.rs+++ b/crates/kernel/src/prism_lineage.rs@@ -7,7 +7,7 @@use std::collections::{BTreeSet, HashMap};-use solvecraft_geom::{Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Plane, Region2, Vec2, Vec3};use truck_modeling as mt;use super::{Index, Section, Tag, dist_to, inside};diff --git a/crates/kernel/src/prism_measure.rs b/crates/kernel/src/prism_measure.rsindex 8b3ed66b3c..3f17768bb6 100644--- a/crates/kernel/src/prism_measure.rs+++ b/crates/kernel/src/prism_measure.rs@@ -1,7 +1,7 @@//! Independent current-geometry intervals for uniform prisms.//! These are not mesh measurements or certificates of construction history.use crate::body::from_p3;-use solvecraft_geom::{Plane, Seg2, Vec2, Vec3};+use solidcraft_geom::{Plane, Seg2, Vec2, Vec3};use truck_modeling as mt;#[derive(Clone, Copy, Debug)]@@ -750,7 +750,7 @@ mod tests {use mt::builder;fn drilled(radius: f64, shift: f64) -> crate::Body {- use solvecraft_geom::{Loop2, Region2};+ use solidcraft_geom::{Loop2, Region2};let region = Region2 {outer: Loop2::polygon(&[Vec2::ZERO, Vec2::new(20., 0.), Vec2::new(20., 20.), Vec2::new(0., 20.)]),holes: vec![Loop2::circle(Vec2::new(10. + shift, 10.), radius)],@@ -874,7 +874,7 @@ mod tests {let arc = Seg2::Arc { center: Vec2::ZERO, radius: 6., start: 0., sweep: std::f64::consts::TAU };let retraced = CapLoop { segments: vec![arc, arc.reversed(), arc], area: Interval::enclosing(36. * std::f64::consts::PI, 1e-8).unwrap() };assert!(circle(&retraced, 1e-6).is_none());- let region = solvecraft_geom::Loop2::polygon(&[Vec2::ZERO, Vec2::new(20., 0.), Vec2::new(20., 20.), Vec2::new(0., 20.)]);+ let region = solidcraft_geom::Loop2::polygon(&[Vec2::ZERO, Vec2::new(20., 0.), Vec2::new(20., 20.), Vec2::new(0., 20.)]);let doubled = CapLoop { segments: region.segs.iter().chain(®ion.segs).copied().collect(), area: Interval::enclosing(800., 1e-8).unwrap() };assert!(separated_material(&[doubled], 1e-6, &mut 16_000_000).is_none());let thin = crate::box_solid(Vec3::ZERO, Vec3::new(20., 20., 1e-5)).unwrap();diff --git a/crates/kernel/src/provenance.rs b/crates/kernel/src/provenance.rsindex 62898dadc8..354625b63a 100644--- a/crates/kernel/src/provenance.rs+++ b/crates/kernel/src/provenance.rs@@ -10,7 +10,7 @@use std::collections::BTreeSet;-use solvecraft_geom::{Mesh, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Mesh, Plane, Region2, Seg2, Vec2, Vec3};use crate::Result;use crate::body::Body;@@ -396,7 +396,7 @@ pub fn compose(prov: &mut History, operand: usize, tool: &[FaceOrigin]) {#[cfg(test)]mod tests {- use solvecraft_geom::Vec3;+ use solidcraft_geom::Vec3;use super::{Change, FaceOrigin, trace};use crate::{BoolOp, boolean, box_solid, cylinder};@@ -457,7 +457,7 @@ mod tests {#[test]fn provenance_of_sweeps_blends_and_shells() {- use solvecraft_geom::{Loop2, Plane, Region2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2};use super::{History, blend_origins, compose, extrude_origins, offset_origins, revolve_origins};let plane = Plane::named("XY").unwrap();diff --git a/crates/kernel/src/record_tests.rs b/crates/kernel/src/record_tests.rsindex ec917fea71..35fd1b5d5b 100644--- a/crates/kernel/src/record_tests.rs+++ b/crates/kernel/src/record_tests.rs@@ -3,7 +3,7 @@use std::f64::consts::{FRAC_PI_2, PI, TAU};-use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2, Vec3};use crate::body::Body;use crate::build::PathSeg;diff --git a/crates/kernel/src/regularization_protection_tests.rs b/crates/kernel/src/regularization_protection_tests.rsindex 05c3534a38..5bcab8ab8e 100644--- a/crates/kernel/src/regularization_protection_tests.rs+++ b/crates/kernel/src/regularization_protection_tests.rs@@ -1,5 +1,5 @@use super::*;-use solvecraft_geom::Plane;+use solidcraft_geom::Plane;fn stamped_stock() -> Body {crate::box_solid(Vec3::new(-20., -15., 0.), Vec3::new(20., 15., 24.)).unwrap().with_box_certificate(7).unwrap()diff --git a/crates/kernel/src/sew.rs b/crates/kernel/src/sew.rsindex 6f4b4105b5..a5835dddad 100644--- a/crates/kernel/src/sew.rs+++ b/crates/kernel/src/sew.rs@@ -7,7 +7,7 @@use std::collections::HashMap;use mt::builder;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use truck_modeling as mt;use crate::body::{Body, Solid, p3, v3};diff --git a/crates/kernel/src/shell_groups.rs b/crates/kernel/src/shell_groups.rsindex d76c829178..5d3bc1921f 100644--- a/crates/kernel/src/shell_groups.rs+++ b/crates/kernel/src/shell_groups.rs@@ -1,7 +1,7 @@//! Group disconnected material regions without moving a cavity to another enclosing shell.//! A valid shell hierarchy alternates material and void at every nesting level.-use solvecraft_geom::{Aabb3, Mesh, Vec3};+use solidcraft_geom::{Aabb3, Mesh, Vec3};use crate::{KernelError, Result};diff --git a/crates/kernel/src/smooth_edges.rs b/crates/kernel/src/smooth_edges.rsindex 4da5dd1d98..96ca9061c1 100644--- a/crates/kernel/src/smooth_edges.rs+++ b/crates/kernel/src/smooth_edges.rs@@ -1,5 +1,5 @@//! Display-only tangent joins. Unknown geometry retains its existing presentation.-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use truck_modeling as mt;use crate::body::{Body, from_p3};@@ -219,7 +219,7 @@ fn classify(body: &Body, mesh: &Mesh, mut work: usize) -> (Vec<bool>, Vec<bool>)#[allow(clippy::unwrap_used)]mod tests {use super::*;- use solvecraft_geom::{Loop2, Plane, Region2, Seg2, Vec2};+ use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2};fn circle(radius: f64, count: usize) -> Loop2 {let step = std::f64::consts::TAU / count as f64;diff --git a/crates/kernel/src/splitface.rs b/crates/kernel/src/splitface.rsindex 5b04383ee5..5c77077631 100644--- a/crates/kernel/src/splitface.rs+++ b/crates/kernel/src/splitface.rs@@ -9,7 +9,7 @@use std::collections::HashMap;use mt::{BoundedCurve, InnerSpace, MetricSpace, ParametricCurve, ParametricSurface, ParametricSurface3D, SearchNearestParameter};-use solvecraft_geom::{Plane, Seg2, Vec2, Vec3};+use solidcraft_geom::{Plane, Seg2, Vec2, Vec3};use truck_meshalgo::tessellation::RobustMeshableShape;use truck_modeling as mt;diff --git a/crates/kernel/src/step_in/tests.rs b/crates/kernel/src/step_in/tests.rsindex 4a142ff4ed..20827bc48e 100644--- a/crates/kernel/src/step_in/tests.rs+++ b/crates/kernel/src/step_in/tests.rs@@ -1,4 +1,4 @@-use solvecraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};use super::*;use crate::{BoolOp, boolean, box_solid, cylinder, extrude, fillet, measure, revolve, sphere, step_export, torus};@@ -10,8 +10,8 @@ fn rel(a: f64, b: f64) -> f64 {#[test]#[ignore = "manual STEP import timing; run without concurrent builds"]fn benchmark_independent_step_solids() {- let count = std::env::var("SOLVECRAFT_STEP_BENCH_COUNT").ok().map(|s| s.parse::<usize>().unwrap().clamp(1, 512)).unwrap_or(48);- let kind = std::env::var("SOLVECRAFT_STEP_BENCH_KIND").unwrap_or_else(|_| "cylinder".into());+ let count = solidcraft_geom::env::var("STEP_BENCH_COUNT").map(|s| s.parse::<usize>().unwrap().clamp(1, 512)).unwrap_or(48);+ let kind = solidcraft_geom::env::var("STEP_BENCH_KIND").unwrap_or_else(|| "cylinder".into());let bodies: Vec<_> = (0..count).map(|i| {let at = Vec3::new((i % 8) as f64 * 60.0, (i / 8) as f64 * 60.0, 0.0);@@ -23,7 +23,7 @@ fn benchmark_independent_step_solids() {}).collect();let text = step_export(&bodies.iter().collect::<Vec<_>>(), "independent bodies").unwrap();- if let Ok(path) = std::env::var("SOLVECRAFT_STEP_BENCH_FIXTURE") {+ if let Ok(path) = solidcraft_geom::env::var("STEP_BENCH_FIXTURE").ok_or(()) {std::fs::write(path, &text).unwrap();}let start = std::time::Instant::now();diff --git a/crates/kernel/src/step_out.rs b/crates/kernel/src/step_out.rsindex d9d4e825b7..64870acc91 100644--- a/crates/kernel/src/step_out.rs+++ b/crates/kernel/src/step_out.rs@@ -11,7 +11,7 @@use std::collections::HashMap;use std::fmt::Write as _;-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::body::Body;use crate::step_in::p21::{self, Param};@@ -1501,8 +1501,8 @@ mod tests {#[test]fn assembly_names_colours_round_trip() {use crate::{box_solid, cylinder, measure, step_import, step_validate};- let bx = box_solid(solvecraft_geom::Vec3::ZERO, solvecraft_geom::Vec3::new(10.0, 20.0, 5.0)).unwrap();- let pin = cylinder(solvecraft_geom::Vec3::ZERO, solvecraft_geom::Vec3::Z, 2.0, 8.0).unwrap();+ let bx = box_solid(solidcraft_geom::Vec3::ZERO, solidcraft_geom::Vec3::new(10.0, 20.0, 5.0)).unwrap();+ let pin = cylinder(solidcraft_geom::Vec3::ZERO, solidcraft_geom::Vec3::Z, 2.0, 8.0).unwrap();let rot90 = [[0.0, 1.0, 0.0, 0.0], [-1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [50.0, 0.0, 0.0, 1.0]];let shift = [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 5.0, 1.0]];let products = vec![@@ -1530,7 +1530,7 @@ mod tests {let m: Vec<_> = imp.bodies.iter().map(|b| measure(&b.body).unwrap()).collect();assert!((m[1].bbox.min.z - 5.0).abs() < 1e-6 && (m[1].bbox.max.z - 13.0).abs() < 1e-6);// Rotated 90° about Z and moved 50 along X: centre at (50, 0).- assert!(m[2].centroid.dist(solvecraft_geom::Vec3::new(50.0, 0.0, 4.0)) < 1e-3, "{:?}", m[2].centroid);+ assert!(m[2].centroid.dist(solidcraft_geom::Vec3::new(50.0, 0.0, 4.0)) < 1e-3, "{:?}", m[2].centroid);// Recursion and bad placements are errors.let cyc = vec![ExportProduct {name: "A".into(),diff --git a/crates/kernel/src/surface_kind.rs b/crates/kernel/src/surface_kind.rsindex b28aa9946c..a79f4128d9 100644--- a/crates/kernel/src/surface_kind.rs+++ b/crates/kernel/src/surface_kind.rs@@ -1,7 +1,7 @@//! What surface a face lies on (plane, cylinder, cone, sphere, torus), for construction//! geometry: axes through round faces, centres of spheres and tori.-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::Body;use crate::offset::{Surf, surf_of};diff --git a/crates/kernel/src/surfaces.rs b/crates/kernel/src/surfaces.rsindex 360f23ac4d..b13924822c 100644--- a/crates/kernel/src/surfaces.rs+++ b/crates/kernel/src/surfaces.rs@@ -6,7 +6,7 @@use std::collections::HashMap;use mt::{BoundedCurve, InnerSpace, MetricSpace, ParametricCurve, ParametricSurface3D, SearchNearestParameter};-use solvecraft_geom::{Plane, Region2, Vec3};+use solidcraft_geom::{Plane, Region2, Vec3};use truck_modeling as mt;use crate::body::{Body, from_p3, p3};@@ -612,7 +612,7 @@ pub fn extend(body: &Body, at: &[Vec3], distance: f64) -> Result<Body> {mod tests {use super::*;use crate::{box_solid, cylinder, measure};- use solvecraft_geom::{Loop2, Vec2};+ use solidcraft_geom::{Loop2, Vec2};fn rel(a: f64, b: f64) -> f64 {(a - b).abs() / b.abs().max(1e-9)diff --git a/crates/kernel/src/sweep_path.rs b/crates/kernel/src/sweep_path.rsindex c0099c2ae4..34f2041e90 100644--- a/crates/kernel/src/sweep_path.rs+++ b/crates/kernel/src/sweep_path.rs@@ -4,7 +4,7 @@//! between stations, mitred at the corners.use mt::builder;-use solvecraft_geom::{Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Plane, Region2, Vec2, Vec3};use truck_modeling as mt;use crate::body::{Body, p3};@@ -298,7 +298,7 @@ fn smooth_walls(plane: &Plane, profile: &NumberedLoop, st: &[Station], expected:#[cfg(test)]mod tests {- use solvecraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};+ use solidcraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};use super::sweep_path;diff --git a/crates/kernel/src/tests.rs b/crates/kernel/src/tests.rsindex 9446cb4720..a2ac4c027c 100644--- a/crates/kernel/src/tests.rs+++ b/crates/kernel/src/tests.rs@@ -1,6 +1,6 @@use std::f64::consts::PI;-use solvecraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};+use solidcraft_geom::{Loop2, Plane, Region2, Vec2, Vec3};use crate::*;@@ -130,7 +130,7 @@ fn chamfer_and_step() {let b = box_solid(Vec3::ZERO, Vec3::new(20.0, 20.0, 20.0)).unwrap();let c = chamfer(&b, &[Vec3::new(20.0, 10.0, 20.0)], 2.0).unwrap();assert!(rel(measure(&c).unwrap().volume, 8000.0 - 2.0 * 20.0) < 1e-4);- let s = step_export(&[&c], "SolveCraft").unwrap();+ let s = step_export(&[&c], "SolidCraft").unwrap();assert!(s.starts_with("ISO-10303-21;"));assert!(s.contains("MANIFOLD_SOLID_BREP") || s.contains("CLOSED_SHELL"));}@@ -668,7 +668,7 @@ fn connected_logo_join_preserves_exact_faces_at_edge_contact() {let tops =logo.faces(0.01).unwrap().iter().filter(|f| f.plane_normal.is_some_and(|n| n.z > 0.999999) && (f.centroid.z - 20.0).abs() < 1e-9).count();assert_eq!(tops, 1);- let text = step_export(&[&logo], "SolveCraft").unwrap();+ let text = step_export(&[&logo], "SolidCraft").unwrap();let imported = step_import(&text).unwrap();assert_eq!(imported.bodies.len(), 1);let roundtrip = &imported.bodies.first().unwrap().body;@@ -1407,7 +1407,7 @@ fn circle_loop_fillets_and_chamfers() {#[test]fn trimmed_revolved_faces_measure_exactly() {- use solvecraft_geom::Seg2;+ use solidcraft_geom::Seg2;use std::f64::consts::FRAC_PI_2;// A slot with concave ends sketched on the plane x = 12.5, cut 4 deep into a revolved shaft// of radius 12.5 (the cut faces' triangulation spans wide angles unless refined).@@ -1463,7 +1463,7 @@ fn shell_with_cylindrical_faces() {#[test]fn draft_of_a_round_ended_pocket() {- use solvecraft_geom::Seg2;+ use solidcraft_geom::Seg2;use std::f64::consts::FRAC_PI_2;let block = box_solid(Vec3::ZERO, Vec3::new(80.0, 60.0, 25.0)).unwrap();let segs = vec![@@ -1610,7 +1610,7 @@ fn fillet_where_a_branch_pipe_meets_a_main_pipe() {#[test]fn fillet_an_open_curved_edge() {- use solvecraft_geom::Seg2;+ use solidcraft_geom::Seg2;// A D-shaped block: the round top edge only, ending at the flat wall's sharp corners.let d = Loop2 {segs: vec![@@ -1740,7 +1740,7 @@ fn fillet_three_edges_at_a_corner() {#[test]fn shell_with_spherical_and_conical_faces() {// A cylinder capped by a hemisphere (a dome), revolved, opened at the bottom.- use solvecraft_geom::Seg2;+ use solidcraft_geom::Seg2;let xz = Plane::new(Vec3::ZERO, Vec3::X, Vec3::new(0.0, 0.0, -1.0)).unwrap();let segs = vec![Seg2::Line { a: Vec2::new(0.0, 0.0), b: Vec2::new(10.0, 0.0) },@@ -1952,7 +1952,7 @@ fn measure_of_a_body_with_many_faces() {}/// The time it takes (run alone, the suite's other tests share the machine):-/// `cargo test --release -p solvecraft-kernel perf_measure_5000_faces -- --ignored`.+/// `cargo test --release -p solidcraft-kernel perf_measure_5000_faces -- --ignored`.#[test]#[ignore]fn perf_measure_5000_faces() {diff --git a/crates/kernel/src/thread_tests.rs b/crates/kernel/src/thread_tests.rsindex ad694ad393..70a2ddd04a 100644--- a/crates/kernel/src/thread_tests.rs+++ b/crates/kernel/src/thread_tests.rs@@ -2,7 +2,7 @@use std::f64::consts::PI;-use solvecraft_geom::{Plane, Vec2, Vec3};+use solidcraft_geom::{Plane, Vec2, Vec3};use crate::{BoolOp, cylinder, faceted_boolean, sweep_helix_mesh};diff --git a/crates/kernel/src/topo.rs b/crates/kernel/src/topo.rsindex 8c6b63b645..0f7fcdfe3a 100644--- a/crates/kernel/src/topo.rs+++ b/crates/kernel/src/topo.rs@@ -8,7 +8,7 @@use std::collections::{BTreeMap, HashMap};use serde::Serialize;-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::Result;use crate::body::{Body, from_p3};diff --git a/crates/kernel/src/tspline.rs b/crates/kernel/src/tspline.rsindex e804765cd7..2a6e6a9bba 100644--- a/crates/kernel/src/tspline.rs+++ b/crates/kernel/src/tspline.rs@@ -1,4 +1,4 @@-//! T-spline sheets: a T-spline surface (`solvecraft_geom::tspline`) as a surface body of NURBS+//! T-spline sheets: a T-spline surface (`solidcraft_geom::tspline`) as a surface body of NURBS//! faces. A T-mesh without T-junctions becomes one clamped tensor face; otherwise each Bézier//! element is a face, and the faces share their edges and vertices — a side that meets two//! neighbours is split at the T-point between them — so the sheet is one sewn open shell.@@ -6,8 +6,8 @@use std::collections::hash_map::Entry;use std::collections::{BTreeMap, BTreeSet, HashMap};-use solvecraft_geom::bspline::{BezierPatch, HPoint, NurbsSurface, SplineError, bezier_segment};-use solvecraft_geom::tspline::TSpline;+use solidcraft_geom::bspline::{BezierPatch, HPoint, NurbsSurface, SplineError, bezier_segment};+use solidcraft_geom::tspline::TSpline;use truck_modeling as mt;use crate::body::Body;@@ -156,9 +156,9 @@ fn patch_faces(patches: &[BezierPatch]) -> Result<Vec<mt::Face>> {#[cfg(test)]mod tests {- use solvecraft_geom::Vec3;- use solvecraft_geom::bspline::NurbsSurface;- use solvecraft_geom::tspline::{Cut, TSpline};+ use solidcraft_geom::Vec3;+ use solidcraft_geom::bspline::NurbsSurface;+ use solidcraft_geom::tspline::{Cut, TSpline};use truck_modeling as mt;use super::tspline_sheet;diff --git a/crates/mcp/Cargo.toml b/crates/mcp/Cargo.tomlindex 33a1d62ae0..b71ede2683 100644--- a/crates/mcp/Cargo.toml+++ b/crates/mcp/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-mcp"+name = "solidcraft-mcp"description = "SolidCraft MCP server: JSON-RPC 2.0 over stdio, driving a headless session or the running app"version.workspace = trueedition.workspace = true@@ -9,5 +9,5 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-engine = { workspace = true }+solidcraft-engine = { workspace = true }serde_json = { workspace = true }diff --git a/crates/mcp/src/backend.rs b/crates/mcp/src/backend.rsindex 14de941d8e..0130905942 100644--- a/crates/mcp/src/backend.rs+++ b/crates/mcp/src/backend.rs@@ -5,8 +5,8 @@ use std::net::{TcpStream, ToSocketAddrs};use std::time::Duration;use serde_json::{Value, json};-use solvecraft_engine::Session;-use solvecraft_engine::render::{StandardView, render_png};+use solidcraft_engine::Session;+use solidcraft_engine::render::{StandardView, render_png};/// Something that answers control-channel methods: `engine.execute`, `engine.commands`,/// `document.inspect`, `ui.view`, `ui.render`, `ui.screenshot`.@@ -20,8 +20,8 @@ pub trait Backend {/// Longest reply line accepted from the app.const MAX_REPLY: u64 = 64 << 20;-/// A running SolveCraft app reached through its loopback control port-/// (`solvecraft --control PORT`).+/// A running SolidCraft app reached through its loopback control port+/// (`solidcraft --control PORT`).pub struct Remote {addr: String,conn: Option<(BufReader<TcpStream>, TcpStream)>,@@ -152,9 +152,9 @@ impl Backend for Headless {}"ui.render" => {let (w, h) = (dim(&p, "width", 1280.0), dim(&p, "height", 800.0));- let mut cam = solvecraft_engine::view::home_camera(s);+ let mut cam = solidcraft_engine::view::home_camera(s);cam.set_view(self.view);- let scene = solvecraft_engine::view::scene(s, &cam);+ let scene = solidcraft_engine::view::scene(s, &cam);let png = render_png(&scene, &cam, w, h).ok_or("render failed")?;let path = str_p("path").ok_or("missing `path`")?;std::fs::write(path, &png).map_err(|e| format!("{path}: {e}"))?;diff --git a/crates/mcp/src/lib.rs b/crates/mcp/src/lib.rsindex 3fdc47405b..ceebc49f2c 100644--- a/crates/mcp/src/lib.rs+++ b/crates/mcp/src/lib.rs@@ -1,4 +1,4 @@-//! SolveCraft MCP server.+//! SolidCraft MCP server.//!//! JSON-RPC 2.0 over stdio (newline-delimited), implementing the MCP lifecycle, tools and//! resources. Tools map onto the control-channel methods (`engine.execute`, `document.inspect`,diff --git a/crates/mcp/src/server.rs b/crates/mcp/src/server.rsindex b2e42b7c11..de49f34d4b 100644--- a/crates/mcp/src/server.rs+++ b/crates/mcp/src/server.rs@@ -4,7 +4,7 @@ use std::io::{BufRead, Write};use serde_json::{Value, json};/// Longest accepted request line, shared with the control server.-use solvecraft_engine::MAX_LINE;+use solidcraft_engine::MAX_LINE;use crate::backend::Backend;use crate::tools::{call_tool, check_arguments, tool_definitions};@@ -133,7 +133,7 @@ impl Server {Ok(json!({"protocolVersion": version,"capabilities": {"tools": {"listChanged": false}, "resources": {"listChanged": false}},- "serverInfo": {"name": "solvecraft", "title": "SolidCraft", "version": env!("CARGO_PKG_VERSION")},+ "serverInfo": {"name": "solidcraft", "title": "SolidCraft", "version": env!("CARGO_PKG_VERSION")},"instructions": format!("{INSTRUCTIONS} Backend: {}.", self.backend.describe()),}))}@@ -149,16 +149,18 @@ impl Server {Ok(call_tool(self.backend.as_mut(), name, &args))}"resources/list" => Ok(json!({"resources": [- {"uri": "solvecraft://design", "name": "Active design", "description": "document.inspect with measurements", "mimeType": "application/json"},- {"uri": "solvecraft://commands", "name": "Command catalog", "description": "every command with its parameter docs", "mimeType": "application/json"},+ {"uri": "solidcraft://design", "name": "Active design", "description": "document.inspect with measurements", "mimeType": "application/json"},+ {"uri": "solidcraft://commands", "name": "Command catalog", "description": "every command with its parameter docs", "mimeType": "application/json"},]})),"resources/templates/list" => Ok(json!({"resourceTemplates": []})),"prompts/list" => Ok(json!({"prompts": []})),"resources/read" => {let uri = params.get("uri").and_then(Value::as_str).unwrap_or("");let v = match uri {- "solvecraft://design" => self.backend.call("document.inspect", json!({"measure": true})),- "solvecraft://commands" => self.backend.call("engine.commands", json!({})),+ // The solvecraft:// URIs are what earlier releases listed (compatibility shim,+ // docs/compatibility.md); clients that saved them still read the resource.+ "solidcraft://design" | "solvecraft://design" => self.backend.call("document.inspect", json!({"measure": true})),+ "solidcraft://commands" | "solvecraft://commands" => self.backend.call("engine.commands", json!({})),_ => return Err((RESOURCE_NOT_FOUND, format!("unknown resource `{uri}`"))),}.map_err(|e| (INTERNAL_ERROR, e))?;diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rsindex 882725df09..f57c7b374f 100644--- a/crates/mcp/src/tests.rs+++ b/crates/mcp/src/tests.rs@@ -55,7 +55,7 @@ fn handshake_and_tools_list() {let init =call(&mut s, 1, "initialize", json!({"protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": {"name": "t", "version": "0"}}));assert_eq!(init["result"]["protocolVersion"], "2025-03-26");- assert_eq!(init["result"]["serverInfo"]["name"], "solvecraft");+ assert_eq!(init["result"]["serverInfo"]["name"], "solidcraft");assert!(init["result"]["capabilities"]["tools"].is_object());assert!(init["result"]["instructions"].as_str().unwrap().contains("headless"));// An unknown version gets ours.@@ -97,9 +97,9 @@ fn handshake_and_tools_list() {let res = call(&mut s, 5, "resources/list", json!({}));assert_eq!(res["result"]["resources"].as_array().unwrap().len(), 2);- let d = call(&mut s, 6, "resources/read", json!({"uri": "solvecraft://design"}));+ let d = call(&mut s, 6, "resources/read", json!({"uri": "solidcraft://design"}));assert!(d["result"]["contents"][0]["text"].as_str().unwrap().contains("timeline"));- assert_eq!(call(&mut s, 7, "resources/read", json!({"uri": "solvecraft://nope"}))["error"]["code"], -32002);+ assert_eq!(call(&mut s, 7, "resources/read", json!({"uri": "solidcraft://nope"}))["error"]["code"], -32002);assert_eq!(call(&mut s, 8, "nope/nope", json!({}))["error"]["code"], -32601);}@@ -154,7 +154,7 @@ fn agent_builds_box_fillet_hole() {assert!(img["data"].as_str().unwrap().starts_with("iVBORw0KGgo"), "not a PNG");// Export, save, start over, open.- let dir = std::env::temp_dir().join(format!("solvecraft-mcp-test-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-mcp-test-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let step = dir.join("part.step");tool(&mut s, "export", json!({"path": step.to_string_lossy()}));@@ -165,7 +165,7 @@ fn agent_builds_box_fillet_hole() {let shot = dir.join("shot.png");tool(&mut s, "screenshot", json!({"path": shot.to_string_lossy(), "width": 64, "height": 64}));assert!(std::fs::metadata(&shot).unwrap().len() > 100);- let design = dir.join("part.solvecraft");+ let design = dir.join("part.solidcraft");tool(&mut s, "save", json!({"path": design.to_string_lossy()}));tool(&mut s, "new_design", json!({"name": "Empty"}));assert_eq!(tool(&mut s, "measure", json!({}))["body_count"], 0);@@ -386,3 +386,19 @@ fn list_commands_filter_by_a_command_id_matches_ids() {assert!(ids.contains(&"sketch.delete"), "{ids:?}");assert!(ids.iter().all(|id| id.contains("sketch.delete")), "{} commands matched: {ids:?}", ids.len());}++/// Compatibility shims (docs/compatibility.md): a design saved before the rename (legacy+/// extension and format tag) opens through MCP, and the legacy resource URIs still read.+#[test]+fn legacy_design_files_and_resource_uris() {+ let mut s = server();+ let saved = String::from_utf8(solidcraft_engine::io::write_design(&solidcraft_engine::doc::Document::default())).unwrap();+ assert!(saved.contains("\"solidcraft/"), "{saved}");+ let legacy = saved.replace("\"solidcraft/", "\"solvecraft/");+ let path = std::env::temp_dir().join(format!("solidcraft-mcp-legacy-{}.solvecraft", std::process::id()));+ std::fs::write(&path, legacy).unwrap();+ tool(&mut s, "open", json!({"path": path.to_string_lossy()}));+ let _ = std::fs::remove_file(&path);+ let d = call(&mut s, 1, "resources/read", json!({"uri": "solvecraft://design"}));+ assert!(d["result"]["contents"][0]["text"].as_str().unwrap().contains("timeline"));+}diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rsindex 122c3c520f..9939d47e3b 100644--- a/crates/mcp/src/tools.rs+++ b/crates/mcp/src/tools.rs@@ -214,17 +214,17 @@ pub fn tool_definitions() -> Vec<Value> {tool("open","Open a design",- "Open a .solvecraft design file, a STEP file (.step/.stp: a new design whose bodies come from the file, as an \+ "Open a .solidcraft design file, a STEP file (.step/.stp: a new design whose bodies come from the file, as an \Import base feature) or a 3MF/STL mesh (.3mf/.stl: mesh bodies). Replaces the current design; insert into it \instead with the file.insert_step (STEP) or file.insert_mesh (3MF/STL) commands.",- obj(json!({"path": string("Path to a .solvecraft, .step/.stp, .3mf or .stl file")}), &["path"]),+ obj(json!({"path": string("Path to a .solidcraft, .step/.stp, .3mf or .stl file")}), &["path"]),false,true,),tool("save","Save the design",- "Save the design as a .solvecraft file (to `path`, or to the file it came from).",+ "Save the design as a .solidcraft file (to `path`, or to the file it came from).",obj(json!({"path": string("Path to save to (default: the current file)")}), &[]),false,false,@@ -499,7 +499,7 @@ fn capture(b: &mut dyn Backend, a: &Map<String, Value>) -> Result<(Vec<u8>, Valulet keep = str_arg(a, "path").filter(|p| !p.trim().is_empty()).map(str::to_string);let path = keep.clone().unwrap_or_else(|| {let n = SHOT.fetch_add(1, Ordering::Relaxed);- std::env::temp_dir().join(format!("solvecraft-mcp-{}-{n}.png", std::process::id())).to_string_lossy().to_string()+ std::env::temp_dir().join(format!("solidcraft-mcp-{}-{n}.png", std::process::id())).to_string_lossy().to_string()});let window = match str_arg(a, "source") {Some("model") => false,diff --git a/crates/render/Cargo.toml b/crates/render/Cargo.tomlindex 404190893c..3cbd4b976a 100644--- a/crates/render/Cargo.toml+++ b/crates/render/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-render"+name = "solidcraft-render"description = "SolidCraft view math (orbit camera, projection, picking rays) and a CPU rasterizer for headless snapshots"version.workspace = trueedition.workspace = true@@ -9,7 +9,7 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }+solidcraft-geom = { workspace = true }serde = { workspace = true }image = { workspace = true }diff --git a/crates/render/src/camera.rs b/crates/render/src/camera.rsindex 011b02d2ce..6e1d38f7bd 100644--- a/crates/render/src/camera.rs+++ b/crates/render/src/camera.rs@@ -1,5 +1,5 @@use serde::{Deserialize, Serialize};-use solvecraft_geom::{Aabb3, Vec3};+use solidcraft_geom::{Aabb3, Vec3};/// Column-major 4×4 matrix.#[derive(Clone, Copy, Debug, PartialEq)]diff --git a/crates/render/src/curve_display.rs b/crates/render/src/curve_display.rsindex 4098680add..08bbebf5ab 100644--- a/crates/render/src/curve_display.rs+++ b/crates/render/src/curve_display.rs@@ -1,6 +1,6 @@//! Pixel-bounded display paths. CAD segments remain untouched; positive homogeneous//! control hulls bound perspective projection, including looping and rational curves.-use solvecraft_geom::{Plane, Seg2, Vec2, Vec3};+use solidcraft_geom::{Plane, Seg2, Vec2, Vec3};use crate::Mat4;diff --git a/crates/render/src/raster.rs b/crates/render/src/raster.rsindex 5a5e2c9ea9..b140a08655 100644--- a/crates/render/src/raster.rs+++ b/crates/render/src/raster.rs@@ -3,7 +3,7 @@use std::sync::Arc;-use solvecraft_geom::{Mesh, Vec3};+use solidcraft_geom::{Mesh, Vec3};use crate::Camera;diff --git a/crates/sketch/Cargo.toml b/crates/sketch/Cargo.tomlindex b2ce10edba..76fa295c24 100644--- a/crates/sketch/Cargo.toml+++ b/crates/sketch/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-sketch"+name = "solidcraft-sketch"description = "SolidCraft sketches: points, curves, geometric constraints and dimensions, the constraint solver, and profile detection"version.workspace = trueedition.workspace = true@@ -9,7 +9,7 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-geom = { workspace = true }+solidcraft-geom = { workspace = true }serde = { workspace = true }thiserror = { workspace = true }ttf-parser = { workspace = true }diff --git a/crates/sketch/examples/solve_bench.rs b/crates/sketch/examples/solve_bench.rsindex 89cabd850b..cf31f9c784 100644--- a/crates/sketch/examples/solve_bench.rs+++ b/crates/sketch/examples/solve_bench.rs@@ -1,12 +1,12 @@//! Solve times of an n×n grid (origin corner fixed, every row and column edge horizontal or//! vertical with a distance), started at the solution and ±1 mm off it, and of one held drag//! frame on a strip of rectangles. Run with-//! `cargo run --release -p solvecraft-sketch --example solve_bench`; results go in docs/perf.md.+//! `cargo run --release -p solidcraft-sketch --example solve_bench`; results go in docs/perf.md.use std::time::Instant;-use solvecraft_geom::Vec2;-use solvecraft_sketch::{Analysis, Budget, ConstraintKind, Hold, Sketch, SolveReport, solve, solve_with};+use solidcraft_geom::Vec2;+use solidcraft_sketch::{Analysis, Budget, ConstraintKind, Hold, Sketch, SolveReport, solve, solve_with};/// A small deterministic generator for the start offsets.struct Lcg(u64);diff --git a/crates/sketch/src/construct.rs b/crates/sketch/src/construct.rsindex 72dfce10fc..996abef942 100644--- a/crates/sketch/src/construct.rs+++ b/crates/sketch/src/construct.rs@@ -40,7 +40,7 @@use std::collections::{BTreeMap, BTreeSet, VecDeque};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::decompose::{Budget, Decomposition, enqueue};use crate::loci::{MAX_LOCI, Reading, Rel, View, place, radii, read};diff --git a/crates/sketch/src/construct_rounds_tests.rs b/crates/sketch/src/construct_rounds_tests.rsindex aa02e9710a..8be3c0bb51 100644--- a/crates/sketch/src/construct_rounds_tests.rs+++ b/crates/sketch/src/construct_rounds_tests.rs@@ -5,7 +5,7 @@//! and its sweep, every line its direction, every point its side of its lines.//! Deterministic (fixed LCG seeds), no timing.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::construct::{Placement, seed};use crate::decompose::Budget;diff --git a/crates/sketch/src/construct_tests.rs b/crates/sketch/src/construct_tests.rsindex 5eb9778916..50c1998ce8 100644--- a/crates/sketch/src/construct_tests.rs+++ b/crates/sketch/src/construct_tests.rs@@ -2,7 +2,7 @@//! points that keep a degree of freedom, drag continuity, and hostile input. Deterministic//! (fixed LCG seeds), no timing.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::construct::{Placement, seed};use crate::decompose::Budget;diff --git a/crates/sketch/src/continuation_tests.rs b/crates/sketch/src/continuation_tests.rsindex d1e25f16de..13c418058b 100644--- a/crates/sketch/src/continuation_tests.rs+++ b/crates/sketch/src/continuation_tests.rs@@ -2,7 +2,7 @@//! triangles joined by three links, left to the iteration by the construction) under random//! dimension edits from its previous solved state, with every failure that remains proven//! infeasible; and the solve without continuation when nothing it could help with changed.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::construct::switch;use crate::model::{ConstraintKind, Sketch};diff --git a/crates/sketch/src/curves.rs b/crates/sketch/src/curves.rsindex 595c495833..a0579061e6 100644--- a/crates/sketch/src/curves.rs+++ b/crates/sketch/src/curves.rs@@ -4,7 +4,7 @@use std::f64::consts::TAU;-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;/// Polyline samples per spline span / conic / ellipse quarter.const SPAN_SAMPLES: usize = 24;diff --git a/crates/sketch/src/decompose.rs b/crates/sketch/src/decompose.rsindex 7447293357..a91bb921cf 100644--- a/crates/sketch/src/decompose.rs+++ b/crates/sketch/src/decompose.rs@@ -58,7 +58,7 @@use std::collections::btree_map::Entry;use std::collections::{BTreeMap, BTreeSet, VecDeque};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::loci::{Locus, Reading, Rel, Span, View, crossing, mag, place, side};use crate::union_find::{find, union};diff --git a/crates/sketch/src/dims.rs b/crates/sketch/src/dims.rsindex 63cdc9ba88..efba9b14ab 100644--- a/crates/sketch/src/dims.rs+++ b/crates/sketch/src/dims.rs@@ -8,7 +8,7 @@//!//! [`Constraint::text`]: crate::Constraint::text-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::model::{ConstraintKind, CurveKind, Sketch};use crate::union_find::{find, union};@@ -70,7 +70,7 @@ pub fn dim_frame(sk: &Sketch, k: &ConstraintKind) -> Option<DimFrame> {}}ArcSweep { c, .. } => match sk.segs(c).first()? {- solvecraft_geom::Seg2::Arc { center, start, sweep, .. } => {+ solidcraft_geom::Seg2::Arc { center, start, sweep, .. } => {DimFrame::Angular { vertex: *center, d0: Vec2::from_angle(*start), sweep: *sweep }}_ => return None,@@ -96,7 +96,7 @@ pub fn dim_frame(sk: &Sketch, k: &ConstraintKind) -> Option<DimFrame> {DimFrame::Radial { center: sk.center(c)?, radius, diameter: matches!(k, Diameter { .. }) }}ArcLength { c, .. } => match sk.segs(c).first()? {- solvecraft_geom::Seg2::Arc { center, radius, start, sweep } => {+ solidcraft_geom::Seg2::Arc { center, radius, start, sweep } => {DimFrame::ArcLength { center: *center, radius: *radius, start: *start, sweep: *sweep }}_ => return None,diff --git a/crates/sketch/src/freeform_offset.rs b/crates/sketch/src/freeform_offset.rsindex fee33f0a63..f20e3eed91 100644--- a/crates/sketch/src/freeform_offset.rs+++ b/crates/sketch/src/freeform_offset.rs@@ -4,7 +4,7 @@//! bounds their distance everywhere, rather than just at selected samples.use crate::{CurveKind, Sketch, SketchError, fit_beziers_mode};use serde::{Deserialize, Serialize};-use solvecraft_geom::{Seg2, Vec2};+use solidcraft_geom::{Seg2, Vec2};pub const OFFSET_TOLERANCE: f64 = 0.002;const MAX_PIECES: usize = 256;diff --git a/crates/sketch/src/link.rs b/crates/sketch/src/link.rsindex 459ed18e22..cb716f8d78 100644--- a/crates/sketch/src/link.rs+++ b/crates/sketch/src/link.rs@@ -7,7 +7,7 @@//! constants; they still bound profiles and take constraints and dimensions like any curve.use serde::{Deserialize, Serialize};-use solvecraft_geom::{Vec2, Vec3};+use solidcraft_geom::{Vec2, Vec3};use crate::model::{Curve, CurveKind, Result, Sketch, SketchError, in_range, radius_in_range};diff --git a/crates/sketch/src/link_loops.rs b/crates/sketch/src/link_loops.rsindex 72f557cfb6..9f669f205a 100644--- a/crates/sketch/src/link_loops.rs+++ b/crates/sketch/src/link_loops.rs@@ -2,7 +2,7 @@//! Endpoint walks exclude support centres. Crossings/touches refuse before nesting.use super::{LCurve, curve_points};use crate::{Shape, intersections};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use std::f64::consts::TAU;struct Boundary {diff --git a/crates/sketch/src/loci.rs b/crates/sketch/src/loci.rsindex bc9a37ef64..37ec3a7750 100644--- a/crates/sketch/src/loci.rs+++ b/crates/sketch/src/loci.rs@@ -32,7 +32,7 @@//! Tolerances are relative to the loci's own size plus the rounding of the coordinates they//! are computed from, so a construction far from the origin behaves like the same one near it.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::model::{ConstraintKind, CurveKind, MAX_COORD, Sketch, in_range, radius_in_range};use crate::union_find::{find, union};diff --git a/crates/sketch/src/model.rs b/crates/sketch/src/model.rsindex 7d84ea8fd9..2836dcfa19 100644--- a/crates/sketch/src/model.rs+++ b/crates/sketch/src/model.rs@@ -1,5 +1,5 @@use serde::{Deserialize, Serialize};-use solvecraft_geom::{Seg2, Vec2, Vec3};+use solidcraft_geom::{Seg2, Vec2, Vec3};use crate::union_find::{find, union};@@ -1120,7 +1120,7 @@ impl Sketch {_ => Vec::new(),},CurveKind::Circle { c, r } => match self.point(c) {- Some(c) => solvecraft_geom::Loop2::circle(c, r).segs,+ Some(c) => solidcraft_geom::Loop2::circle(c, r).segs,None => Vec::new(),},CurveKind::Arc { c, a, b } => match (self.point(c), self.point(a), self.point(b)) {@@ -1167,10 +1167,10 @@ impl Sketch {crate::curves::fit_beziers_mode(&p, *periodic).ok()?.into_iter().map(|[p0, p1, p2, p3]| Seg2::Cubic { p0, p1, p2, p3 }).collect(),)}- CurveKind::Spline { pts, control: true, degree, .. } if (*degree as usize) <= solvecraft_geom::MAX_BEZIER_DEGREE => {+ CurveKind::Spline { pts, control: true, degree, .. } if (*degree as usize) <= solidcraft_geom::MAX_BEZIER_DEGREE => {let p: Vec<Vec2> = pts.iter().map(pt).collect::<Option<_>>()?;let k = (*degree as usize).min(p.len().saturating_sub(1)).max(1);- Some(crate::curves::bspline_beziers(&p, k).iter().filter_map(|c| solvecraft_geom::bezier(c)).collect())+ Some(crate::curves::bspline_beziers(&p, k).iter().filter_map(|c| solidcraft_geom::bezier(c)).collect())}_ => None,}diff --git a/crates/sketch/src/offset.rs b/crates/sketch/src/offset.rsindex 00e2223616..6fd0e8dd9c 100644--- a/crates/sketch/src/offset.rs+++ b/crates/sketch/src/offset.rs@@ -1,7 +1,7 @@//! Associative offsets keep their output entity ids while their source curves move.use crate::{CurveKind, Shape, Sketch, SketchError, intersections};use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]pub struct OffsetChain {diff --git a/crates/sketch/src/offset_topology.rs b/crates/sketch/src/offset_topology.rsindex aea8bb0ae9..6c1675d194 100644--- a/crates/sketch/src/offset_topology.rs+++ b/crates/sketch/src/offset_topology.rs@@ -3,7 +3,7 @@ use std::collections::{BTreeMap, BTreeSet};use std::f64::consts::TAU;use serde::{Deserialize, Serialize};-use solvecraft_geom::{Seg2, Vec2};+use solidcraft_geom::{Seg2, Vec2};use crate::{Curve, CurveKind, OffsetChain, Sketch, SketchError};type Result<T> = std::result::Result<T, SketchError>;diff --git a/crates/sketch/src/periodic.rs b/crates/sketch/src/periodic.rsindex e0c5a4260e..698e58a585 100644--- a/crates/sketch/src/periodic.rs+++ b/crates/sketch/src/periodic.rs@@ -1,7 +1,7 @@//! Explicit cyclic C2 fit splines. Missing periodic markers retain natural interpolation.use crate::model::in_range;use crate::{MAX_SPLINE_POINTS, Sketch, SketchError};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;type Result<T> = std::result::Result<T, SketchError>;fn bad() -> SketchError {diff --git a/crates/sketch/src/profiles.rs b/crates/sketch/src/profiles.rsindex a8da95ed7e..2678a3d2e2 100644--- a/crates/sketch/src/profiles.rs+++ b/crates/sketch/src/profiles.rs@@ -10,7 +10,7 @@use std::f64::consts::TAU;use serde::{Deserialize, Serialize};-use solvecraft_geom::{Loop2, Region2, Seg2, Vec2};+use solidcraft_geom::{Loop2, Region2, Seg2, Vec2};use crate::model::{CurveKind, Sketch};use crate::shape::{Shape, intersections};diff --git a/crates/sketch/src/shape.rs b/crates/sketch/src/shape.rsindex 56446b188a..524ee00e20 100644--- a/crates/sketch/src/shape.rs+++ b/crates/sketch/src/shape.rs@@ -2,7 +2,7 @@use std::f64::consts::TAU;-use solvecraft_geom::{Seg2, Vec2};+use solidcraft_geom::{Seg2, Vec2};use crate::model::{CurveKind, Sketch};diff --git a/crates/sketch/src/solver.rs b/crates/sketch/src/solver.rsindex 2b0ed3a110..1c43c21fcd 100644--- a/crates/sketch/src/solver.rs+++ b/crates/sketch/src/solver.rs@@ -14,7 +14,7 @@//! analysis runs only on what remains.use serde::{Deserialize, Serialize};-use solvecraft_geom::{Seg2, Vec2};+use solidcraft_geom::{Seg2, Vec2};use crate::decompose::Budget;use crate::linalg::{Mat, determined_vars, solve as lin_solve};@@ -256,8 +256,8 @@ impl State<'_> {return q.dist(p.first().copied().unwrap_or_default());}if *control {- let k = (*degree as usize).min(solvecraft_geom::MAX_BEZIER_DEGREE).min(p.len().saturating_sub(1)).max(1);- crate::curves::bspline_beziers(&p, k).iter().filter_map(|span| solvecraft_geom::bezier(span)).collect()+ let k = (*degree as usize).min(solidcraft_geom::MAX_BEZIER_DEGREE).min(p.len().saturating_sub(1)).max(1);+ crate::curves::bspline_beziers(&p, k).iter().filter_map(|span| solidcraft_geom::bezier(span)).collect()} else {crate::curves::fit_beziers_mode(&p, *periodic).unwrap_or_default()diff --git a/crates/sketch/src/tests.rs b/crates/sketch/src/tests.rsindex b43252f2ff..f8c8d37e32 100644--- a/crates/sketch/src/tests.rs+++ b/crates/sketch/src/tests.rs@@ -1,6 +1,6 @@use std::f64::consts::{FRAC_PI_2, PI};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::*;@@ -323,12 +323,12 @@ fn profiles_split_at_crossings_and_touch_points() {#[test]fn merging_adjacent_regions() {let a =- solvecraft_geom::Region2 { outer: solvecraft_geom::Loop2::polygon(&[v(0.0, 0.0), v(10.0, 0.0), v(10.0, 10.0), v(0.0, 10.0)]), holes: vec![] };- let b = solvecraft_geom::Region2 {- outer: solvecraft_geom::Loop2::polygon(&[v(10.0, 0.0), v(20.0, 0.0), v(20.0, 10.0), v(10.0, 10.0)]),+ solidcraft_geom::Region2 { outer: solidcraft_geom::Loop2::polygon(&[v(0.0, 0.0), v(10.0, 0.0), v(10.0, 10.0), v(0.0, 10.0)]), holes: vec![] };+ let b = solidcraft_geom::Region2 {+ outer: solidcraft_geom::Loop2::polygon(&[v(10.0, 0.0), v(20.0, 0.0), v(20.0, 10.0), v(10.0, 10.0)]),holes: vec![],};- let c = solvecraft_geom::Region2 { outer: solvecraft_geom::Loop2::polygon(&[v(50.0, 0.0), v(60.0, 0.0), v(60.0, 10.0)]), holes: vec![] };+ let c = solidcraft_geom::Region2 { outer: solidcraft_geom::Loop2::polygon(&[v(50.0, 0.0), v(60.0, 0.0), v(60.0, 10.0)]), holes: vec![] };let m = merge_regions(&[a, b, c]);assert_eq!(m.len(), 2);let mut areas: Vec<f64> = m.iter().map(|r| r.area()).collect();@@ -446,7 +446,7 @@ fn long_connected_chain_solves() {/// cut in two by a line through it (each side gets an exact sub-curve ending on the line).#[test]fn exact_profiles_for_high_degree_and_cut_free_form_curves() {- use solvecraft_geom::Seg2;+ use solidcraft_geom::Seg2;let exact_loop = |p: &Profile| p.region.outer.segs.iter().all(|s| !matches!(s, Seg2::Line { .. }) || s.length() > 1.0);let closed = |p: &Profile| {let s = &p.region.outer.segs;diff --git a/crates/sketch/src/text.rs b/crates/sketch/src/text.rsindex f1c9d439e2..a45898d61c 100644--- a/crates/sketch/src/text.rs+++ b/crates/sketch/src/text.rs@@ -2,7 +2,7 @@//! `fonts/OFL.txt` and ATTRIBUTION.md) as lines and conics (TrueType quadratic Béziers are//! conics with rho = 0.5), so text closes into profiles that can be extruded.-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;use crate::link::LinkGeom;use crate::model::{Result, SketchError};diff --git a/crates/sketch/src/virtual_corner_tests.rs b/crates/sketch/src/virtual_corner_tests.rsindex ea4d411d4a..2103875c02 100644--- a/crates/sketch/src/virtual_corner_tests.rs+++ b/crates/sketch/src/virtual_corner_tests.rs@@ -1,7 +1,7 @@#![allow(clippy::unwrap_used, clippy::panic)]use crate::{Constraint, ConstraintKind, CurveKind, Sketch};-use solvecraft_geom::Vec2;+use solidcraft_geom::Vec2;fn point(sk: &mut Sketch, x: f64, y: f64) -> usize {sk.add_point(Vec2::new(x, y), None).unwrap()diff --git a/crates/sketch/src/wire.rs b/crates/sketch/src/wire.rsindex 33a30c49da..0ecabda4ac 100644--- a/crates/sketch/src/wire.rs+++ b/crates/sketch/src/wire.rs@@ -3,7 +3,7 @@//! They are reference geometry: drawn and usable as paths, not part of profiles or the solver.use serde::{Deserialize, Serialize};-use solvecraft_geom::Vec3;+use solidcraft_geom::Vec3;use crate::link::{Link, LinkGeom, LinkKind, LinkSource};use crate::model::{Result, Sketch, SketchError, in_range3};diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.tomlindex f6b7838785..5529628f64 100644--- a/crates/ui-egui/Cargo.toml+++ b/crates/ui-egui/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "solvecraft-ui-egui"+name = "solidcraft-ui-egui"description = "SolidCraft user interface (egui + wgpu): the swappable front end"version.workspace = trueedition.workspace = true@@ -9,7 +9,7 @@ license.workspace = trueworkspace = true[dependencies]-solvecraft-engine = { workspace = true }+solidcraft-engine = { workspace = true }egui = { workspace = true }egui-wgpu = { workspace = true }serde = { workspace = true }diff --git a/crates/ui-egui/build.rs b/crates/ui-egui/build.rsindex 553f32b6ce..63bc3b2011 100644--- a/crates/ui-egui/build.rs+++ b/crates/ui-egui/build.rs@@ -28,8 +28,8 @@ fn main() {let dirty = git(&["status", "--porcelain", "--untracked-files=no"]).is_some();let secs = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs() as i64).unwrap_or(0);let (y, m, d) = civil(secs.div_euclid(86_400));- println!("cargo:rustc-env=SOLVECRAFT_COMMIT={commit}{}", if dirty { "+" } else { "" });- println!("cargo:rustc-env=SOLVECRAFT_BUILD_DATE={y:04}-{m:02}-{d:02}");+ println!("cargo:rustc-env=SOLIDCRAFT_COMMIT={commit}{}", if dirty { "+" } else { "" });+ println!("cargo:rustc-env=SOLIDCRAFT_BUILD_DATE={y:04}-{m:02}-{d:02}");// A new commit in this checkout (or worktree) restamps the build.if let Some(dir) = git(&["rev-parse", "--git-dir"]) {println!("cargo:rerun-if-changed={dir}/logs/HEAD");diff --git a/crates/ui-egui/src/access.rs b/crates/ui-egui/src/access.rsindex 69b3d2c842..0274704d28 100644--- a/crates/ui-egui/src/access.rs+++ b/crates/ui-egui/src/access.rs@@ -4,8 +4,8 @@use std::cell::RefCell;use std::sync::Arc;-use solvecraft_engine::SurfaceAnalysis;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::SurfaceAnalysis;+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::gpu::AccessMap;@@ -39,7 +39,7 @@ pub fn map(app: &SolveApp) -> Option<AccessMap> {}/// Rasterise the triangles seen along `dir` (orthographic), keeping the highest point per pixel.-fn build(meshes: &[&solvecraft_engine::geom::Mesh], dir: Vec3, version: u64) -> Option<AccessMap> {+fn build(meshes: &[&solidcraft_engine::geom::Mesh], dir: Vec3, version: u64) -> Option<AccessMap> {let d = dir.normalized()?;let u = d.cross(if d.x.abs() < 0.9 { Vec3::X } else { Vec3::Y }).normalized()?;let v = d.cross(u);diff --git a/crates/ui-egui/src/agent_cursor.rs b/crates/ui-egui/src/agent_cursor.rsindex 39b1ac885f..5f76a72870 100644--- a/crates/ui-egui/src/agent_cursor.rs+++ b/crates/ui-egui/src/agent_cursor.rs@@ -16,7 +16,7 @@ use std::sync::mpsc::Sender;use egui::{Color32, FontId, Pos2, Shape, Stroke, pos2, vec2};use serde::{Deserialize, Serialize};use serde_json::{Value, json};-use solvecraft_engine::geom::{Vec2, Vec3};+use solidcraft_engine::geom::{Vec2, Vec3};use crate::SolveApp;use crate::control::ControlResponse;@@ -132,7 +132,7 @@ pub struct AgentCursor {/// Click ripples: where and when.ripples: Vec<(Pos2, f64)>,/// The view before a followed sketch (restored when it finishes).- saved_view: Option<solvecraft_engine::render::Camera>,+ saved_view: Option<solidcraft_engine::render::Camera>,}impl AgentCursor {@@ -149,7 +149,7 @@ const NOT_PLACES: [&str; 14] =/// Where the pointer goes for a command: its toolbar button (or its panel), then each pick.pub fn stops(app: &SolveApp, command: &str, params: &Value) -> Vec<Pos2> {let mut out = Vec::new();- if let Some(spec) = solvecraft_engine::find_command(command) {+ if let Some(spec) = solidcraft_engine::find_command(command) {let button = crate::scenario::handle_at(&format!("toolbar:{}", spec.id)).or_else(|| crate::scenario::handle_at(&format!("panel:{}:{}", spec.tab, spec.panel)));out.extend(button);@@ -167,7 +167,7 @@ pub fn stops(app: &SolveApp, command: &str, params: &Value) -> Vec<Pos2> {/// The places a command's parameters pick, in the world: [x, y, z] points (faces, edges,/// vertices, positions), active-sketch [x, y] points, and a new sketch's plane.pub fn picks(app: &SolveApp, command: &str, params: &Value) -> Vec<Vec3> {- let id = solvecraft_engine::find_command(command).map_or(command, |c| c.id);+ let id = solidcraft_engine::find_command(command).map_or(command, |c| c.id);let mut out = Vec::new();if id == "sketch.create"&& let Some(n) = params.get("plane").and_then(Value::as_str)@@ -308,7 +308,7 @@ fn finish(app: &mut SolveApp, ctx: &egui::Context) {let mut params = job.params;params["animate"] = json!(false);let cmd = params.get("command").or(params.get("id")).and_then(Value::as_str).unwrap_or_default().to_string();- let id = solvecraft_engine::find_command(&cmd).map_or(cmd.clone(), |c| c.id.to_string());+ let id = solidcraft_engine::find_command(&cmd).map_or(cmd.clone(), |c| c.id.to_string());let follow = app.ui.agent_cursor.follow_camera;if follow && id == "sketch.create" {app.agent.saved_view = Some(app.cam);@@ -360,7 +360,7 @@ pub fn paint(app: &SolveApp, ctx: &egui::Context) {mod tests {use super::*;use crate::Services;- use solvecraft_engine::Session;+ use solidcraft_engine::Session;fn app() -> SolveApp {let mut s = Session::default();diff --git a/crates/ui-egui/src/browser.rs b/crates/ui-egui/src/browser.rsindex 3af128a2bf..64b1b36076 100644--- a/crates/ui-egui/src/browser.rs+++ b/crates/ui-egui/src/browser.rs@@ -14,8 +14,8 @@ use std::collections::BTreeSet;use egui::{Color32, FontId, Pos2, Rect, RichText, Sense, Stroke, pos2, vec2};use serde_json::{Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::FeatureKind;+use solidcraft_engine::Sel;+use solidcraft_engine::doc::FeatureKind;use crate::context_menu::{Item, Target};use crate::theme::Tokens;@@ -72,13 +72,13 @@ pub struct OccMove {/// Exact assembly placement used for world-space movement and the pivot.pub path: Vec<u64>,/// Effective local placement at dialog opening, including its pre-existing pending move.- pub baseline: Option<solvecraft_engine::doc::Mat>,+ pub baseline: Option<solidcraft_engine::doc::Mat>,pub had_pending: bool,/// Distances along X, Y, Z (mm) and turns about X, Y, Z (degrees) from where it was.pub translate: [f64; 3],pub angles: [f64; 3],/// The occurrence's origin when the move began: what it turns about.- pub pivot: Option<solvecraft_engine::geom::Vec3>,+ pub pivot: Option<solidcraft_engine::geom::Vec3>,/// The values when the current triad drag began.drag0: Option<([f64; 3], [f64; 3])>,}@@ -98,7 +98,7 @@ pub fn sketch_visible(app: &SolveApp, id: u64) -> bool {if app.session.visibility.hidden_sketches.contains(&id) {return false;}- app.session.visibility.shown_sketches.contains(&id) || (app.ui.show_sketches && !solvecraft_engine::view::sketch_consumed(&app.session, id))+ app.session.visibility.shown_sketches.contains(&id) || (app.ui.show_sketches && !solidcraft_engine::view::sketch_consumed(&app.session, id))}pub fn set_sketch_visible(app: &mut SolveApp, id: u64, on: bool) {@@ -116,7 +116,7 @@ pub fn redefine_sketch(app: &mut SolveApp, id: u64) {app.tree.redefine_draft = Some(crate::sketch_attachment_ui::Draft::new(app, id));}-fn find_group(app: &SolveApp, id: u64) -> Option<&solvecraft_engine::doc::BrowserGroup> {+fn find_group(app: &SolveApp, id: u64) -> Option<&solidcraft_engine::doc::BrowserGroup> {app.session.doc.browser_groups.iter().find(|g| g.id == id)}@@ -864,7 +864,7 @@ pub fn restore_view(app: &mut SolveApp, name: &str) {}let Some(v) = app.session.doc.named_views.iter().find(|v| v.name == name) else { return };let j = json!({ "target": v.target, "yaw": v.yaw, "pitch": v.pitch, "distance": v.distance, "fov": v.fov });- if let Ok(cam) = serde_json::from_value::<solvecraft_engine::render::Camera>(j) {+ if let Ok(cam) = serde_json::from_value::<solidcraft_engine::render::Camera>(j) {app.animate_to(cam);}}@@ -1072,7 +1072,7 @@ fn canvas_panel(app: &mut SolveApp, ctx: &egui::Context) {/// otherwise it becomes the selection.fn pick_from_browser(app: &mut SolveApp, x: Sel) {let hit = match &x {- Sel::Plane { name } => crate::viewport::Hit::Plane { name: name.clone(), point: solvecraft_engine::geom::Vec3::ZERO },+ Sel::Plane { name } => crate::viewport::Hit::Plane { name: name.clone(), point: solidcraft_engine::geom::Vec3::ZERO },Sel::Axis { name } => crate::viewport::Hit::Axis { name: name.clone() },_ => return,};@@ -1146,7 +1146,7 @@ fn entries(app: &SolveApp, comp: u64, folder: &str) -> Vec<Entry> {.map(|f| {let active = app.session.active_sketch == Some(f.id);let lost = app.session.model.result(f.id).is_some_and(|result| result.error.is_some())- && matches!(doc.sketch_face_attachment(f.id, &app.session.model), solvecraft_engine::doc::FaceAttachmentStatus::Lost { .. });+ && matches!(doc.sketch_face_attachment(f.id, &app.session.model), solidcraft_engine::doc::FaceAttachmentStatus::Lost { .. });Entry {key: f.id.to_string(),row_key: format!("s:{}", f.id),@@ -1190,9 +1190,9 @@ fn entries(app: &SolveApp, comp: u64, folder: &str) -> Vec<Entry> {}/// A folder's groups (with their items) and the items in no group, in browser order.-fn arrange(app: &SolveApp, comp: u64, folder: &str, all: Vec<Entry>) -> (Vec<(solvecraft_engine::doc::BrowserGroup, Vec<Entry>)>, Vec<Entry>) {+fn arrange(app: &SolveApp, comp: u64, folder: &str, all: Vec<Entry>) -> (Vec<(solidcraft_engine::doc::BrowserGroup, Vec<Entry>)>, Vec<Entry>) {let doc = &app.session.doc;- let groups: Vec<solvecraft_engine::doc::BrowserGroup> =+ let groups: Vec<solidcraft_engine::doc::BrowserGroup> =doc.browser_groups.iter().filter(|g| g.component == comp && g.folder == folder).cloned().collect();let mut rest: Vec<Option<Entry>> = all.into_iter().map(Some).collect();let mut take = |key: &str| rest.iter_mut().find(|e| e.as_ref().is_some_and(|e| e.key == key)).and_then(Option::take);@@ -1551,7 +1551,7 @@ fn occurrence_panel(app: &mut SolveApp, ui: &mut egui::Ui) {m.pivot = if m.path.is_empty() {occurrence_origin(app, m.occurrence)} else {- app.session.occurrence_placement(&m.path).ok().map(|p| solvecraft_engine::doc::apply_point(&p.world, solvecraft_engine::geom::Vec3::ZERO))+ app.session.occurrence_placement(&m.path).ok().map(|p| solidcraft_engine::doc::apply_point(&p.world, solidcraft_engine::geom::Vec3::ZERO))};}let name = app.session.doc.occurrences.iter().find(|o| o.id == m.occurrence).map(|o| o.name.clone()).unwrap_or_default();@@ -1629,7 +1629,7 @@ pub(crate) fn revert_occurrence_dialog(app: &mut SolveApp, m: &OccMove) {/// The pending move: turned about X, then Y, then Z through the starting origin, then moved.pub fn apply_occurrence_move(app: &mut SolveApp, m: &OccMove) {use crate::gizmo;- use solvecraft_engine::geom::Vec3;+ use solidcraft_engine::geom::Vec3;let a = m.angles.map(f64::to_radians);let r = gizmo::mul(&gizmo::mul(&gizmo::rotation(Vec3::Z, a[2]), &gizmo::rotation(Vec3::Y, a[1])), &gizmo::rotation(Vec3::X, a[0]));let (axis, angle) = gizmo::axis_angle(&r);@@ -1650,7 +1650,7 @@ fn triad(app: &mut SolveApp, ui: &mut egui::Ui, m: &mut OccMove) {use crate::gizmo::{self, Change};let (Some(rect), Some(pivot)) = (app.viewport.rect, m.pivot) else { return };let proj = crate::viewport::projection(app, rect);- let center = pivot + solvecraft_engine::geom::Vec3::new(m.translate[0], m.translate[1], m.translate[2]);+ let center = pivot + solidcraft_engine::geom::Vec3::new(m.translate[0], m.translate[1], m.translate[2]);let layer = egui::LayerId::new(egui::Order::Middle, egui::Id::new("sc_occ_triad_layer"));let mut gui = ui.new_child(egui::UiBuilder::new().layer_id(layer).max_rect(rect));let painter = gui.painter().with_clip_rect(rect);@@ -1677,8 +1677,8 @@ fn triad(app: &mut SolveApp, ui: &mut egui::Ui, m: &mut OccMove) {/// Dimensions of finished sketches whose dimensions are shown (Show Dimensions), drawn over the/// viewport like the sketch being edited draws its own (`crate::dim_view`), but not editable.pub fn dims_overlay(app: &SolveApp, ctx: &egui::Context) {- use solvecraft_engine::geom::Vec2;- use solvecraft_engine::sketch::{DimFrame, chain_centres, default_text, dim_frame, dim_layout};+ use solidcraft_engine::geom::Vec2;+ use solidcraft_engine::sketch::{DimFrame, chain_centres, default_text, dim_frame, dim_layout};let Some(rect) = app.viewport.rect else { return };if app.ui.shown_dims.is_empty() {return;@@ -1815,9 +1815,9 @@ fn capture_prompt(app: &mut SolveApp, ctx: &egui::Context) {}/// Where an occurrence's origin is now (with its pending move).-fn occurrence_origin(app: &SolveApp, occurrence: u64) -> Option<solvecraft_engine::geom::Vec3> {+fn occurrence_origin(app: &SolveApp, occurrence: u64) -> Option<solidcraft_engine::geom::Vec3> {let o = app.session.doc.occurrences.iter().find(|o| o.id == occurrence)?;let parent = app.session.doc.component_transform(o.parent);let own = app.session.pending_moves.get(&occurrence).copied().unwrap_or(o.transform);- Some(solvecraft_engine::doc::apply_point(&solvecraft_engine::doc::mat_mul(&parent, &own), solvecraft_engine::geom::Vec3::ZERO))+ Some(solidcraft_engine::doc::apply_point(&solidcraft_engine::doc::mat_mul(&parent, &own), solidcraft_engine::geom::Vec3::ZERO))}diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rsindex a0b2557ddf..6c83218af8 100644--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -6,9 +6,9 @@//! moves on, Esc cancels.use egui::{Color32, Pos2, Stroke, vec2};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::geom::{Mesh, Vec3};+use solidcraft_engine::Sel;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::geom::{Mesh, Vec3};use crate::SolveApp;use crate::dialogs::{Dialog, Kind};@@ -36,9 +36,9 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {}).map(|p| p.region.clone()).collect();- let regions = solvecraft_engine::sketch::merge_regions(®ions);+ let regions = solidcraft_engine::sketch::merge_regions(®ions);let points: Vec<_> = regions.iter().flat_map(|r| r.outer.polyline(1e-2)).collect();- points.iter().fold(solvecraft_engine::geom::Vec2::default(), |sum, p| sum + *p) * (1.0 / points.len().max(1) as f64)+ points.iter().fold(solidcraft_engine::geom::Vec2::default(), |sum, p| sum + *p) * (1.0 / points.len().max(1) as f64)} else {p.region.interior_point()};@@ -54,8 +54,8 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {}Sel::Body { name } => (st.body(name)?.mesh().bounds().center(), None),Sel::Plane { name } => {- let pl = solvecraft_engine::geom::Plane::named(name).or_else(|| {- solvecraft_engine::view::construction_planes(&app.session).into_iter().find(|(_, n, _)| n == name).map(|(_, _, pl)| pl)+ let pl = solidcraft_engine::geom::Plane::named(name).or_else(|| {+ solidcraft_engine::view::construction_planes(&app.session).into_iter().find(|(_, n, _)| n == name).map(|(_, _, pl)| pl)})?;(pl.origin, Some(pl.normal()))}@@ -64,7 +64,7 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {Some(match &d.kind {Kind::Extrude { start, .. } => {let n = normal?;- let plane = solvecraft_engine::geom::Plane::from_normal(at, n)?;+ let plane = solidcraft_engine::geom::Plane::from_normal(at, n)?;let from = reference_height(app, d, "From Object", &plane, at).unwrap_or(0.0);let offset = if start.trim().is_empty() { 0.0 } else { app.session.doc.eval(start, ValueKind::Length).ok()? };(at + n * (from + offset), Some(n))@@ -79,23 +79,23 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {})}-fn profile_plane(app: &SolveApp, sketch: u64) -> Option<solvecraft_engine::geom::Plane> {+fn profile_plane(app: &SolveApp, sketch: u64) -> Option<solidcraft_engine::geom::Plane> {let component = app.session.doc.feature(sketch)?.component;let state = app.session.model.state();let plane = state.sketch(sketch)?.plane;let frame = crate::dialogs::feature_frame(&app.session, component);- solvecraft_engine::geom::Plane::new(- solvecraft_engine::doc::apply_point(&frame, plane.origin),- solvecraft_engine::doc::apply_vector(&frame, plane.x),- solvecraft_engine::doc::apply_vector(&frame, plane.y),+ solidcraft_engine::geom::Plane::new(+ solidcraft_engine::doc::apply_point(&frame, plane.origin),+ solidcraft_engine::doc::apply_vector(&frame, plane.x),+ solidcraft_engine::doc::apply_vector(&frame, plane.y),)}-fn reference_height(app: &SolveApp, d: &Dialog, label: &str, plane: &solvecraft_engine::geom::Plane, centre: Vec3) -> Option<f64> {+fn reference_height(app: &SolveApp, d: &Dialog, label: &str, plane: &solidcraft_engine::geom::Plane, centre: Vec3) -> Option<f64> {let point = crate::dialogs::object_point(&d.inputs, label)?;let p = point.as_array()?;let p = Vec3::new(p.first()?.as_f64()?, p.get(1)?.as_f64()?, p.get(2)?.as_f64()?);- Some(solvecraft_engine::doc::object_height(&app.session.world_state(), plane, centre, p))+ Some(solidcraft_engine::doc::object_height(&app.session.world_state(), plane, centre, p))}/// The outward direction between the two faces at an edge (a fillet's radius arrow points the@@ -195,7 +195,7 @@ fn offset_plane_quad(proj: &Proj, c: Vec3, n: Vec3, h: f64) -> Option<Vec<Pos2>>fn draw(app: &SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj, d: &mut Dialog, base: Vec3, bs: Pos2, dir: Option<Vec3>) {let t = Tokens::get();let to_span = dir.and_then(|n| {- let plane = solvecraft_engine::geom::Plane::from_normal(base, n)?;+ let plane = solidcraft_engine::geom::Plane::from_normal(base, n)?;reference_height(app, d, "To Object", &plane, base)});let all_span = if matches!(d.kind, Kind::Extrude { all: true, .. }) {@@ -203,7 +203,7 @@ fn draw(app: &SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj,let state = app.session.world_state();let plane = match d.inputs.first()?.items.first()? {Sel::Profile { sketch, .. } => profile_plane(app, *sketch)?,- _ => solvecraft_engine::geom::Plane::from_normal(base, n)?,+ _ => solidcraft_engine::geom::Plane::from_normal(base, n)?,};let targets: Vec<String> = d.extra@@ -211,7 +211,7 @@ fn draw(app: &SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj,.and_then(serde_json::Value::as_array).map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_owned)).collect()).unwrap_or_default();- solvecraft_engine::doc::through_all_distance(&state, &plane, &targets).ok()+ solidcraft_engine::doc::through_all_distance(&state, &plane, &targets).ok()})} else {None@@ -446,7 +446,7 @@ pub(crate) fn revolve_axis(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Vec3)> {"Y" => Vec3::Y,_ => Vec3::Z,};- return Some((solvecraft_engine::doc::apply_point(&frame, Vec3::ZERO), solvecraft_engine::doc::apply_vector(&frame, dir)));+ return Some((solidcraft_engine::doc::apply_point(&frame, Vec3::ZERO), solidcraft_engine::doc::apply_vector(&frame, dir)));}if let Sel::Axis { name } = selected&& matches!(name.as_str(), "x" | "y")@@ -479,7 +479,7 @@ fn draw_revolve(focus: bool,) {let to_mode = d.inputs.iter().any(|input| input.label == "To Object");- let extent = revolve_display_extent(app, d, axis).unwrap_or(solvecraft_engine::doc::RevolveExtent {+ let extent = revolve_display_extent(app, d, axis).unwrap_or(solidcraft_engine::doc::RevolveExtent {start: 0.0,sweep: f64::NAN,rotation_axis: axis.1,@@ -495,8 +495,8 @@ fn draw_revolve(let e1 = (base - centre) / radius;let e2 = extent.rotation_axis.cross(e1);let handed = match revolve_convention(d) {- solvecraft_engine::doc::RevolveConvention::LegacyAxisStart => -direction.dot(extent.rotation_axis),- solvecraft_engine::doc::RevolveConvention::SketchNormal => 1.0,+ solidcraft_engine::doc::RevolveConvention::LegacyAxisStart => -direction.dot(extent.rotation_axis),+ solidcraft_engine::doc::RevolveConvention::SketchNormal => 1.0,};let at = |angle: f64| centre + (e1 * angle.cos() + e2 * angle.sin()) * radius;let points: Vec<_> = (0..=48).filter_map(|i| proj.to_screen(at(extent.display_start + extent.sweep * i as f64 / 48.0))).collect();@@ -611,14 +611,14 @@ fn draw_revolve(});}-fn revolve_convention(d: &Dialog) -> solvecraft_engine::doc::RevolveConvention {+fn revolve_convention(d: &Dialog) -> solidcraft_engine::doc::RevolveConvention {d.extra.get("convention").and_then(|value| serde_json::from_value(value.clone()).ok())- .unwrap_or(solvecraft_engine::doc::RevolveConvention::SketchNormal)+ .unwrap_or(solidcraft_engine::doc::RevolveConvention::SketchNormal)}-fn revolve_display_extent(app: &SolveApp, d: &Dialog, axis: (Vec3, Vec3)) -> Option<solvecraft_engine::doc::RevolveExtent> {+fn revolve_display_extent(app: &SolveApp, d: &Dialog, axis: (Vec3, Vec3)) -> Option<solidcraft_engine::doc::RevolveExtent> {let Sel::Profile { sketch, .. } = d.inputs.first()?.items.first()? else { return None };let state = app.session.world_state();let ss = state.sketch(*sketch)?;@@ -632,7 +632,7 @@ fn revolve_display_extent(app: &SolveApp, d: &Dialog, axis: (Vec3, Vec3)) -> Opt_ => None,}).collect();- let regions = solvecraft_engine::sketch::merge_regions(®ions);+ let regions = solidcraft_engine::sketch::merge_regions(®ions);let plane = profile_plane(app, *sketch)?;let to_mode = d.inputs.iter().any(|input| input.label == "To Object");let to = if to_mode {@@ -649,7 +649,7 @@ fn revolve_display_extent(app: &SolveApp, d: &Dialog, axis: (Vec3, Vec3)) -> Optlet other = d.extra.get("angle2").map(|value| app.session.doc.eval(value.as_str().unwrap_or_default(), ValueKind::Angle)).transpose().ok()?;(angle, other)};- solvecraft_engine::doc::revolve_extent_with_convention(+ solidcraft_engine::doc::revolve_extent_with_convention(&state,&plane,®ions,@@ -788,7 +788,7 @@ mod tests {let mut worst = f32::NEG_INFINITY;for n in [Vec3::X, Vec3::Y, Vec3::Z] {for dir in crate::viewport::orbit_directions() {- let cam = solvecraft_engine::render::Camera::default().looking_from(dir);+ let cam = solidcraft_engine::render::Camera::default().looking_from(dir);let proj = Proj { cam, vp: cam.view_proj(4.0 / 3.0, 100.0), rect };let h = cam.half_height() * 0.25;let (Some(q), Some(c), Some(side)) =diff --git a/crates/ui-egui/src/configuration_rules_ui.rs b/crates/ui-egui/src/configuration_rules_ui.rsindex 0fcffab3e7..0a0ebfbf85 100644--- a/crates/ui-egui/src/configuration_rules_ui.rs+++ b/crates/ui-egui/src/configuration_rules_ui.rs@@ -2,7 +2,7 @@use crate::SolveApp;use egui::{RichText, Ui};use serde_json::{Value, json};-use solvecraft_engine::doc::config::{Column, ConfigRule, RuleCondition, RuleEffect, RuleOperator};+use solidcraft_engine::doc::config::{Column, ConfigRule, RuleCondition, RuleEffect, RuleOperator};#[derive(Clone, Debug)]pub struct Editor {diff --git a/crates/ui-egui/src/context_menu.rs b/crates/ui-egui/src/context_menu.rsindex 71dadd3d72..4c35d2d6b4 100644--- a/crates/ui-egui/src/context_menu.rs+++ b/crates/ui-egui/src/context_menu.rs@@ -14,7 +14,7 @@use egui::{Align2, Color32, FontId, Pos2, Rect, Sense, Stroke, Vec2, pos2, vec2};use serde::Serialize;use serde_json::{Value, json};-use solvecraft_engine::Sel;+use solidcraft_engine::Sel;use crate::theme::Tokens;use crate::{SolveApp, icons};@@ -123,7 +123,7 @@ impl Item {/// A command entry: label, icon, shortcut and enablement come from the registry.fn cmd(app: &SolveApp, id: &str, label: &str) -> Item {- let info = solvecraft_engine::find_command(id).map(|c| c.info(&app.session));+ let info = solidcraft_engine::find_command(id).map(|c| c.info(&app.session));let shortcut = match id {"edit.undo" => "Ctrl+Z".to_string(),"edit.redo" => "Ctrl+Y".to_string(),@@ -493,7 +493,7 @@ fn sketch_items(app: &SolveApp, id: u64) -> Vec<Item> {/// An assembly joint: edit, drive, suppress, delete.fn joint_items(app: &SolveApp, id: u64) -> Vec<Item> {let Some(j) = app.session.doc.assembly.joints.iter().find(|j| j.id == id) else { return Vec::new() };- let rigid = j.kind == solvecraft_engine::doc::joints::JointKind::Rigid;+ let rigid = j.kind == solidcraft_engine::doc::joints::JointKind::Rigid;vec![act("ui.editJoint", "Edit Joint", "joint").with(json!({ "joint": id })),act("ui.editJoint", "Edit Joint Limits", "").with(json!({ "joint": id })).on(!rigid),@@ -609,7 +609,7 @@ fn component_items(app: &SolveApp, id: u64) -> Vec<Item> {/// Sketch entity items: construction, fix, delete, dimension and the constraints the selection/// can take.fn sketch_entity_items(app: &SolveApp) -> Vec<Item> {- use solvecraft_engine::sketch::CurveKind;+ use solidcraft_engine::sketch::CurveKind;let Some(sid) = app.session.active_sketch else { return Vec::new() };let st = app.session.world_state();let Some(ss) = st.sketch(sid) else { return Vec::new() };@@ -1024,7 +1024,7 @@ pub fn delete(app: &mut SolveApp) {/// visibility (bodies, faces' and edges' bodies, sketches, construction and origin planes and/// axes, components' bodies, canvases). When some are shown and some hidden, all are hidden.pub fn toggle_visibility(app: &mut SolveApp) {- use solvecraft_engine::doc::FeatureKind;+ use solidcraft_engine::doc::FeatureKind;let paths: Vec<Vec<u64>> =app.session.selection.iter().filter_map(|s| if let Sel::Occurrence { path } = s { Some(path.clone()) } else { None }).collect();if !paths.is_empty() {@@ -1686,7 +1686,7 @@ mod tests {#[test]fn disabled_radial_menu_does_not_capture_right_button_hold() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());let ctx = egui::Context::default();let point = pos2(600.0, 400.0);app.viewport.mouse = Some(point);diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rsindex 6f7e426183..9d1c2eb3a2 100644--- a/crates/ui-egui/src/control.rs+++ b/crates/ui-egui/src/control.rs@@ -37,7 +37,7 @@use std::sync::mpsc::Sender;use serde_json::{Value, json};-use solvecraft_engine::render::{StandardView, render_png};+use solidcraft_engine::render::{StandardView, render_png};use crate::SolveApp;@@ -180,7 +180,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->};}}- match (serde_json::from_value::<crate::UiState>(cur), serde_json::from_value::<solvecraft_engine::Visibility>(vis)) {+ match (serde_json::from_value::<crate::UiState>(cur), serde_json::from_value::<solidcraft_engine::Visibility>(vis)) {(Ok(u), Ok(v)) => {app.ui = u;app.session.visibility = v;@@ -349,13 +349,13 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->let proj = crate::viewport::projection(app, rect);let num = |v: &Value, i: usize| v.get(i).and_then(Value::as_f64).unwrap_or(0.0);let world = if let Some(w) = p.get("world") {- Some(solvecraft_engine::geom::Vec3::new(num(w, 0), num(w, 1), num(w, 2)))+ Some(solidcraft_engine::geom::Vec3::new(num(w, 0), num(w, 1), num(w, 2)))} else if let Some(s) = p.get("sketch") {let st = app.session.world_state();app.session.active_sketch.and_then(|id| st.sketch(id))- .map(|ss| ss.plane.to_world(solvecraft_engine::geom::Vec2::new(num(s, 0), num(s, 1))))+ .map(|ss| ss.plane.to_world(solidcraft_engine::geom::Vec2::new(num(s, 0), num(s, 1))))} else if let Some(n) = p.get("plane").and_then(Value::as_str) {crate::viewport::origin_planes(app).into_iter().find(|(name, _, _)| *name == n).map(|(_, _, q)| (q[0] + q[1] + q[2] + q[3]) / 4.0)} else if let Some(n) = p.get("axis").and_then(Value::as_str) {@@ -365,7 +365,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->} else if let Some(n) = p.get("gizmo").and_then(Value::as_str) {// A handle of the move triad ("x", "xy", "rz", "ball"), moved `by` [x,y,z] mm or// turned `turn` degrees (rings).- let by = p.get("by").map(|b| solvecraft_engine::geom::Vec3::new(num(b, 0), num(b, 1), num(b, 2))).unwrap_or_default();+ let by = p.get("by").map(|b| solidcraft_engine::geom::Vec3::new(num(b, 0), num(b, 1), num(b, 2))).unwrap_or_default();crate::gizmo::handle_point(n, by, p.get("turn").and_then(Value::as_f64).unwrap_or(0.0))} else {None@@ -386,7 +386,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->.take(1000).map(|v| {let c = |i: usize| v.get(i).and_then(Value::as_f64).unwrap_or(0.0);- proj.to_screen(solvecraft_engine::geom::Vec3::new(c(0), c(1), c(2))).map_or(Value::Null, |q| json!([q.x, q.y]))+ proj.to_screen(solidcraft_engine::geom::Vec3::new(c(0), c(1), c(2))).map_or(Value::Null, |q| json!([q.x, q.y]))}).collect();ok(json!(pts))@@ -406,7 +406,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->.take(1000).map(|v| {let c = |i: usize| v.get(i).and_then(Value::as_f64).unwrap_or(0.0);- let q = solvecraft_engine::geom::Vec2::new(c(0), c(1));+ let q = solidcraft_engine::geom::Vec2::new(c(0), c(1));proj.to_screen(ss.plane.to_world(q)).map_or(Value::Null, |p| json!([p.x, p.y]))}).collect();@@ -527,7 +527,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->let h = f("height").unwrap_or(800.0).clamp(16.0, 8192.0) as usize;// Cut by the section the viewport shows (an open Section Analysis dialog's preview,// a sketch's Slice), not only the committed one.- let scene = solvecraft_engine::view::scene_with_section(&app.session, &app.cam, crate::viewport::section_plane(app));+ let scene = solidcraft_engine::view::scene_with_section(&app.session, &app.cam, crate::viewport::section_plane(app));let Some(png) = render_png(&scene, &app.cam, w, h) else { return err("render failed") };match s("path") {Some(path) => match std::fs::write(path, &png) {@@ -561,7 +561,7 @@ pub fn save_screenshot(image: &egui::ColorImage, path: Option<&str>) -> Value {buf.extend_from_slice(&c.to_array());}let Some(img) = image::RgbaImage::from_raw(w as u32, h as u32, buf) else { return json!({"ok": false, "error": "bad image"}) };- let path = path.map(str::to_string).unwrap_or_else(|| std::env::temp_dir().join("solvecraft-shot.png").to_string_lossy().to_string());+ let path = path.map(str::to_string).unwrap_or_else(|| std::env::temp_dir().join("solidcraft-shot.png").to_string_lossy().to_string());match img.save(&path) {Ok(()) => json!({"ok": true, "result": {"path": path, "width": w, "height": h}}),Err(e) => json!({"ok": false, "error": e.to_string()}),@@ -571,7 +571,7 @@ pub fn save_screenshot(image: &egui::ColorImage, path: Option<&str>) -> Value {#[cfg(test)]mod tests {use serde_json::json;- use solvecraft_engine::{Sel, Session};+ use solidcraft_engine::{Sel, Session};use super::*;use crate::Services;@@ -592,7 +592,7 @@ mod tests {let mut s = Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();let mut app = SolveApp::new(s, Services::default());- let dir = std::env::temp_dir().join(format!("solvecraft-render-section-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-render-section-{}", std::process::id()));std::fs::create_dir_all(&dir).unwrap();let whole = render(&mut app, &dir.join("whole.png"));app.session.selection = vec![Sel::Plane { name: "XZ".into() }];diff --git a/crates/ui-egui/src/crash_ui.rs b/crates/ui-egui/src/crash_ui.rsindex 4ce3dc48cb..fb04140528 100644--- a/crates/ui-egui/src/crash_ui.rs+++ b/crates/ui-egui/src/crash_ui.rs@@ -1,8 +1,8 @@-//! The Crash Reports window (Help > Crash Reports…): the reports `solvecraft_engine::crash`+//! The Crash Reports window (Help > Crash Reports…): the reports `solidcraft_engine::crash`//! keeps on this computer, each with a reviewed issue draft. It opens by itself after a crash.use egui::{RichText, vec2};-use solvecraft_engine::crash::{self, Summary};+use solidcraft_engine::crash::{self, Summary};use crate::SolveApp;use crate::theme::Tokens;@@ -153,12 +153,12 @@ mod tests {use serde_json::json;fn folder(tag: &str) -> std::path::PathBuf {- let d = std::env::temp_dir().join(format!("solvecraft-crash-ui-{tag}-{}", std::process::id()));+ let d = std::env::temp_dir().join(format!("solidcraft-crash-ui-{tag}-{}", std::process::id()));let _ = std::fs::remove_dir_all(&d);let id = "20261012-162341-bb60791ed6692f1d";std::fs::create_dir_all(d.join(id)).unwrap();let report = json!({- "format": "solvecraft-crash/1", "id": id, "kind": "unclean_exit", "count": 2,+ "format": "solidcraft-crash/1", "id": id, "kind": "unclean_exit", "count": 2,"first_seen": "2026-10-12T16:23:41Z", "message": "SolidCraft ended without a clean exit while running `solid.fillet`","location": "unclean exit in solid.fillet", "thread": "(unknown)", "backtrace": [],"command": {"command": "solid.fillet", "params": {"radius": 2}},@@ -176,7 +176,7 @@ mod tests {let d = folder("draft");let mut h = crate::scenario::Harness::new();h.app.crashes.folder = Some(d.clone());- let fresh = solvecraft_engine::crash::list(&d);+ let fresh = solidcraft_engine::crash::list(&d);assert_eq!(fresh.len(), 1);super::announce(&mut h.app, &fresh);assert!(h.app.crashes.open, "a real crash opens the window");@@ -201,7 +201,7 @@ mod tests {h.frames(2);h.step(&json!({"widget": "Delete all"})).unwrap();h.frames(2);- assert!(solvecraft_engine::crash::list(&d).is_empty());+ assert!(solidcraft_engine::crash::list(&d).is_empty());let _ = std::fs::remove_dir_all(&d);}@@ -221,7 +221,7 @@ mod tests {#[test]fn recovered_kernel_errors_do_not_interrupt() {let mut h = crate::scenario::Harness::new();- let quiet = solvecraft_engine::crash::Summary {+ let quiet = solidcraft_engine::crash::Summary {id: "x".into(),kind: "kernel_panic_recovered".into(),time: String::new(),diff --git a/crates/ui-egui/src/delete.rs b/crates/ui-egui/src/delete.rsindex 9089d952ae..d719a3805c 100644--- a/crates/ui-egui/src/delete.rs+++ b/crates/ui-egui/src/delete.rs@@ -18,8 +18,8 @@ pub struct Pending {/// What Delete acts on now: the selection (bodies not locked), plus the components picked in/// the browser (their occurrences).pub fn selection_params(app: &SolveApp) -> Value {- let items: Vec<&solvecraft_engine::Sel> =- app.session.selection.iter().filter(|s| !matches!(s, solvecraft_engine::Sel::Body { name } if app.ui.locked_bodies.contains(name))).collect();+ let items: Vec<&solidcraft_engine::Sel> =+ app.session.selection.iter().filter(|s| !matches!(s, solidcraft_engine::Sel::Body { name } if app.ui.locked_bodies.contains(name))).collect();let occurrences: Vec<u64> = app.tree.picked_components.iter().filter_map(|c| app.session.doc.occurrence_of(*c).map(|o| o.id)).collect();json!({ "items": items, "occurrences": occurrences, "canvases": app.tree.picked_canvases })}diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rsindex 50310323c8..e1b2f05888 100644--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@ -6,11 +6,11 @@ use std::hash::{Hash, Hasher};use egui::{Color32, RichText, Stroke, vec2};use serde_json::{Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::Session;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::doc::{AxisRef, Direction, FeatureKind, FilletStyle, HoleKind, Operation, PatternKind, PlaneRef, ProfileSel};-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::Session;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::doc::{AxisRef, Direction, FeatureKind, FilletStyle, HoleKind, Operation, PatternKind, PlaneRef, ProfileSel};+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::selection::{self, AXES, Accept, BODIES, CURVES, EDGES, FACES, PLANAR_FACES, PLANES, PROFILES, SelInput};@@ -936,7 +936,7 @@ fn feature_of_face(s: &Session, body: &str, index: usize, p: Vec3) -> Option<u64}) {return hit;}- let on_model = |st: &solvecraft_engine::doc::ModelState| {+ let on_model = |st: &solidcraft_engine::doc::ModelState| {st.bodies.iter().any(|b| {let m = b.mesh();let bb = m.bounds();@@ -1173,13 +1173,13 @@ fn update_fill_cells(app: &SolveApp, d: &mut Dialog) {/// The cells a set of tool bodies makes: each region inside some of them and outside the rest,/// as a point inside it and which tools hold it. Found by sampling a grid over the tools.-pub(crate) fn fill_cells(st: &solvecraft_engine::doc::ModelState, tools: &[String]) -> Vec<(Vec3, String)> {+pub(crate) fn fill_cells(st: &solidcraft_engine::doc::ModelState, tools: &[String]) -> Vec<(Vec3, String)> {let bodies: Vec<_> = tools.iter().filter_map(|n| st.body(n).map(|b| (n.clone(), b.mesh()))).take(16).collect();if bodies.is_empty() {return Vec::new();}let indexes: Vec<_> = bodies.iter().map(|(_, m)| m.inside_index()).collect();- let bb = bodies.iter().fold(solvecraft_engine::geom::Aabb3::EMPTY, |b, (_, m)| b.union(&m.bounds()));+ let bb = bodies.iter().fold(solidcraft_engine::geom::Aabb3::EMPTY, |b, (_, m)| b.union(&m.bounds()));let n = 20;let at = |i: usize, lo: f64, hi: f64| lo + (hi - lo) * (i as f64 + 0.5) / n as f64;// Signature (which tools hold the point) → the points with it.@@ -1280,7 +1280,7 @@ fn auto_operation(app: &SolveApp, d: &mut Dialog) {return;}let Some(op) =- dialog_commands(app, d).ok().and_then(|c| c.into_iter().next()).and_then(|(_, p)| solvecraft_engine::auto_operation(&app.session, &p))+ dialog_commands(app, d).ok().and_then(|c| c.into_iter().next()).and_then(|(_, p)| solidcraft_engine::auto_operation(&app.session, &p))else {return;};@@ -1816,7 +1816,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {}}Kind::Material { index } => {- let names: Vec<&str> = solvecraft_engine::doc::MATERIALS.iter().map(|(n, _)| *n).collect();+ let names: Vec<&str> = solidcraft_engine::doc::MATERIALS.iter().map(|(n, _)| *n).collect();row_label(ui, "Material");combo(ui, "mat", &names, index);ui.end_row();@@ -2372,7 +2372,7 @@ fn run_dialog(app: &mut SolveApp, d: &Dialog) -> Result<(), String> {}/// Placement used to edit a definition in the selected authoring occurrence.-pub(crate) fn feature_frame(s: &Session, component: u64) -> solvecraft_engine::doc::Mat {+pub(crate) fn feature_frame(s: &Session, component: u64) -> solidcraft_engine::doc::Mat {if component == s.active_component { s.active_component_frame() } else { s.placed_document().component_transform(component) }}@@ -2427,7 +2427,7 @@ pub fn preview_commands(app: &SolveApp, d: &Dialog) -> Result<Vec<(String, Value/// A wrapped Emboss edit keeps its profile guide in the saved author occurrence./// An invalid saved context must not draw the guide at a different occurrence.-pub(crate) fn emboss_profile_plane(app: &SolveApp, sketch: u64) -> Result<Option<solvecraft_engine::geom::Plane>, String> {+pub(crate) fn emboss_profile_plane(app: &SolveApp, sketch: u64) -> Result<Option<solidcraft_engine::geom::Plane>, String> {let Some(dialog) = app.dialog.as_ref().filter(|d| matches!(d.kind, Kind::Emboss { .. })) else { return Ok(None) };let Some((feature, _)) = dialog.editing else { return Ok(None) };let Some(feature) = app.session.doc.feature(feature) else { return Err("the edited feature is missing".into()) };@@ -2441,10 +2441,10 @@ pub(crate) fn emboss_profile_plane(app: &SolveApp, sketch: u64) -> Result<Optionlet owner = app.session.doc.feature(sketch.feature).map(|feature| feature.component).unwrap_or(0);let plane = sketch.plane;let frame = face.sketch_frame(&app.session.doc, feature.component, owner, body).map_err(|error| error.to_string())?;- solvecraft_engine::geom::Plane::new(- solvecraft_engine::doc::apply_point(&frame, plane.origin),- solvecraft_engine::doc::apply_vector(&frame, plane.x),- solvecraft_engine::doc::apply_vector(&frame, plane.y),+ solidcraft_engine::geom::Plane::new(+ solidcraft_engine::doc::apply_point(&frame, plane.origin),+ solidcraft_engine::doc::apply_vector(&frame, plane.x),+ solidcraft_engine::doc::apply_vector(&frame, plane.y),).map(Some).ok_or_else(|| "the Emboss author frame is degenerate".into())@@ -2837,7 +2837,7 @@ fn dialog_commands(app: &SolveApp, d: &Dialog) -> Result<Vec<(String, Value)>, S}Kind::Material { index } => {need(0, "bodies")?;- let name = solvecraft_engine::doc::MATERIALS.get(*index).map(|(n, _)| *n).unwrap_or("Default");+ let name = solidcraft_engine::doc::MATERIALS.get(*index).map(|(n, _)| *n).unwrap_or("Default");("material.assign", json!({"bodies": body_names(0), "material": name}))}Kind::Section { offset, flip } => {@@ -2849,7 +2849,7 @@ fn dialog_commands(app: &SolveApp, d: &Dialog) -> Result<Vec<(String, Value)>, Sjson!({"origin": pt(*point), "normal": pt(n)})}Some(Sel::Plane { name }) => {- let pl = solvecraft_engine::view::construction_planes(s)+ let pl = solidcraft_engine::view::construction_planes(s).into_iter().find(|(_, n, _)| n == name).map(|(_, _, pl)| pl)@@ -3042,14 +3042,14 @@ pub fn axis_of(app: &SolveApp, sel: &Sel) -> Option<(Vec3, Vec3)> {"Y" => Some((Vec3::ZERO, Vec3::Y)),"Z" => Some((Vec3::ZERO, Vec3::Z)),// A construction axis.- n => solvecraft_engine::view::construction_axes(&app.session).into_iter().find(|(_, an, _, _)| an == n).map(|(_, _, o, d)| (o, d)),+ n => solidcraft_engine::view::construction_axes(&app.session).into_iter().find(|(_, an, _, _)| an == n).map(|(_, _, o, d)| (o, d)),},Sel::SketchCurve { id } => {let st = app.session.world_state();let sid = curves_sketch(app, std::slice::from_ref(id), None)?;let ss = st.sketch(sid)?;let c = ss.sketch.curves.get(ss.sketch.curve_index(id)?)?;- let solvecraft_engine::sketch::CurveKind::Line { a, b } = c.kind else { return None };+ let solidcraft_engine::sketch::CurveKind::Line { a, b } = c.kind else { return None };let (pa, pb) = (ss.plane.to_world(ss.sketch.point(a)?), ss.plane.to_world(ss.sketch.point(b)?));Some((pa, (pb - pa).normalized()?))}@@ -3073,21 +3073,21 @@ pub fn axis_of(app: &SolveApp, sel: &Sel) -> Option<(Vec3, Vec3)> {}/// Which profiles of a sketch a profile selection means.-pub(crate) fn profile_indices(ss: &solvecraft_engine::doc::SolvedSketch, sel: &ProfileSel) -> Vec<usize> {+pub(crate) fn profile_indices(ss: &solidcraft_engine::doc::SolvedSketch, sel: &ProfileSel) -> Vec<usize> {let ps = &ss.profiles;match sel {ProfileSel::All => (0..ps.len()).collect(),ProfileSel::Indices { indices } => indices.iter().copied().filter(|i| *i < ps.len()).collect(),ProfileSel::OffsetBoundaries { .. } | ProfileSel::WholeBoundaries { .. } => {- solvecraft_engine::doc::profile_selection_indices(ss, sel).unwrap_or_default()+ solidcraft_engine::doc::profile_selection_indices(ss, sel).unwrap_or_default()}ProfileSel::Curves { loops } => loops.iter().filter_map(|l| {- solvecraft_engine::doc::profile_selection_indices(ss, &ProfileSel::Curves { loops: vec![l.clone()] }).ok()?.first().copied()+ solidcraft_engine::doc::profile_selection_indices(ss, &ProfileSel::Curves { loops: vec![l.clone()] }).ok()?.first().copied()}).collect(),- ProfileSel::Points { points } => points.iter().filter_map(|q| solvecraft_engine::doc::sketch::profile_at_point(ps, *q)).collect(),+ ProfileSel::Points { points } => points.iter().filter_map(|q| solidcraft_engine::doc::sketch::profile_at_point(ps, *q)).collect(),}}@@ -3115,13 +3115,13 @@ impl Drop for Refill {/// A point stored in a feature, as it shows on world body `body`: features keep their picks in/// the frame of the body they were on, so each body's placement takes the point to the world/// (a moved component, a pasted instance). Other points are the world already.-fn stored_on(frames: &Option<Vec<(String, solvecraft_engine::doc::Mat)>>, body: &str, p: Vec3) -> Vec3 {- frames.as_ref().and_then(|f| f.iter().find(|(n, _)| n == body)).map(|(_, m)| solvecraft_engine::doc::apply_point(m, p)).unwrap_or(p)+fn stored_on(frames: &Option<Vec<(String, solidcraft_engine::doc::Mat)>>, body: &str, p: Vec3) -> Vec3 {+ frames.as_ref().and_then(|f| f.iter().find(|(n, _)| n == body)).map(|(_, m)| solidcraft_engine::doc::apply_point(m, p)).unwrap_or(p)}/// Body placements while filling a dialog from a feature (when anything is placed).-fn stored_frames(s: &Session) -> Option<Vec<(String, solvecraft_engine::doc::Mat)>> {- if !REFILL.with(std::cell::Cell::get) || !solvecraft_engine::frames::placed(s) {+fn stored_frames(s: &Session) -> Option<Vec<(String, solidcraft_engine::doc::Mat)>> {+ if !REFILL.with(std::cell::Cell::get) || !solidcraft_engine::frames::placed(s) {return None;}let st = s.model.state();@@ -3165,14 +3165,14 @@ pub(crate) fn face_sel(s: &Session, p0: Vec3) -> Option<Sel> {best.filter(|(d, _)| *d < 1e-3 + 1e-6 * p0.len()).map(|x| x.1)}-fn emboss_face_sel(s: &Session, component: u64, face: &solvecraft_engine::doc::EmbossFace, persistent: &str) -> Option<Sel> {+fn emboss_face_sel(s: &Session, component: u64, face: &solidcraft_engine::doc::EmbossFace, persistent: &str) -> Option<Sel> {let source = s.model.state();let body = source.body(&face.body)?;- let index = solvecraft_engine::doc::naming::face_names(body).iter().position(|name| name == persistent)?;+ let index = solidcraft_engine::doc::naming::face_names(body).iter().position(|name| name == persistent)?;let owner = s.doc.model_body_component(body);let world_name = s.doc.world_body_name(&source, &face.body, owner, &face.path);- let author = solvecraft_engine::doc::EmbossFace::component_frame(&s.doc, component, &face.author_path).ok()?;- let point = solvecraft_engine::doc::apply_point(&author, face.at);+ let author = solidcraft_engine::doc::EmbossFace::component_frame(&s.doc, component, &face.author_path).ok()?;+ let point = solidcraft_engine::doc::apply_point(&author, face.at);s.world_state().body(&world_name)?;Some(Sel::Face { body: world_name, index, point })}@@ -3207,7 +3207,7 @@ fn pt3(v: Vec3) -> Value {}/// A point of expressions: numbers as numbers, expressions as strings.-fn pt_expr(p: &solvecraft_engine::doc::PointExpr) -> Value {+fn pt_expr(p: &solidcraft_engine::doc::PointExpr) -> Value {Value::Array(p.iter().map(|e| e.parse::<f64>().ok().filter(|x| x.is_finite()).map_or_else(|| json!(e), |x| json!(x))).collect())}@@ -3246,7 +3246,7 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Diaif let Some(point) = point {set_object(&mut d.inputs, &mut d.active, label, true);if let Some(input) = d.inputs.iter_mut().find(|i| i.label == label) {- input.items = vec![Sel::Vertex { body: String::new(), point: solvecraft_engine::doc::apply_point(&frame, point) }];+ input.items = vec![Sel::Vertex { body: String::new(), point: solidcraft_engine::doc::apply_point(&frame, point) }];}}}@@ -3264,8 +3264,8 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Dialet frame = feature_frame(s, f.component);let stored_axis = match axis {AxisRef::Line { origin, dir } => Some(json!({- "origin": pt(solvecraft_engine::doc::apply_point(&frame, *origin)),- "dir": pt(solvecraft_engine::doc::apply_vector(&frame, *dir))+ "origin": pt(solidcraft_engine::doc::apply_point(&frame, *origin)),+ "dir": pt(solidcraft_engine::doc::apply_vector(&frame, *dir))})),_ => None,};@@ -3280,7 +3280,7 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Diaif let Some(point) = to {set_to_object(&mut d.inputs, &mut d.active, true);if let Some(input) = d.inputs.iter_mut().find(|i| i.label == TO_OBJECT) {- input.items = vec![Sel::Vertex { body: String::new(), point: solvecraft_engine::doc::apply_point(&frame, *point) }];+ input.items = vec![Sel::Vertex { body: String::new(), point: solidcraft_engine::doc::apply_point(&frame, *point) }];}}let items = st.sketch(*sketch).map(|ss| profile_indices(ss, profiles)).unwrap_or_default();@@ -3320,7 +3320,7 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Dia}}// A fillet that reduces a radius too large for its edges.- if let FeatureKind::Fillet { fit: solvecraft_engine::doc::FilletFit::Reduce, .. } = &f.kind {+ if let FeatureKind::Fillet { fit: solidcraft_engine::doc::FilletFit::Reduce, .. } = &f.kind {d.extra.insert("fit".into(), json!("reduce"));}// A chord-length or variable fillet.@@ -3631,8 +3631,8 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<DiaFeatureKind::ConstructionPlane { plane: PlaneRef::AlongPath { path, t } } => {let mut d = start("construct.plane.along_path")?;let (item, sketch) = match path.as_ref() {- solvecraft_engine::doc::construct::GeoRef::SketchCurve { sketch, curve } => (Sel::SketchCurve { id: curve.clone() }, Some(*sketch)),- solvecraft_engine::doc::construct::GeoRef::Edge { at, name } => {+ solidcraft_engine::doc::construct::GeoRef::SketchCurve { sketch, curve } => (Sel::SketchCurve { id: curve.clone() }, Some(*sketch)),+ solidcraft_engine::doc::construct::GeoRef::Edge { at, name } => {// Preserve the saved named reference until a replacement is picked.d.extra.insert("path".into(), json!({"type":"edge","at":pt3(*at),"name":name}));(Sel::Edge { body: String::new(), index: 0, point: *at }, None)@@ -3798,7 +3798,7 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Dia#[cfg(test)]mod param_refusal_tests {use super::*;- use solvecraft_engine::Session;+ use solidcraft_engine::Session;#[test]fn a_refused_parameter_change_shows_why() {diff --git a/crates/ui-egui/src/dialogs_appearance.rs b/crates/ui-egui/src/dialogs_appearance.rsindex b52d501af7..bc8bf0b4b2 100644--- a/crates/ui-egui/src/dialogs_appearance.rs+++ b/crates/ui-egui/src/dialogs_appearance.rs@@ -5,7 +5,7 @@use egui::{Color32, RichText, Sense, Stroke, vec2};use serde_json::{Value, json};-use solvecraft_engine::Sel;+use solidcraft_engine::Sel;use crate::SolveApp;use crate::dialogs::{Kind, combo, row_label};@@ -118,12 +118,12 @@ pub fn start(app: &SolveApp, id: &str) -> Option<(Kind, Vec<SelInput>)> {let faces = app.session.selection.iter().any(|s| matches!(s, Sel::Face { .. }))&& !app.session.selection.iter().any(|s| matches!(s, Sel::Body { .. }));let state = app.session.world_state();- let body_look = |body: &solvecraft_engine::doc::ModelBody| {+ let body_look = |body: &solidcraft_engine::doc::ModelBody| {app.session.doc.model_body_look(body).or_else(|| {(body.body.paint().is_some() || body.imported.is_some() || body.body.color().is_some()).then(|| {let color =app.session.doc.body_color(body).map(|rgb| rgb.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8)).unwrap_or([196, 199, 204]);- solvecraft_engine::doc::appearance::Look::custom(color, app.session.doc.model_body_opacity(body))+ solidcraft_engine::doc::appearance::Look::custom(color, app.session.doc.model_body_opacity(body))})})};@@ -169,7 +169,7 @@ fn apply_params(targets: &[Sel], color: [u8; 3], opacity: f64, look: Option<&strif !faces.is_empty() {p["faces"] = json!(faces);// An engine without face looks: their bodies.- if bodies.is_empty() && solvecraft_engine::find_command("appearance.list").is_none() {+ if bodies.is_empty() && solidcraft_engine::find_command("appearance.list").is_none() {let mut owners: Vec<String> =targets.iter().filter_map(|x| if let Sel::Face { body, .. } = x { Some(body.clone()) } else { None }).collect();owners.dedup();@@ -483,8 +483,8 @@ fn target_names(targets: &[Sel]) -> String {#[cfg(test)]mod tests {- use solvecraft_engine::Session;- use solvecraft_engine::geom::Vec3;+ use solidcraft_engine::Session;+ use solidcraft_engine::geom::Vec3;use super::*;use crate::Services;diff --git a/crates/ui-egui/src/dialogs_assembly.rs b/crates/ui-egui/src/dialogs_assembly.rsindex 21a654e4e5..9bfd6d0283 100644--- a/crates/ui-egui/src/dialogs_assembly.rs+++ b/crates/ui-egui/src/dialogs_assembly.rs@@ -7,11 +7,11 @@use egui::{Color32, Pos2, RichText, Stroke, vec2};use serde_json::{Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::Session;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::doc::joints::JointKind;-use solvecraft_engine::geom::{Aabb3, Mesh, Vec3};+use solidcraft_engine::Sel;+use solidcraft_engine::Session;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::doc::joints::JointKind;+use solidcraft_engine::geom::{Aabb3, Mesh, Vec3};use crate::SolveApp;use crate::dialogs::{Dialog, Kind, combo, field, row_label};@@ -335,7 +335,7 @@ pub fn snap_of(s: &Session, sel: &Sel) -> Option<SnapPt> {match f.plane_normal {Some(n) => (body, SnapPt { at: f.centroid, z: n, kind: SnapKind::FaceCenter, param: json!({"face": pt(*point)}) }),None => {- let c = solvecraft_engine::kernel::cylinder_face_at(&b.body, *point)?;+ let c = solidcraft_engine::kernel::cylinder_face_at(&b.body, *point)?;let sv = (*point - c.axis_point).dot(c.axis);let (at, dir) = if (sv - c.start).abs() <= (c.end - sv).abs() { (c.start, -1.0) } else { (c.end, 1.0) };(@@ -614,7 +614,7 @@ fn interference(app: &mut SolveApp, picked: &[Sel]) -> (Value, Vec<Mesh>) {let mut meshes = Vec::new();for hit in r["interferences"].as_array().into_iter().flatten() {let (Some(a), Some(b)) = (hit["a"].as_str().and_then(|n| st.body(n)), hit["b"].as_str().and_then(|n| st.body(n))) else { continue };- if let Ok(Some(o)) = solvecraft_engine::kernel::boolean(&a.body, &b.body, solvecraft_engine::kernel::BoolOp::Intersect)+ if let Ok(Some(o)) = solidcraft_engine::kernel::boolean(&a.body, &b.body, solidcraft_engine::kernel::BoolOp::Intersect)&& let Ok(m) = o.tessellate((o.size() * 2e-3).max(1e-3)){meshes.push(m);@@ -816,7 +816,7 @@ pub fn world_preview(s: &Session, cmds: &[(String, Value)], colors: Colors) -> O// Any feature, when components are placed away from their frames: the preview must show// the world the viewport shows.let moves = cmds.iter().all(|(c, _)| MOVES.contains(&c.as_str()));- if cmds.is_empty() || !(moves || solvecraft_engine::frames::placed(s)) {+ if cmds.is_empty() || !(moves || solidcraft_engine::frames::placed(s)) {return None;}let preview = match s.preview_visible_world(cmds) {@@ -1086,12 +1086,12 @@ mod tests;thread_local! {/// Named joint origins in the world, for the design state they were found in.- static ORIGINS: std::cell::RefCell<Option<(String, Vec<(String, solvecraft_engine::doc::Mat)>)>> = const { std::cell::RefCell::new(None) };+ static ORIGINS: std::cell::RefCell<Option<(String, Vec<(String, solidcraft_engine::doc::Mat)>)>> = const { std::cell::RefCell::new(None) };}/// Named joint origins in the world: on their occurrence's component, so they move with it/// (joint drives, free moves not captured yet, Capture Position).-pub fn origins_world(s: &Session) -> Vec<(String, solvecraft_engine::doc::Mat)> {+pub fn origins_world(s: &Session) -> Vec<(String, solidcraft_engine::doc::Mat)> {if s.doc.assembly.origins.is_empty() {return Vec::new();}@@ -1099,7 +1099,7 @@ pub fn origins_world(s: &Session) -> Vec<(String, solvecraft_engine::doc::Mat)>if let Some(v) = ORIGINS.with(|o| o.borrow().as_ref().filter(|(k, _)| *k == key).map(|(_, v)| v.clone())) {return v;}- let doc: std::borrow::Cow<solvecraft_engine::doc::Document> = if s.pending_moves.is_empty() {+ let doc: std::borrow::Cow<solidcraft_engine::doc::Document> = if s.pending_moves.is_empty() {std::borrow::Cow::Borrowed(&*s.doc)} else {let mut d = (*s.doc).clone();@@ -1121,10 +1121,10 @@ pub fn origins(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {let t = Tokens::get();let len = app.cam.half_height() * 2.0 * 0.04;for (_, m) in origins_world(&app.session) {- let at = solvecraft_engine::doc::apply_point(&m, Vec3::ZERO);+ let at = solidcraft_engine::doc::apply_point(&m, Vec3::ZERO);let Some(c) = proj.to_screen(at) else { continue };for (axis, col) in [(Vec3::X, t.axis_x), (Vec3::Y, t.axis_y), (Vec3::Z, t.axis_z)] {- if let Some(tip) = proj.to_screen(at + solvecraft_engine::doc::apply_vector(&m, axis) * len) {+ if let Some(tip) = proj.to_screen(at + solidcraft_engine::doc::apply_vector(&m, axis) * len) {painter.line_segment([c, tip], Stroke::new(2.0, col));}}diff --git a/crates/ui-egui/src/dialogs_assembly_tests.rs b/crates/ui-egui/src/dialogs_assembly_tests.rsindex ade77ceb04..5803bcd2f4 100644--- a/crates/ui-egui/src/dialogs_assembly_tests.rs+++ b/crates/ui-egui/src/dialogs_assembly_tests.rs@@ -1,5 +1,5 @@use serde_json::json;-use solvecraft_engine::Session;+use solidcraft_engine::Session;use super::*;use crate::Services;@@ -273,7 +273,7 @@ fn joint_origins_follow_their_component() {let at = |app: &SolveApp| {let v = origins_world(&app.session);let (_, m) = v.iter().find(|(n, _)| n == "Top of B").unwrap();- solvecraft_engine::doc::apply_point(m, Vec3::ZERO)+ solidcraft_engine::doc::apply_point(m, Vec3::ZERO)};assert!(at(&app).dist(Vec3::new(40.0, 10.0, 10.0)) < 1e-6, "{:?}", at(&app));let b = occ(&app, "B");diff --git a/crates/ui-egui/src/dialogs_motion.rs b/crates/ui-egui/src/dialogs_motion.rsindex f4483b3d96..84754d83c4 100644--- a/crates/ui-egui/src/dialogs_motion.rs+++ b/crates/ui-egui/src/dialogs_motion.rs@@ -7,9 +7,9 @@ use std::collections::BTreeMap;use egui::{Color32, Pos2, RichText, Sense, Stroke, pos2, vec2};use serde_json::{Value, json};-use solvecraft_engine::Session;-use solvecraft_engine::doc::Mat;-use solvecraft_engine::doc::joints::JointKind;+use solidcraft_engine::Session;+use solidcraft_engine::doc::Mat;+use solidcraft_engine::doc::joints::JointKind;use crate::SolveApp;use crate::dialogs::{Dialog, Kind, combo, field, row_label};@@ -251,10 +251,10 @@ pub fn table(v: &Value) -> Table {}/// The unit a value of this kind is shown in.-fn unit_of(k: solvecraft_engine::doc::expr::Kind) -> Option<&'static str> {+fn unit_of(k: solidcraft_engine::doc::expr::Kind) -> Option<&'static str> {match k {- solvecraft_engine::doc::expr::Kind::Length => Some("mm"),- solvecraft_engine::doc::expr::Kind::Angle => Some("deg"),+ solidcraft_engine::doc::expr::Kind::Length => Some("mm"),+ solidcraft_engine::doc::expr::Kind::Angle => Some("deg"),_ => None,}}@@ -604,7 +604,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel&& let Some(unit) = app.session.doc.param(n).map(|parameter| parameter.unit.clone()).or_else(|| {kinds.iter().find(|x| x.0 == n).and_then(|x| {unit_of(x.2).map(|unit| {- if x.2 == solvecraft_engine::doc::expr::Kind::Length { app.session.doc.units.clone() } else { unit.to_string() }+ if x.2 == solidcraft_engine::doc::expr::Kind::Length { app.session.doc.units.clone() } else { unit.to_string() }})})})@@ -675,10 +675,10 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sellet (kind, _) = column_parts(c);let appearance = matches!(kind, "appearance" | "component_appearance" | "face_appearance");let shown = if appearance {- solvecraft_engine::doc::config::appearance_cell(val)+ solidcraft_engine::doc::config::appearance_cell(val).ok().flatten()- .filter(|look| solvecraft_engine::doc::appearance::library(&look.name).as_ref() == Some(look))+ .filter(|look| solidcraft_engine::doc::appearance::library(&look.name).as_ref() == Some(look)).map(|look| look.name).unwrap_or_else(|| val.clone())} else {@@ -702,14 +702,14 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Selui.close();}if kind == "material" {- for (name, _) in solvecraft_engine::doc::MATERIALS.iter().filter(|(n, _)| *n != "Default") {+ for (name, _) in solidcraft_engine::doc::MATERIALS.iter().filter(|(n, _)| *n != "Default") {if ui.button(*name).clicked() {choice = Some(name.to_string());ui.close();}}} else {- for (name, _, _) in solvecraft_engine::doc::appearance::LIBRARY {+ for (name, _, _) in solidcraft_engine::doc::appearance::LIBRARY {if ui.button(name).clicked() {choice = Some(name.to_string());ui.close();@@ -785,7 +785,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel}}for selected in &app.session.selection {- if let solvecraft_engine::Sel::Face { body, point, .. } = selected {+ if let solidcraft_engine::Sel::Face { body, point, .. } = selected {options.push((format!("Selected face on {body} (shared appearance)"), json!({"face_appearance":{"body":body,"point":point}})));}@@ -930,7 +930,7 @@ pub fn commands(app: &SolveApp, k: &Mo, inputs: &[SelInput]) -> Result<Vec<(StriMo::ContactSet { name, .. } => {let mut occs: Vec<u64> = Vec::new();for x in inputs.first().map(|i| i.items.as_slice()).unwrap_or(&[]) {- if let solvecraft_engine::Sel::Body { name } = x+ if let solidcraft_engine::Sel::Body { name } = x&& let Some(b) = app.session.world_state().body(name){let comp = app.session.doc.model_body_component(b);@@ -974,9 +974,9 @@ mod tests {#[test]fn shown_poses_are_put_back() {let mut app = SolveApp::new(Session::default(), crate::Services::default());- app.session.pending_moves.insert(9, solvecraft_engine::doc::IDENTITY);+ app.session.pending_moves.insert(9, solidcraft_engine::doc::IDENTITY);let before = app.session.pending_moves.clone();- let mut m = solvecraft_engine::doc::IDENTITY;+ let mut m = solidcraft_engine::doc::IDENTITY;m[3] = [5.0, 0.0, 0.0, 1.0];let shown: BTreeMap<u64, Mat> = [(3, m)].into_iter().collect();for (kind, applied, kept) in [("study", true, false), ("explode", false, false), ("explode", true, true)] {@@ -1061,7 +1061,7 @@ mod tests {select_rule_parameter(&mut h, "length");h.step(&json!({"widget":"Save Rule"})).unwrap();assert!(- matches!(&h.app.session.doc.configs.rules[0].condition,solvecraft_engine::doc::config::RuleCondition::All{conditions} if matches!(&conditions[0],solvecraft_engine::doc::config::RuleCondition::Parameter{..}))+ matches!(&h.app.session.doc.configs.rules[0].condition,solidcraft_engine::doc::config::RuleCondition::All{conditions} if matches!(&conditions[0],solidcraft_engine::doc::config::RuleCondition::Parameter{..})));h.run(&json!([{"call":"engine.execute","params":{"command":"config.rule","params":{"rule":{"id":"last","name":"Last drive","condition":{"type":"always"},"effect":{"type":"drive_parameter","parameter":"length","expression":"20 mm"}}}}},@@ -1179,8 +1179,8 @@ mod tests {assert!(h.widget("side:outer").is_some());assert!(h.widget("side:inner").is_some());h.run(&json!([{"widget":"side:outer"},{"widget":"Library"},{"widget":"ABS - Red"},{"widget":"Apply"}])).unwrap();- let solvecraft_engine::doc::config::Column::FaceAppearance(target) = &h.app.session.doc.configs.columns[0] else { panic!() };- assert!(matches!(&target.certificate, Some(solvecraft_engine::doc::config::FaceCertificate::ExtrudeSide { curve, .. }) if curve == "outer"));+ let solidcraft_engine::doc::config::Column::FaceAppearance(target) = &h.app.session.doc.configs.columns[0] else { panic!() };+ assert!(matches!(&target.certificate, Some(solidcraft_engine::doc::config::FaceCertificate::ExtrudeSide { curve, .. }) if curve == "outer"));let state = h.app.session.model.state();let body = state.body("Ring").unwrap();let indices = h.app.session.doc.configuration_face_indices(body, target).unwrap();diff --git a/crates/ui-egui/src/dialogs_move.rs b/crates/ui-egui/src/dialogs_move.rsindex 6d916c23c4..f0e54bae32 100644--- a/crates/ui-egui/src/dialogs_move.rs+++ b/crates/ui-egui/src/dialogs_move.rs@@ -3,9 +3,9 @@//! moves until a value is typed or the triad is dragged.use serde_json::{Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::dialogs::{Dialog, Kind, combo, field, row_label};diff --git a/crates/ui-egui/src/dialogs_parts.rs b/crates/ui-egui/src/dialogs_parts.rsindex e2afd05bfe..5097cf6199 100644--- a/crates/ui-egui/src/dialogs_parts.rs+++ b/crates/ui-egui/src/dialogs_parts.rs@@ -5,7 +5,7 @@use egui::{RichText, vec2};use serde_json::{Value, json};-use solvecraft_engine::{Sel, Session};+use solidcraft_engine::{Sel, Session};use crate::SolveApp;use crate::dialogs::{Kind, combo, row_label};@@ -207,14 +207,14 @@ pub fn commands(app: &SolveApp, k: &Pt, inputs: &[SelInput]) -> Result<Vec<(Stri};let p = insert_params(&lib, k, inputs.first().and_then(|i| i.items.first()))?;// The toolbar's command when the engine has it (same parameters).- let id = if solvecraft_engine::find_command("parts.fastener").is_some() { "parts.fastener" } else { "parts.insert" };+ let id = if solidcraft_engine::find_command("parts.fastener").is_some() { "parts.fastener" } else { "parts.insert" };Ok(vec![(id.into(), p)])}#[cfg(test)]mod tests {use super::*;- use solvecraft_engine::geom::Vec3;+ use solidcraft_engine::geom::Vec3;fn lib() -> Vec<Family> {families(&json!({"families": [diff --git a/crates/ui-egui/src/dialogs_plastic.rs b/crates/ui-egui/src/dialogs_plastic.rsindex afc3ff0d15..4fbc4ec91e 100644--- a/crates/ui-egui/src/dialogs_plastic.rs+++ b/crates/ui-egui/src/dialogs_plastic.rs@@ -2,11 +2,11 @@//! Plastic Rules and Assign Plastic Rule. Values left empty take the body's plastic rule.use serde_json::{Map, Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::FeatureKind;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::doc::plastic::PlasticRule;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::doc::FeatureKind;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::doc::plastic::PlasticRule;+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::dialogs::{Kind, combo, face_sel, field, row_label};diff --git a/crates/ui-egui/src/dialogs_plastic_tests.rs b/crates/ui-egui/src/dialogs_plastic_tests.rsindex fae6e6b290..7e054f0b03 100644--- a/crates/ui-egui/src/dialogs_plastic_tests.rs+++ b/crates/ui-egui/src/dialogs_plastic_tests.rs@@ -1,5 +1,5 @@use serde_json::json;-use solvecraft_engine::Session;+use solidcraft_engine::Session;use super::*;use crate::Services;diff --git a/crates/ui-egui/src/dialogs_sheet.rs b/crates/ui-egui/src/dialogs_sheet.rsindex 94f7528c62..40ebc902d8 100644--- a/crates/ui-egui/src/dialogs_sheet.rs+++ b/crates/ui-egui/src/dialogs_sheet.rs@@ -5,11 +5,11 @@use egui::{Align2, Color32, FontId, Pos2, Rect, RichText, Stroke, pos2, vec2};use serde_json::{Map, Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::doc::sheet::SheetRule;-use solvecraft_engine::doc::{FeatureKind, ProfileSel};-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::doc::sheet::SheetRule;+use solidcraft_engine::doc::{FeatureKind, ProfileSel};+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::dialogs::{Dialog, Kind, combo, edge_sel, face_sel, field, profile_indices, row_label};diff --git a/crates/ui-egui/src/dialogs_sheet_tests.rs b/crates/ui-egui/src/dialogs_sheet_tests.rsindex 1027824f77..8d83e428d9 100644--- a/crates/ui-egui/src/dialogs_sheet_tests.rs+++ b/crates/ui-egui/src/dialogs_sheet_tests.rs@@ -1,5 +1,5 @@use serde_json::json;-use solvecraft_engine::Session;+use solidcraft_engine::Session;use super::*;use crate::Services;@@ -295,7 +295,7 @@ fn bend_table_picker_writes_the_current_body() {app.run("sheet.flange", json!({"sketch": "Base"})).unwrap();app.run("sheet.flange", json!({"edges": [[50, 0, 2.5]], "height": 20})).unwrap();let body = app.session.model.state().sheets[0].body.clone();- let path = std::env::temp_dir().join(format!("solvecraft-bend-table-{}.csv", std::process::id()));+ let path = std::env::temp_dir().join(format!("solidcraft-bend-table-{}.csv", std::process::id()));let output = path.to_string_lossy().into_owned();let chosen = output.clone();app.services.pick_save = Some(Box::new(move |_, extensions| {diff --git a/crates/ui-egui/src/dialogs_surface.rs b/crates/ui-egui/src/dialogs_surface.rsindex cfbf7bf135..78696e8fe9 100644--- a/crates/ui-egui/src/dialogs_surface.rs+++ b/crates/ui-egui/src/dialogs_surface.rs@@ -2,10 +2,10 @@//! Trim and Split Face. Each has a live preview and Edit Feature.use serde_json::{Map, Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::doc::{FaceAt, FeatureKind, PlaneRef};-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::doc::{FaceAt, FeatureKind, PlaneRef};+use solidcraft_engine::geom::Vec3;use crate::SolveApp;use crate::dialogs::{Kind, OP_LABELS, OPS, combo, field, op_index, row_label};diff --git a/crates/ui-egui/src/dim_view.rs b/crates/ui-egui/src/dim_view.rsindex 5af1355f21..a20703be48 100644--- a/crates/ui-egui/src/dim_view.rs+++ b/crates/ui-egui/src/dim_view.rs@@ -2,7 +2,7 @@//! dimension line (or arc) with arrowheads, and the value centred on it; radius and diameter//! leaders with R / Ø, angles as an arc between the two lines, arc lengths with the arc mark,//! driven (reference) dimensions in parentheses in a muted colour. The geometry comes from-//! `solvecraft_sketch::dim_layout`.+//! `solidcraft_sketch::dim_layout`.//!//! A click selects a dimension (Delete removes it), a drag moves its text (and so the offset of//! its dimension line), a double-click edits its value in place with parameter completion.@@ -14,9 +14,9 @@ use std::sync::Arc;use egui::{FontId, Pos2, Rect, Shape, Stroke, vec2};use serde_json::json;-use solvecraft_engine::Sel;-use solvecraft_engine::geom::Vec2;-use solvecraft_engine::sketch::{ConstraintKind, DimFrame, chain_centres, default_text, dim_frame, dim_layout};+use solidcraft_engine::Sel;+use solidcraft_engine::geom::Vec2;+use solidcraft_engine::sketch::{ConstraintKind, DimFrame, chain_centres, default_text, dim_frame, dim_layout};use crate::SolveApp;use crate::theme::Tokens;@@ -52,16 +52,16 @@ struct Edit {/// document also makes the editor's identity check safe across document replacements.#[derive(Clone, Debug)]struct DimensionDraft {- baseline: Arc<solvecraft_engine::doc::Document>,+ baseline: Arc<solidcraft_engine::doc::Document>,sketch: u64,component: u64,path: Option<Vec<u64>>,- pending: std::collections::BTreeMap<u64, solvecraft_engine::doc::Mat>,+ pending: std::collections::BTreeMap<u64, solidcraft_engine::doc::Mat>,entities: Vec<String>,at: Vec2,checked_expr: String,- preview_doc: Arc<solvecraft_engine::doc::Document>,- preview: Arc<solvecraft_engine::doc::ModelState>,+ preview_doc: Arc<solidcraft_engine::doc::Document>,+ preview: Arc<solidcraft_engine::doc::ModelState>,error: Option<String>,/// A dimension that would over-constrain the sketch, placed as a driven (reference) one:/// it has no parameter and no value to edit (#320).@@ -79,7 +79,7 @@ impl DimensionDraft {fn params(&self, expr: &str) -> serde_json::Value {json!({"entities": self.entities, "text_at": [self.at.x, self.at.y], "value": expr})}- fn evaluate(&self, app: &SolveApp, expr: &str) -> Result<solvecraft_engine::Session, String> {+ fn evaluate(&self, app: &SolveApp, expr: &str) -> Result<solidcraft_engine::Session, String> {let mut scratch = app.session.scratch();let result = scratch.execute("sketch.dimension", &self.params(expr)).map_err(|e| e.to_string())?;let param = result.get("param").and_then(serde_json::Value::as_str).ok_or("The dimension value is unavailable")?;@@ -169,11 +169,11 @@ fn draft_of(app: &SolveApp, sketch: u64, entities: &[String], at: Vec2, driven:/// Cache inference at a stationary pointer, including incomplete/unsupported picks.#[derive(Clone)]struct Placement {- baseline: Arc<solvecraft_engine::doc::Document>,+ baseline: Arc<solidcraft_engine::doc::Document>,sketch: Option<u64>,component: u64,path: Option<Vec<u64>>,- pending: std::collections::BTreeMap<u64, solvecraft_engine::doc::Mat>,+ pending: std::collections::BTreeMap<u64, solidcraft_engine::doc::Mat>,entities: Vec<String>,at: Vec2,draft: Option<(String, DimensionDraft)>,@@ -398,7 +398,7 @@ pub fn show(app: &mut SolveApp, ui: &egui::Ui, painter: &egui::Painter, proj: &Plet mut constraints = sk.constraints.iter().map(|c| (ss, c, false)).collect::<Vec<_>>();if let (Some(source), Some((param, _))) = (draft_sketch, draft.as_ref()) {// A driven draft is keyed by its constraint id (it has no parameter).- let ours = |c: &&solvecraft_engine::sketch::Constraint| c.param.as_deref() == Some(param.as_str()) || (c.driven && c.id == *param);+ let ours = |c: &&solidcraft_engine::sketch::Constraint| c.param.as_deref() == Some(param.as_str()) || (c.driven && c.id == *param);constraints.extend(source.sketch.constraints.iter().filter(ours).map(|c| (source, c, true)));}for (source, c, is_draft) in constraints {@@ -483,7 +483,7 @@ pub fn show(app: &mut SolveApp, ui: &egui::Ui, painter: &egui::Painter, proj: &P}/// A point a dimension measures (for the shape it belongs to).-fn first_point(sk: &solvecraft_engine::sketch::Sketch, k: &ConstraintKind) -> Option<usize> {+fn first_point(sk: &solidcraft_engine::sketch::Sketch, k: &ConstraintKind) -> Option<usize> {use ConstraintKind::*;match *k {Length { l, .. } => sk.curves.get(l).and_then(|c| c.kind.point_ids().first().copied()),@@ -574,9 +574,9 @@ fn edit_box(app: &mut SolveApp, ctx: &egui::Context) {.session.doc.param(&e.param)- .and_then(|p| solvecraft_engine::doc::expr::unit_info(&p.unit))+ .and_then(|p| solidcraft_engine::doc::expr::unit_info(&p.unit)).map(|(k, _)| k)- .unwrap_or(solvecraft_engine::doc::expr::Kind::Unitless);+ .unwrap_or(solidcraft_engine::doc::expr::Kind::Unitless);let expression = app.session.doc.with_design_unit(&e.expr, kind);app.run("parameters.change", json!({"name": e.param, "expression": expression}))};diff --git a/crates/ui-egui/src/dimension_create_ui_tests.rs b/crates/ui-egui/src/dimension_create_ui_tests.rsindex 3cca17cf46..3e3f253b34 100644--- a/crates/ui-egui/src/dimension_create_ui_tests.rs+++ b/crates/ui-egui/src/dimension_create_ui_tests.rs@@ -11,7 +11,7 @@ fn line(end: [f64; 2]) -> Harness {// Leave room around the measured shape while testing the draft itself. Separate Fit// tests exercise measured dock occlusion without changing the picking projection.h.app.cam.distance = 80.0;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(end[0] * 0.5, end[1] * 0.5, 0.0);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(end[0] * 0.5, end[1] * 0.5, 0.0);h.settle();h}@@ -137,7 +137,7 @@ fn rectangle_side_and_fixed_origin_line_dimensions_preserve_other_constraints()h.app.run("sketch.rectangle.two_point", json!({"p0":[0,0],"p1":[20,10]})).unwrap();h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 80.;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(10., 5., 0.);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(10., 5., 0.);h.settle();let baseline = h.app.session.doc.to_json();let undo = h.app.session.undo.len();@@ -155,7 +155,7 @@ fn rectangle_side_and_fixed_origin_line_dimensions_preserve_other_constraints()#[test]fn pending_second_nested_plane_uses_world_picks_but_one_local_dimension() {- use solvecraft_engine::geom::Vec2;+ use solidcraft_engine::geom::Vec2;crate::dim_view::cancel();let mut h = Harness::new();let parent = h.app.run("component.create", json!({"name":"Assembly"})).unwrap();@@ -221,7 +221,7 @@ fn invalid_zero_negative_failed_open_and_click_away_leave_no_dimension() {h.step(&json!({"key":"Escape"})).unwrap();}place(&mut h, &[[10., 0.]], [10., 5.]);- assert!(h.app.run("doc.open", json!({"path":"missing-dimension-draft-design.solvecraft"})).is_err());+ assert!(h.app.run("doc.open", json!({"path":"missing-dimension-draft-design.solidcraft"})).is_err());assert!(crate::dim_view::editing(), "failed replacement must preserve the draft");assert_eq!(h.app.session.doc.to_json(), baseline);h.frames(8);@@ -247,7 +247,7 @@ fn dimension_to_fillet_virtual_sharp_keeps_the_arc_and_fixed_origin() {let corner = fillet["virtual_corners"][0].as_str().unwrap().to_string();h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 90.;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(5., 10., 0.);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(5., 10., 0.);h.settle();let baseline = h.app.session.doc.to_json();let undo = h.app.session.undo.len();@@ -262,7 +262,7 @@ fn dimension_to_fillet_virtual_sharp_keeps_the_arc_and_fixed_origin() {let sk = &solved.sketch;assert!((sk.point(sk.point_index(&corner).unwrap()).unwrap().y - 30.).abs() < 1e-6);assert!(sk.point(sk.resolve_point("riser.start").unwrap()).unwrap().len() < 1e-8);- assert!(sk.curves.iter().any(|c| matches!(c.kind, solvecraft_engine::sketch::CurveKind::Arc { .. })), "the dimension retains the fillet arc");+ assert!(sk.curves.iter().any(|c| matches!(c.kind, solidcraft_engine::sketch::CurveKind::Arc { .. })), "the dimension retains the fillet arc");h.app.run("edit.undo", json!({})).unwrap();assert_eq!(h.app.session.doc.to_json(), baseline);}@@ -276,7 +276,7 @@ fn draft_annotation_does_not_move_committed_dimension_hitboxes() {let width = h.app.run("sketch.dimension", json!({"entities":["l3"],"value":20})).unwrap()["param"].as_str().unwrap().to_string();h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 80.;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(10., 5., 0.);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(10., 5., 0.);h.settle();let at = crate::dim_view::text_at(&width).unwrap();let drawn = crate::dim_view::drawn();@@ -317,8 +317,8 @@ fn inch_dimension_entry_survives_unit_changes_undo_and_reopen() {assert_eq!(h.app.session.world_state().sketch(sketch).unwrap().sketch, before);h.app.run("edit.undo", json!({})).unwrap();assert_eq!(h.app.session.doc.units, "in");- let doc = solvecraft_engine::doc::Document::from_json(&h.app.session.doc.to_json()).unwrap();- let reopened = solvecraft_engine::Session::new(doc);+ let doc = solidcraft_engine::doc::Document::from_json(&h.app.session.doc.to_json()).unwrap();+ let reopened = solidcraft_engine::Session::new(doc);assert_eq!(reopened.doc.units, "in");assert_eq!(reopened.world_state().sketch(sketch).unwrap().sketch, before);crate::dim_view::cancel();@@ -329,7 +329,7 @@ fn inch_dimension_entry_survives_unit_changes_undo_and_reopen() {#[test]fn placing_a_two_point_dimension_picks_horizontal_vertical_or_aligned() {// What each placement fixes at 10 mm: the X span, the Y span, or the length.- let spans = |a: solvecraft_engine::geom::Vec2, b: solvecraft_engine::geom::Vec2| [(b.x - a.x).abs(), (b.y - a.y).abs(), a.dist(b)];+ let spans = |a: solidcraft_engine::geom::Vec2, b: solidcraft_engine::geom::Vec2| [(b.x - a.x).abs(), (b.y - a.y).abs(), a.dist(b)];for (at, measured) in [([6., 25.], 0), ([-10., 1.], 1), ([-5., 12.], 2)] {let mut h = line([12., 16.]);place(&mut h, &[[0., 0.], [12., 16.]], at);diff --git a/crates/ui-egui/src/documents.rs b/crates/ui-egui/src/documents.rsindex e46320907e..8d4b76fd8a 100644--- a/crates/ui-egui/src/documents.rs+++ b/crates/ui-egui/src/documents.rs@@ -6,8 +6,8 @@use egui::{Align2, Color32, FontId, Rect, Sense, Stroke, pos2, vec2};use serde_json::{Value, json};-use solvecraft_engine::Session;-use solvecraft_engine::render::Camera;+use solidcraft_engine::Session;+use solidcraft_engine::render::Camera;use crate::SolveApp;use crate::theme::Tokens;@@ -555,7 +555,7 @@ mod tests {fn tabs_keep_their_own_design() {let mut a = app();a.run("solid.box", json!({"length": 10, "width": 10, "height": 10})).unwrap();- a.session.selection = vec![solvecraft_engine::Sel::Body { name: "Body1".into() }];+ a.session.selection = vec![solidcraft_engine::Sel::Body { name: "Body1".into() }];a.cam.distance = 123.0;new_design(&mut a);assert_eq!(a.docs.count(), 2);@@ -591,7 +591,7 @@ mod tests {assert!(a.quit_requested, "nothing unsaved: quits at once");let mut a = app();- let file = std::env::temp_dir().join(format!("solvecraft-quit-save-{}.solvecraft", std::process::id()));+ let file = std::env::temp_dir().join(format!("solidcraft-quit-save-{}.solidcraft", std::process::id()));let _ = std::fs::remove_file(&file);a.run("solid.box", json!({"length": 10, "width": 10, "height": 10})).unwrap();a.run("file.save_as", json!({"path": file.to_string_lossy()})).unwrap();@@ -607,7 +607,7 @@ mod tests {answer_prompt(&mut a, Answer::Save);assert!(!dirty(&a, 0), "saved");assert_eq!(- std::fs::read(&file).ok().and_then(|b| solvecraft_engine::io::read_design(&b).ok()).map(|d| d.features.len()),+ std::fs::read(&file).ok().and_then(|b| solidcraft_engine::io::read_design(&b).ok()).map(|d| d.features.len()),Some(2),"the file holds the change");@@ -638,7 +638,7 @@ mod tests {assert!(!a.quit_requested && a.docs.quitting.is_none() && a.session.is_dirty());// A picked file: saved, then quit.- let file = std::env::temp_dir().join(format!("solvecraft-quit-saveas-{}.solvecraft", std::process::id()));+ let file = std::env::temp_dir().join(format!("solidcraft-quit-saveas-{}.solidcraft", std::process::id()));let _ = std::fs::remove_file(&file);let to = file.to_string_lossy().to_string();a.services.pick_save = Some(Box::new(move |_: &str, _: &[&str]| Some(to.clone())));@@ -653,7 +653,7 @@ mod tests {fn adopt_reuses_a_blank_design() {let mut a = app();let mut s = Session::default();- s.run_script(&solvecraft_engine::sample::script()).unwrap();+ s.run_script(&solidcraft_engine::sample::script()).unwrap();adopt(&mut a, s);assert_eq!(a.docs.count(), 1);assert!(!a.session.doc.features.is_empty());diff --git a/crates/ui-egui/src/drag_snap.rs b/crates/ui-egui/src/drag_snap.rsindex f165f789c9..5b3ce73937 100644--- a/crates/ui-egui/src/drag_snap.rs+++ b/crates/ui-egui/src/drag_snap.rs@@ -8,8 +8,8 @@ use std::cell::{Cell, RefCell};use egui::{Align2, FontId, Shape, Stroke};use serde_json::{Value, json};-use solvecraft_engine::geom::Vec2;-use solvecraft_engine::sketch::{CurveKind, Sketch};+use solidcraft_engine::geom::Vec2;+use solidcraft_engine::sketch::{CurveKind, Sketch};use crate::SolveApp;use crate::theme::Tokens;diff --git a/crates/ui-egui/src/expression_complete.rs b/crates/ui-egui/src/expression_complete.rsindex 10c235b4de..26df7cd500 100644--- a/crates/ui-egui/src/expression_complete.rs+++ b/crates/ui-egui/src/expression_complete.rs@@ -168,7 +168,7 @@ mod tests {impl Editor {fn new(text: &str) -> Self {let ctx = egui::Context::default();- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());for (name, value) in [("width", 40), ("width_extra", 50), ("wing", 20), ("wire", 10)] {app.run("parameters.add", json!({"name":name,"expression":format!("{value} mm")})).unwrap();}diff --git a/crates/ui-egui/src/extrude_edit_tests.rs b/crates/ui-egui/src/extrude_edit_tests.rsindex 467518e4bf..1e9e8fb95c 100644--- a/crates/ui-egui/src/extrude_edit_tests.rs+++ b/crates/ui-egui/src/extrude_edit_tests.rs@@ -1,7 +1,7 @@//! Exercise the actual feature editor, including frames rendered before OK.use crate::scenario::Harness;use serde_json::{Value, json};-use solvecraft_engine::doc::{Extent, FeatureKind};+use solidcraft_engine::doc::{Extent, FeatureKind};fn make(params: Value) -> Harness {make_in(Harness::new(), params)@@ -31,12 +31,12 @@ fn unchanged_all_profiles_includes_profiles_added_after_edit() {open(&mut h);h.step(&json!({"widget":"OK"})).unwrap();let FeatureKind::Extrude { profiles, .. } = &h.app.session.doc.find_feature("Depth").unwrap().kind else { panic!("extrude") };- assert!(matches!(profiles, solvecraft_engine::doc::ProfileSel::All));+ assert!(matches!(profiles, solidcraft_engine::doc::ProfileSel::All));h.app.run("sketch.edit", json!({"sketch":"Base"})).unwrap();h.app.run("sketch.rectangle.two_point", json!({"p0":[20,0],"p1":[25,5]})).unwrap();h.app.run("sketch.finish", json!({})).unwrap();let state = h.app.session.world_state();- let volume: f64 = state.bodies.iter().map(|b| solvecraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum();+ let volume: f64 = state.bodies.iter().map(|b| solidcraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum();assert!((volume - 1250.0).abs() < 1e-7, "{volume}");}@@ -71,7 +71,7 @@ fn negative_edit_keeps_downstream_distance_reference_positive() {h.app.run("solid.box", json!({"length":10,"width":10,"height":"d1","corner":[30,0,0],"body_name":"Dependent"})).unwrap();open(&mut h);h.step(&json!({"widget":"OK"})).unwrap();- assert_eq!(h.app.session.doc.eval("d1", solvecraft_engine::doc::expr::Kind::Length).unwrap(), 10.0);+ assert_eq!(h.app.session.doc.eval("d1", solidcraft_engine::doc::expr::Kind::Length).unwrap(), 10.0);assert_eq!(h.app.session.world_state().body("Dependent").unwrap().mesh().bounds().max.z, 10.0);}@@ -149,7 +149,7 @@ fn referenced_offset_recomputes_after_edit_and_save_reopen() {assert_eq!(extent(&h).to_offset.as_deref(), Some("clearance"));h.app.run("parameters.change", json!({"name":"clearance","expression":"6 mm"})).unwrap();assert_eq!(h.app.session.world_state().body("Main").unwrap().mesh().bounds().max.z, 21.0);- let path = h.dir.join("extent.solvecraft");+ let path = h.dir.join("extent.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();assert_eq!(extent(&h).to_offset.as_deref(), Some("clearance"));@@ -174,8 +174,8 @@ fn explicit_reverse_keeps_original_expression_and_parameter_sign() {h.step(&json!({"widget":"Reverse Direction"})).unwrap();h.step(&json!({"widget":"OK"})).unwrap();assert_eq!(extent(&h).distance, "10");- assert_eq!(extent(&h).direction, solvecraft_engine::doc::Direction::Negative);- assert_eq!(h.app.session.doc.eval("d1", solvecraft_engine::doc::expr::Kind::Length).unwrap(), 10.0);+ assert_eq!(extent(&h).direction, solidcraft_engine::doc::Direction::Negative);+ assert_eq!(h.app.session.doc.eval("d1", solidcraft_engine::doc::expr::Kind::Length).unwrap(), 10.0);assert_eq!(h.app.session.world_state().body("Main").unwrap().mesh().bounds().min.z, -10.0);}@@ -191,7 +191,7 @@ fn failed_edit_and_cancel_keep_full_history_and_existing_redo() {let redo = h.app.session.redo.len();assert_eq!(undo, 199);assert_eq!(redo, 1);- h.app.session.selection = vec![solvecraft_engine::Sel::Body { name: "Main".into() }];+ h.app.session.selection = vec![solidcraft_engine::Sel::Body { name: "Main".into() }];let selection = h.app.session.selection.clone();let original = serde_json::to_value(&*h.app.session.doc).unwrap();open(&mut h);@@ -225,7 +225,7 @@ fn tapered_from_and_signed_to_have_correct_start_volume_and_preview_parity() {let bounds = body.mesh().bounds();assert!((bounds.min.z - lo).abs() < 1e-8 && (bounds.max.z - hi).abs() < 1e-8, "{params}: {bounds:?}");let expected = 10.0 * (100.0 + 120.0 + 144.0) / 3.0;- let volume = solvecraft_engine::doc::kernel::measure(&body.body).unwrap().volume;+ let volume = solidcraft_engine::doc::kernel::measure(&body.body).unwrap().volume;assert!((volume - expected).abs() < 1e-5, "{params}: volume{volume} expected{expected}");let original = extent(&h);open(&mut h);diff --git a/crates/ui-egui/src/file_load.rs b/crates/ui-egui/src/file_load.rsindex 9e1afa7773..f7d3d34039 100644--- a/crates/ui-egui/src/file_load.rs+++ b/crates/ui-egui/src/file_load.rs@@ -11,7 +11,7 @@ use std::sync::{use serde_json::Value;#[cfg(not(target_arch = "wasm32"))]use serde_json::json;-use solvecraft_engine::{Session, doc::Document};+use solidcraft_engine::{Session, doc::Document};use crate::SolveApp;@@ -102,14 +102,14 @@ fn start(app: &mut SolveApp) {#[cfg(not(target_arch = "wasm32"))]fn compute(mut session: Session, path: &str, insert: bool, phase: &AtomicU8, cancelled: &AtomicBool) -> Job {- let profile = std::env::var_os("SOLVECRAFT_PROFILE_OPEN").is_some();+ let profile = solidcraft_engine::geom::env::var_os("PROFILE_OPEN").is_some();let began = std::time::Instant::now();if cancelled.load(Ordering::Relaxed) {return Err("file operation cancelled".into());}let command = if !insert {"doc.open"- } else if solvecraft_engine::io::is_mesh_path(path) {+ } else if solidcraft_engine::io::is_mesh_path(path) {"file.insert_mesh"} else {"file.insert_step"diff --git a/crates/ui-egui/src/fonts.rs b/crates/ui-egui/src/fonts.rsindex 67be7d4e20..796c995ba1 100644--- a/crates/ui-egui/src/fonts.rs+++ b/crates/ui-egui/src/fonts.rs@@ -343,7 +343,7 @@ pub fn setup_fonts(ctx: &egui::Context) {}/// On web, setup_fonts does not perform synchronous disk reads.-/// Use asynchronous loading through [`solvecraft_web`] or host scripts.+/// Use asynchronous loading through [`solidcraft_web`] or host scripts.#[cfg(target_arch = "wasm32")]pub fn setup_fonts(_ctx: &egui::Context) {}diff --git a/crates/ui-egui/src/gizmo.rs b/crates/ui-egui/src/gizmo.rsindex 5b8bf20c7f..d5706bfe00 100644--- a/crates/ui-egui/src/gizmo.rs+++ b/crates/ui-egui/src/gizmo.rs@@ -7,7 +7,7 @@use std::cell::RefCell;use egui::{Color32, Pos2, Rect, Sense, Shape, Stroke, vec2};-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::geom::Vec3;use crate::theme::Tokens;use crate::viewport::{Proj, projected_polygon};@@ -426,7 +426,7 @@ mod tests {let limit = (0.45 * 2f64.sqrt() * LEN_PX) as f32 + 3.0;let mut worst = 0.0f32;for dir in crate::viewport::orbit_directions() {- let cam = solvecraft_engine::render::Camera::default().looking_from(dir);+ let cam = solidcraft_engine::render::Camera::default().looking_from(dir);let proj = Proj { cam, vp: cam.view_proj(4.0 / 3.0, 100.0), rect };let l = mm_per_px(&proj, t.center).unwrap() * LEN_PX;let sh = shapes(&proj, &t, l).unwrap();diff --git a/crates/ui-egui/src/help.rs b/crates/ui-egui/src/help.rsindex 0effa70a80..b88258857a 100644--- a/crates/ui-egui/src/help.rs+++ b/crates/ui-egui/src/help.rs@@ -1,5 +1,5 @@//! The Help menu (the ? button on the application bar): Documentation (the online book), About-//! SolveCraft (version, commit, build date, licences, attributions, fonts), the keyboard shortcuts+//! SolidCraft (version, commit, build date, licences, attributions, fonts), the keyboard shortcuts//! (read only), and Report an Issue, which opens a local editable report draft.use egui::{RichText, vec2};@@ -8,12 +8,12 @@ use crate::SolveApp;use crate::theme::Tokens;pub const VERSION: &str = env!("CARGO_PKG_VERSION");-pub const COMMIT: &str = env!("SOLVECRAFT_COMMIT");-pub const BUILD_DATE: &str = env!("SOLVECRAFT_BUILD_DATE");+pub const COMMIT: &str = env!("SOLIDCRAFT_COMMIT");+pub const BUILD_DATE: &str = env!("SOLIDCRAFT_BUILD_DATE");/// The user and developer guide (docs/book, published by .github/workflows/pages.yml).pub const DOCS_URL: &str = "https://bherbruck.github.io/solidcraft/";const ATTRIBUTION: &str = include_str!("../../../ATTRIBUTION.md");-use solvecraft_engine::licences::{LICENSE_APACHE, LICENSE_MIT, NOTICE, THIRD_PARTY};+use solidcraft_engine::licences::{LICENSE_APACHE, LICENSE_MIT, NOTICE, THIRD_PARTY};/// Fonts: what this build carries.pub const FONTS: &str = "The interface uses egui's built-in fonts (Ubuntu Light and Hack, under the Ubuntu Font Licence and \the MIT/Bitstream Vera licence; Noto Emoji and the emoji icon font, under the OFL and MIT). Sketch text uses Liberation Sans \@@ -137,7 +137,7 @@ fn about(app: &mut SolveApp, ctx: &egui::Context) {});egui::CollapsingHeader::new("Third-party licences").show(ui, |ui| {if ui.button("Copy all licences").clicked() {- ctx.copy_text(solvecraft_engine::licences::all());+ ctx.copy_text(solidcraft_engine::licences::all());}third_party(ui);});@@ -170,7 +170,7 @@ mod tests {fn about_knows_its_build_and_diagnostics_say_where_it_runs() {assert!(!COMMIT.is_empty() && BUILD_DATE.len() == 10, "{COMMIT} {BUILD_DATE}");assert!(ATTRIBUTION.contains("ATTRIBUTION") || ATTRIBUTION.contains("Attribution"));- let app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());let d = diagnostics(&app);assert!(d.contains(VERSION) && d.contains(std::env::consts::OS) && d.contains("Renderer: CPU"), "{d}");}diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rsindex 4bbe6f4b88..cb7eb1f2bb 100644--- a/crates/ui-egui/src/home.rs+++ b/crates/ui-egui/src/home.rs@@ -5,8 +5,8 @@use std::collections::HashMap;use egui::{Color32, CornerRadius, RichText, Sense, Stroke, vec2};-use solvecraft_engine::Session;-use solvecraft_engine::render::{Camera, StandardView};+use solidcraft_engine::Session;+use solidcraft_engine::render::{Camera, StandardView};use crate::SolveApp;use crate::theme::Tokens;@@ -61,15 +61,15 @@ impl HomeState {pub fn thumbnail(s: &Session) -> Option<egui::ColorImage> {let mut cam = Camera::default();cam.set_view(StandardView::Iso);- let b = solvecraft_engine::view::bounds(s);+ let b = solidcraft_engine::view::bounds(s);if b.is_empty() {return None;}cam.fit(&b);// Fill the card: the fit leaves room for a whole window's margins.cam.distance *= 0.7;- let scene = solvecraft_engine::view::scene(s, &cam);- let c = solvecraft_engine::render::render(&scene, &cam, THUMB[0], THUMB[1]);+ let scene = solidcraft_engine::view::scene(s, &cam);+ let c = solidcraft_engine::render::render(&scene, &cam, THUMB[0], THUMB[1]);(c.rgba.len() == c.w * c.h * 4).then(|| egui::ColorImage::from_rgba_unmultiplied([c.w, c.h], &c.rgba))}@@ -86,7 +86,7 @@ fn cache_path(key: &str) -> Option<std::path::PathBuf> {.or_else(|| std::env::var_os("XDG_CACHE_HOME")).map(std::path::PathBuf::from).unwrap_or_else(std::env::temp_dir);- Some(root.join("SolveCraft").join("thumbnails").join(format!("{:016x}.png", h.finish())))+ Some(root.join("SolidCraft").join("thumbnails").join(format!("{:016x}.png", h.finish())))}#[cfg(not(target_arch = "wasm32"))]@@ -123,11 +123,11 @@ fn remember_at(s: &Session, #[cfg(not(target_arch = "wasm32"))] identity: Option#[cfg(not(target_arch = "wasm32"))]if let Some(path) = identity.filter(|p| s.path.as_deref().and_then(cache_path).as_ref() == Some(p)) {let rgba: Vec<u8> = img.pixels.iter().flat_map(|c| c.to_srgba_unmultiplied()).collect();- if let Some(bytes) = solvecraft_engine::render::png(THUMB[0], THUMB[1], rgba)+ if let Some(bytes) = solidcraft_engine::render::png(THUMB[0], THUMB[1], rgba)&& let Some(dir) = path.parent()&& std::fs::create_dir_all(dir).is_ok(){- let _ = solvecraft_engine::io::write_atomic(&path, &bytes, false);+ let _ = solidcraft_engine::io::write_atomic(&path, &bytes, false);}}Some(img)@@ -173,7 +173,7 @@ fn make(key: &str) -> Made {}let mut s = Session::default();let built = match key.strip_prefix("sample:").and_then(|i| i.parse::<usize>().ok()) {- Some(i) => solvecraft_engine::sample::samples().get(i).is_some_and(|smp| {+ Some(i) => solidcraft_engine::sample::samples().get(i).is_some_and(|smp| {let ok = s.run_script(&(smp.script)()).is_ok();s.doc_mut().name = smp.name.to_string();s.undo.clear();@@ -315,7 +315,7 @@ pub fn open_sample(app: &mut SolveApp, i: usize) {}pub fn open_recent(app: &mut SolveApp, path: &str) {- if !solvecraft_engine::io::vfs::exists(path) {+ if !solidcraft_engine::io::vfs::exists(path) {app.set_status(format!("{path} is no longer there"), true);return;}@@ -327,7 +327,7 @@ pub fn open_recent(app: &mut SolveApp, path: &str) {pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {poll(app, ui.ctx());let t = Tokens::get();- let samples = solvecraft_engine::sample::samples();+ let samples = solidcraft_engine::sample::samples();// In the browser a picture blocks the page while it builds (no threads) and a kernel// failure there can't be caught: samples are built when they are opened.if !cfg!(target_arch = "wasm32") {@@ -336,7 +336,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {}}let recent = app.home.recent.clone();- for p in recent.iter().filter(|p| solvecraft_engine::io::vfs::exists(p)) {+ for p in recent.iter().filter(|p| solidcraft_engine::io::vfs::exists(p)) {want(&mut app.home, p);}let mut action: Option<Box<dyn FnOnce(&mut SolveApp)>> = None;@@ -393,8 +393,8 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {ui.add_space(24.0);ui.horizontal_wrapped(|ui| {ui.hyperlink_to("Documentation", crate::help::DOCS_URL);- ui.hyperlink_to("Report an Issue", "https://github.com/bherbruck/solvecraft/issues/new");- ui.hyperlink_to("What's new", "https://github.com/bherbruck/solvecraft/releases/latest");+ ui.hyperlink_to("Report an Issue", "https://github.com/bherbruck/solidcraft/issues/new");+ ui.hyperlink_to("What's new", "https://github.com/bherbruck/solidcraft/releases/latest");if ui.link("Keyboard Shortcuts").clicked() {app.keymap.open = true;app.keymap.read_only = true;@@ -412,7 +412,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {let Some(p) = recent.get(i) else { return };let path = std::path::Path::new(p);let name = path.file_stem().map(|x| x.to_string_lossy().to_string()).unwrap_or_else(|| p.clone());- let missing = !solvecraft_engine::io::vfs::exists(p);+ let missing = !solidcraft_engine::io::vfs::exists(p);let mut sub = if missing {"missing".to_string()} else if p.starts_with("/opfs/") {@@ -555,7 +555,7 @@ mod tests {#[test]fn cached_recent_uses_a_separate_png_without_reading_or_changing_design_json() {let nonce = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos();- let path = std::env::temp_dir().join(format!("solvecraft-thumb-{}-{nonce}.solvecraft", std::process::id()));+ let path = std::env::temp_dir().join(format!("solidcraft-thumb-{}-{nonce}.solidcraft", std::process::id()));// Deliberately invalid design: a cached recent must not parse/evaluate it.let bytes = b"{\"thumbnail_test\":true}";std::fs::write(&path, bytes).unwrap();@@ -579,12 +579,12 @@ mod tests {fn recent_list_is_newest_first_and_bounded() {let mut h = HomeState::default();for i in 0..20 {- h.add_recent(&format!("/d/{i}.solvecraft"));+ h.add_recent(&format!("/d/{i}.solidcraft"));}- h.add_recent("/d/5.solvecraft");+ h.add_recent("/d/5.solidcraft");assert_eq!(h.recent.len(), MAX_RECENT);- assert_eq!(h.recent.first().map(String::as_str), Some("/d/5.solvecraft"));- assert_eq!(h.recent.iter().filter(|p| p.as_str() == "/d/5.solvecraft").count(), 1);+ assert_eq!(h.recent.first().map(String::as_str), Some("/d/5.solidcraft"));+ assert_eq!(h.recent.iter().filter(|p| p.as_str() == "/d/5.solidcraft").count(), 1);}/// Samples build in the background and make a picture; picking one opens its design.diff --git a/crates/ui-egui/src/inference.rs b/crates/ui-egui/src/inference.rsindex ea37034820..e27f40b3a6 100644--- a/crates/ui-egui/src/inference.rs+++ b/crates/ui-egui/src/inference.rs@@ -7,8 +7,8 @@ use std::cell::RefCell;use egui::{Shape, Stroke};use serde_json::json;-use solvecraft_engine::geom::Vec2;-use solvecraft_engine::sketch::{CurveKind, Sketch};+use solidcraft_engine::geom::Vec2;+use solidcraft_engine::sketch::{CurveKind, Sketch};use crate::SolveApp;use crate::theme::Tokens;diff --git a/crates/ui-egui/src/issue_report.rs b/crates/ui-egui/src/issue_report.rsindex 76162fb838..7b91c80bf8 100644--- a/crates/ui-egui/src/issue_report.rs+++ b/crates/ui-egui/src/issue_report.rs@@ -218,16 +218,16 @@ fn signature(app: &SolveApp, dialog: Option<&dialogs::Dialog>) -> u64 {h.0.finish()}-fn reportable(feature: &solvecraft_engine::doc::Feature) -> bool {+fn reportable(feature: &solidcraft_engine::doc::Feature) -> bool {!matches!(feature.kind,- solvecraft_engine::doc::FeatureKind::Sketch { .. }- | solvecraft_engine::doc::FeatureKind::Import { .. }- | solvecraft_engine::doc::FeatureKind::MeshImport { .. }+ solidcraft_engine::doc::FeatureKind::Sketch { .. }+ | solidcraft_engine::doc::FeatureKind::Import { .. }+ | solidcraft_engine::doc::FeatureKind::MeshImport { .. })}-fn feature_context(feature: &solvecraft_engine::doc::Feature) -> String {+fn feature_context(feature: &solidcraft_engine::doc::Feature) -> String {format!("Feature {}: {}\n{}", feature.id, debug(&feature.name, 160), block(&json_context(&feature.kind, 2000)))}@@ -249,7 +249,7 @@ pub fn draft_for(app: &SolveApp, dialog: Option<&dialogs::Dialog>, error: Optioncontext.push_str("\nSelected items (including occurrence paths):\n");context.push_str(&block(&debug(&app.session.selection.iter().take(32).collect::<Vec<_>>(), 3000)));for item in app.session.selection.iter().take(8) {- if let solvecraft_engine::Sel::Feature { id } = item+ if let solidcraft_engine::Sel::Feature { id } = item&& let Some(feature) = app.session.doc.feature(*id)&& reportable(feature){@@ -289,7 +289,7 @@ pub fn draft_for(app: &SolveApp, dialog: Option<&dialogs::Dialog>, error: OptionDraft { title, body, image: None, texture: None, note: String::new(), source_signature: source_signature(app, dialog) }}-/// A draft from a crash report (`solvecraft_engine::crash`): what happened, where, the command+/// A draft from a crash report (`solidcraft_engine::crash`): what happened, where, the command/// and how to replay it. The design stays on this computer; the draft says how to share it.pub fn crash_draft(report: &serde_json::Value) -> Draft {let s = |k: &str| report.get(k).and_then(serde_json::Value::as_str).unwrap_or("?").to_string();@@ -328,7 +328,7 @@ pub fn crash_draft(report: &serde_json::Value) -> Draft {if recent.is_empty() { "(none recorded)".to_string() } else { recent.join(", ") },s("id"),match (report.get("design_path").is_some(), report.get("replay_path").is_some()) {- (true, true) => "the design as it was before the crash (design.solvecraft) and the commands that crash it (replay.json)",+ (true, true) => "the design as it was before the crash (design.solidcraft) and the commands that crash it (replay.json)",(false, true) => "the commands that crash it on a new design (replay.json)",_ => "no replay (see its notes)",},@@ -622,7 +622,7 @@ mod tests {#![allow(clippy::unwrap_used, clippy::panic)]use super::*;use serde_json::json;- use solvecraft_engine::{Sel, Session};+ use solidcraft_engine::{Sel, Session};fn app() -> SolveApp {SolveApp::new(Session::default(), Default::default())@@ -909,7 +909,7 @@ mod tests {h.app.run("sketch.line", json!({"points":[[0,0],[20,0]]})).unwrap();h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 80.0;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(10.0, 0.0, 0.0);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(10.0, 0.0, 0.0);h.settle();h.step(&json!({"start":"sketch.dimension"})).unwrap();for point in [[0, 0, 0], [20, 0, 0], [10, 5, 0]] {diff --git a/crates/ui-egui/src/keymap.rs b/crates/ui-egui/src/keymap.rsindex afb84559be..78b7aba2b2 100644--- a/crates/ui-egui/src/keymap.rs+++ b/crates/ui-egui/src/keymap.rs@@ -7,7 +7,7 @@ use std::collections::BTreeMap;use egui::RichText;use serde_json::{Value, json};-use solvecraft_engine::command_specs;+use solidcraft_engine::command_specs;use crate::SolveApp;use crate::theme::Tokens;@@ -63,7 +63,7 @@ pub fn effective(app: &SolveApp, id: &str) -> Option<String> {match app.keymap.custom.get(id) {Some(k) if k.is_empty() => None,Some(k) => Some(k.clone()),- None => solvecraft_engine::find_command(id).and_then(|c| c.shortcut).map(str::to_string),+ None => solidcraft_engine::find_command(id).and_then(|c| c.shortcut).map(str::to_string),}}@@ -74,20 +74,20 @@ pub fn commands_for(app: &SolveApp, key: &str) -> Vec<&'static str> {/// The enabled command a key press runs, if any.pub fn command_for(app: &SolveApp, key: &str) -> Option<&'static str> {- commands_for(app, key).into_iter().find(|id| solvecraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled))+ commands_for(app, key).into_iter().find(|id| solidcraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled))}/// Bind `key` to a command (`""` clears it). Refused for reserved keys, and when other commands/// use the key unless `replace` (they lose it).pub fn bind(app: &mut SolveApp, id: &str, key: &str, replace: bool) -> Result<(), String> {- let spec = solvecraft_engine::find_command(id).ok_or_else(|| format!("no command `{id}`"))?;+ let spec = solidcraft_engine::find_command(id).ok_or_else(|| format!("no command `{id}`"))?;if RESERVED.contains(&key) {return Err(format!("{key} is used by SolidCraft itself"));}if !key.is_empty() {let others: Vec<&'static str> = commands_for(app, key).into_iter().filter(|o| *o != id).collect();if !others.is_empty() && !replace {- let names: Vec<&str> = others.iter().filter_map(|o| solvecraft_engine::find_command(o).map(|c| c.label)).collect();+ let names: Vec<&str> = others.iter().filter_map(|o| solidcraft_engine::find_command(o).map(|c| c.label)).collect();return Err(format!("{key} is already used by {}", names.join(", ")));}for o in others {@@ -264,7 +264,7 @@ mod tests {use super::*;fn app() -> SolveApp {- SolveApp::new(solvecraft_engine::Session::default(), Default::default())+ SolveApp::new(solidcraft_engine::Session::default(), Default::default())}#[test]diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rsindex 64c4f9876b..92196b39e2 100644--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@ -1,6 +1,6 @@-//! The SolveCraft egui front end.+//! The SolidCraft egui front end.//!-//! A thin shell over [`solvecraft_engine::Session`]: panels read engine state and act through+//! A thin shell over [`solidcraft_engine::Session`]: panels read engine state and act through//! commands ([`SolveApp::run`]). Nothing here owns design data. The layout follows the familiar//! parametric-CAD desktop: application bar, a toolbar of workspace tabs and panels, the browser//! on the left, the 3D viewport with an axis view and navigation bar, the command dialog on the@@ -55,7 +55,7 @@ mod status_tests {"Shell: offset: must be positive");assert_eq!(super::friendly_error("edit.undo", "nothing to undo"), "Undo: nothing to undo");- let mut app = super::SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = super::SolveApp::new(solidcraft_engine::Session::default(), Default::default());app.run("solid.box", serde_json::json!({"length": 5, "width": 5, "height": 5})).unwrap();assert_eq!(app.session.log.last().map(String::as_str), Some("Box done"));let _ = app.run("edit.redo", serde_json::json!({}));@@ -115,8 +115,8 @@ use std::sync::mpsc::Receiver;use serde::{Deserialize, Serialize};use serde_json::{Value, json};-use solvecraft_engine::Session;-use solvecraft_engine::render::{Camera, CameraAnim, StandardView};+use solidcraft_engine::Session;+use solidcraft_engine::render::{Camera, CameraAnim, StandardView};pub use control::{ControlRequest, ControlResponse};@@ -144,7 +144,7 @@ pub struct UiState {/// A soft shadow on the ground under the model (seen from above).pub ground_shadow: bool,/// The world's up axis (Z or Y; #3): the camera, axis view, home view and ground follow it.- pub up_axis: solvecraft_engine::render::UpAxis,+ pub up_axis: solidcraft_engine::render::UpAxis,/// Sketches whose closed profiles are not shaded.pub hidden_profiles: Vec<u64>,/// Finished sketches whose dimensions are shown.@@ -237,9 +237,9 @@ pub struct SolveApp {pub status: Option<(String, f64, bool)>,pub quit_requested: bool,/// Autosave into the recovery folder (the desktop app turns it on).- pub autosave: Option<solvecraft_engine::recovery::Autosaver>,+ pub autosave: Option<solidcraft_engine::recovery::Autosaver>,/// Designs left by crashed apps, offered for recovery.- pub recoverable: Vec<solvecraft_engine::recovery::Entry>,+ pub recoverable: Vec<solidcraft_engine::recovery::Entry>,/// The bodies of a just-opened Y-up file, offered to be stood up (`stand_up`).pub stand_up: Option<Vec<String>>,/// The anti-aliasing sample counts the graphics device supports (empty without a GPU).@@ -267,7 +267,7 @@ pub struct SolveApp {shot_token: u64,styled: bool,fitted: bool,- pending_fit: Option<(Camera, solvecraft_engine::geom::Aabb3, bool)>,+ pending_fit: Option<(Camera, solidcraft_engine::geom::Aabb3, bool)>,/// The start page.pub home: home::HomeState,pub file_load: file_load::FileLoad,@@ -538,7 +538,7 @@ impl SolveApp {}// Press Pull: edges get a fillet, faces and profiles an extrude.if id == "solid.press_pull" {- let edges = self.session.selection.iter().any(|s| matches!(s, solvecraft_engine::Sel::Edge { .. }));+ let edges = self.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::Edge { .. }));return self.start(if edges { "solid.fillet" } else { "solid.extrude" });}// Construction toggle: selected sketch curves switch at once, otherwise pick them.@@ -547,7 +547,7 @@ impl SolveApp {sketch_palette::toggle_construction(self);return;}- if let Some(spec) = solvecraft_engine::find_command(id)+ if let Some(spec) = solidcraft_engine::find_command(id)&& (tools::Tool::for_command(id).is_some() || dialogs::Dialog::for_command(self, id).is_some())&& id != "sketch.create"{@@ -580,7 +580,7 @@ impl SolveApp {| "sketch.constraint.tangent"| "sketch.constraint.concentric"| "sketch.constraint.collinear"- ) && let [solvecraft_engine::Sel::SketchCurve { id: a }, solvecraft_engine::Sel::SketchCurve { id: b }] =+ ) && let [solidcraft_engine::Sel::SketchCurve { id: a }, solidcraft_engine::Sel::SketchCurve { id: b }] =self.session.selection.as_slice()&& a != b{@@ -597,7 +597,7 @@ impl SolveApp {.selection.iter().filter_map(|s| match s {- solvecraft_engine::Sel::SketchCurve { id } | solvecraft_engine::Sel::SketchPoint { id } => Some(id.clone()),+ solidcraft_engine::Sel::SketchCurve { id } | solidcraft_engine::Sel::SketchPoint { id } => Some(id.clone()),_ => None,}).take(2)@@ -622,7 +622,7 @@ impl SolveApp {/// Edit a feature the way Fusion does: sketches open in sketch mode; other features roll the/// timeline back to just before themselves and reopen their dialog, filled in.pub fn edit_feature(&mut self, id: u64) {- use solvecraft_engine::doc::FeatureKind;+ use solidcraft_engine::doc::FeatureKind;let Some(f) = self.session.doc.feature(id) else { return };if matches!(f.kind, FeatureKind::Sketch { .. }) {self.edit_sketch(id);@@ -652,7 +652,7 @@ impl SolveApp {/// puts them back. Editing the sketch that is already open does nothing; editing another one/// finishes the current sketch first, so edit sessions never nest.pub fn edit_sketch(&mut self, id: u64) {- if let solvecraft_engine::doc::FaceAttachmentStatus::Lost { message, .. } =+ if let solidcraft_engine::doc::FaceAttachmentStatus::Lost { message, .. } =self.session.placed_document().sketch_face_attachment(id, &self.session.model){browser::redefine_sketch(self, id);@@ -704,7 +704,7 @@ impl SolveApp {}/// Everything shown as selected: the selection plus the open dialog's inputs.- pub fn highlighted(&self) -> Vec<solvecraft_engine::Sel> {+ pub fn highlighted(&self) -> Vec<solidcraft_engine::Sel> {let mut v = self.session.selection.clone();if let Some(d) = &self.dialog {v.extend(d.items());@@ -744,7 +744,7 @@ impl SolveApp {/// Insert a STEP file's bodies (an Import base feature) or a 3MF/STL file's meshes into the/// current design.pub fn insert_path(&mut self, path: &str) {- let cmd = if solvecraft_engine::io::is_mesh_path(path) { "file.insert_mesh" } else { "file.insert_step" };+ let cmd = if solidcraft_engine::io::is_mesh_path(path) { "file.insert_mesh" } else { "file.insert_step" };let before: Vec<String> = self.session.world_state().bodies.iter().map(|b| b.name.clone()).collect();if let Ok(r) = self.run(cmd, json!({ "path": path })) {self.fit_view();@@ -758,7 +758,7 @@ impl SolveApp {/// A dropped file: a STEP, 3MF or STL file joins a design that has features, anything else/// opens.pub fn drop_path(&mut self, path: &str) {- let import = solvecraft_engine::io::is_step_path(path) || solvecraft_engine::io::is_mesh_path(path);+ let import = solidcraft_engine::io::is_step_path(path) || solidcraft_engine::io::is_mesh_path(path);if import && !self.session.doc.features.is_empty() {self.insert_path_async(path);} else {@@ -769,7 +769,7 @@ impl SolveApp {/// Frame the model at once (programmatic use; the toolbar animates)./// Make `up` the world's up axis: the camera turns to the same standard view in that world/// (home) and frames the model.- pub fn set_up_axis(&mut self, up: solvecraft_engine::render::UpAxis) {+ pub fn set_up_axis(&mut self, up: solidcraft_engine::render::UpAxis) {self.ui.up_axis = up;self.cam_anim = None;self.cam.up = up;@@ -781,16 +781,16 @@ impl SolveApp {self.cam_anim = None;self.viewport.orbit_snap = None;self.viewport.orbit_free = None;- let bounds = solvecraft_engine::view::bounds(&self.session);+ let bounds = solidcraft_engine::view::bounds(&self.session);self.pending_fit = Some((self.cam, bounds, false));self.cam = self.fitted(self.cam);}/// `cam` moved to frame the whole model.pub fn fitted(&self, mut cam: Camera) -> Camera {- let b = solvecraft_engine::view::bounds(&self.session);+ let b = solidcraft_engine::view::bounds(&self.session);if b.is_empty() {- cam.target = solvecraft_engine::geom::Vec3::ZERO;+ cam.target = solidcraft_engine::geom::Vec3::ZERO;cam.distance = 150.0;} else {cam = self.fitted_bounds(cam, &b);@@ -798,7 +798,7 @@ impl SolveApp {cam}- fn fitted_bounds(&self, mut cam: Camera, bounds: &solvecraft_engine::geom::Aabb3) -> Camera {+ fn fitted_bounds(&self, mut cam: Camera, bounds: &solidcraft_engine::geom::Aabb3) -> Camera {if let Some(layout) = &self.viewport.layout {return viewport_layout::fit_bounds(cam, bounds, layout, self.ui.perspective).unwrap_or(cam);}@@ -857,13 +857,13 @@ impl SolveApp {to = self.fitted_bounds(to, &b);}None => {- self.pending_fit = Some((to, solvecraft_engine::view::bounds(&self.session), true));+ self.pending_fit = Some((to, solidcraft_engine::view::bounds(&self.session), true));to = self.fitted(to);}},"home" => {to.set_view(StandardView::Iso);- self.pending_fit = Some((to, solvecraft_engine::view::bounds(&self.session), true));+ self.pending_fit = Some((to, solidcraft_engine::view::bounds(&self.session), true));to = self.fitted(to);}v => match StandardView::parse(v) {@@ -1116,7 +1116,7 @@ impl SolveApp {/// A command's name as people see it (its label), for the status bar.pub fn command_label(id: &str) -> &str {- solvecraft_engine::find_command(id).map_or(id, |c| c.label)+ solidcraft_engine::find_command(id).map_or(id, |c| c.label)}/// An engine error with the command's label instead of its id: "Shell: offset must be …".diff --git a/crates/ui-egui/src/menu_tests.rs b/crates/ui-egui/src/menu_tests.rsindex 3f8b2f3378..08c1a0149e 100644--- a/crates/ui-egui/src/menu_tests.rs+++ b/crates/ui-egui/src/menu_tests.rs@@ -2,14 +2,14 @@use egui::pos2;use serde_json::json;-use solvecraft_engine::Session;+use solidcraft_engine::Session;use crate::context_menu::{self, Item, Target};use crate::{Services, SolveApp};fn sample_app() -> SolveApp {let mut s = Session::default();- s.run_script(&solvecraft_engine::sample::script()).unwrap();+ s.run_script(&solidcraft_engine::sample::script()).unwrap();SolveApp::new(s, Services::default())}@@ -19,7 +19,7 @@ fn properties_leave_with_the_document_but_survive_a_failed_open() {app.menu.props = Some(("Prior body".into(), json!({"volume_mm3":42})));app.start("config.table");assert!(app.dialog.is_some());- assert!(app.run("doc.open", json!({"path":"__missing_properties_regression__.solvecraft"})).is_err());+ assert!(app.run("doc.open", json!({"path":"__missing_properties_regression__.solidcraft"})).is_err());assert!(app.menu.props.is_some());assert!(app.dialog.is_some());app.run("file.new", json!({"name":"New design"})).unwrap();@@ -73,7 +73,7 @@ fn appearance_browser_action_targets_the_clicked_body() {act(&mut app, &Target::Body { name: b.clone() }, "Appearance");let dialog = app.dialog.as_ref().unwrap();assert!(matches!(dialog.kind, crate::dialogs::Kind::Appearance(_)));- assert_eq!(dialog.inputs[0].items, vec![solvecraft_engine::Sel::Body { name: b }]);+ assert_eq!(dialog.inputs[0].items, vec![solidcraft_engine::Sel::Body { name: b }]);}#[test]@@ -102,7 +102,7 @@ fn face_menu_hides_and_finds_the_body() {}assert!(find(&items, "Appearance").enabled);context_menu::run_item(&mut app, &find(&items, "Find in Timeline"), pos2(0.0, 0.0));- assert!(matches!(app.session.selection.as_slice(), [solvecraft_engine::Sel::Feature { .. }]));+ assert!(matches!(app.session.selection.as_slice(), [solidcraft_engine::Sel::Feature { .. }]));context_menu::run_item(&mut app, &find(&items, "Show/Hide"), pos2(0.0, 0.0));assert_eq!(app.session.visibility.hidden_bodies, vec![b]);}@@ -268,7 +268,7 @@ fn browser_folds_are_kept_in_the_preferences() {#[test]fn delete_key_handles_every_kind_and_asks_about_dependents() {- use solvecraft_engine::Sel;+ use solidcraft_engine::Sel;let mut app = sample_app();app.run("construct.plane.offset", json!({"base": "XY", "offset": 10})).unwrap();app.run("solid.box", json!({"length": 5, "width": 5, "height": 5, "corner": [200, 0, 0]})).unwrap();@@ -309,7 +309,7 @@ fn delete_key_handles_every_kind_and_asks_about_dependents() {fn menu_delete_items_use_the_same_path() {let mut app = sample_app();let b = body(&app);- let original_volume = solvecraft_engine::kernel::measure(&app.session.world_state().body(&b).unwrap().body).unwrap().volume;+ let original_volume = solidcraft_engine::kernel::measure(&app.session.world_state().body(&b).unwrap().body).unwrap().volume;let created = app.run("component.from_bodies", json!({"bodies": [b]})).unwrap();let c = app.session.doc.components[0].id;let transfer = created["components"][0]["feature"].as_u64().unwrap();@@ -328,14 +328,14 @@ fn menu_delete_items_use_the_same_path() {assert_eq!(restored.bodies.len(), 1, "the original joined plate stays intact");let plate = restored.body(&b).unwrap();assert_eq!(plate.component, 0);- assert!((solvecraft_engine::kernel::measure(&plate.body).unwrap().volume - original_volume).abs() < 1e-6);- assert!(plate.mesh().contains(solvecraft_engine::geom::Vec3::new(40.0, 35.0, 12.0)));- let mut reopened = solvecraft_engine::Session::new(solvecraft_engine::doc::Document::from_json(&app.session.doc.to_json()).unwrap());+ assert!((solidcraft_engine::kernel::measure(&plate.body).unwrap().volume - original_volume).abs() < 1e-6);+ assert!(plate.mesh().contains(solidcraft_engine::geom::Vec3::new(40.0, 35.0, 12.0)));+ let mut reopened = solidcraft_engine::Session::new(solidcraft_engine::doc::Document::from_json(&app.session.doc.to_json()).unwrap());reopened.refresh();let reopened_state = reopened.world_state();assert_eq!(reopened_state.bodies.len(), 1);assert_eq!(reopened_state.body(&b).unwrap().component, 0);- assert!((solvecraft_engine::kernel::measure(&reopened_state.body(&b).unwrap().body).unwrap().volume - original_volume).abs() < 1e-6);+ assert!((solidcraft_engine::kernel::measure(&reopened_state.body(&b).unwrap().body).unwrap().volume - original_volume).abs() < 1e-6);// A sketch from the browser: asks, since its features go too.let id = app.session.doc.features.iter().find(|f| f.name == "Base").unwrap().id;act(&mut app, &Target::Sketch { id }, "Delete");@@ -349,7 +349,7 @@ fn canvas_menu_hides_renames_calibrates_and_deletes() {png.extend(400u32.to_be_bytes());png.extend(200u32.to_be_bytes());png.extend([8, 6, 0, 0, 0, 0, 0, 0, 0]);- let data = solvecraft_engine::doc::canvas::base64_encode(&png);+ let data = solidcraft_engine::doc::canvas::base64_encode(&png);let id = app.run("canvas.insert", json!({"data": data, "plane": "XY", "width": 80})).unwrap()["canvas"].as_u64().unwrap();let t = Target::Canvas { id };act(&mut app, &t, "Show/Hide");@@ -476,7 +476,7 @@ fn named_views_save_restore_rename_and_delete() {act(&mut app, &Target::NamedViews, "New Named View");assert_eq!(app.session.doc.named_views.len(), 1);let saved = app.cam;- app.cam.set_view(solvecraft_engine::render::StandardView::Top);+ app.cam.set_view(solidcraft_engine::render::StandardView::Top);let t = Target::NamedView { name: "Named View1".into() };act(&mut app, &t, "Restore");assert_eq!(app.cam_anim.map(|a| a.to), Some(saved), "animates back to the saved camera");@@ -523,7 +523,7 @@ fn an_uncaptured_move_asks_before_the_next_command() {crate::browser::answer_capture(&mut app, "revert").unwrap();assert!(app.session.pending_moves.is_empty());assert!(app.dialog.is_some(), "Create Sketch started");- assert_eq!(app.session.doc.occurrences[0].transform, solvecraft_engine::doc::IDENTITY);+ assert_eq!(app.session.doc.occurrences[0].transform, solidcraft_engine::doc::IDENTITY);// Capture keeps the move.app.dialog = None;app.run("occurrence.move", json!({"occurrence": occ, "translate": [10, 0, 0], "capture": false})).unwrap();@@ -552,21 +552,21 @@ fn occurrence_moves_turn_about_their_origin_then_move() {app.run("component.from_bodies", json!({"bodies": [b]})).unwrap();let occ = app.session.doc.occurrences[0].id;let mut m = crate::browser::OccMove::new(occ);- m.pivot = Some(solvecraft_engine::geom::Vec3::new(5.0, 0.0, 0.0));+ m.pivot = Some(solidcraft_engine::geom::Vec3::new(5.0, 0.0, 0.0));m.translate = [10.0, 0.0, 0.0];m.angles = [0.0, 0.0, 90.0];crate::browser::apply_occurrence_move(&mut app, &m);let t = *app.session.pending_moves.get(&occ).unwrap();// The pivot lands 10 mm along X; X turns into Y.- let p = solvecraft_engine::doc::apply_point(&t, solvecraft_engine::geom::Vec3::new(5.0, 0.0, 0.0));- let x = solvecraft_engine::doc::apply_vector(&t, solvecraft_engine::geom::Vec3::X);+ let p = solidcraft_engine::doc::apply_point(&t, solidcraft_engine::geom::Vec3::new(5.0, 0.0, 0.0));+ let x = solidcraft_engine::doc::apply_vector(&t, solidcraft_engine::geom::Vec3::X);assert!((p.x - 15.0).abs() < 1e-9 && p.y.abs() < 1e-9, "{p:?}");assert!((x.y - 1.0).abs() < 1e-9, "{x:?}");// Changing the values again starts from where it was, not from the last move.m.translate = [0.0, 0.0, 0.0];m.angles = [0.0; 3];crate::browser::apply_occurrence_move(&mut app, &m);- assert_eq!(*app.session.pending_moves.get(&occ).unwrap(), solvecraft_engine::doc::IDENTITY);+ assert_eq!(*app.session.pending_moves.get(&occ).unwrap(), solidcraft_engine::doc::IDENTITY);}#[test]diff --git a/crates/ui-egui/src/occurrence_ui_tests.rs b/crates/ui-egui/src/occurrence_ui_tests.rsindex c70de7b2c1..0c1c698d53 100644--- a/crates/ui-egui/src/occurrence_ui_tests.rs+++ b/crates/ui-egui/src/occurrence_ui_tests.rs@@ -1,7 +1,7 @@use crate::context_menu::{self, Target};use crate::scenario::Harness;use serde_json::json;-use solvecraft_engine::Sel;+use solidcraft_engine::Sel;#[test]fn replaced_body_name_uses_evaluated_owner_in_browser_and_component_actions() {@@ -104,19 +104,19 @@ fn occurrence_move_dialog_keeps_other_pending_moves_and_reuses_initial_baseline(context_menu::run_item(&mut h.app, movement, egui::Pos2::ZERO);let mut m = h.app.tree.occurrence_move.clone().unwrap();m.pivot =- Some(solvecraft_engine::doc::apply_point(&h.app.session.occurrence_placement(&[second]).unwrap().world, solvecraft_engine::geom::Vec3::ZERO));+ Some(solidcraft_engine::doc::apply_point(&h.app.session.occurrence_placement(&[second]).unwrap().world, solidcraft_engine::geom::Vec3::ZERO));m.translate = [10.0, 0.0, 0.0];crate::browser::apply_occurrence_move(&mut h.app, &m);let at = h.app.session.occurrence_placement(&[second]).unwrap();- assert!((solvecraft_engine::doc::apply_point(&at.world, solvecraft_engine::geom::Vec3::ZERO).x - 65.0).abs() < 1e-8);+ assert!((solidcraft_engine::doc::apply_point(&at.world, solidcraft_engine::geom::Vec3::ZERO).x - 65.0).abs() < 1e-8);m.translate = [3.0, 0.0, 0.0];crate::browser::apply_occurrence_move(&mut h.app, &m);let at = h.app.session.occurrence_placement(&[second]).unwrap();- assert!((solvecraft_engine::doc::apply_point(&at.world, solvecraft_engine::geom::Vec3::ZERO).x - 58.0).abs() < 1e-8);+ assert!((solidcraft_engine::doc::apply_point(&at.world, solidcraft_engine::geom::Vec3::ZERO).x - 58.0).abs() < 1e-8);assert_eq!(h.app.session.pending_moves[&first], first_pending);crate::browser::revert_occurrence_dialog(&mut h.app, &m);let restored = h.app.session.occurrence_placement(&[second]).unwrap();- assert!((solvecraft_engine::doc::apply_point(&restored.world, solvecraft_engine::geom::Vec3::ZERO).x - 55.0).abs() < 1e-8);+ assert!((solidcraft_engine::doc::apply_point(&restored.world, solidcraft_engine::geom::Vec3::ZERO).x - 55.0).abs() < 1e-8);assert_eq!(h.app.session.pending_moves[&first], first_pending);h.app.run("component.revert_position", json!({"occurrences":[second]})).unwrap();context_menu::run_item(&mut h.app, movement, egui::Pos2::ZERO);diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rsindex 8ddadb243a..ff1c7c69c3 100644--- a/crates/ui-egui/src/palette.rs+++ b/crates/ui-egui/src/palette.rs@@ -3,7 +3,7 @@use egui::{RichText, vec2};use serde_json::Value;-use solvecraft_engine::command_specs;+use solidcraft_engine::command_specs;use crate::SolveApp;use crate::theme::Tokens;@@ -38,7 +38,7 @@ pub fn submit(app: &mut SolveApp, line: &str) {Some(i) => (&line[..i], line[i..].trim()),None => (line, ""),};- if solvecraft_engine::find_command(id).is_some() {+ if solidcraft_engine::find_command(id).is_some() {if rest.is_empty() {app.start(id);} else {@@ -113,7 +113,7 @@ pub fn popup(app: &mut SolveApp, ctx: &egui::Context) {}egui::ScrollArea::vertical().max_height(280.0).show(ui, |ui| {for (id, label, icon) in list.iter().take(60) {- let enabled = solvecraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled);+ let enabled = solidcraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled);ui.horizontal(|ui| {let (ir, _) = ui.allocate_exact_size(vec2(18.0, 18.0), egui::Sense::hover());crate::icons::paint(ui.painter(), ir, icon, t.icon, t.icon_fill, t.accent);diff --git a/crates/ui-egui/src/params_dialog.rs b/crates/ui-egui/src/params_dialog.rsindex 1383f5df1d..4987a442fd 100644--- a/crates/ui-egui/src/params_dialog.rs+++ b/crates/ui-egui/src/params_dialog.rs@@ -69,7 +69,7 @@ fn rows(app: &mut SolveApp) -> Vec<Row> {// Sketch dimension parameters: the sketch that owns each.let mut owner: std::collections::BTreeMap<String, String> = Default::default();for f in &app.session.doc.features {- if let solvecraft_engine::doc::FeatureKind::Sketch { sketch, .. } = &f.kind {+ if let solidcraft_engine::doc::FeatureKind::Sketch { sketch, .. } = &f.kind {for c in &sketch.constraints {if let Some(p) = &c.param {owner.insert(p.clone(), f.name.clone());@@ -502,7 +502,7 @@ mod tests {assert_eq!(word_before("1 + ", 4), (4, String::new()));assert_eq!(word_before("ü", 9), (0, "ü".to_string()));let ctx = egui::Context::default();- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());let _ = app.run("parameters.add", json!({"name": "width", "expression": "40 mm"}));publish(&mut app, &ctx);let s = suggestions(&ctx, "wi");diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rsindex a603dc68a9..d09ee9f4c9 100644--- a/crates/ui-egui/src/prefs.rs+++ b/crates/ui-egui/src/prefs.rs@@ -11,7 +11,18 @@use egui::{Modifiers, Pos2, RichText};use serde::{Deserialize, Serialize};use serde_json::json;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::geom::Vec3;++/// The key the apps keep the preferences under in eframe's storage.+pub const STORAGE_KEY: &str = "solidcraft.prefs";+/// The key earlier releases used. Compatibility shim (docs/compatibility.md): read when the+/// current key is missing, never written.+pub const LEGACY_STORAGE_KEY: &str = "solvecraft.prefs";++/// The stored preferences, from the current key or else the legacy one.+pub fn stored(get: impl Fn(&str) -> Option<String>) -> Option<String> {+ get(STORAGE_KEY).or_else(|| get(LEGACY_STORAGE_KEY))+}use crate::SolveApp;use crate::theme::Tokens;@@ -483,12 +494,12 @@ pub fn length_drag<'a>(value: &'a mut f64, units: &str, decimals: u8) -> egui::D/// A length typed into a field, in millimetres: a bare number is in the design's units (`scale`/// units per millimetre); an explicit unit ("10 mm", "0.5 in", "2 cm + 3 mm") is honoured.pub fn parse_length_mm(text: &str, scale: f64) -> Option<f64> {- use solvecraft_engine::doc::expr;+ use solidcraft_engine::doc::expr;if !(scale.is_finite() && scale > 0.0) {return None;}let defaults = expr::Defaults { len: 1.0 / scale, ..expr::Defaults::default() };- let no_params = |n: &str| Err(solvecraft_engine::doc::DocError::Expr(format!("unknown parameter `{n}`")));+ let no_params = |n: &str| Err(solidcraft_engine::doc::DocError::Expr(format!("unknown parameter `{n}`")));let value = expr::eval_with_defaults(text.trim(), &no_params, defaults).ok()?.to_kind_in(expr::Kind::Length, defaults).ok()?;value.is_finite().then_some(value)}@@ -706,7 +717,7 @@ fn close(app: &mut SolveApp, revert: bool) {/// The default orientation changed: the view turns to match.fn up_axis_changed(app: &mut SolveApp) {- use solvecraft_engine::render::UpAxis;+ use solidcraft_engine::render::UpAxis;app.prefs_window.applied_up = Some(app.preferences.up_axis.clone());let up = if app.preferences.up_axis.eq_ignore_ascii_case("y") { UpAxis::Y } else { UpAxis::Z };if app.ui.up_axis != up || app.cam.up != up {@@ -1001,6 +1012,15 @@ pub fn set(app: &mut SolveApp, p: &serde_json::Value) -> Result<serde_json::Valu#[cfg(test)]mod tests {+ #[test]+ fn stored_prefs_fall_back_to_the_legacy_key() {+ let only_old = |k: &str| (k == super::LEGACY_STORAGE_KEY).then(|| "old".to_string());+ assert_eq!(super::stored(only_old).as_deref(), Some("old"));+ let both = |k: &str| Some(if k == super::STORAGE_KEY { "new" } else { "old" }.to_string());+ assert_eq!(super::stored(both).as_deref(), Some("new"));+ assert_eq!(super::stored(|_| None), None);+ }+use super::*;#[test]@@ -1009,7 +1029,7 @@ mod tests {let _ = std::fs::create_dir_all(&dir);let path = dir.join("graphics.json");let services = crate::Services { graphics_path: Some(path.to_string_lossy().to_string()), ..Default::default() };- let mut app = SolveApp::new(solvecraft_engine::Session::default(), services);+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), services);// WebGPU's guarantee for the surface format: 8x saved, the device can only do 1x and 4x.app.msaa_supported = vec![1, 4];app.preferences.msaa = 8;@@ -1048,7 +1068,7 @@ mod tests {#[test]fn control_channel_rejects_msaa_the_device_cannot_do_and_bad_saved_msaa_loads_as_default() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());app.msaa_supported = vec![1, 4];assert!(set(&mut app, &serde_json::json!({ "msaa": 8 })).is_err());assert!(set(&mut app, &serde_json::json!({ "msaa": 1 })).is_ok());@@ -1081,7 +1101,7 @@ mod tests {h.call("ui.prefs", json!({"open":"Navigation"}));h.step(&json!({"widget":"Radial context menu"})).unwrap();assert!(h.app.preferences.radial_context_menu, "the actual checkbox enables radial menus");- let mut restored = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut restored = SolveApp::new(solidcraft_engine::Session::default(), Default::default());restored.load_prefs(&h.app.prefs());assert!(restored.preferences.radial_context_menu, "enabled preference survives save/load");h.call("ui.prefs", json!({"button":"cancel"}));@@ -1097,7 +1117,7 @@ mod tests {#[test]fn wheel_smoothing_persists_and_follows_dialog_buttons() {assert!(serde_json::from_value::<Prefs>(json!({})).unwrap().smooth_wheel_zoom);- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());control(&mut app, &json!({"open":"Navigation", "smooth_wheel_zoom":false})).unwrap();control(&mut app, &json!({"button":"cancel"})).unwrap();assert!(app.preferences.smooth_wheel_zoom);@@ -1105,7 +1125,7 @@ mod tests {control(&mut app, &json!({"button":"apply"})).unwrap();control(&mut app, &json!({"smooth_wheel_zoom":true, "button":"cancel"})).unwrap();assert!(!app.preferences.smooth_wheel_zoom);- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.load_prefs(&app.prefs());assert!(!other.preferences.smooth_wheel_zoom);control(&mut app, &json!({"open":"Navigation", "button":"defaults"})).unwrap();@@ -1116,14 +1136,14 @@ mod tests {#[test]fn openscad_preset_maps_navigation_and_persists() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());set(&mut app, &json!({"nav": OPENSCAD_NAV})).unwrap();for button in [NavButton::Middle, NavButton::Right] {assert_eq!(nav_mode(&app, button, Modifiers::default()), Some(NavMode::Pan));assert_eq!(nav_mode(&app, button, Modifiers { shift: true, ..Default::default() }), Some(NavMode::Zoom));}assert_eq!(nav_mode(&app, NavButton::Left, Modifiers::default()), Some(NavMode::Orbit));- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.load_prefs(&app.prefs());assert_eq!(other.preferences.nav, OPENSCAD_NAV);}@@ -1132,14 +1152,14 @@ mod tests {fn trackpad_pan_defaults_on_persists_and_follows_dialog_buttons() {assert!(serde_json::from_value::<Prefs>(json!({})).unwrap().trackpad_pan);assert!(Prefs::default().trackpad_pan);- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());control(&mut app, &json!({"open":"Navigation", "trackpad_pan":false})).unwrap();control(&mut app, &json!({"button":"cancel"})).unwrap();assert!(app.preferences.trackpad_pan);control(&mut app, &json!({"open":"Navigation", "trackpad_pan":false})).unwrap();control(&mut app, &json!({"button":"apply"})).unwrap();assert!(!app.preferences.trackpad_pan);- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.load_prefs(&app.prefs());assert!(!other.preferences.trackpad_pan);control(&mut app, &json!({"open":"Navigation", "button":"defaults"})).unwrap();@@ -1150,7 +1170,7 @@ mod tests {#[test]fn presets_map_the_mouse_and_prefs_round_trip() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());let shift = Modifiers { shift: true, ..Default::default() };let ctrl = Modifiers { ctrl: true, ..Default::default() };let none = Modifiers::default();@@ -1177,7 +1197,7 @@ mod tests {assert!(set(&mut app, &json!({"default_units": "furlong"})).is_err());assert!(set(&mut app, &json!({"nope": 1})).is_err());// Kept between runs.- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.load_prefs(&app.prefs());assert_eq!(other.preferences, app.preferences);assert_eq!(format_length(25.4, "in", 3), "1.000 in");@@ -1187,7 +1207,7 @@ mod tests {/// keeps them, Restore Defaults resets one page, and the shortcuts menus open its page.#[test]fn preferences_dialog_cancel_apply_and_defaults() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());control(&mut app, &json!({"open": "general"})).unwrap();assert!(app.prefs_window.open && app.prefs_window.section == 0);control(&mut app, &json!({"theme": "light", "ui_scale": 1.25, "zoom_to_cursor": false})).unwrap();@@ -1205,7 +1225,7 @@ mod tests {assert_eq!(app.preferences.nav, "alias", "Cancel goes back to the last Apply");let to = {let mut c = app.cam;- c.set_view(solvecraft_engine::render::StandardView::Top);+ c.set_view(solidcraft_engine::render::StandardView::Top);c};app.animate_to(to);@@ -1232,7 +1252,7 @@ mod tests {#[test]fn language_preference_switches_and_persists() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());assert_eq!(app.preferences.language, "en");assert_eq!(app.tr("ui.preferences"), "Preferences");assert_eq!(app.tr("ui.extrude"), "Extrude");@@ -1244,7 +1264,7 @@ mod tests {assert_eq!(app.tr("ui.extrude"), "押し出し");// Preferences round-trip- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.load_prefs(&app.prefs());assert_eq!(other.preferences.language, "ja");assert_eq!(other.tr("ui.preferences"), "環境設定");@@ -1253,18 +1273,18 @@ mod tests {/// A STEP file opened Z-up is offered to be stood up: a quarter turn about X, undoable.#[test]fn a_y_up_step_file_can_be_stood_up() {- let dir = std::env::temp_dir().join(format!("solvecraft-standup-{}", std::process::id()));+ let dir = std::env::temp_dir().join(format!("solidcraft-standup-{}", std::process::id()));let _ = std::fs::create_dir_all(&dir);let path = dir.join("tall_in_y.step").to_string_lossy().to_string();- let mut src = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut src = SolveApp::new(solidcraft_engine::Session::default(), Default::default());src.run("solid.box", json!({"length": 10, "width": 40, "height": 5})).unwrap();src.run("file.export", json!({"path": path})).unwrap();- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());app.open_path(&path);let offered = app.stand_up.clone().unwrap_or_default();assert_eq!(offered.len(), 1, "the file's body is offered");- let size = |app: &SolveApp| solvecraft_engine::view::bounds(&app.session);+ let size = |app: &SolveApp| solidcraft_engine::view::bounds(&app.session);assert!((size(&app).max.y - size(&app).min.y - 40.0).abs() < 1e-6);control(&mut app, &json!({"stand_up": true})).unwrap();let b = size(&app);@@ -1274,11 +1294,11 @@ mod tests {assert!((size(&app).max.y - size(&app).min.y - 40.0).abs() < 1e-6, "one undo step");// Not offered when turned off, or with Y up as the default orientation.- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());app.preferences.offer_stand_up = false;app.open_path(&path);assert!(app.stand_up.is_none());- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());app.preferences.up_axis = "y".into();app.open_path(&path);assert!(app.stand_up.is_none());@@ -1287,7 +1307,7 @@ mod tests {#[test]fn orbiting_around_the_cursor_keeps_that_point_still() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());app.run("solid.box", json!({"length": 40, "width": 40, "height": 40})).unwrap();app.preferences.orbit_cursor = true;let rect = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0));@@ -1302,8 +1322,8 @@ mod tests {/// The Y up preference turns the view: the camera's up axis follows it, startup included.#[test]fn up_axis_preference_turns_the_view() {- use solvecraft_engine::render::UpAxis;- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ use solidcraft_engine::render::UpAxis;+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());let ctx = egui::Context::default();apply(&mut app, &ctx);assert_eq!(app.cam.up, UpAxis::Z);diff --git a/crates/ui-egui/src/preselect_tests.rs b/crates/ui-egui/src/preselect_tests.rsindex bd47d2afb6..77a82c6e66 100644--- a/crates/ui-egui/src/preselect_tests.rs+++ b/crates/ui-egui/src/preselect_tests.rs@@ -2,8 +2,8 @@//! type, whether the command starts from a shortcut, the toolbar or a menu.use serde_json::json;-use solvecraft_engine::geom::Vec3;-use solvecraft_engine::{Sel, Session};+use solidcraft_engine::geom::Vec3;+use solidcraft_engine::{Sel, Session};use crate::dialogs::{Dialog, Kind, apply_commands};use crate::{Services, SolveApp};@@ -36,7 +36,7 @@ fn path_plane_click_retains_source_and_previews_then_edits_in_place() {let built = crate::preview::compute(&h.app.session, &commands, crate::preview::Colors::from_tokens(&crate::theme::Tokens::dark())).unwrap();assert!(!built.scene.xray.is_empty(), "construction preview must contain visible geometry");let plane = preview.after.construct.last().unwrap();- let solvecraft_engine::doc::construct::ConstructGeom::Plane(pl) = plane.geom else { panic!("plane") };+ let solidcraft_engine::doc::construct::ConstructGeom::Plane(pl) = plane.geom else { panic!("plane") };assert!(pl.origin.dist(Vec3::new(20.0, 27.5, 25.0)) < 1e-6);assert_eq!(h.app.session.doc.features.len(), count);assert_eq!(h.app.session.undo.len(), history);@@ -54,7 +54,7 @@ fn path_plane_click_retains_source_and_previews_then_edits_in_place() {h.step(&json!({"key":"Enter"})).unwrap();assert!(h.app.dialog.is_none(), "{:?}", h.app.dialog);assert_eq!(h.app.session.doc.features.len(), count + 1);- let p = solvecraft_engine::view::construction_planes(&h.app.session).into_iter().find(|p| p.0 == feature.id).unwrap().2;+ let p = solidcraft_engine::view::construction_planes(&h.app.session).into_iter().find(|p| p.0 == feature.id).unwrap().2;assert!(p.origin.dist(Vec3::new(15.0, 23.75, 17.5)) < 1e-6, "{p:?}");h.app.run("edit.undo", json!({})).unwrap();assert_eq!(h.app.session.doc.feature(feature.id).unwrap().kind, feature.kind);@@ -94,7 +94,7 @@ fn cylinder_emboss_empty_target_face_applies_automatic_wrap_and_deboss() {h.step(&json!({"key":"Enter"})).unwrap();assert!(h.app.dialog.is_none(), "{:?}", h.app.dialog);let feature = h.app.session.doc.features.last().unwrap().clone();- let solvecraft_engine::doc::FeatureKind::Emboss { face: Some(face), deboss: actual, .. } = &feature.kind else {+ let solidcraft_engine::doc::FeatureKind::Emboss { face: Some(face), deboss: actual, .. } = &feature.kind else {panic!("automatic Apply must save its cylinder anchor: {:?}", feature.kind)};assert_eq!(*actual, deboss);@@ -172,7 +172,7 @@ fn cylinder_emboss_edit_retains_second_source_and_author_paths_and_all_profiles(.as_u64().unwrap();let before = h.app.session.doc.feature(feature).unwrap().clone();- let solvecraft_engine::doc::FeatureKind::Emboss { face: Some(face), .. } = &before.kind else { panic!("selected face") };+ let solidcraft_engine::doc::FeatureKind::Emboss { face: Some(face), .. } = &before.kind else { panic!("selected face") };assert_eq!(face.path, vec![source_second]);assert_eq!(face.author_path, vec![author_second]);h.app.run("component.activate", json!({"component":"root"})).unwrap();@@ -396,7 +396,7 @@ fn hole_at_sketch_points() {{"command": "sketch.point", "params": {"point": [30, 20], "id": "h2"}},{"command": "sketch.finish", "params": {}},]));- let sk = app.session.doc.features.iter().find(|f| matches!(f.kind, solvecraft_engine::doc::FeatureKind::Sketch { .. })).unwrap().id;+ let sk = app.session.doc.features.iter().find(|f| matches!(f.kind, solidcraft_engine::doc::FeatureKind::Sketch { .. })).unwrap().id;app.start("solid.hole");let mut d = app.dialog.clone().unwrap();if let Kind::Hole { opts, .. } = &mut d.kind {diff --git a/crates/ui-egui/src/preview.rs b/crates/ui-egui/src/preview.rsindex 6ad01d8149..aa3351aa04 100644--- a/crates/ui-egui/src/preview.rs+++ b/crates/ui-egui/src/preview.rs@@ -1,5 +1,5 @@//! Live operation previews. While a feature dialog is open, its commands are evaluated on a-//! scratch copy of the session ([`solvecraft_engine::Session::preview`]), off the UI thread+//! scratch copy of the session ([`solidcraft_engine::Session::preview`]), off the UI thread//! where threads exist, and the result is drawn in place of the bodies it changes: new surface//! tinted, removed material as a translucent ghost. The last good preview stays up while the//! next one computes or when an input makes the feature fail (the error shows in the dialog).@@ -9,9 +9,9 @@ use std::hash::{Hash, Hasher};use std::sync::mpsc::{Receiver, TryRecvError};use serde_json::Value;-use solvecraft_engine::Session;-use solvecraft_engine::doc::ModelState;-use solvecraft_engine::geom::{Aabb3, Mesh, Vec3};+use solidcraft_engine::Session;+use solidcraft_engine::doc::ModelState;+use solidcraft_engine::geom::{Aabb3, Mesh, Vec3};use crate::SolveApp;use crate::gpu::{GpuScene, SceneSlot};@@ -299,7 +299,7 @@ pub fn build(before: &ModelState, after: &ModelState, c: Colors) -> Built {if before.construct.iter().any(|old| old == construct) {continue;}- if let solvecraft_engine::doc::construct::ConstructGeom::Plane(plane) = construct.geom {+ if let solidcraft_engine::doc::construct::ConstructGeom::Plane(plane) = construct.geom {let (o, x, y) = (plane.origin, plane.x * 10.0, plane.y * 10.0);let quad = [o - x - y, o + x - y, o + x + y, o - x + y];let color = [c.added[0], c.added[1], c.added[2], 64];@@ -459,7 +459,7 @@ mod tests {#[test]fn a_hole_shows_its_cut_through_the_body() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();let p = s.preview(&[("solid.hole".to_string(), json!({"position": [20, 15, 20], "diameter": 5, "depth": 10}))]).unwrap();let b = build(&p.before, &p.after, colors());diff --git a/crates/ui-egui/src/recovery_ui.rs b/crates/ui-egui/src/recovery_ui.rsindex 756b291486..85266897d7 100644--- a/crates/ui-egui/src/recovery_ui.rs+++ b/crates/ui-egui/src/recovery_ui.rs@@ -2,7 +2,7 @@use egui::RichText;use serde_json::json;-use solvecraft_engine::recovery::{self, Autosaver, Entry};+use solidcraft_engine::recovery::{self, Autosaver, Entry};use crate::SolveApp;diff --git a/crates/ui-egui/src/ref_images.rs b/crates/ui-egui/src/ref_images.rsindex 770b5d1740..2ed13236da 100644--- a/crates/ui-egui/src/ref_images.rs+++ b/crates/ui-egui/src/ref_images.rs@@ -6,8 +6,8 @@ use std::collections::HashMap;use std::sync::Arc;use egui::{Color32, Mesh, Shape, TextureHandle, TextureId, pos2};-use solvecraft_engine::doc::canvas::Canvas;-use solvecraft_engine::geom::Vec2;+use solidcraft_engine::doc::canvas::Canvas;+use solidcraft_engine::geom::Vec2;use crate::SolveApp;use crate::gpu::GpuImage;diff --git a/crates/ui-egui/src/revolve_edit_tests.rs b/crates/ui-egui/src/revolve_edit_tests.rsindex be452ca787..fa56996047 100644--- a/crates/ui-egui/src/revolve_edit_tests.rs+++ b/crates/ui-egui/src/revolve_edit_tests.rs@@ -1,6 +1,6 @@use crate::scenario::Harness;use serde_json::{Value, json};-use solvecraft_engine::doc::{AxisRef, FeatureKind};+use solidcraft_engine::doc::{AxisRef, FeatureKind};fn make(h: Harness, axis: Value) -> Harness {make_params(h, axis, json!({}))@@ -32,12 +32,12 @@ fn unchanged_all_profiles_retains_future_geometry_but_reselection_is_explicit()}h.step(&json!({"widget":"OK"})).unwrap();let FeatureKind::Revolve { profiles, .. } = &h.app.session.doc.find_feature("Turn").unwrap().kind else { panic!("revolve") };- assert_eq!(matches!(profiles, solvecraft_engine::doc::ProfileSel::All), !reselect);+ assert_eq!(matches!(profiles, solidcraft_engine::doc::ProfileSel::All), !reselect);h.app.run("sketch.edit", json!({"sketch":"Profile"})).unwrap();h.app.run("sketch.rectangle.two_point", json!({"p0":[20,0],"p1":[25,5]})).unwrap();h.app.run("sketch.finish", json!({})).unwrap();let state = h.app.session.world_state();- let volume: f64 = state.bodies.iter().map(|b| solvecraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum();+ let volume: f64 = state.bodies.iter().map(|b| solidcraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum();let expected = if reselect { 490.873852 } else { 1374.446786 };assert!((volume - expected).abs() < 0.3, "{volume} != {expected}");}@@ -53,24 +53,24 @@ fn to_object_noop_preserves_cut_targets_and_untargeted_body() {let state = h.app.session.world_state();// A quarter annulus separates the stock into inner and outer solids. Both are// results of cutting A; checking only the first named solid loses material.- let cut_volume = |state: &solvecraft_engine::doc::ModelState| -> f64 {- state.bodies.iter().filter(|b| b.name != "B").map(|b| solvecraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum()+ let cut_volume = |state: &solidcraft_engine::doc::ModelState| -> f64 {+ state.bodies.iter().filter(|b| b.name != "B").map(|b| solidcraft_engine::doc::kernel::measure(&b.body).unwrap().volume).sum()};let before_a = cut_volume(&state);let removed = 0.5 * (15.0f64.powi(2) - 10.0f64.powi(2)) * 5.0 * std::f64::consts::FRAC_PI_2;assert!((before_a - (2000.0 - removed)).abs() < 0.2, "cut results {:?}: {before_a}", state.bodies.iter().map(|b| &b.name).collect::<Vec<_>>());let in_cut_stock = |p| state.bodies.iter().filter(|b| b.name != "B").any(|b| b.body.contains(p));- assert!(in_cut_stock(solvecraft_engine::geom::Vec3::new(2.0, 2.0, 2.0)));- assert!(in_cut_stock(solvecraft_engine::geom::Vec3::new(18.0, 2.0, 18.0)));- assert!(!in_cut_stock(solvecraft_engine::geom::Vec3::new(9.0, 2.0, 9.0)));- assert!(state.body("B").unwrap().body.contains(solvecraft_engine::geom::Vec3::new(9.0, 2.0, 9.0)));+ assert!(in_cut_stock(solidcraft_engine::geom::Vec3::new(2.0, 2.0, 2.0)));+ assert!(in_cut_stock(solidcraft_engine::geom::Vec3::new(18.0, 2.0, 18.0)));+ assert!(!in_cut_stock(solidcraft_engine::geom::Vec3::new(9.0, 2.0, 9.0)));+ assert!(state.body("B").unwrap().body.contains(solidcraft_engine::geom::Vec3::new(9.0, 2.0, 9.0)));let before_bounds: Vec<_> = state.bodies.iter().map(|b| (b.name.clone(), b.mesh().bounds())).collect();let undo = h.app.session.undo.len();open(&mut h);h.step(&json!({"widget":"OK"})).unwrap();assert!(h.app.dialog.is_none());let state = h.app.session.world_state();- assert!((solvecraft_engine::doc::kernel::measure(&state.body("B").unwrap().body).unwrap().volume - 2000.0).abs() < 1e-7);+ assert!((solidcraft_engine::doc::kernel::measure(&state.body("B").unwrap().body).unwrap().volume - 2000.0).abs() < 1e-7);assert!((cut_volume(&state) - before_a).abs() < 1e-7);assert_eq!(state.bodies.iter().map(|b| (b.name.clone(), b.mesh().bounds())).collect::<Vec<_>>(), before_bounds);assert_eq!(h.app.session.undo.len(), undo + 1);@@ -116,7 +116,7 @@ fn second_active_occurrence_noop_preserves_definition_axis_target_and_instances(h.app.run("component.activate", json!({"component":owner["component"],"occurrence":second,"path":[second]})).unwrap();let original = serde_json::to_value(&h.app.session.doc.find_feature("Turn").unwrap().kind).unwrap();let frame = h.app.session.active_component_frame();- let expected_origin = solvecraft_engine::doc::apply_point(&frame, solvecraft_engine::geom::Vec3::ZERO);+ let expected_origin = solidcraft_engine::doc::apply_point(&frame, solidcraft_engine::geom::Vec3::ZERO);let before: Vec<_> = h.app.session.world_state().bodies.iter().map(|b| (b.name.clone(), b.mesh().bounds())).collect();open(&mut h);let (origin, _) = crate::canvas::revolve_axis(&h.app, h.app.dialog.as_ref().unwrap()).unwrap();@@ -154,7 +154,7 @@ fn actual_noop_editor_retains_all_revolve_axis_kinds_and_analytic_volume() {let bounds = body.mesh().bounds();let radii = if axis_value == json!("l4") { 25.0 } else { 225.0 - 100.0 };let expected = 0.5 * radii * 5.0 * std::f64::consts::FRAC_PI_2;- let volume = solvecraft_engine::doc::kernel::measure(&body.body).unwrap().volume;+ let volume = solidcraft_engine::doc::kernel::measure(&body.body).unwrap().volume;assert!((volume - expected).abs() < 0.03, "{axis_value}: {volume}");open(&mut h);let commands = crate::dialogs::apply_commands(&h.app, h.app.dialog.as_ref().unwrap()).unwrap();diff --git a/crates/ui-egui/src/revolve_manipulator_tests.rs b/crates/ui-egui/src/revolve_manipulator_tests.rsindex d62d4f075f..e4e4216741 100644--- a/crates/ui-egui/src/revolve_manipulator_tests.rs+++ b/crates/ui-egui/src/revolve_manipulator_tests.rs@@ -1,6 +1,6 @@use crate::scenario::Harness;use serde_json::{Value, json};-use solvecraft_engine::doc::{FeatureKind, kernel};+use solidcraft_engine::doc::{FeatureKind, kernel};fn fixture(mut h: Harness, extra: Value) -> Harness {h.app.run("sketch.create", json!({"plane":"XY","name":"Profile"})).unwrap();@@ -91,7 +91,7 @@ fn symmetric_boundary_drags_edit_included_angle_and_cancel_is_lossless() {assert!((volume(&h) - expected_volume(90.0)).abs() < 0.1, "{handle}: {} angle {}", volume(&h), angle(&h));let bounds = h.app.session.world_state().body("Main").unwrap().mesh().bounds();assert!((bounds.max.z - 15.0 / 2.0f64.sqrt()).abs() < 0.03 && (bounds.min.z + 15.0 / 2.0f64.sqrt()).abs() < 0.03);- let path = h.dir.join("symmetric.solvecraft");+ let path = h.dir.join("symmetric.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();assert_eq!(angle(&h), "90 deg");@@ -154,7 +154,7 @@ fn selected_second_placement_custom_axis_handle_and_preview_stay_in_its_frame()let frame = h.app.session.active_component_frame();let world = |degrees: f64| {let a = degrees.to_radians();- let p = solvecraft_engine::doc::apply_point(&frame, solvecraft_engine::geom::Vec3::new(12.5 * a.cos(), 2.5, 12.5 * a.sin()));+ let p = solidcraft_engine::doc::apply_point(&frame, solidcraft_engine::geom::Vec3::new(12.5 * a.cos(), 2.5, 12.5 * a.sin()));json!([p.x, p.y, p.z])};let axis = match &h.app.session.doc.find_feature("Turn").unwrap().kind {@@ -186,7 +186,7 @@ fn curved_to_object_has_surface_feedback_without_an_angular_handle_or_input() {h.step(&json!({"click":{"handle":"dialog:Type:To Object"}})).unwrap();let mut dialog = h.app.dialog.take().unwrap();dialog.active = dialog.inputs.iter().position(|input| input.label == "To Object").unwrap();- dialog.pick(&h.app.session, solvecraft_engine::Sel::Vertex { body: "Target".into(), point: solvecraft_engine::geom::Vec3::new(0.0, 2.0, 15.0) });+ dialog.pick(&h.app.session, solidcraft_engine::Sel::Vertex { body: "Target".into(), point: solidcraft_engine::geom::Vec3::new(0.0, 2.0, 15.0) });h.app.dialog = Some(dialog);h.frames(8);assert!(h.widget("To surface").is_some());@@ -206,7 +206,7 @@ fn free_drag_and_invalid_expression_stay_editable_before_commit() {open(&mut h);h.step(&json!({"drag":[{"handle":"revolve"},{"world":at_angle(37.3)}],"ctrl":true})).unwrap();let crate::dialogs::Kind::Revolve { angle: entered, .. } = &h.app.dialog.as_ref().unwrap().kind else { panic!("revolve") };- assert!((h.app.session.doc.eval(entered, solvecraft_engine::doc::expr::Kind::Angle).unwrap().to_degrees() - 37.3).abs() < 0.2);+ assert!((h.app.session.doc.eval(entered, solidcraft_engine::doc::expr::Kind::Angle).unwrap().to_degrees() - 37.3).abs() < 0.2);h.step(&json!({"click":{"handle":"dialog:Angle"}})).unwrap();h.step(&json!({"key":"A","cmd":true})).unwrap();h.step(&json!({"text":"unknown_angle"})).unwrap();@@ -257,15 +257,15 @@ fn legacy_reversed_axis_symmetric_interval_is_shown_and_preserved_exactly() {);// Exercise an actual older design: no convention marker was stored by version 10.let mut saved: Value = serde_json::from_str(&h.app.session.doc.to_json()).unwrap();- saved["format"] = json!("solvecraft/10");+ saved["format"] = json!("solidcraft/10");for feature in saved["features"].as_array_mut().unwrap() {feature.as_object_mut().unwrap().remove("convention");}- let path = h.dir.join("legacy-revolve.solvecraft");+ let path = h.dir.join("legacy-revolve.solidcraft");std::fs::write(&path, serde_json::to_vec(&saved).unwrap()).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();let FeatureKind::Revolve { convention, .. } = &h.app.session.doc.find_feature("Turn").unwrap().kind else { panic!("revolve") };- assert_eq!(*convention, solvecraft_engine::doc::RevolveConvention::LegacyAxisStart);+ assert_eq!(*convention, solidcraft_engine::doc::RevolveConvention::LegacyAxisStart);let original = serde_json::to_value(&h.app.session.doc.find_feature("Turn").unwrap().kind).unwrap();let before = h.app.session.world_state().body("Main").unwrap().mesh().bounds();assert!(before.min.x < -14.9 && before.max.x < 7.6 && before.min.z > -1e-6 && before.max.z > 14.9);@@ -307,8 +307,8 @@ fn canonical_symmetric_ring_preview_drag_and_reopen_match_material() {let commands = crate::dialogs::apply_commands(&h.app, h.app.dialog.as_ref().unwrap()).unwrap();let preview = h.app.session.preview_world(&commands).unwrap();let body = &preview.after.body("Main").unwrap().body;- assert!(body.contains(solvecraft_engine::geom::Vec3::new(3.0, 5.0, 0.0)));- assert!(!body.contains(solvecraft_engine::geom::Vec3::new(0.0, 5.0, 3.0)));+ assert!(body.contains(solidcraft_engine::geom::Vec3::new(3.0, 5.0, 0.0)));+ assert!(!body.contains(solidcraft_engine::geom::Vec3::new(0.0, 5.0, 3.0)));let bounds = preview.after.body("Main").unwrap().mesh().bounds();assert!((bounds.min.x - 2.0f64.sqrt()).abs() < 0.02 && (bounds.max.x - 4.0).abs() < 0.02, "{bounds:?}");assert!((bounds.min.z + 2.0 * 2.0f64.sqrt()).abs() < 0.02 && (bounds.max.z - 2.0 * 2.0f64.sqrt()).abs() < 0.02);@@ -320,14 +320,14 @@ fn canonical_symmetric_ring_preview_drag_and_reopen_match_material() {assert_eq!(angle(&h), "60 deg");assert_eq!(h.app.session.doc.find_feature("Turn").unwrap().param_names, names);assert!((volume(&h) - 60.0 * std::f64::consts::FRAC_PI_3).abs() < 0.03);- let path = h.dir.join("canonical-revolve.solvecraft");+ let path = h.dir.join("canonical-revolve.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();open(&mut h);handle_at(&mut h, "revolve", at(30.0));handle_at(&mut h, "revolve2", at(-30.0));let FeatureKind::Revolve { convention, .. } = &h.app.session.doc.find_feature("Turn").unwrap().kind else { panic!("revolve") };- assert_eq!(*convention, solvecraft_engine::doc::RevolveConvention::SketchNormal);+ assert_eq!(*convention, solidcraft_engine::doc::RevolveConvention::SketchNormal);h.step(&json!({"widget":"Cancel"})).unwrap();}}@@ -347,15 +347,15 @@ fn reversed_axis_to_object_canvas_sweep_and_preview_follow_the_quarter_target()let preview = h.app.session.preview_world(&commands).unwrap();let result = preview.after.body("Main").unwrap();assert_eq!(result.mesh().bounds(), before);- assert!(result.body.contains(solvecraft_engine::geom::Vec3::new(p, 2.5, p)));+ assert!(result.body.contains(solidcraft_engine::geom::Vec3::new(p, 2.5, p)));for (x, z) in [(-p, p), (-p, -p), (p, -p)] {- assert!(!result.body.contains(solvecraft_engine::geom::Vec3::new(x, 2.5, z)));+ assert!(!result.body.contains(solidcraft_engine::geom::Vec3::new(x, 2.5, z)));}assert!((kernel::measure(&result.body).unwrap().volume - expected_volume(90.0)).abs() < 0.03);h.step(&json!({"widget":"OK"})).unwrap();assert_eq!(serde_json::to_value(&h.app.session.doc.find_feature("Turn").unwrap().kind).unwrap(), original);assert_eq!(h.app.session.doc.find_feature("Turn").unwrap().param_names, names);- let path = h.dir.join("reversed-to-object.solvecraft");+ let path = h.dir.join("reversed-to-object.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();open(&mut h);diff --git a/crates/ui-egui/src/scenario.rs b/crates/ui-egui/src/scenario.rsindex 09caf41098..9e496b7abd 100644--- a/crates/ui-egui/src/scenario.rs+++ b/crates/ui-egui/src/scenario.rs@@ -18,7 +18,7 @@//! - `{"choose_file": "part.step"}`: the next Open picker returns that file of the scenario's//! folder (Save pickers save there)//! - `{"shot": "name"}`: a screenshot when run in a window; headless, a render of the model-//! into `$SOLVECRAFT_SCENARIO_SHOTS` when that is set; `{"debug": 1}`+//! into `$SOLIDCRAFT_SCENARIO_SHOTS` when that is set; `{"debug": 1}`//! prints the UI state (`"widgets"`: also every widget's text; `"handles"`: every published//! handle, browser rows as `row:<label>` and their fold arrows as `fold:<label>`)//! - `{"camera": {"yaw": rad, "pitch": rad}}` puts the camera at an orbit; `{"view_anim": "top",@@ -41,7 +41,7 @@ use std::path::PathBuf;use std::rc::Rc;use serde_json::{Value, json};-use solvecraft_engine::Session;+use solidcraft_engine::Session;use crate::control::{ControlRequest, Outcome, handle};use crate::{Services, SolveApp};@@ -114,7 +114,7 @@ fn with_dir(v: Value, dir: &str) -> Value {fn scratch_dir() -> PathBuf {use std::sync::atomic::{AtomicUsize, Ordering};static N: AtomicUsize = AtomicUsize::new(0);- let d = std::env::temp_dir().join(format!("solvecraft-scenario-{}-{}", std::process::id(), N.fetch_add(1, Ordering::Relaxed)));+ let d = std::env::temp_dir().join(format!("solidcraft-scenario-{}-{}", std::process::id(), N.fetch_add(1, Ordering::Relaxed)));let _ = std::fs::create_dir_all(&d);d}@@ -135,7 +135,7 @@ pub struct Harness {time: f64,size: egui::Vec2,/// The camera as the last `camera` step left it.- cam_mark: Option<solvecraft_engine::render::Camera>,+ cam_mark: Option<solidcraft_engine::render::Camera>,}impl Default for Harness {@@ -145,9 +145,9 @@ impl Default for Harness {}impl Drop for Harness {- /// The scenario's files go with it (kept with SOLVECRAFT_SCENARIO_KEEP set).+ /// The scenario's files go with it (kept with SOLIDCRAFT_SCENARIO_KEEP set).fn drop(&mut self) {- if std::env::var_os("SOLVECRAFT_SCENARIO_KEEP").is_none() {+ if solidcraft_engine::geom::env::var_os("SCENARIO_KEEP").is_none() {let _ = std::fs::remove_dir_all(&self.dir);}}@@ -324,7 +324,7 @@ impl Harness {/// frame may turn the view (its right or back vector) by more than `max_deg`, the last/// included, so the move ends without a jump.fn view_anim(&mut self, v: &str, max_deg: f64) -> Result<(), String> {- let basis = |c: &solvecraft_engine::render::Camera| c.basis();+ let basis = |c: &solidcraft_engine::render::Camera| c.basis();let mut prev = basis(&self.app.cam);self.app.animate_view(v);if self.app.cam_anim.is_none() && self.app.viewport.orbit_snap.is_none() {@@ -334,7 +334,7 @@ impl Harness {for i in 0..240 {self.frame();let now = basis(&self.app.cam);- let ang = |a: solvecraft_engine::geom::Vec3, b: solvecraft_engine::geom::Vec3| a.dot(b).clamp(-1.0, 1.0).acos().to_degrees();+ let ang = |a: solidcraft_engine::geom::Vec3, b: solidcraft_engine::geom::Vec3| a.dot(b).clamp(-1.0, 1.0).acos().to_degrees();let d = ang(prev.0, now.0).max(ang(prev.2, now.2));if d > worst.0 {worst = (d, i);@@ -403,7 +403,7 @@ impl Harness {v} else if let Some(f) = s.get("script").and_then(Value::as_str) {// A command script (`{"commands": [{command, params}]}`, path from the repository- // root) run through the engine, as `solvecraft-cli run` does.+ // root) run through the engine, as `solidcraft-cli run` does.let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..").join(f);let text = std::fs::read_to_string(&path).map_err(|e| format!("{f}: {e}"))?;let v: Value = serde_json::from_str(&text).map_err(|e| format!("{f}: {e}"))?;@@ -422,8 +422,8 @@ impl Harness {} else if s.get("note").is_some() || s.get("pending").is_some() {return Ok(());} else if let Some(name) = s.get("shot").and_then(Value::as_str) {- // With SOLVECRAFT_SCENARIO_SHOTS set: a render of the model as the camera sees it.- if let Ok(dir) = std::env::var("SOLVECRAFT_SCENARIO_SHOTS") {+ // With SOLIDCRAFT_SCENARIO_SHOTS set: a render of the model as the camera sees it.+ if let Ok(dir) = solidcraft_engine::geom::env::var("SCENARIO_SHOTS").ok_or(()) {let path = std::path::Path::new(&dir).join(format!("{name}.png"));self.call("ui.render", json!({"path": path.to_string_lossy(), "width": 1000, "height": 700}));}diff --git a/crates/ui-egui/src/selection.rs b/crates/ui-egui/src/selection.rsindex cfbfe9fef5..71d3166cfd 100644--- a/crates/ui-egui/src/selection.rs+++ b/crates/ui-egui/src/selection.rs@@ -3,8 +3,8 @@//! selection. The pure parts are unit tested; the viewport uses them.use egui::{Pos2, Rect};-use solvecraft_engine::Sel;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::Sel;+use solidcraft_engine::geom::Vec3;use crate::viewport::Hit;@@ -180,7 +180,7 @@ fn segments_cross(p: Pos2, q: Pos2, r: Pos2, s: Pos2) -> bool {mod tests {use super::*;use egui::pos2;- use solvecraft_engine::render::{Camera, StandardView};+ use solidcraft_engine::render::{Camera, StandardView};#[test]fn origin_widget_keeps_its_screen_size() {diff --git a/crates/ui-egui/src/shell_face_sketch_ui_tests.rs b/crates/ui-egui/src/shell_face_sketch_ui_tests.rsindex 5d90be8c94..0248001dd2 100644--- a/crates/ui-egui/src/shell_face_sketch_ui_tests.rs+++ b/crates/ui-egui/src/shell_face_sketch_ui_tests.rs@@ -1,6 +1,6 @@use crate::scenario::Harness;use serde_json::json;-use solvecraft_engine::{+use solidcraft_engine::{Sel,doc::{FaceAttachmentStatus, FeatureKind, PlaneRef},};diff --git a/crates/ui-egui/src/shortcut_box.rs b/crates/ui-egui/src/shortcut_box.rsindex 5d3561c8cb..94d5c83d16 100644--- a/crates/ui-egui/src/shortcut_box.rs+++ b/crates/ui-egui/src/shortcut_box.rs@@ -6,7 +6,7 @@use egui::{Align2, FontId, Pos2, Rect, Sense, Stroke, pos2, vec2};use serde_json::{Value, json};-use solvecraft_engine::command_specs;+use solidcraft_engine::command_specs;use crate::theme::Tokens;use crate::{SolveApp, icons};@@ -162,7 +162,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {if !app.sbox.pinned.is_empty() {ui.horizontal_wrapped(|ui| {for id in app.sbox.pinned.clone() {- let Some(c) = solvecraft_engine::find_command(&id) else { continue };+ let Some(c) = solidcraft_engine::find_command(&id) else { continue };let (r, resp) = ui.allocate_exact_size(vec2(28.0, 28.0), Sense::click());if resp.hovered() {ui.painter().rect_filled(r, 4.0, t.hover);@@ -189,7 +189,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {egui::ScrollArea::vertical().max_height(h - 90.0).show(ui, |ui| {ui.spacing_mut().item_spacing.y = 0.0;for (i, (id, label, icon, place)) in list.iter().enumerate().take(80) {- let enabled = solvecraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled);+ let enabled = solidcraft_engine::find_command(id).is_some_and(|c| c.info(&app.session).enabled);let (r, resp) = ui.allocate_exact_size(vec2(W - 20.0, 26.0), Sense::click());let lit = i == app.sbox.index || resp.hovered();if lit {@@ -280,7 +280,7 @@ mod tests {#[test]fn search_finds_by_name_id_and_panel_and_puts_recent_first() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default());assert_eq!(search(&app, "extr").first().map(|x| x.0), Some("solid.extrude"));assert_eq!(search(&app, "solid.fil").first().map(|x| x.0), Some("solid.fillet"));assert!(search(&app, "constraints").iter().any(|x| x.0 == "sketch.constraint.parallel"), "by panel");@@ -289,7 +289,7 @@ mod tests {let all = search(&app, "");assert_eq!((all[0].0, all[1].0), ("solid.revolve", "solid.shell"));app.sbox.toggle_pin("solid.extrude");- let mut other = SolveApp::new(solvecraft_engine::Session::default(), Default::default());+ let mut other = SolveApp::new(solidcraft_engine::Session::default(), Default::default());other.sbox.load(&app.sbox.prefs());assert_eq!((other.sbox.pinned.clone(), other.sbox.recent.len()), (vec!["solid.extrude".to_string()], 2));}diff --git a/crates/ui-egui/src/sketch3d.rs b/crates/ui-egui/src/sketch3d.rsindex f2014fe2a8..086ba813f4 100644--- a/crates/ui-egui/src/sketch3d.rs+++ b/crates/ui-egui/src/sketch3d.rs@@ -9,7 +9,7 @@ use std::cell::RefCell;use egui::{Pos2, Rect, Shape, Stroke, vec2};use serde_json::{Value, json};-use solvecraft_engine::geom::{Vec2, Vec3};+use solidcraft_engine::geom::{Vec2, Vec3};use crate::SolveApp;use crate::theme::Tokens;@@ -224,7 +224,7 @@ pub fn preview(app: &SolveApp, t: &Tool, painter: &egui::Painter, proj: &Proj) -if let Some((h, _)) = hover {w.push(h);}- let poly: Vec<Pos2> = solvecraft_engine::sketch::fit_polyline(&w).into_iter().filter_map(|p| proj.to_screen(p)).collect();+ let poly: Vec<Pos2> = solidcraft_engine::sketch::fit_polyline(&w).into_iter().filter_map(|p| proj.to_screen(p)).collect();painter.add(Shape::line(poly, stroke));} else {painter.add(Shape::line(all, stroke));diff --git a/crates/ui-egui/src/sketch3d_frame_ui_tests.rs b/crates/ui-egui/src/sketch3d_frame_ui_tests.rsindex cc314e508f..7662c67208 100644--- a/crates/ui-egui/src/sketch3d_frame_ui_tests.rs+++ b/crates/ui-egui/src/sketch3d_frame_ui_tests.rs@@ -1,7 +1,7 @@//! Real 3D drawing and triad input in a rotated second component occurrence.use serde_json::json;-use solvecraft_engine::geom::Vec3;+use solidcraft_engine::geom::Vec3;#[test]fn bridge_line_snaps_to_points_on_two_visible_sketch_planes() {@@ -82,7 +82,7 @@ fn sketch_tools_never_pick_another_sketchs_point() {);let (at, id) = crate::viewport::sketch_point_at(&h.app, &proj, pos).unwrap();assert!(id.is_none(), "sketch_3d={sketch_3d}: snapped to foreign point id {id:?}");- assert!(at.dist(solvecraft_engine::geom::Vec2::new(10.0, 20.0)) < 0.5, "{at:?}");+ assert!(at.dist(solidcraft_engine::geom::Vec2::new(10.0, 20.0)) < 0.5, "{at:?}");if !sketch_3d {let before = h.app.session.world_state().sketch(other).unwrap().sketch.clone();// A real 2D line click there creates nothing tied to the other sketch's point.diff --git a/crates/ui-egui/src/sketch_attachment_ui.rs b/crates/ui-egui/src/sketch_attachment_ui.rsindex 455cce2e47..5d0b792fc2 100644--- a/crates/ui-egui/src/sketch_attachment_ui.rs+++ b/crates/ui-egui/src/sketch_attachment_ui.rs@@ -2,10 +2,10 @@use egui::{Pos2, RichText};use serde_json::{Value, json};-use solvecraft_engine::Sel;-use solvecraft_engine::doc::face_anchor::plane_face_anchor;-use solvecraft_engine::doc::{EmbossFace, FaceAttachmentStatus, FeatureKind, mat_inverse};-use solvecraft_engine::geom::{Plane, Vec3};+use solidcraft_engine::Sel;+use solidcraft_engine::doc::face_anchor::plane_face_anchor;+use solidcraft_engine::doc::{EmbossFace, FaceAttachmentStatus, FeatureKind, mat_inverse};+use solidcraft_engine::geom::{Plane, Vec3};use crate::SolveApp;use crate::theme::Tokens;@@ -253,7 +253,7 @@ pub fn panel(app: &mut SolveApp, ctx: &egui::Context, at: Pos2) {/// Only a lost reference's explicit saved author frame supplies a guide. It is/// absent from ModelState, selection, snapping and all downstream evaluation.-pub fn lost_guide(app: &SolveApp) -> Option<(Plane, &solvecraft_engine::sketch::Sketch)> {+pub fn lost_guide(app: &SolveApp) -> Option<(Plane, &solidcraft_engine::sketch::Sketch)> {let sketch = app.tree.redefine?;let FaceAttachmentStatus::Lost { repair_plane: Some(plane), .. } = attachment(app, sketch) else { return None };let FeatureKind::Sketch { sketch, .. } = &app.session.doc.feature(sketch)?.kind else { return None };@@ -270,7 +270,7 @@ pub fn guide_lines(app: &SolveApp) -> Vec<Vec<Vec3>> {pub fn display_guide_lines(app: &SolveApp, proj: &crate::viewport::Proj) -> Vec<Vec<Vec3>> {let Some((plane, sketch)) = lost_guide(app) else { return Vec::new() };- let mut budget = solvecraft_engine::render::SamplingBudget::new(65_536, 262_144);+ let mut budget = solidcraft_engine::render::SamplingBudget::new(65_536, 262_144);(0..sketch.curves.len()).flat_map(|index| crate::sketch_display::curve_with_budget(sketch, index, &plane, proj, app.viewport.pixels_per_point(), &mut budget).parts).collect()diff --git a/crates/ui-egui/src/sketch_attachment_ui_tests.rs b/crates/ui-egui/src/sketch_attachment_ui_tests.rsindex c13a7b9206..6a4bf5b61e 100644--- a/crates/ui-egui/src/sketch_attachment_ui_tests.rs+++ b/crates/ui-egui/src/sketch_attachment_ui_tests.rs@@ -1,6 +1,6 @@use crate::scenario::Harness;use serde_json::{Value, json};-use solvecraft_engine::doc::{FaceAttachmentStatus, FeatureKind, PlaneRef};+use solidcraft_engine::doc::{FaceAttachmentStatus, FeatureKind, PlaneRef};fn picked_sketch() -> (Harness, u64) {let mut h = Harness::new();@@ -46,7 +46,7 @@ fn actual_picked_face_and_noop_edit_preserve_exact_anchor_and_dimensions() {h.settle();h.app.finish_sketch();assert_eq!(serde_json::to_value(&h.app.session.doc.feature(sketch).unwrap().kind).unwrap(), before);- let path = h.dir.join("picked-face.solvecraft");+ let path = h.dir.join("picked-face.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();assert_eq!(serde_json::to_value(&h.app.session.doc.feature(sketch).unwrap().kind).unwrap(), before);@@ -84,7 +84,7 @@ fn lost_attachment_ghost_rebind_preview_cancel_apply_and_undo_preserve_sketch()h.app.run("browser.visibility", json!({"items":["ControlBox"],"visible":true})).unwrap();h.frames(4);h.step(&json!({"click":{"world":[3,4,30]}})).unwrap();- assert!(matches!(h.app.session.selection.first(), Some(solvecraft_engine::Sel::Face { body, .. }) if body=="ControlBox"));+ assert!(matches!(h.app.session.selection.first(), Some(solidcraft_engine::Sel::Face { body, .. }) if body=="ControlBox"));h.frames(2);h.step(&json!({"widget":"Reattach selected face"})).unwrap();let commands = crate::sketch_attachment_ui::commands(&h.app)@@ -113,7 +113,7 @@ fn lost_attachment_ghost_rebind_preview_cancel_apply_and_undo_preserve_sketch()let boss = h.app.session.world_state().body("Boss").unwrap().mesh().bounds();assert!((boss.min.z - 30.0).abs() < 1e-7 && (boss.max.z - 32.0).abs() < 1e-7);let repaired = h.app.session.doc.to_json();- let path = h.dir.join("rebound-face.solvecraft");+ let path = h.dir.join("rebound-face.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("edit.undo", json!({})).unwrap();assert_eq!(h.app.session.doc.to_json(), before);@@ -130,7 +130,7 @@ fn attachment_drafts_leave_on_document_replacement_but_survive_failed_open() {h.frames(2);h.step(&json!({"widget":"Use XZ plane"})).unwrap();assert!(crate::sketch_attachment_ui::commands(&h.app).is_some());- assert!(h.app.run("doc.open", json!({"path":h.dir.join("missing.solvecraft")})).is_err());+ assert!(h.app.run("doc.open", json!({"path":h.dir.join("missing.solidcraft")})).is_err());assert!(crate::sketch_attachment_ui::commands(&h.app).is_some());h.app.run("file.new", json!({})).unwrap();assert!(h.app.tree.redefine.is_none());@@ -223,7 +223,7 @@ fn actual_nested_second_placement_face_pick_keeps_target_and_author_paths() {assert_eq!(h.app.session.active_occurrence_path.as_ref(), Some(&path));h.app.finish_sketch();assert_eq!(h.app.session.doc.feature(sketch).unwrap().kind, kind);- let file = h.dir.join("nested-face.solvecraft");+ let file = h.dir.join("nested-face.solidcraft");h.app.run("file.save", json!({"path":file})).unwrap();h.app.run("doc.open", json!({"path":file})).unwrap();assert_eq!(h.app.session.doc.feature(sketch).unwrap().kind, kind);@@ -241,9 +241,9 @@ fn actual_nested_second_placement_face_pick_keeps_target_and_author_paths() {#[test]fn nested_anchor_saved_fixed_conversion_preserves_rotated_second_author_plane() {- use solvecraft_engine::doc::{EmbossFace, apply_point, apply_vector};- use solvecraft_engine::geom::Plane;- use solvecraft_engine::geom::Vec3;+ use solidcraft_engine::doc::{EmbossFace, apply_point, apply_vector};+ use solidcraft_engine::geom::Plane;+ use solidcraft_engine::geom::Vec3;let mut h = Harness::new();h.app.session.auto_project = false;let created = h.app.run("component.create", json!({"name":"Author"})).unwrap();@@ -285,7 +285,7 @@ fn nested_anchor_saved_fixed_conversion_preserves_rotated_second_author_plane()axis_dir: Vec3::X,angle: "15 deg".into(),};- h.app.session = solvecraft_engine::Session::new(document);+ h.app.session = solidcraft_engine::Session::new(document);let raw = h.app.session.doc.sketch(id).unwrap().clone();let before = h.app.session.doc.to_json();let undo = h.app.session.undo.len();diff --git a/crates/ui-egui/src/sketch_corner_ui_tests.rs b/crates/ui-egui/src/sketch_corner_ui_tests.rsindex 419001ce3d..449521cd1f 100644--- a/crates/ui-egui/src/sketch_corner_ui_tests.rs+++ b/crates/ui-egui/src/sketch_corner_ui_tests.rs@@ -1,5 +1,5 @@use super::*;-use solvecraft_engine::sketch::CurveKind;+use solidcraft_engine::sketch::CurveKind;#[test]fn clicked_periodic_fit_closes_at_start_and_right_click_keeps_natural() {@@ -19,7 +19,7 @@ fn clicked_periodic_fit_closes_at_start_and_right_click_keeps_natural() {assert_eq!(sk.curves.len(), 1, "{:?}", h.app.status);assert!(matches!(sk.curves[0].kind, CurveKind::Spline { periodic: true, .. }));sk.validate_periodic_splines().unwrap();- assert_eq!(solvecraft_engine::sketch::find_profiles(&sk).len(), 1);+ assert_eq!(solidcraft_engine::sketch::find_profiles(&sk).len(), 1);assert!(h.app.tool.as_ref().unwrap().pts.is_empty());for point in [[15, 2, 0], [20, 2, 0], [20, 6, 0]] {h.step(&json!({"click":{"world":point}})).unwrap();@@ -54,7 +54,7 @@ fn clicked_ellipse_offset_then_closed_offset_preserves_exact_distance_and_undo()assert_eq!(sk.freeform_offsets.len(), 2, "{:?}", h.app.status);assert!((sk.freeform_offsets[1].distance + 0.5).abs() < 1e-4);assert!(sk.freeform_offsets.iter().all(|r| r.certificate == 2));- assert_eq!(solvecraft_engine::sketch::find_profiles(&sk).len(), 3);+ assert_eq!(solidcraft_engine::sketch::find_profiles(&sk).len(), 3);let last = sk.curve_index(&sk.freeform_offsets[1].output).unwrap();assert!(sk.exact_segs(last).unwrap()[0].point_at(0.0).dist(Vec2::new(11.5, 0.0)) < 1e-4);h.app.run("edit.undo", json!({})).unwrap();@@ -86,7 +86,7 @@ fn derived_offset_context_action_releases_geometry_and_undo_restores() {h.app.run("sketch.ellipse", json!({"center":[0,0],"major":[10,0],"minor_radius":5})).unwrap();let out = h.app.run("sketch.offset", json!({"curves":["e1"],"distance":-1,"chain":false})).unwrap();let id = out["curves"][0].as_str().unwrap().to_string();- h.app.session.selection = vec![solvecraft_engine::Sel::SketchCurve { id: id.clone() }];+ h.app.session.selection = vec![solidcraft_engine::Sel::SketchCurve { id: id.clone() }];let items = crate::context_menu::items(&h.app, &crate::context_menu::Target::Viewport);let item = items.iter().find(|item| item.id == "sketch.offset.break").unwrap();assert_eq!(item.params, Some(json!({"curve":id})));diff --git a/crates/ui-egui/src/sketch_dims.rs b/crates/ui-egui/src/sketch_dims.rsindex 12647baf6b..7dee6349c1 100644--- a/crates/ui-egui/src/sketch_dims.rs+++ b/crates/ui-egui/src/sketch_dims.rs@@ -6,8 +6,8 @@use egui::{Pos2, vec2};use serde_json::{Value, json};-use solvecraft_engine::doc::expr::Kind as ValueKind;-use solvecraft_engine::geom::Vec2;+use solidcraft_engine::doc::expr::Kind as ValueKind;+use solidcraft_engine::geom::Vec2;use crate::SolveApp;use crate::theme::Tokens;diff --git a/crates/ui-egui/src/sketch_display.rs b/crates/ui-egui/src/sketch_display.rsindex b9eae2246e..fbb20c190a 100644--- a/crates/ui-egui/src/sketch_display.rs+++ b/crates/ui-egui/src/sketch_display.rs@@ -3,10 +3,10 @@ use std::collections::HashMap;use std::hash::{Hash, Hasher};use std::sync::Arc;-use solvecraft_engine::doc::ModelState;-use solvecraft_engine::geom::{Loop2, Plane, Region2, Vec2, Vec3};-use solvecraft_engine::render::{PixelCurveView, SampledPath, SamplingBudget, SamplingQuality, sample_segment, sample_segment_unclipped};-use solvecraft_engine::sketch::Sketch;+use solidcraft_engine::doc::ModelState;+use solidcraft_engine::geom::{Loop2, Plane, Region2, Vec2, Vec3};+use solidcraft_engine::render::{PixelCurveView, SampledPath, SamplingBudget, SamplingQuality, sample_segment, sample_segment_unclipped};+use solidcraft_engine::sketch::Sketch;use crate::SolveApp;use crate::viewport::Proj;diff --git a/crates/ui-egui/src/sketch_display_preview_tests.rs b/crates/ui-egui/src/sketch_display_preview_tests.rsindex aad5aae87b..fef371d4ab 100644--- a/crates/ui-egui/src/sketch_display_preview_tests.rs+++ b/crates/ui-egui/src/sketch_display_preview_tests.rs@@ -2,16 +2,16 @@ use super::{Tool, preview_curve};use crate::scenario::Harness;use crate::viewport::Proj;use serde_json::{Value, json};-use solvecraft_engine::geom::{Plane, Vec2, Vec3};-use solvecraft_engine::render::{Camera, Mat4};-use solvecraft_engine::sketch::Sketch;+use solidcraft_engine::geom::{Plane, Vec2, Vec3};+use solidcraft_engine::render::{Camera, Mat4};+use solidcraft_engine::sketch::Sketch;fn tool(command: &str, points: &[[f64; 2]]) -> Tool {let mut tool = Tool::for_command(command).unwrap();tool.pts = points.iter().map(|p| (Vec2::new(p[0], p[1]), None)).collect();tool}-fn spans(sk: &Sketch) -> Vec<solvecraft_engine::geom::Seg2> {+fn spans(sk: &Sketch) -> Vec<solidcraft_engine::geom::Seg2> {sk.exact_segs(0).unwrap_or_else(|| sk.segs(0))}fn projection(scale: f64) -> Proj {diff --git a/crates/ui-egui/src/sketch_display_ui_tests.rs b/crates/ui-egui/src/sketch_display_ui_tests.rsindex a654a44817..74d7f26c38 100644--- a/crates/ui-egui/src/sketch_display_ui_tests.rs+++ b/crates/ui-egui/src/sketch_display_ui_tests.rs@@ -3,8 +3,8 @@ use crate::scenario::Harness;use crate::sketch_display::{curve_sample, projection_key};use crate::viewport::{Hit, Proj, pick, projection};use serde_json::json;-use solvecraft_engine::geom::{Plane, Vec2, Vec3};-use solvecraft_engine::render::{SampledPath, SamplingQuality};+use solidcraft_engine::geom::{Plane, Vec2, Vec3};+use solidcraft_engine::render::{SampledPath, SamplingQuality};use std::sync::Arc;fn circle(h: &mut Harness) -> u64 {@@ -78,7 +78,7 @@ fn pixel_circle_fit_exact_half_chord_hover_click_and_model_invariance() {h.app.viewport.hover);h.step(&json!({"click":{"world":[world.x,world.y,world.z]}})).unwrap();- assert!(h.app.session.selection.iter().any(|s| matches!(s, solvecraft_engine::Sel::SketchCurve{id} if id == "c1")));+ assert!(h.app.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::SketchCurve{id} if id == "c1")));h.app.session.selection.clear();}assert_eq!(h.app.session.doc.to_json(), baseline, "display and selection must not alter stored geometry, constraints or expressions");@@ -106,16 +106,16 @@ fn pixel_cache_full_view_resize_and_hidpi_invalidate_within_same_grid_bucket() {let keys = crate::viewport::display_scene_keys(&h.app, &first);let a = curve_sample(&h.app, sid, index, &plane, &first);assert!(Arc::ptr_eq(&a, &curve_sample(&h.app, sid, index, &plane, &first)));- let grid = solvecraft_engine::view::grid_step(h.app.cam.half_height());+ let grid = solidcraft_engine::view::grid_step(h.app.cam.half_height());// Find a real zoom change which keeps the complete grid bucket unchanged.let distance = h.app.cam.distance;for factor in [0.8, 0.9, 1.1, 1.2] {h.app.cam.distance = distance * factor;- if solvecraft_engine::view::grid_step(h.app.cam.half_height()) == grid {+ if solidcraft_engine::view::grid_step(h.app.cam.half_height()) == grid {break;}}- assert_eq!(solvecraft_engine::view::grid_step(h.app.cam.half_height()), grid);+ assert_eq!(solidcraft_engine::view::grid_step(h.app.cam.half_height()), grid);assert_ne!(h.app.cam.distance, distance);let zoom = projection(&h.app, first.rect);let zoom_keys = crate::viewport::display_scene_keys(&h.app, &zoom);@@ -163,7 +163,7 @@ fn pixel_adapter_uses_exact_ellipse_periodic_fit_and_control_spline_spans() {let ss = state.sketch(sid).unwrap();let exact = ss.sketch.exact_segs(0).unwrap();assert!(- exact.iter().all(|s| !matches!(s, solvecraft_engine::geom::Seg2::Line { .. })),+ exact.iter().all(|s| !matches!(s, solidcraft_engine::geom::Seg2::Line { .. })),"freeform display must reach the exact span extractor");let proj = projection(&h.app, h.app.viewport.rect.unwrap());@@ -216,7 +216,7 @@ fn pixel_curve_second_nested_rotated_occurrence_uses_its_world_plane() {assert!(dense_circle_error(&path, &ss.plane, &proj, 1.0, h.app.viewport.pixels_per_point()) <= 1.0);let world = ss.plane.to_world(Vec2::new(0.8090169943749475, 0.5877852522924731));h.step(&json!({"click":{"world":[world.x,world.y,world.z]}})).unwrap();- assert!(h.app.session.selection.iter().any(|s| matches!(s, solvecraft_engine::Sel::SketchCurve{id} if id == "c1")));+ assert!(h.app.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::SketchCurve{id} if id == "c1")));assert_eq!(h.app.session.doc.to_json(), baseline);}@@ -231,7 +231,7 @@ fn pixel_annulus_fill_keeps_hole_and_cpu_bridge_matches_cached_boundaries() {let ss = state.sketch(sid).unwrap();let proj = projection(&h.app, h.app.viewport.rect.unwrap());let ppp = h.app.viewport.pixels_per_point();- let profiles = solvecraft_engine::sketch::find_profiles(&ss.sketch);+ let profiles = solidcraft_engine::sketch::find_profiles(&ss.sketch);let ring = profiles.iter().find(|p| p.region.holes.len() == 1).unwrap();let display = crate::sketch_display::display_region(&ring.region, &ss.plane, &proj, ppp).unwrap();assert_eq!(display.holes.len(), 1);@@ -254,7 +254,7 @@ fn pixel_annulus_fill_keeps_hole_and_cpu_bridge_matches_cached_boundaries() {}}assert!((area - std::f64::consts::PI * 0.75).abs() < 0.02, "adaptive fill area: {area}");- let cpu = solvecraft_engine::view::sketch_lines_with_sampler(&ss.sketch, &ss.plane, true, &[], |sk, index, plane| {+ let cpu = solidcraft_engine::view::sketch_lines_with_sampler(&ss.sketch, &ss.plane, true, &[], |sk, index, plane| {crate::sketch_display::curve_parts(sk, index, plane, &proj, ppp)});let cached: Vec<_> = (0..ss.sketch.curves.len()).flat_map(|index| curve_sample(&h.app, sid, index, &ss.plane, &proj).parts.clone()).collect();diff --git a/crates/ui-egui/src/sketch_drag_ui_tests.rs b/crates/ui-egui/src/sketch_drag_ui_tests.rsindex f94209d085..89e6b32658 100644--- a/crates/ui-egui/src/sketch_drag_ui_tests.rs+++ b/crates/ui-egui/src/sketch_drag_ui_tests.rs@@ -2,7 +2,7 @@//! brings the model up to date in the drag's one undo step, and the grab stays on the geometry.use serde_json::{Value, json};-use solvecraft_engine::geom::Vec2;+use solidcraft_engine::geom::Vec2;use crate::scenario::Harness;diff --git a/crates/ui-egui/src/sketch_edit_tests.rs b/crates/ui-egui/src/sketch_edit_tests.rsindex d50cf9fbbf..2430b5c7cc 100644--- a/crates/ui-egui/src/sketch_edit_tests.rs+++ b/crates/ui-egui/src/sketch_edit_tests.rs@@ -1,12 +1,12 @@//! Regression tests: editing a sketch from the Browser or timeline can always be left again.use crate::{Services, SolveApp};-use solvecraft_engine::Session;-use solvecraft_engine::doc::FeatureKind;+use solidcraft_engine::Session;+use solidcraft_engine::doc::FeatureKind;fn sample_app() -> SolveApp {let mut s = Session::default();- s.run_script(&solvecraft_engine::sample::script()).unwrap();+ s.run_script(&solidcraft_engine::sample::script()).unwrap();SolveApp::new(s, Services::default())}diff --git a/crates/ui-egui/src/sketch_palette.rs b/crates/ui-egui/src/sketch_palette.rsindex f22dcae1e1..3cd0389e73 100644--- a/crates/ui-egui/src/sketch_palette.rs+++ b/crates/ui-egui/src/sketch_palette.rs@@ -12,7 +12,7 @@ use std::cell::Cell;use egui::{Color32, RichText, Stroke, vec2};use serde_json::{Value, json};-use solvecraft_engine::Sel;+use solidcraft_engine::Sel;use crate::SolveApp;use crate::theme::Tokens;@@ -88,7 +88,7 @@ pub fn toggle_construction(app: &mut SolveApp) {/// Curves a drawing command just made take the drawing line type.pub fn apply_mode(app: &mut SolveApp, id: &str, result: &Value) {let m = mode(app);- if m == 0 || !solvecraft_engine::find_command(id).is_some_and(|c| c.tab == "SKETCH" && c.panel == "CREATE") {+ if m == 0 || !solidcraft_engine::find_command(id).is_some_and(|c| c.tab == "SKETCH" && c.panel == "CREATE") {return;}let curves: Vec<String> = result["curves"].as_array().into_iter().flatten().filter_map(|c| c.as_str().map(str::to_string)).collect();@@ -104,7 +104,7 @@ pub fn apply_mode(app: &mut SolveApp, id: &str, result: &Value) {ss.sketch.curve_index(c).and_then(|i| ss.sketch.curves.get(i))- .is_some_and(|c| matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. }))+ .is_some_and(|c| matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. }))}).cloned().collect()@@ -144,7 +144,7 @@ pub fn set_linetype(app: &mut SolveApp, kind: u8) {ss.sketch.curve_index(id).and_then(|i| ss.sketch.curves.get(i))- .is_some_and(|c| matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. }))+ .is_some_and(|c| matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. }))}).cloned().collect()diff --git a/crates/ui-egui/src/sketch_text.rs b/crates/ui-egui/src/sketch_text.rsindex 8e00920e4c..b99c9da459 100644--- a/crates/ui-egui/src/sketch_text.rs+++ b/crates/ui-egui/src/sketch_text.rs@@ -1,7 +1,7 @@//! Edit Text: the shared feature dialog (OK/Cancel, expression fields) for the source of a//! sketch text's outlines; OK runs `sketch.edit_text`.use serde_json::{Value, json};-use solvecraft_engine::{+use solidcraft_engine::{Sel,doc::expr::Kind as ValueKind,sketch::{LinkKind, LinkSource},@@ -244,14 +244,14 @@ mod tests {let sk = h.app.session.doc.sketch(sid).unwrap();let expected = LinkSource::Text {text: "O".into(),- at: solvecraft_engine::geom::Vec2::new(25.0, 12.0),+ at: solidcraft_engine::geom::Vec2::new(25.0, 12.0),height: 20.0,angle: std::f64::consts::FRAC_PI_2,};assert_eq!(sk.link(&link).unwrap().source, expected);assert!(!h.app.session.world_state().sketch(sid).unwrap().profiles.is_empty());let changed = h.app.session.doc.to_json();- let reopened = solvecraft_engine::Session::new(solvecraft_engine::doc::Document::from_json(&changed).unwrap());+ let reopened = solidcraft_engine::Session::new(solidcraft_engine::doc::Document::from_json(&changed).unwrap());assert_eq!(reopened.doc.sketch(sid).unwrap().link(&link).unwrap().source, expected);h.app.run("edit.undo", json!({})).unwrap();assert_eq!(h.app.session.doc.to_json(), before);@@ -322,7 +322,7 @@ mod tests {assert!(!editing(&h.app));h.app.start("sketch.edit_text");assert!(editing(&h.app));- crate::documents::open_tab(&mut h.app, solvecraft_engine::Session::default()).unwrap();+ crate::documents::open_tab(&mut h.app, solidcraft_engine::Session::default()).unwrap();assert!(!editing(&h.app));}diff --git a/crates/ui-egui/src/sketch_tools.rs b/crates/ui-egui/src/sketch_tools.rsindex 77a3d9f119..4f13a6c4f2 100644--- a/crates/ui-egui/src/sketch_tools.rs+++ b/crates/ui-egui/src/sketch_tools.rs@@ -7,7 +7,7 @@ use std::cell::{Cell, RefCell};use egui::{Pos2, Stroke};use serde_json::{Value, json};-use solvecraft_engine::geom::{Vec2, Vec3};+use solidcraft_engine::geom::{Vec2, Vec3};use crate::SolveApp;use crate::tools::{Kind, Tool};@@ -55,9 +55,9 @@ const ALSO_IN: &[(&str, &str, &str)] = &[pub fn also_in<'a>(tab: &str,panel: &str,- mut cmds: Vec<&'a solvecraft_engine::CommandSpec>,- specs: &[&'a solvecraft_engine::CommandSpec],-) -> Vec<&'a solvecraft_engine::CommandSpec> {+ mut cmds: Vec<&'a solidcraft_engine::CommandSpec>,+ specs: &[&'a solidcraft_engine::CommandSpec],+) -> Vec<&'a solidcraft_engine::CommandSpec> {for (t, p, id) in ALSO_IN {if *t == tab&& *p == panel@@ -132,7 +132,7 @@ pub fn start_hook(app: &mut SolveApp, id: &str) -> bool {return false;}// Surface analyses toggle: a second click turns the same one off.- use solvecraft_engine::SurfaceAnalysis as A;+ use solidcraft_engine::SurfaceAnalysis as A;let same = match (id, app.session.analysis) {("inspect.zebra", Some(A::Zebra { .. })) => Some(true),("inspect.draft", Some(A::Draft { .. })) => Some(true),@@ -201,8 +201,8 @@ fn combs(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {pub fn refine_snap(app: &SolveApp,proj: &Proj,- sk: &solvecraft_engine::sketch::Sketch,- plane: &solvecraft_engine::geom::Plane,+ sk: &solidcraft_engine::sketch::Sketch,+ plane: &solidcraft_engine::geom::Plane,lp: Vec2,) -> Option<(Vec2, Option<String>)> {crate::inference::clear();@@ -220,8 +220,8 @@ pub fn refine_snap(let mut best: Option<(f64, &'static str, Vec2)> = None;let mut mid_of: Option<String> = None;for (i, c) in sk.curves.iter().enumerate() {- if let solvecraft_engine::sketch::CurveKind::Line { .. } = c.kind- && let Some(solvecraft_engine::sketch::Shape::Line { a, b }) = sk.shape(i)+ if let solidcraft_engine::sketch::CurveKind::Line { .. } = c.kind+ && let Some(solidcraft_engine::sketch::Shape::Line { a, b }) = sk.shape(i){let m = (a + b) * 0.5;let d = m.dist(lp);@@ -267,7 +267,7 @@ pub fn refine_snap({let (dx, dy) = ((lp.x - prev.x).abs(), (lp.y - prev.y).abs());// The free coordinate still follows the grid.- let step = solvecraft_engine::view::grid_step(app.cam.half_height()).0 / 10.0;+ let step = solidcraft_engine::view::grid_step(app.cam.half_height()).0 / 10.0;let g = |v: f64| (v / step).round() * step;if dy < tol && dx > tol {best = Some((dy, "H", Vec2::new(g(lp.x), prev.y)));@@ -372,7 +372,7 @@ fn mode(id: &str) -> Option<Mode> {/// A tool for one of the extra sketch commands.pub fn tool_for(id: &str) -> Option<Tool> {mode(id)?;- let spec = solvecraft_engine::find_command(id)?;+ let spec = solidcraft_engine::find_command(id)?;Some(Tool {cmd: spec.id,kind: Kind::Ext,@@ -490,8 +490,8 @@ pub(super) fn corner_point(app: &SolveApp, proj: &Proj, pos: Pos2, cmd: &str) ->.collect();if curves.len() != 2|| curves.iter().any(|(_, c)| {- !matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. })- && (cmd != "sketch.fillet" || !matches!(c.kind, solvecraft_engine::sketch::CurveKind::Arc { .. }))+ !matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. })+ && (cmd != "sketch.fillet" || !matches!(c.kind, solidcraft_engine::sketch::CurveKind::Arc { .. }))}){return None;@@ -529,7 +529,7 @@ fn corner_len(app: &SolveApp, point: &str) -> f64 {sk.curves.iter().enumerate()- .filter(|(_, c)| c.kind.uses(q) && matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. }))+ .filter(|(_, c)| c.kind.uses(q) && matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. })).map(|(i, _)| sk.polyline(i).windows(2).map(|w| w[0].dist(w[1])).sum::<f64>()).fold(f64::INFINITY, f64::min).min(1e6)@@ -988,7 +988,7 @@ pub fn preview(app: &SolveApp, t: &Tool, painter: &egui::Painter, proj: &Proj) {crate::tools::paint_preview_curve(&curve, &ss.plane, painter, proj, stroke);}// Picked curves highlighted.- let mut display_budget = solvecraft_engine::render::SamplingBudget::new(32_768, 65_536);+ let mut display_budget = solidcraft_engine::render::SamplingBudget::new(32_768, 65_536);for id in t.picks.iter().filter(|x| *x != "|") {if let Some(ci) = ss.sketch.curve_index(id) {crate::tools::paint_curve(&ss.sketch, ci, &ss.plane, painter, proj, Stroke::new(3.0, tk.accent.gamma_multiply(0.7)), &mut display_budget);@@ -1060,7 +1060,7 @@ fn glyphs(app: &SolveApp, painter: &egui::Painter, proj: &Proj, hover: Option<Po&& let Some(c) = ss.sketch.constraints.iter().find(|c| &c.id == id){let (cs, ps) = constraint_entities(&c.kind);- let mut display_budget = solvecraft_engine::render::SamplingBudget::new(32_768, 65_536);+ let mut display_budget = solidcraft_engine::render::SamplingBudget::new(32_768, 65_536);for ci in cs {crate::tools::paint_curve(&ss.sketch, ci, &ss.plane, painter, proj, Stroke::new(3.0, tk.accent.gamma_multiply(0.7)), &mut display_budget);}@@ -1075,7 +1075,7 @@ fn glyphs(app: &SolveApp, painter: &egui::Painter, proj: &Proj, hover: Option<Polet Some(c) = ss.sketch.constraints.iter().find(|c| &c.id == id) else { continue };let failing = ss.report.failing.contains(id);let selected = picked.as_deref() == Some(id.as_str())- || app.session.selection.iter().any(|s| matches!(s, solvecraft_engine::Sel::SketchConstraint { id: x } if x == id));+ || app.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::SketchConstraint { id: x } if x == id));let lit = selected || hovered.as_deref() == Some(id.as_str());let col = if failing {tk.error@@ -1130,8 +1130,8 @@ fn glyph_icon(name: &str) -> Option<&'static str> {}/// The curves and points a constraint ties together.-fn constraint_entities(k: &solvecraft_engine::sketch::ConstraintKind) -> (Vec<usize>, Vec<usize>) {- use solvecraft_engine::sketch::ConstraintKind::*;+fn constraint_entities(k: &solidcraft_engine::sketch::ConstraintKind) -> (Vec<usize>, Vec<usize>) {+ use solidcraft_engine::sketch::ConstraintKind::*;match *k {Coincident { p, q } | HorizontalPoints { p, q } | VerticalPoints { p, q } => (vec![], vec![p, q]),Fix { p } => (vec![], vec![p]),@@ -1160,8 +1160,8 @@ fn glyph_letter(name: &str) -> &'static str {/// Where a constraint's glyphs go: one per entity (the middle of a curve, with its direction/// there; a point, without).-fn glyph_anchors(sk: &solvecraft_engine::sketch::Sketch, k: &solvecraft_engine::sketch::ConstraintKind) -> Vec<(Vec2, Option<Vec2>)> {- use solvecraft_engine::sketch::ConstraintKind::*;+fn glyph_anchors(sk: &solidcraft_engine::sketch::Sketch, k: &solidcraft_engine::sketch::ConstraintKind) -> Vec<(Vec2, Option<Vec2>)> {+ use solidcraft_engine::sketch::ConstraintKind::*;// Half way along the curve, and the direction there.let mid = |c: usize| -> Option<(Vec2, Option<Vec2>)> {let poly = sk.polyline(c);diff --git a/crates/ui-egui/src/sketch_typed_intent_tests.rs b/crates/ui-egui/src/sketch_typed_intent_tests.rsindex 646ed903e7..a849cec3f4 100644--- a/crates/ui-egui/src/sketch_typed_intent_tests.rs+++ b/crates/ui-egui/src/sketch_typed_intent_tests.rs@@ -1,7 +1,7 @@//! Keyboard-authored intent must survive stage transitions and later model edits.use crate::scenario::Harness;use serde_json::json;-use solvecraft_engine::sketch::{ConstraintKind, CurveKind};+use solidcraft_engine::sketch::{ConstraintKind, CurveKind};fn start(command: &str) -> Harness {let mut h = Harness::new();@@ -39,7 +39,7 @@ fn typed_arc_radius_and_signed_sweep_survive_stages_parameter_edit_and_reopen()assert!(kinds.iter().any(|k| matches!(k, ConstraintKind::Radius{value,..} if (*value-5.0).abs()<1e-7)));assert!(kinds.iter().any(|k| matches!(k, ConstraintKind::ArcSweep{value,..} if (*value+std::f64::consts::FRAC_PI_2).abs()<1e-7)));h.app.run("parameters.change", json!({"name":"arc_radius","expression":"8 mm"})).unwrap();- let path = h.dir.join("typed-arc.solvecraft");+ let path = h.dir.join("typed-arc.solidcraft");h.app.run("file.save", json!({"path":path})).unwrap();h.app.run("doc.open", json!({"path":path})).unwrap();let state = h.app.session.world_state();diff --git a/crates/ui-egui/src/stand_up.rs b/crates/ui-egui/src/stand_up.rsindex edf5b41759..b5f7034a31 100644--- a/crates/ui-egui/src/stand_up.rs+++ b/crates/ui-egui/src/stand_up.rs@@ -1,5 +1,5 @@//! Standing up a Y-up file (#3). Many CAD programs save parts with Y up, so a STEP or IGES file-//! from them opens lying on its back in a Z-up design. After such a file opens, SolveCraft+//! from them opens lying on its back in a Z-up design. After such a file opens, SolidCraft//! offers to stand it up: a quarter turn about X (Y → Z) of the bodies it brought, as one//! Move feature that can be undone or edited. Preferences › Design › "Offer to stand up Y-up//! files" turns the offer off; with Y up as the default orientation it isn't needed.@@ -11,8 +11,8 @@ use crate::SolveApp;/// The bodies a just-opened file brought (`before`: body names before it opened, none for a/// new design): offer to stand them up.pub fn offer(app: &mut SolveApp, path: &str, before: &[String]) {- let io = &solvecraft_engine::io::is_step_path;- if !(io(path) || solvecraft_engine::io::is_iges_path(path)) || !app.preferences.offer_stand_up || app.preferences.up_axis != "z" {+ let io = &solidcraft_engine::io::is_step_path;+ if !(io(path) || solidcraft_engine::io::is_iges_path(path)) || !app.preferences.offer_stand_up || app.preferences.up_axis != "z" {return;}let bodies: Vec<String> = app.session.world_state().bodies.iter().map(|b| b.name.clone()).filter(|n| !before.contains(n)).collect();diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rsindex 38783de148..9ec1dd0f68 100644--- a/crates/ui-egui/src/theme.rs+++ b/crates/ui-egui/src/theme.rs@@ -255,7 +255,7 @@ impl Tokens {/// How a physical material looks (the default appearance follows the material).pub fn material_color(name: &str) -> Option<Color32> {- solvecraft_engine::doc::material_color(name).map(|[r, g, b]| Color32::from_rgb(r, g, b))+ solidcraft_engine::doc::material_color(name).map(|[r, g, b]| Color32::from_rgb(r, g, b))}/// Switch themes (the visuals follow on the next [`apply`]).diff --git a/crates/ui-egui/src/timeline.rs b/crates/ui-egui/src/timeline.rsindex 59e95a5529..a54a7e3808 100644--- a/crates/ui-egui/src/timeline.rs+++ b/crates/ui-egui/src/timeline.rs@@ -2,7 +2,7 @@use egui::{Color32, Rect, Sense, Stroke, UiBuilder, pos2, vec2};use serde_json::json;-use solvecraft_engine::doc::FeatureKind;+use solidcraft_engine::doc::FeatureKind;use crate::theme::Tokens;use crate::{SolveApp, icons};@@ -19,7 +19,7 @@ fn icon_of(k: &FeatureKind) -> &'static str {FeatureKind::Sphere { .. } => "sphere",FeatureKind::Torus { .. } => "torus",FeatureKind::Combine { .. } => "combine",- FeatureKind::Pattern { pattern: solvecraft_engine::doc::PatternKind::Rectangular { .. }, .. } => "pattern_rect",+ FeatureKind::Pattern { pattern: solidcraft_engine::doc::PatternKind::Rectangular { .. }, .. } => "pattern_rect",FeatureKind::Pattern { .. } => "pattern_circ",FeatureKind::Mirror { .. } => "mirror",FeatureKind::ConstructionPlane { .. } => "plane",@@ -148,7 +148,7 @@ pub fn timeline(app: &mut SolveApp, ui: &mut egui::Ui) {let err = res.and_then(|r| r.error.clone());let warn = res.and_then(|r| r.warning.clone());let rolled = i >= marker;- let is_it = |s: &solvecraft_engine::Sel| matches!(s, solvecraft_engine::Sel::Feature { id: f } if f == id);+ let is_it = |s: &solidcraft_engine::Sel| matches!(s, solidcraft_engine::Sel::Feature { id: f } if f == id);let sel = app.session.selection.iter().any(is_it) || app.dialog.as_ref().is_some_and(|d| d.items().iter().any(is_it));if resp.hovered() {hovered = Some(*id);@@ -212,7 +212,7 @@ pub fn timeline(app: &mut SolveApp, ui: &mut egui::Ui) {let takes = app.dialog.as_ref().and_then(|d| d.active_input()).is_some_and(|i| i.accept & crate::selection::FEATURES != 0);if takes {if let Some(mut d) = app.dialog.take() {- d.pick(&app.session, solvecraft_engine::Sel::Feature { id: *id });+ d.pick(&app.session, solidcraft_engine::Sel::Feature { id: *id });app.dialog = Some(d);}} else {diff --git a/crates/ui-egui/src/titlebar.rs b/crates/ui-egui/src/titlebar.rsindex 910688bdf7..6144c3d2bc 100644--- a/crates/ui-egui/src/titlebar.rs+++ b/crates/ui-egui/src/titlebar.rs@@ -190,7 +190,7 @@ pub fn resize_zones(ui: &mut Ui) {mod tests {use super::*;use egui::{Event, Pos2, RawInput, ViewportId};- use solvecraft_engine::Session;+ use solidcraft_engine::Session;/// A headless window `width` pt wide showing the application bar (as the title bar) and the/// resize zones.diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rsindex 7b0480b7fd..83344f0c98 100644--- a/crates/ui-egui/src/toolbar.rs+++ b/crates/ui-egui/src/toolbar.rs@@ -97,9 +97,9 @@ pub fn fit(widths: &[f32], room: f32) -> Vec<Fit> {/// The commands a panel's drop-down (or its » submenu) lists: its own, then any button moved/// into it from another panel.fn menu_commands(- cmds: &[&'static solvecraft_engine::CommandSpec],- shown: &[&'static solvecraft_engine::CommandSpec],-) -> Vec<&'static solvecraft_engine::CommandSpec> {+ cmds: &[&'static solidcraft_engine::CommandSpec],+ shown: &[&'static solidcraft_engine::CommandSpec],+) -> Vec<&'static solidcraft_engine::CommandSpec> {let mut out = cmds.to_vec();for c in shown {if !out.iter().any(|o| o.id == c.id) {@@ -340,7 +340,7 @@ fn file_menu(app: &mut SolveApp, ctx: &egui::Context) {}ui.menu_button(app.tr("ui.open_recent"), |ui| {for path in app.home.recent.clone() {- let missing = !solvecraft_engine::io::vfs::exists(&path);+ let missing = !solidcraft_engine::io::vfs::exists(&path);let label = format!("{path}{}", if missing { " (missing)" } else { "" });if ui.button(label).clicked() {crate::home::open_recent(app, &path);@@ -430,8 +430,8 @@ pub fn save(app: &mut SolveApp) {}fn save_as(app: &mut SolveApp) {- let name = format!("{}.{}", app.session.doc.name, solvecraft_engine::io::DESIGN_EXT);- if let Some(p) = app.services.pick_save.as_ref().and_then(|f| f(&name, &[solvecraft_engine::io::DESIGN_EXT])) {+ let name = format!("{}.{}", app.session.doc.name, solidcraft_engine::io::DESIGN_EXT);+ if let Some(p) = app.services.pick_save.as_ref().and_then(|f| f(&name, &[solidcraft_engine::io::DESIGN_EXT])) {let _ = app.run("file.save_as", json!({"path": p}));}}@@ -802,7 +802,7 @@ fn dropdown_row_id(id: &str) -> egui::Id {}/// How wide a panel drop-down's rows are: the widest label and shortcut, at least 200.-fn dropdown_width(app: &SolveApp, ui: &egui::Ui, cmds: &[&'static solvecraft_engine::CommandSpec]) -> f32 {+fn dropdown_width(app: &SolveApp, ui: &egui::Ui, cmds: &[&'static solidcraft_engine::CommandSpec]) -> f32 {let t = Tokens::get();let font = FontId::proportional(13.0);cmds.iter()@@ -816,7 +816,7 @@ fn dropdown_width(app: &SolveApp, ui: &egui::Ui, cmds: &[&'static solvecraft_eng/// One command row of a panel drop-down: icon, label and shortcut, with the hover background/// under the pointer or keyboard focus (like every menu).-fn dropdown_row(app: &SolveApp, ui: &mut egui::Ui, c: &'static solvecraft_engine::CommandSpec, width: f32, pinned: bool) -> RowAction {+fn dropdown_row(app: &SolveApp, ui: &mut egui::Ui, c: &'static solidcraft_engine::CommandSpec, width: f32, pinned: bool) -> RowAction {let t = Tokens::get();let info = c.info(&app.session);let (rect, _) = ui.allocate_exact_size(vec2(width, ROW_H), Sense::hover());@@ -886,7 +886,7 @@ struct ToolbarDrag {/// The dragged command's icon under the pointer, crossed out when releasing removes it.fn drag_ghost(ctx: &egui::Context, id: &str, at: egui::Pos2, removing: bool) {let t = Tokens::get();- let Some(c) = solvecraft_engine::find_command(id) else { return };+ let Some(c) = solidcraft_engine::find_command(id) else { return };let p = ctx.layer_painter(egui::LayerId::new(egui::Order::Tooltip, egui::Id::new("sc_toolbar_drag")));let r = Rect::from_center_size(at + vec2(14.0, 16.0), vec2(30.0, 30.0));p.rect(r, 4.0, t.toolbar.gamma_multiply(0.92), Stroke::new(1.0, if removing { t.error } else { t.accent }), egui::StrokeKind::Inside);@@ -1115,7 +1115,7 @@ mod header_report_tests {h.app.run("sketch.line", json!({"points":[[0,0],[20,0]]})).unwrap();h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 80.0;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(10.0, 0.0, 0.0);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(10.0, 0.0, 0.0);h.settle();h.step(&json!({"start":"sketch.dimension"})).unwrap();for point in [[0, 0, 0], [20, 0, 0], [10, 5, 0]] {@@ -1158,7 +1158,7 @@ mod home_tests {h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10, "body_name": "Main"})).unwrap();h.app.run("solid.box", json!({"length": 5, "width": 5, "height": 5, "corner": [20, 0, 0]})).unwrap();h.app.run("edit.undo", json!({})).unwrap();- h.app.session.selection = vec![solvecraft_engine::Sel::Body { name: "Main".into() }];+ h.app.session.selection = vec![solidcraft_engine::Sel::Body { name: "Main".into() }];let rev = h.app.session.revision;h.app.home.show(rev);h.frames(2);diff --git a/crates/ui-egui/src/toolbar_custom.rs b/crates/ui-egui/src/toolbar_custom.rsindex 5936dac870..efe2dd64d4 100644--- a/crates/ui-egui/src/toolbar_custom.rs+++ b/crates/ui-egui/src/toolbar_custom.rs@@ -11,7 +11,7 @@use std::collections::BTreeMap;use serde_json::{Value, json};-use solvecraft_engine::{CommandSpec, command_specs};+use solidcraft_engine::{CommandSpec, command_specs};use crate::SolveApp;use crate::context_menu::Item;@@ -55,7 +55,7 @@ fn key(tab: &str, panel: &str) -> String {/// The buttons a panel shows: the user's list, or the first `promoted` commands of the panel.pub fn buttons(app: &SolveApp, tab: &str, panel: &str, cmds: &[&'static CommandSpec], promoted: usize) -> Vec<&'static CommandSpec> {match app.toolbar_custom.panels.get(&key(tab, panel)) {- Some(ids) => ids.iter().filter_map(|id| solvecraft_engine::find_command(id)).collect(),+ Some(ids) => ids.iter().filter_map(|id| solidcraft_engine::find_command(id)).collect(),None => cmds.iter().take(promoted).copied().collect(),}}@@ -101,7 +101,7 @@ fn home_panel(tab: &str, id: &str) -> Option<&'static str> {/// Pin a command to the toolbar of a tab (as a button of its panel, at the end).pub fn pin(app: &mut SolveApp, tab: &str, id: &str) -> Result<(), String> {- if solvecraft_engine::find_command(id).is_none() {+ if solidcraft_engine::find_command(id).is_none() {return Err(format!("no command `{id}`"));}if pinned_on(app, tab, id).is_some() {@@ -197,11 +197,12 @@ pub fn run(app: &mut SolveApp, action: &str, p: &Value) {/// Shortcut keys, S box favourites and the toolbar as one file (Keyboard Shortcuts › Export).pub fn export(app: &SolveApp) -> Value {- json!({ "format": "solvecraft-shortcuts/1", "shortcuts": app.keymap.prefs(), "favourites": app.sbox.pinned, "toolbar": app.toolbar_custom.prefs() })+ json!({ "format": "solidcraft-shortcuts/1", "shortcuts": app.keymap.prefs(), "favourites": app.sbox.pinned, "toolbar": app.toolbar_custom.prefs() })}pub fn import(app: &mut SolveApp, v: &Value) -> Result<(), String> {- if v.get("format").and_then(Value::as_str) != Some("solvecraft-shortcuts/1") {+ // "solvecraft-shortcuts/1": files exported before the rename (compatibility shim).+ if !matches!(v.get("format").and_then(Value::as_str), Some("solidcraft-shortcuts/1" | "solvecraft-shortcuts/1")) {return Err("not a SolidCraft shortcuts file".into());}if let Some(s) = v.get("shortcuts") {diff --git a/crates/ui-egui/src/tools.rs b/crates/ui-egui/src/tools.rsindex 83a69d73fd..76b0e36003 100644--- a/crates/ui-egui/src/tools.rs+++ b/crates/ui-egui/src/tools.rs@@ -3,7 +3,7 @@use egui::{Pos2, Stroke};use serde_json::{Value, json};-use solvecraft_engine::geom::Vec2;+use solidcraft_engine::geom::Vec2;use crate::SolveApp;use crate::viewport::{Hit, Proj, pick, sketch_point_at};@@ -336,8 +336,8 @@ fn run_shape(app: &mut SolveApp, t: &Tool) -> Result<Vec<String>, String> {}/// Only consume a complete, unambiguous selection; command validation owns geometry.-pub(crate) fn constraint_preselection(command: &str, selection: &[solvecraft_engine::Sel]) -> Option<Value> {- use solvecraft_engine::Sel::{SketchCurve, SketchPoint};+pub(crate) fn constraint_preselection(command: &str, selection: &[solidcraft_engine::Sel]) -> Option<Value> {+ use solidcraft_engine::Sel::{SketchCurve, SketchPoint};let selected_ids = |curves_only: bool, minimum: usize| -> Option<Vec<&str>> {if !(minimum..=200).contains(&selection.len()) {return None;@@ -360,7 +360,7 @@ pub(crate) fn constraint_preselection(command: &str, selection: &[solvecraft_eng("sketch.constraint.horizontal_vertical", [SketchCurve { id }]) => Some(json!({"line":id})),("sketch.constraint.horizontal_vertical", [SketchPoint { id: a }, SketchPoint { id: b }]) if a != b => Some(json!({"points":[a,b]})),("sketch.constraint.coincident", [a, b]) => {- let entity = |s: &solvecraft_engine::Sel| match s {+ let entity = |s: &solidcraft_engine::Sel| match s {SketchPoint { id } | SketchCurve { id } => Some(id.clone()),_ => None,};@@ -390,8 +390,8 @@ pub(crate) fn constraint_preselection(command: &str, selection: &[solvecraft_eng}}-pub(crate) fn projection_preselection(selection: &[solvecraft_engine::Sel]) -> Option<Vec<Value>> {- use solvecraft_engine::Sel;+pub(crate) fn projection_preselection(selection: &[solidcraft_engine::Sel]) -> Option<Vec<Value>> {+ use solidcraft_engine::Sel;// The projection command processes at most 1000 references; never consume a subset.if selection.is_empty() || selection.len() > 1000 {return None;@@ -451,23 +451,23 @@ pub fn finish(app: &mut SolveApp) {/// Rubber-band preview of the shape being drawn.pub(crate) fn paint_preview_curve(- sketch: &solvecraft_engine::sketch::Sketch,- plane: &solvecraft_engine::geom::Plane,+ sketch: &solidcraft_engine::sketch::Sketch,+ plane: &solidcraft_engine::geom::Plane,painter: &egui::Painter,proj: &Proj,stroke: Stroke,) {- paint_curve(sketch, 0, plane, painter, proj, stroke, &mut solvecraft_engine::render::SamplingBudget::new(4096, 65_536));+ paint_curve(sketch, 0, plane, painter, proj, stroke, &mut solidcraft_engine::render::SamplingBudget::new(4096, 65_536));}pub(crate) fn paint_curve(- sketch: &solvecraft_engine::sketch::Sketch,+ sketch: &solidcraft_engine::sketch::Sketch,index: usize,- plane: &solvecraft_engine::geom::Plane,+ plane: &solidcraft_engine::geom::Plane,painter: &egui::Painter,proj: &Proj,stroke: Stroke,- budget: &mut solvecraft_engine::render::SamplingBudget,+ budget: &mut solidcraft_engine::render::SamplingBudget,) {for part in crate::sketch_display::curve_with_budget(sketch, index, plane, proj, painter.ctx().pixels_per_point(), budget).parts {let screen: Vec<_> = part.into_iter().filter_map(|point| proj.to_screen(point)).collect();@@ -479,9 +479,9 @@ pub(crate) fn paint_curve(/// Temporary analytic geometry uses the same exact span extraction as committed curves./// It never solves constraints or modifies the document.-pub(crate) fn preview_curve(t: &Tool, hover: Vec2, sweep: Option<f64>) -> Option<solvecraft_engine::sketch::Sketch> {- use solvecraft_engine::sketch::{CurveKind, Sketch};- if !hover.is_finite() || t.pts.len() >= solvecraft_engine::sketch::MAX_SPLINE_POINTS || t.pts.iter().any(|p| !p.0.is_finite()) {+pub(crate) fn preview_curve(t: &Tool, hover: Vec2, sweep: Option<f64>) -> Option<solidcraft_engine::sketch::Sketch> {+ use solidcraft_engine::sketch::{CurveKind, Sketch};+ if !hover.is_finite() || t.pts.len() >= solidcraft_engine::sketch::MAX_SPLINE_POINTS || t.pts.iter().any(|p| !p.0.is_finite()) {return None;}let mut sk = Sketch::new();diff --git a/crates/ui-egui/src/viewport.rs b/crates/ui-egui/src/viewport.rsindex ceba370ffa..794bc5aac9 100644--- a/crates/ui-egui/src/viewport.rs+++ b/crates/ui-egui/src/viewport.rs@@ -3,11 +3,11 @@use egui::{Align2, Color32, FontId, Pos2, Rect, Sense, Shape, Stroke, pos2, vec2};use serde_json::json;-use solvecraft_engine::Sel;-use solvecraft_engine::geom::{Vec2, Vec3};-use solvecraft_engine::render::{Camera, Mat4, Rgb};-use solvecraft_engine::sketch::CurveKind;-use solvecraft_engine::view::{colors, grid_step, sketch_consumed, sketch_lines_with_sampler};+use solidcraft_engine::Sel;+use solidcraft_engine::geom::{Vec2, Vec3};+use solidcraft_engine::render::{Camera, Mat4, Rgb};+use solidcraft_engine::sketch::CurveKind;+use solidcraft_engine::view::{colors, grid_step, sketch_consumed, sketch_lines_with_sampler};use std::hash::{Hash, Hasher};use crate::gpu::{GpuScene, GpuTarget, SceneSlot, ViewportCallback};@@ -29,7 +29,7 @@ pub enum NavMode {#[derive(Default)]pub struct ViewportState {/// Per-body bounding boxes for fast picking, keyed by the model they were taken from.- pick_bounds: std::sync::Mutex<Option<(usize, std::sync::Arc<Vec<(String, solvecraft_engine::geom::Aabb3)>>)>>,+ pick_bounds: std::sync::Mutex<Option<(usize, std::sync::Arc<Vec<(String, solidcraft_engine::geom::Aabb3)>>)>>,/// The last pick (its key and hits): reused while nothing it depends on changed.last_pick: Option<(u64, Vec<Hit>)>,pub rect: Option<Rect>,@@ -325,7 +325,7 @@ fn build_scene(app: &SolveApp) -> GpuScene {let hidden_col = c4(tk.text.gamma_multiply(0.35));// Appearances: the body's opacity, and faces with looks of their own.let opacity = s.doc.model_body_opacity(b);- let face_looks: std::collections::HashMap<usize, solvecraft_engine::doc::appearance::Look> =+ let face_looks: std::collections::HashMap<usize, solidcraft_engine::doc::appearance::Look> =if shaded { s.doc.face_colors(b).into_iter().collect() } else { Default::default() };for (ti, t) in m.triangles.iter().enumerate().filter(|_| shaded) {let (mut col, a) = match m.tri_face.get(ti).and_then(|f| face_looks.get(&(*f as usize))) {@@ -371,7 +371,7 @@ fn build_scene(app: &SolveApp) -> GpuScene {if let Some((o, n)) = section_plane(app) {let col = c4(tk.text.gamma_multiply(0.9));for b in st.bodies.iter().filter(|b| app.session.body_visible(&b.name)) {- for (a, c) in solvecraft_engine::view::section_segments(&b.mesh(), o, n) {+ for (a, c) in solidcraft_engine::view::section_segments(&b.mesh(), o, n) {sc.line(a.to_f32(), c.to_f32(), col, 1.8, false);}}@@ -444,9 +444,9 @@ fn build_sketch_scene(app: &SolveApp, proj: &Proj) -> GpuScene {sc}-fn ground_shadow(sc: &mut GpuScene, app: &SolveApp, st: &solvecraft_engine::doc::ModelState) {+fn ground_shadow(sc: &mut GpuScene, app: &SolveApp, st: &solidcraft_engine::doc::ModelState) {// The bodies' box in the camera's Z-up frame (the ground is its XY plane).- let mut b = solvecraft_engine::geom::Aabb3::EMPTY;+ let mut b = solidcraft_engine::geom::Aabb3::EMPTY;for x in st.bodies.iter().filter(|x| app.session.body_visible(&x.name)) {let bb = x.mesh().bounds();if bb.is_empty() {@@ -561,8 +561,8 @@ pub fn origin_axes(app: &SolveApp) -> Vec<(&'static str, Vec3)> {/// from, to).pub fn construction_axis_segments(app: &SolveApp) -> Vec<(String, Vec3, Vec3)> {let h = origin_size(app.cam.half_height()) * AXIS_LEN;- let bb = solvecraft_engine::view::bounds(&app.session);- solvecraft_engine::view::construction_axes(&app.session)+ let bb = solidcraft_engine::view::bounds(&app.session);+ solidcraft_engine::view::construction_axes(&app.session).into_iter().filter(|(_, n, _, _)| !app.session.visibility.hidden_origin.contains(n)).map(|(_, name, o, d)| {@@ -586,7 +586,7 @@ pub fn construction_axis_segments(app: &SolveApp) -> Vec<(String, Vec3, Vec3)> {/// Construction points shown: (name, position).pub fn construction_points(app: &SolveApp) -> Vec<(String, Vec3)> {- solvecraft_engine::view::construction_points(&app.session)+ solidcraft_engine::view::construction_points(&app.session).into_iter().filter(|(_, n, _)| !app.session.visibility.hidden_origin.contains(n)).map(|(_, n, p)| (n, p))@@ -596,7 +596,7 @@ pub fn construction_points(app: &SolveApp) -> Vec<(String, Vec3)> {/// Construction planes drawn as squares around their origin: (name, normal, quad).pub fn construction_quads(app: &SolveApp) -> Vec<(String, Vec3, [Vec3; 4])> {let h = origin_size(app.cam.half_height()) * 1.2;- solvecraft_engine::view::construction_planes(&app.session)+ solidcraft_engine::view::construction_planes(&app.session).into_iter().filter(|(_, n, _)| !app.session.visibility.hidden_origin.contains(n)).map(|(_, name, pl)| {@@ -611,8 +611,8 @@ pub fn construction_quads(app: &SolveApp) -> Vec<(String, Vec3, [Vec3; 4])> {/// Bounding boxes of the shown model's bodies (cached until the model changes).fn body_bounds(app: &SolveApp,- st: &std::sync::Arc<solvecraft_engine::doc::ModelState>,-) -> std::sync::Arc<Vec<(String, solvecraft_engine::geom::Aabb3)>> {+ st: &std::sync::Arc<solidcraft_engine::doc::ModelState>,+) -> std::sync::Arc<Vec<(String, solidcraft_engine::geom::Aabb3)>> {let key = std::sync::Arc::as_ptr(st) as usize;if let Ok(mut g) = app.viewport.pick_bounds.lock() {if let Some((k, b)) = g.as_ref()@@ -628,9 +628,9 @@ fn body_bounds(}/// The model's extent: bodies (from the cached boxes) and sketches.-pub fn model_bounds(app: &SolveApp) -> solvecraft_engine::geom::Aabb3 {+pub fn model_bounds(app: &SolveApp) -> solidcraft_engine::geom::Aabb3 {let st = app.session.world_state();- let mut b = body_bounds(app, &st).iter().fold(solvecraft_engine::geom::Aabb3::EMPTY, |a, (_, x)| a.union(x));+ let mut b = body_bounds(app, &st).iter().fold(solidcraft_engine::geom::Aabb3::EMPTY, |a, (_, x)| a.union(x));for ss in &st.sketches {if let Some((lo, hi)) = ss.sketch.bounds() {for p in [lo, hi] {@@ -645,7 +645,7 @@ pub fn model_bounds(app: &SolveApp) -> solvecraft_engine::geom::Aabb3 {}/// Where a ray enters a box (None: it misses).-fn ray_box(o: Vec3, d: Vec3, b: &solvecraft_engine::geom::Aabb3, pad: f64) -> Option<f64> {+fn ray_box(o: Vec3, d: Vec3, b: &solidcraft_engine::geom::Aabb3, pad: f64) -> Option<f64> {let (mut t0, mut t1) = (f64::NEG_INFINITY, f64::INFINITY);for (oo, dd, lo, hi) in [(o.x, d.x, b.min.x, b.max.x), (o.y, d.y, b.min.y, b.max.y), (o.z, d.z, b.min.z, b.max.z)] {let (lo, hi) = (lo - pad, hi + pad);@@ -663,7 +663,7 @@ fn ray_box(o: Vec3, d: Vec3, b: &solvecraft_engine::geom::Aabb3, pad: f64) -> Op}/// A box's outline on screen, grown by `px` (None: behind the eye).-fn screen_box(proj: &Proj, b: &solvecraft_engine::geom::Aabb3, px: f32) -> Option<Rect> {+fn screen_box(proj: &Proj, b: &solidcraft_engine::geom::Aabb3, px: f32) -> Option<Rect> {let mut r = Rect::NOTHING;for i in 0..8 {let p = Vec3::new(@@ -917,7 +917,7 @@ fn pick_with_sketch_points(app: &SolveApp, proj: &Proj, pos: Pos2, other_sketch_/// The section cut shown now: the open Section Analysis dialog's plane, else the session's./// The active sketch's display options (defaults when not sketching).-pub fn active_view(app: &SolveApp) -> solvecraft_engine::sketch::SketchView {+pub fn active_view(app: &SolveApp) -> solidcraft_engine::sketch::SketchView {let st = app.session.world_state();app.session.active_sketch.and_then(|s| st.sketch(s)).map(|ss| ss.sketch.view.clone()).unwrap_or_default()}@@ -959,7 +959,7 @@ fn feature_geometry(app: &SolveApp, id: u64) -> Vec<Sel> {out.push(Sel::Body { name: b.name.clone() });continue;}- let names = solvecraft_engine::doc::naming::face_names(b);+ let names = solidcraft_engine::doc::naming::face_names(b);let m = b.mesh();for (index, _) in names.iter().enumerate().filter(|(_, n)| n.starts_with(&prefix)) {if let Some(point) = m.triangles.iter().zip(&m.tri_face).find_map(|(t, f)| {@@ -992,9 +992,9 @@ fn displayed_selection(app: &SolveApp, item: &Sel) -> Vec<Sel> {/// The box around what is selected (bodies, faces, edges, vertices, sketch curves and the/// bodies of selected features), where it is shown.-pub fn selection_bounds(app: &SolveApp) -> Option<solvecraft_engine::geom::Aabb3> {+pub fn selection_bounds(app: &SolveApp) -> Option<solidcraft_engine::geom::Aabb3> {let st = app.session.world_state();- let mut b = solvecraft_engine::geom::Aabb3::EMPTY;+ let mut b = solidcraft_engine::geom::Aabb3::EMPTY;for s in app.session.selection.iter().flat_map(|item| displayed_selection(app, item)) {match &s {Sel::Body { name } => {@@ -1056,7 +1056,7 @@ pub fn selection_bounds(app: &SolveApp) -> Option<solvecraft_engine::geom::Aabb3/// The section as the shader's clip plane (normal, d), zero when there is none./// The surface analysis for the shader (see `gpu::ViewportCallback::analysis`).fn analysis_uniform(app: &SolveApp) -> [f32; 8] {- use solvecraft_engine::SurfaceAnalysis as A;+ use solidcraft_engine::SurfaceAnalysis as A;match app.session.analysis {Some(A::Zebra { stripes }) => [1.0, stripes as f32, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0],Some(A::Draft { pull, angle }) => [2.0, angle as f32, 0.0, 0.0, pull.x as f32, pull.y as f32, pull.z as f32, 0.0],@@ -1128,7 +1128,7 @@ pub fn candidate(app: &SolveApp, hits: &[Hit]) -> Option<(Hit, Sel)> {/// The edge a selection refers to now: by index if it still passes through the stored point,/// otherwise the edge nearest the point.-fn edge_of(m: &solvecraft_engine::geom::Mesh, index: usize, point: Vec3) -> Option<&Vec<Vec3>> {+fn edge_of(m: &solidcraft_engine::geom::Mesh, index: usize, point: Vec3) -> Option<&Vec<Vec3>> {let tol = m.bounds().diagonal().max(1.0) * 1e-6;let near = |e: &Vec<Vec3>| e.windows(2).map(|w| point.dist_to_segment(w[0], w[1])).fold(f64::INFINITY, f64::min);if let Some(e) = m.edges.get(index)@@ -1139,7 +1139,7 @@ fn edge_of(m: &solvecraft_engine::geom::Mesh, index: usize, point: Vec3) -> Optim.edges.iter().min_by(|a, b| near(a).total_cmp(&near(b))).filter(|e| near(e) < tol * 1e3)}-fn face_tris(sc: &mut GpuScene, m: &solvecraft_engine::geom::Mesh, face: usize, col: [u8; 4], lit: bool) {+fn face_tris(sc: &mut GpuScene, m: &solidcraft_engine::geom::Mesh, face: usize, col: [u8; 4], lit: bool) {for (t, f) in m.triangles.iter().zip(&m.tri_face) {if *f as usize != face {continue;@@ -1167,7 +1167,7 @@ fn edge_lines(sc: &mut GpuScene, e: &[Vec3], core: Color32, halo: Color32, w: f3}/// The outline of a highlighted face where the model hides it (dimmed).-fn hidden_face_outline(sc: &mut GpuScene, m: &solvecraft_engine::geom::Mesh, face: usize, col: Color32) {+fn hidden_face_outline(sc: &mut GpuScene, m: &solidcraft_engine::geom::Mesh, face: usize, col: Color32) {for (ei, e) in m.edges.iter().enumerate() {let on = m.edge_faces.get(ei).is_some_and(|f| f.iter().any(|x| *x as usize == face));if on && m.edge_pickable(ei) {@@ -1189,7 +1189,7 @@ pub(crate) fn profile_fill(sc: &mut GpuScene, app: &SolveApp, sketch: u64, index};// Lift toward the eye so a profile on a face shows over it.let lift = app.cam.back() * (app.cam.half_height() * 0.002);- let w = |q: solvecraft_engine::geom::Vec2| (plane.to_world(q) + lift).to_f32();+ let w = |q: solidcraft_engine::geom::Vec2| (plane.to_world(q) + lift).to_f32();let col = c4(fill);// In the translucent pass (after the grid and edges) so it covers them.let proj = display_proj(app);@@ -1467,7 +1467,7 @@ fn build_highlight(app: &SolveApp) -> GpuScene {}/// A body's display colour (appearance, material or imported colour), if it has one.-fn body_color(doc: &solvecraft_engine::doc::Document, b: &solvecraft_engine::doc::ModelBody) -> Option<Color32> {+fn body_color(doc: &solidcraft_engine::doc::Document, b: &solidcraft_engine::doc::ModelBody) -> Option<Color32> {let to8 = |x: f32| (x.clamp(0.0, 1.0) * 255.0).round() as u8;doc.body_color(b).map(|[r, g, b]| Color32::from_rgb(to8(r), to8(g), to8(b)))}@@ -2080,7 +2080,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {let at = match app.session.execute("sketch.drag", &json!({"entity": id, "from": [from.x, from.y], "to": [q.x, q.y], "live": true})) {Ok(r) => {app.session.undo.truncate(depth + 1);- r.get("at").and_then(solvecraft_engine::params::vec2).unwrap_or(q)+ r.get("at").and_then(solidcraft_engine::params::vec2).unwrap_or(q)}Err(_) => from,};@@ -2147,7 +2147,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {points_2d(app, &painter, &proj);if let Some((plane, sketch)) = crate::sketch_attachment_ui::lost_guide(app)&& let Some((low, high)) = sketch.bounds()- && let Some(at) = proj.to_screen(plane.to_world(solvecraft_engine::geom::Vec2::new((low.x + high.x) * 0.5, high.y)))+ && let Some(at) = proj.to_screen(plane.to_world(solidcraft_engine::geom::Vec2::new((low.x + high.x) * 0.5, high.y))){painter.text(at - vec2(0.0, 12.0), Align2::CENTER_BOTTOM, "Saved sketch plane — attachment lost", FontId::proportional(12.0), t.warning);}@@ -2209,7 +2209,7 @@ fn select(app: &mut SolveApp, sel: Option<Sel>, add: bool) {/// Expand a visible rim or surface into the kernel pieces a command needs. The original/// face pick keeps its point (used by tools such as Hole and construction geometry).-pub(crate) fn grouped_selection(s: &solvecraft_engine::Session, sel: &Sel) -> Vec<Sel> {+pub(crate) fn grouped_selection(s: &solidcraft_engine::Session, sel: &Sel) -> Vec<Sel> {let st = s.world_state();match sel {Sel::Edge { body, index, .. } => {@@ -2250,7 +2250,7 @@ pub(crate) fn grouped_selection(s: &solvecraft_engine::Session, sel: &Sel) -> Ve}/// Measure keeps one entry per visible item, rather than using its two slots for kernel halves.-pub(crate) fn measurement_selection(s: &solvecraft_engine::Session, sel: &Sel) -> Sel {+pub(crate) fn measurement_selection(s: &solidcraft_engine::Session, sel: &Sel) -> Sel {let pieces = grouped_selection(s, sel);let mut representative = sel.clone();match &mut representative {@@ -2301,7 +2301,7 @@ fn box_select(app: &mut SolveApp, proj: &Proj, bx: BoxSel, add: bool) {let takes = if bx.crossing {parts.iter().any(|part| bx.takes(part))} else {- sampled.quality == solvecraft_engine::render::SamplingQuality::Complete+ sampled.quality == solidcraft_engine::render::SamplingQuality::Complete&& !parts.is_empty()&& parts.iter().all(|part| bx.takes(part))};@@ -2310,7 +2310,7 @@ fn box_select(app: &mut SolveApp, proj: &Proj, bx: BoxSel, add: bool) {}}for (i, p) in ss.sketch.points.iter().enumerate().filter(|_| !off("sketch") && !off("sketch_points")) {- if i != 0 && solvecraft_engine::view::sketch_point_visible(&ss.sketch, i) && bx.takes(&to2(&[ss.plane.to_world(p.pos)])) {+ if i != 0 && solidcraft_engine::view::sketch_point_visible(&ss.sketch, i) && bx.takes(&to2(&[ss.plane.to_world(p.pos)])) {out.push(Sel::SketchPoint { id: p.id.clone() });}}@@ -2483,7 +2483,7 @@ fn overlays(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {let locked = sk.locked_points();let virtual_corners: Vec<usize> = sk.virtual_corners().into_iter().map(|(i, _)| i).collect();for (i, p) in sk.points.iter().enumerate() {- if !solvecraft_engine::view::sketch_point_visible(sk, i) {+ if !solidcraft_engine::view::sketch_point_visible(sk, i) {continue;}let hidden = (sk.view.hide_points && i != 0) || (sk.view.hide_projected && p.link.is_some());@@ -2531,14 +2531,14 @@ fn cpu_render(app: &mut SolveApp, ctx: &egui::Context, painter: &egui::Painter,(rect.width() as u32, rect.height() as u32).hash(&mut h);let key = h.finish();if app.viewport.cpu.as_ref().is_none_or(|(k, _)| *k != key) {- let mut budget = solvecraft_engine::render::SamplingBudget::new(131_072, 1_048_576);+ let mut budget = solidcraft_engine::render::SamplingBudget::new(131_072, 1_048_576);let scene =- solvecraft_engine::view::scene_with_section_and_sketch_sampler(&app.session, &proj.cam, section_plane(app), |sk, index, plane| {+ solidcraft_engine::view::scene_with_section_and_sketch_sampler(&app.session, &proj.cam, section_plane(app), |sk, index, plane| {crate::sketch_display::curve_with_budget(sk, index, plane, proj, app.viewport.pixels_per_point(), &mut budget).parts});let w = (rect.width() as usize).clamp(16, 4096);let hh = (rect.height() as usize).clamp(16, 4096);- let c = solvecraft_engine::render::render(&scene, &proj.cam, w, hh);+ let c = solidcraft_engine::render::render(&scene, &proj.cam, w, hh);let img = egui::ColorImage::from_rgba_unmultiplied([c.w, c.h], &c.rgba);let tex = ctx.load_texture("sc_cpu_viewport", img, egui::TextureOptions::LINEAR);app.viewport.cpu = Some((key, tex));@@ -2810,7 +2810,7 @@ fn nearest_quarter_turn(yaw: f64) -> f64 {pub fn look_at_selection(app: &mut SolveApp) {let target = app.session.selection.iter().find_map(|s| match s {Sel::Face { body, index, point } => crate::dialogs::planar_face(&app.session, body, *index).map(|(_, n)| (*point, n)),- Sel::Plane { name } => solvecraft_engine::geom::Plane::named(name).map(|p| (p.origin, p.normal())),+ Sel::Plane { name } => solidcraft_engine::geom::Plane::named(name).map(|p| (p.origin, p.normal())),_ => None,});match target {@@ -2963,7 +2963,7 @@ mod tests {}let mut h = crate::scenario::Harness::new();h.app.run("solid.box", json!({"length":40,"width":30,"height":20})).unwrap();- let cam = solvecraft_engine::view::home_camera(&h.app.session);+ let cam = solidcraft_engine::view::home_camera(&h.app.session);let whole = pixels(&mut h, cam);let before = h.app.session.doc.clone();let undo = h.app.session.undo.len();@@ -3031,7 +3031,7 @@ mod tests {#[test]fn timeline_modifier_highlight_follows_edits_and_rollback() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());app.run("solid.box", json!({"length":20,"width":20,"height":20})).unwrap();let id = app.run("solid.fillet", json!({"edges":[[0,0,10]],"radius":2})).unwrap()["feature"].as_u64().unwrap();// A later chamfer changes the same body without consuming the fillet.@@ -3052,7 +3052,7 @@ mod tests {#[test]fn timeline_modifier_highlight_follows_component_instances() {- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());app.run("component.create", json!({"name":"Part"})).unwrap();app.run("solid.box", json!({"length":20,"width":20,"height":20})).unwrap();let id = app.run("solid.fillet", json!({"edges":[[0,0,10]],"radius":2})).unwrap()["feature"].as_u64().unwrap();@@ -3082,7 +3082,7 @@ mod tests {}fn hover_app(gpu: bool) -> SolveApp {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("sketch.create", &json!({"plane": "XY"})).unwrap();s.execute("sketch.point", &json!({"point": [0, 0]})).unwrap();let mut app = SolveApp::new(s, crate::Services::default());@@ -3242,7 +3242,7 @@ mod tests {app.viewport.spin = false;hover_frame(&mut app, &ctx, vec![]);assert!(app.viewport.hover.is_some());- app.cam_anim = Some(solvecraft_engine::render::CameraAnim::new(app.cam, app.cam, 0.0));+ app.cam_anim = Some(solidcraft_engine::render::CameraAnim::new(app.cam, app.cam, 0.0));for _ in 0..3 {hover_frame(&mut app, &ctx, vec![]);assert!(app.viewport.hover.is_none());@@ -3253,7 +3253,7 @@ mod tests {}fn cylinder_app() -> SolveApp {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("solid.cylinder", &json!({"radius": 10, "height": 20})).unwrap();let mut app = SolveApp::new(s, crate::Services::default());app.ui.show_origin = false;@@ -3262,7 +3262,7 @@ mod tests {#[test]fn smooth_wall_display_preserves_wireframe_and_edge_selection() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();let sketch = s.execute("sketch.create", &json!({"plane":"XY"})).unwrap()["sketch"].as_u64().unwrap();s.execute("sketch.ellipse", &json!({"center":[0,0],"major":[25,0],"minor_radius":5})).unwrap();let inner =@@ -3299,22 +3299,22 @@ mod tests {let mut without_display_mask = (*mesh).clone();without_display_mask.smooth_edges.clear();assert_eq!(mesh.surface_patch(mesh.edge_faces[smooth][0] as usize), without_display_mask.surface_patch(mesh.edge_faces[smooth][0] as usize));- let cam = solvecraft_engine::view::home_camera(&app.session);- let cpu = solvecraft_engine::view::scene(&app.session, &cam);- let actual_edges = cpu.lines.iter().filter(|line| line.color == solvecraft_engine::view::colors::EDGE).count();+ let cam = solidcraft_engine::view::home_camera(&app.session);+ let cpu = solidcraft_engine::view::scene(&app.session, &cam);+ let actual_edges = cpu.lines.iter().filter(|line| line.color == solidcraft_engine::view::colors::EDGE).count();assert_eq!(actual_edges, mesh.edges.iter().enumerate().filter(|(i, _)| mesh.shaded_edge_visible(*i)).count());- if let Ok(directory) = std::env::var("SOLVECRAFT_SMOOTH_SCREENSHOTS") {+ if let Ok(directory) = solidcraft_engine::geom::env::var("SMOOTH_SCREENSHOTS").ok_or(()) {std::fs::create_dir_all(&directory).unwrap();for (name, old_edges, wireframe) in [("after", false, false), ("before", true, false), ("wireframe", true, true)] {- let mut scene = solvecraft_engine::view::scene(&app.session, &cam);- scene.lines.retain(|line| line.color == solvecraft_engine::view::colors::EDGE);+ let mut scene = solidcraft_engine::view::scene(&app.session, &cam);+ scene.lines.retain(|line| line.color == solidcraft_engine::view::colors::EDGE);if old_edges {scene.lines.clear();for (i, edge) in mesh.edges.iter().enumerate() {if mesh.edge_pickable(i) {- scene.lines.push(solvecraft_engine::render::SceneLine {+ scene.lines.push(solidcraft_engine::render::SceneLine {points: edge.clone(),- color: solvecraft_engine::view::colors::EDGE,+ color: solidcraft_engine::view::colors::EDGE,width: 1.2,on_top: false,});@@ -3324,7 +3324,7 @@ mod tests {if wireframe {scene.meshes.clear();}- let png = solvecraft_engine::render::render_png(&scene, &cam, 1200, 800).unwrap();+ let png = solidcraft_engine::render::render_png(&scene, &cam, 1200, 800).unwrap();std::fs::write(std::path::Path::new(&directory).join(format!("smooth-ring-{name}.png")), png).unwrap();}}@@ -3332,7 +3332,7 @@ mod tests {#[test]fn certified_small_crease_overrides_old_seam_fit_for_picking_and_patches() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();let sketch = s.execute("sketch.create", &json!({"plane":"XY"})).unwrap()["sketch"].as_u64().unwrap();let step = std::f64::consts::TAU / 8.;let k = 4. / 3. * (step / 4.).tan() * 10.;@@ -3683,7 +3683,7 @@ mod tests {#[test]fn trackpad_gestures_over_dialogs_do_not_move_the_view() {let ctx = egui::Context::default();- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());assert!(app.preferences.trackpad_pan);app.viewport.no_pixels = true;crate::help::run(&mut app, &ctx, "shortcuts");@@ -3741,7 +3741,7 @@ mod tests {fn shortcuts_window_wheel_does_not_zoom_the_viewport() {for smooth in [true, false] {let ctx = egui::Context::default();- let mut app = SolveApp::new(solvecraft_engine::Session::default(), crate::Services::default());+ let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default());app.preferences.smooth_wheel_zoom = smooth;app.preferences.trackpad_pan = false;app.viewport.no_pixels = true;@@ -3883,12 +3883,12 @@ mod tests {#[test]fn section_outlines_follow_the_cut() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();let st = s.model.state();let m = st.bodies[0].mesh();let (o, n) = (Vec3::new(0.0, 15.0, 0.0), Vec3::new(0.0, -1.0, 0.0));- let segs = solvecraft_engine::view::section_segments(&m, o, n);+ let segs = solidcraft_engine::view::section_segments(&m, o, n);assert!(segs.len() >= 4, "{segs:?}");// On the plane (a hair to the kept side) and around the 40 x 20 cut.let mut len = 0.0;@@ -3898,12 +3898,12 @@ mod tests {}assert!((len - 120.0).abs() < 0.5, "outline length {len}");// A plane that misses the body cuts nothing.- assert!(solvecraft_engine::view::section_segments(&m, Vec3::new(0.0, 99.0, 0.0), n).is_empty());+ assert!(solidcraft_engine::view::section_segments(&m, Vec3::new(0.0, 99.0, 0.0), n).is_empty());}#[test]fn selection_shows_where_the_model_hides_it() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();let mut app = SolveApp::new(s, crate::Services::default());assert!(build_highlight(&app).hidden.is_empty());@@ -3963,7 +3963,7 @@ mod tests {#[test]fn axis_snap_selects_all_directions_in_both_up_frames() {assert_eq!(snap_directions().count(), 26);- for up in [solvecraft_engine::render::UpAxis::Z, solvecraft_engine::render::UpAxis::Y] {+ for up in [solidcraft_engine::render::UpAxis::Z, solidcraft_engine::render::UpAxis::Y] {for d in snap_directions() {let mut cam = Camera { up, ..Camera::default() };cam = cam.looking_from(cam.from_frame(d + Vec3::new(0.05, 0.03, 0.02)));@@ -3986,7 +3986,7 @@ mod tests {assert!(h.app.viewport.orbit_snap.is_some());match reset {0 => h.app.fit_view(),- 1 => h.app.set_up_axis(solvecraft_engine::render::UpAxis::Y),+ 1 => h.app.set_up_axis(solidcraft_engine::render::UpAxis::Y),_ => crate::documents::new_design(&mut h.app),}let before = h.app.cam;@@ -4092,7 +4092,7 @@ mod tests {#[test]fn construction_axes_span_the_model_and_points_show() {- let mut s = solvecraft_engine::Session::default();+ let mut s = solidcraft_engine::Session::default();s.execute("solid.box", &json!({"length": 40, "width": 30, "height": 20})).unwrap();s.execute("construct.axis.two_points", &json!({"a": {"vertex": [0, 0, 20]}, "b": {"vertex": [40, 30, 20]}})).unwrap();s.execute("construct.point.vertex", &json!({"point": {"vertex": [40, 0, 20]}})).unwrap();diff --git a/crates/ui-egui/src/viewport_appearance_tests.rs b/crates/ui-egui/src/viewport_appearance_tests.rsindex 1cfacedc66..7f65f589b3 100644--- a/crates/ui-egui/src/viewport_appearance_tests.rs+++ b/crates/ui-egui/src/viewport_appearance_tests.rs@@ -1,7 +1,7 @@use super::build_scene;use crate::{Services, SolveApp};use serde_json::json;-use solvecraft_engine::{Session, doc, geom::Vec3, kernel};+use solidcraft_engine::{Session, doc, geom::Vec3, kernel};#[test]fn placed_step_body_uses_imported_opacity_until_a_design_look_overrides_it() {@@ -24,7 +24,7 @@ fn placed_step_body_uses_imported_opacity_until_a_design_look_overrides_it() {app.ui.ground_shadow = false;app.ui.show_origin = false;let placed = app.session.world_state().bodies.iter().find(|b| b.name != source).unwrap().name.clone();- app.session.selection = vec![solvecraft_engine::Sel::Body { name: placed }];+ app.session.selection = vec![solidcraft_engine::Sel::Body { name: placed }];app.start("appearance.assign");let crate::dialogs::Kind::Appearance(appearance) = &app.dialog.as_ref().unwrap().kind else { panic!("appearance dialog") };assert!((appearance.opacity - 0.4).abs() < 1e-6);diff --git a/crates/ui-egui/src/viewport_layout.rs b/crates/ui-egui/src/viewport_layout.rsindex 973ad1e0ec..cf2c8393a8 100644--- a/crates/ui-egui/src/viewport_layout.rs+++ b/crates/ui-egui/src/viewport_layout.rs@@ -1,7 +1,7 @@//! Floating controls reserve drawing space without changing rendering or picking projection.use egui::{Rect, pos2, vec2};-use solvecraft_engine::geom::{Aabb3, Vec3};-use solvecraft_engine::render::Camera;+use solidcraft_engine::geom::{Aabb3, Vec3};+use solidcraft_engine::render::Camera;#[derive(Clone, Debug)]pub(crate) struct Layout {diff --git a/crates/ui-egui/src/viewport_layout_tests.rs b/crates/ui-egui/src/viewport_layout_tests.rsindex 2b0457656a..0e68c0021c 100644--- a/crates/ui-egui/src/viewport_layout_tests.rs+++ b/crates/ui-egui/src/viewport_layout_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::scenario::Harness;use serde_json::json;-use solvecraft_engine::render::StandardView;+use solidcraft_engine::render::StandardView;#[test]fn thin_rotated_bounds_fit_using_the_original_full_projection() {diff --git a/crates/ui-egui/src/workspace.rs b/crates/ui-egui/src/workspace.rsindex 6040d84edc..5fcdea5696 100644--- a/crates/ui-egui/src/workspace.rs+++ b/crates/ui-egui/src/workspace.rs@@ -4,8 +4,8 @@//! or Joint appear on several tabs. Commands registered on such a panel but not listed follow at//! the end.-use solvecraft_engine::CommandSpec;-use solvecraft_engine::doc::FeatureKind;+use solidcraft_engine::CommandSpec;+use solidcraft_engine::doc::FeatureKind;const ASSEMBLE: &[&str] = &["component.create",@@ -143,7 +143,7 @@ mod tests {use super::*;fn ids(tab: &str, panel: &str) -> Vec<&'static str> {- let specs = solvecraft_engine::command_specs();+ let specs = solidcraft_engine::command_specs();layout(tab, panel, &specs).map(|(v, _)| v.iter().map(|c| c.id).collect()).unwrap_or_default()}diff --git a/crates/ui-egui/tests/coincident_lines.rs b/crates/ui-egui/tests/coincident_lines.rsindex 87bb72dc3d..4d4e430ac5 100644--- a/crates/ui-egui/tests/coincident_lines.rs+++ b/crates/ui-egui/tests/coincident_lines.rs@@ -1,8 +1,8 @@//! Coincident accepts clicked line bodies as well as explicit sketch points.use serde_json::json;-use solvecraft_engine::sketch::ConstraintKind;-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::sketch::ConstraintKind;+use solidcraft_ui_egui::scenario::Harness;fn setup() -> Harness {let mut h = Harness::new();diff --git a/crates/ui-egui/tests/constraint_preselection.rs b/crates/ui-egui/tests/constraint_preselection.rsindex 891240e530..e7cb82368b 100644--- a/crates/ui-egui/tests/constraint_preselection.rs+++ b/crates/ui-egui/tests/constraint_preselection.rs@@ -1,8 +1,8 @@//! Constraint tools accept a selected curve pair as well as tool-first clicks.use serde_json::json;-use solvecraft_engine::{Sel, sketch::ConstraintKind};-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::{Sel, sketch::ConstraintKind};+use solidcraft_ui_egui::scenario::Harness;fn lines() -> Harness {let mut h = Harness::new();@@ -170,7 +170,7 @@ fn curvature_polygon_and_fix_consume_clicked_operands_atomically() {};h.call("ui.view", json!({"view":"top"}));h.app.cam.distance = 80.0;- h.app.cam.target = solvecraft_engine::geom::Vec3::new(30.0, 15.0, 0.0);+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(30.0, 15.0, 0.0);h.settle();for (i, p) in picks.iter().enumerate() {h.step(&json!({"click":{"sketch":p},"shift":i>0})).unwrap();diff --git a/crates/ui-egui/tests/mesh_conversion.rs b/crates/ui-egui/tests/mesh_conversion.rsindex 5ca95ff9ad..60afa90f0a 100644--- a/crates/ui-egui/tests/mesh_conversion.rs+++ b/crates/ui-egui/tests/mesh_conversion.rs@@ -1,12 +1,12 @@use serde_json::json;-use solvecraft_engine::doc::{Document, FeatureKind, MeshData};-use solvecraft_engine::geom::Vec3;-use solvecraft_engine::{Sel, Session};-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::doc::{Document, FeatureKind, MeshData};+use solidcraft_engine::geom::Vec3;+use solidcraft_engine::{Sel, Session};+use solidcraft_ui_egui::scenario::Harness;#[test]fn convert_mesh_uses_preselection_and_reopens_its_timeline_dialog() {- let body = solvecraft_engine::kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();+ let body = solidcraft_engine::kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();let mesh = body.tessellate(0.01).unwrap();let mut doc = Document::default();doc.add_feature(@@ -36,7 +36,7 @@ fn convert_mesh_uses_preselection_and_reopens_its_timeline_dialog() {assert_eq!(response["ok"], true, "{response}");let dialog = h.app.dialog.as_ref().unwrap();assert!(- matches!(&dialog.kind,solvecraft_ui_egui::dialogs::Kind::Surface(solvecraft_ui_egui::dialogs_surface::Surf::ConvertMesh { tolerance }) if tolerance=="0.05 mm")+ matches!(&dialog.kind,solidcraft_ui_egui::dialogs::Kind::Surface(solidcraft_ui_egui::dialogs_surface::Surf::ConvertMesh { tolerance }) if tolerance=="0.05 mm"));assert!(h.app.session.model.state().body("Mesh").unwrap().body.is_mesh());h.step(&json!({"key":"Escape"})).unwrap();diff --git a/crates/ui-egui/tests/parameter_enter.rs b/crates/ui-egui/tests/parameter_enter.rsindex 977f7ed4ba..39dbf8de1f 100644--- a/crates/ui-egui/tests/parameter_enter.rs+++ b/crates/ui-egui/tests/parameter_enter.rs@@ -1,7 +1,7 @@//! Enter submits only the focused Parameters editor row.use egui::{Event, Key, Modifiers};use serde_json::json;-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_ui_egui::scenario::Harness;fn open() -> Harness {let mut h = Harness::new();diff --git a/crates/ui-egui/tests/point_alignment.rs b/crates/ui-egui/tests/point_alignment.rsindex 034dcc594f..a3fc4b151f 100644--- a/crates/ui-egui/tests/point_alignment.rs+++ b/crates/ui-egui/tests/point_alignment.rs@@ -1,8 +1,8 @@//! Horizontal/Vertical accepts either one line or two distinct sketch points.use serde_json::json;-use solvecraft_engine::sketch::ConstraintKind;-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::sketch::ConstraintKind;+use solidcraft_ui_egui::scenario::Harness;#[test]fn horizontal_vertical_uses_preselected_line_and_preserves_rejection() {@@ -42,7 +42,7 @@ fn horizontal_vertical_uses_preselected_line_and_preserves_rejection() {#[test]fn horizontal_vertical_leaves_ambiguous_preselection_to_pick_tool() {- use solvecraft_engine::Sel;+ use solidcraft_engine::Sel;for selection in [vec![Sel::SketchPoint { id: "origin".into() }],vec![Sel::SketchPoint { id: "origin".into() }, Sel::SketchCurve { id: "c1".into() }],diff --git a/crates/ui-egui/tests/point_constraint_preselection.rs b/crates/ui-egui/tests/point_constraint_preselection.rsindex b2b4ed8d47..2d431cd2d0 100644--- a/crates/ui-egui/tests/point_constraint_preselection.rs+++ b/crates/ui-egui/tests/point_constraint_preselection.rs@@ -1,6 +1,6 @@use serde_json::json;-use solvecraft_engine::{Sel, sketch::ConstraintKind};-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::{Sel, sketch::ConstraintKind};+use solidcraft_ui_egui::scenario::Harness;fn setup() -> Harness {let mut h = Harness::new();diff --git a/crates/ui-egui/tests/projection_preselection.rs b/crates/ui-egui/tests/projection_preselection.rsindex 714c6d054f..d4e7066ec0 100644--- a/crates/ui-egui/tests/projection_preselection.rs+++ b/crates/ui-egui/tests/projection_preselection.rs@@ -1,6 +1,6 @@use serde_json::json;-use solvecraft_engine::Sel;-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_engine::Sel;+use solidcraft_ui_egui::scenario::Harness;fn setup() -> (Harness, u64) {let mut h = Harness::new();diff --git a/crates/ui-egui/tests/scenarios.rs b/crates/ui-egui/tests/scenarios.rsindex 66c0e273b3..c6b79c4ff5 100644--- a/crates/ui-egui/tests/scenarios.rs+++ b/crates/ui-egui/tests/scenarios.rs@@ -1,10 +1,10 @@-//! User scenarios in the real UI, headless (see `solvecraft_ui_egui::scenario`). Each JSON file+//! User scenarios in the real UI, headless (see `solidcraft_ui_egui::scenario`). Each JSON file//! under `tests/scenarios/` is one workflow done with clicks, keys and drags, and one test here://! `build.rs` makes a test per file, named after it. A scenario waiting for a fix starts with a//! `{"pending": "why"}` step (its test is ignored with that reason). Adding a scenario is adding//! its file.-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_ui_egui::scenario::Harness;fn run(name: &str) {let path = format!("{}/tests/scenarios/{name}.json", env!("CARGO_MANIFEST_DIR"));@@ -18,12 +18,12 @@ fn run(name: &str) {include!(concat!(env!("OUT_DIR"), "/scenario_tests.rs"));-/// A scenario file named by `SOLVECRAFT_SCENARIO_FILE` (for trying one out):-/// `SOLVECRAFT_SCENARIO_FILE=x.json cargo test --test scenarios adhoc -- --ignored --nocapture`.+/// A scenario file named by `SOLIDCRAFT_SCENARIO_FILE` (for trying one out):+/// `SOLIDCRAFT_SCENARIO_FILE=x.json cargo test --test scenarios adhoc -- --ignored --nocapture`.#[test]#[ignore]fn adhoc() {- let Ok(path) = std::env::var("SOLVECRAFT_SCENARIO_FILE") else { return };+ let Ok(path) = solidcraft_engine::geom::env::var("SCENARIO_FILE").ok_or(()) else { return };let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{path}: {e}"));let steps: serde_json::Value = serde_json::from_str(&text).unwrap_or_else(|e| panic!("{path}: {e}"));let mut h = Harness::new();@@ -62,7 +62,7 @@ fn angle_dimension_both_interactive_workflows() {])).unwrap();let sk = &h.app.session.model.state().sketches[0].sketch;- assert!(sk.constraints.iter().any(|c| matches!(c.kind, solvecraft_engine::sketch::ConstraintKind::Angle { .. })));+ assert!(sk.constraints.iter().any(|c| matches!(c.kind, solidcraft_engine::sketch::ConstraintKind::Angle { .. })));}}@@ -70,7 +70,7 @@ fn angle_dimension_both_interactive_workflows() {fn home_tab_and_file_recent_open_designs() {use serde_json::json;let mut h = Harness::new();- let path = h.dir.join("recent.solvecraft").to_string_lossy().into_owned();+ let path = h.dir.join("recent.solidcraft").to_string_lossy().into_owned();h.run(&json!([{"call":"engine.execute","params":{"command":"solid.box","params":{"length":10,"width":10,"height":10}}},{"call":"engine.execute","params":{"command":"file.save_as","params":{"path":path}}},diff --git a/crates/ui-egui/tests/scenarios/acceptance_sensor_enclosure.json b/crates/ui-egui/tests/scenarios/acceptance_sensor_enclosure.jsonindex c55927871d..d2b3cb363f 100644--- a/crates/ui-egui/tests/scenarios/acceptance_sensor_enclosure.json+++ b/crates/ui-egui/tests/scenarios/acceptance_sensor_enclosure.json@@ -156,7 +156,7 @@"params": {"command": "file.save_as","params": {- "path": "$DIR/enclosure.solvecraft"+ "path": "$DIR/enclosure.solidcraft"}}},@@ -165,7 +165,7 @@"params": {"command": "doc.open","params": {- "path": "$DIR/enclosure.solvecraft"+ "path": "$DIR/enclosure.solidcraft"}}},diff --git a/crates/ui-egui/tests/scenarios/s15_start_page_sample_save_reopen.json b/crates/ui-egui/tests/scenarios/s15_start_page_sample_save_reopen.jsonindex b9b0afdc53..72746ed985 100644--- a/crates/ui-egui/tests/scenarios/s15_start_page_sample_save_reopen.json+++ b/crates/ui-egui/tests/scenarios/s15_start_page_sample_save_reopen.json@@ -13,10 +13,10 @@{"widget": "Close window"},{"expect": {"param": {"width": 100}, "errors": 0}},{"key": "S", "cmd": true},- {"expect": {"file": "Sample Plate.solvecraft"}},+ {"expect": {"file": "Sample Plate.solidcraft"}},{"key": "N", "cmd": true},{"expect": {"bodies": 0}},- {"choose_file": "Sample Plate.solvecraft"},+ {"choose_file": "Sample Plate.solidcraft"},{"key": "O", "cmd": true},{"until": {"file_busy": false}},{"debug": 1},diff --git a/crates/ui-egui/tests/scenarios/s22_sheet_metal_fold.json b/crates/ui-egui/tests/scenarios/s22_sheet_metal_fold.jsonindex cf87dadae0..0bbcd4f864 100644--- a/crates/ui-egui/tests/scenarios/s22_sheet_metal_fold.json+++ b/crates/ui-egui/tests/scenarios/s22_sheet_metal_fold.json@@ -1,6 +1,6 @@[{- "note": "Target: sheet metal plate folded along a sketch line (sheet.fold, solvecraft-params; dialog by solvecraft-dialogs). Adjust the dialog steps when it lands."+ "note": "Target: sheet metal plate folded along a sketch line (sheet.fold, solidcraft-params; dialog by solidcraft-dialogs). Adjust the dialog steps when it lands."},{"call": "ui.set",diff --git a/crates/ui-egui/tests/scenarios/s31_sketch_on_face_projects.json b/crates/ui-egui/tests/scenarios/s31_sketch_on_face_projects.jsonindex 259dd0fca9..4dccefb436 100644--- a/crates/ui-egui/tests/scenarios/s31_sketch_on_face_projects.json+++ b/crates/ui-egui/tests/scenarios/s31_sketch_on_face_projects.json@@ -1,6 +1,6 @@[{- "note": "User bug 1 (owner solvecraft-sketch): Create Sketch on a body face projects the face's loops as reference geometry (linked), with no big square of real lines, and the face stays pickable for Project."+ "note": "User bug 1 (owner solidcraft-sketch): Create Sketch on a body face projects the face's loops as reference geometry (linked), with no big square of real lines, and the face stays pickable for Project."},{"start": "sketch.create"diff --git a/crates/ui-egui/tests/scenarios/s32_cut_in_active_component.json b/crates/ui-egui/tests/scenarios/s32_cut_in_active_component.jsonindex ef40d373a3..a02cef5c89 100644--- a/crates/ui-egui/tests/scenarios/s32_cut_in_active_component.json+++ b/crates/ui-egui/tests/scenarios/s32_cut_in_active_component.json@@ -1,6 +1,6 @@[{- "note": "User bug 2 (owner solvecraft-params): with two components, a cut made in the active one leaves the other untouched."+ "note": "User bug 2 (owner solidcraft-params): with two components, a cut made in the active one leaves the other untouched."},{"start": "component.create"diff --git a/crates/ui-egui/tests/scenarios/s33_move_x_arrow.json b/crates/ui-egui/tests/scenarios/s33_move_x_arrow.jsonindex d3cf6e6a48..ac692c00c8 100644--- a/crates/ui-egui/tests/scenarios/s33_move_x_arrow.json+++ b/crates/ui-egui/tests/scenarios/s33_move_x_arrow.json@@ -1,5 +1,5 @@[- {"note": "User bug 3 (owner solvecraft-ui): Move opens at 0, and dragging its X arrow moves only along X. The X arrow must be published as handle move_x (scenario::publish_handle)."},+ {"note": "User bug 3 (owner solidcraft-ui): Move opens at 0, and dragging its X arrow moves only along X. The X arrow must be published as handle move_x (scenario::publish_handle)."},{"start": "sketch.create"},{"click": {"plane": "XY"}},{"start": "sketch.rectangle.two_point"},diff --git a/crates/ui-egui/tests/scenarios/s34_component_move_carries_sketches.json b/crates/ui-egui/tests/scenarios/s34_component_move_carries_sketches.jsonindex 6f1feac69e..7d48038de6 100644--- a/crates/ui-egui/tests/scenarios/s34_component_move_carries_sketches.json+++ b/crates/ui-egui/tests/scenarios/s34_component_move_carries_sketches.json@@ -1,6 +1,6 @@[{- "note": "User bug 4 (owner solvecraft-repo): moving a component carries its sketches, and a sketch on a body face follows the body."+ "note": "User bug 4 (owner solidcraft-repo): moving a component carries its sketches, and a sketch on a body face follows the body."},{"start": "component.create"diff --git a/crates/ui-egui/tests/ui_layout.rs b/crates/ui-egui/tests/ui_layout.rsindex 4501e706cb..eafb13de23 100644--- a/crates/ui-egui/tests/ui_layout.rs+++ b/crates/ui-egui/tests/ui_layout.rs@@ -1,9 +1,9 @@-//! Layout checks over every toolbar command, headless (see `solvecraft_ui_egui::scenario`):+//! Layout checks over every toolbar command, headless (see `solidcraft_ui_egui::scenario`)://! each command's dialog opens docked at the viewport's right within its width limits, and//! every window it opens fits on screen.use serde_json::{Value, json};-use solvecraft_ui_egui::scenario::{Harness, check};+use solidcraft_ui_egui::scenario::{Harness, check};/// A box body (its sketch finished) to give feature dialogs something to work on.fn harness() -> Harness {@@ -21,11 +21,11 @@ fn harness() -> Harness {}#[test]-#[ignore = "pending: the exploded view dialog opens 635 px wide (solvecraft-ui)"]+#[ignore = "pending: the exploded view dialog opens 635 px wide (solidcraft-ui)"]fn every_dialog_opens_docked_within_its_width_limits() {let mut bad = Vec::new();let mut seen = 0;- for spec in solvecraft_engine::command_specs() {+ for spec in solidcraft_engine::command_specs() {if spec.tab.is_empty() || spec.tab == "SKETCH" {continue;}diff --git a/crates/ui-egui/tests/window_widths.rs b/crates/ui-egui/tests/window_widths.rsindex 0174cc1dbc..1027ae7076 100644--- a/crates/ui-egui/tests/window_widths.rs+++ b/crates/ui-egui/tests/window_widths.rs@@ -2,8 +2,8 @@//! through the control channel (the toolbar's way) and measured as drawn.use serde_json::json;-use solvecraft_ui_egui::frame::{DIALOG_MAX_W, DIALOG_MIN_W, DIALOG_WIDE_MAX_W, WINDOW_WIDE_MAX_W};-use solvecraft_ui_egui::scenario::Harness;+use solidcraft_ui_egui::frame::{DIALOG_MAX_W, DIALOG_MIN_W, DIALOG_WIDE_MAX_W, WINDOW_WIDE_MAX_W};+use solidcraft_ui_egui::scenario::Harness;/// Widths of the windows on screen (their areas in the middle layer).fn window_widths(h: &Harness) -> Vec<(String, f32)> {@@ -30,7 +30,7 @@ fn command_dialogs_shrink_to_their_content_within_limits() {let mut bad = Vec::new();// The frame border and shadow add a little to the content limits.let slack = 4.0;- for spec in solvecraft_engine::command_specs() {+ for spec in solidcraft_engine::command_specs() {h.call("ui.start", json!({"command": spec.id}));h.frames(4);let wide = h.app.dialog.as_ref().is_some_and(|d| d.is_wide());@@ -82,7 +82,7 @@ fn floating_windows_stay_within_limits() {h.app.keymap.open = true;h.app.help.about = true;h.app.ui.palette_open = true;- solvecraft_ui_egui::params_dialog::open(&mut h.app);+ solidcraft_ui_egui::params_dialog::open(&mut h.app);h.frames(6);let ws = window_widths(&h);// Keyboard Shortcuts is a page of Preferences (one window, #36).diff --git a/docs/book/src/dev/architecture.md b/docs/book/src/dev/architecture.mdindex eef50f7191..026a01cf4f 100644--- a/docs/book/src/dev/architecture.md+++ b/docs/book/src/dev/architecture.md@@ -5,7 +5,7 @@ SolidCraft is a Cargo workspace in layers. A crate only depends on crates in low{{#include ../../../../README.md:architecture}}-The web app, `apps/solvecraft-web`, is the desktop front end compiled to wasm with+The web app, `apps/solidcraft-web`, is the desktop front end compiled to wasm with[trunk](https://trunkrs.dev). `xtask` holds the repository's own tooling: `cargo xtask ci`,`layers`, `assets`, `features`, `oracle` and `book`.diff --git a/docs/book/src/dev/commands.md b/docs/book/src/dev/commands.mdindex 16a5202b23..d7b0d3deeb 100644--- a/docs/book/src/dev/commands.md+++ b/docs/book/src/dev/commands.md@@ -16,7 +16,7 @@ CommandSpec::new("solid.fillet", "Fillet", fillet)`run` is `fn(&mut Session, &Value) -> Result<Value>`, and `enabled` is`fn(&Session) -> Result<(), String>`; the error string is the disabled-button tooltip. The-`params` string is the one-line documentation shown by `solvecraft-cli commands`, MCP's+`params` string is the one-line documentation shown by `solidcraft-cli commands`, MCP's`list_commands` and the [command reference](../reference/commands.md).A command that changes the design is undoable by default: the session snapshots the documentdiff --git a/docs/book/src/dev/kernel.md b/docs/book/src/dev/kernel.mdindex 8f54376ace..74d5691325 100644--- a/docs/book/src/dev/kernel.md+++ b/docs/book/src/dev/kernel.md@@ -9,7 +9,7 @@ SolidCraft types (`Body`, face and edge indices, meshes, measures) and a## `guard`truck can panic on geometry it doesn't handle. Every call into it goes through-`solvecraft_kernel::guard`, which catches the panic and turns it into+`solidcraft_kernel::guard`, which catches the panic and turns it into`KernelError::Internal`, leaving the model unchanged:```rustdiff --git a/docs/book/src/dev/naming.md b/docs/book/src/dev/naming.mdindex 1218361a33..660684c48f 100644--- a/docs/book/src/dev/naming.md+++ b/docs/book/src/dev/naming.md@@ -2,7 +2,7 @@A fillet stores the edges it rounds, a sketch the face it sits on, a shell the faces it opens.If those were face and edge *indices*, an upstream edit that adds a face would move the fillet-to another edge. SolveCraft stores **names**, and finds them again every time the timeline+to another edge. SolidCraft stores **names**, and finds them again every time the timelineevaluates.## Why names follow the kernel's historydiff --git a/docs/book/src/dev/testing.md b/docs/book/src/dev/testing.mdindex e8fba22cf2..b134bc53e8 100644--- a/docs/book/src/dev/testing.md+++ b/docs/book/src/dev/testing.md@@ -11,8 +11,8 @@ profile and the wasm build check.| Sketch fuzz | `crates/engine/src/cmd/sketch_fuzz_tests.rs` | random sketches through the solver and profile finder || UI scenarios | `crates/ui-egui/tests/scenarios/*.json` | the real app, headless: clicks, keys, drags, assertions || Layout tests | `crates/ui-egui/tests/ui_layout.rs`, `window_widths.rs` | panels and dialogs at every window width |-| Design-file corpus | `apps/solvecraft-cli/tests/corpus` | every saved file version still opens and evaluates the same |-| Kill mid-save | `apps/solvecraft-cli/tests/kill_mid_save.rs` | a save killed at any moment leaves a readable file |+| Design-file corpus | `apps/solidcraft-cli/tests/corpus` | every saved file version still opens and evaluates the same |+| Kill mid-save | `apps/solidcraft-cli/tests/kill_mid_save.rs` | a save killed at any moment leaves a readable file || Reference tests | `cargo xtask oracle` → [docs/oracle.md](oracle.md) | parts rebuilt from `tests/oracle/*/recipe.json`, compared with analytic or FreeCAD expected values |## UI scenarios@@ -54,12 +54,12 @@ On GitHub, one job builds the tests into aPull requests skip a few heavy tests (each takes one to four minutes); they run on every push to`main`, nightly, and in `cargo xtask test`:-- `solvecraft-engine`: `tests::hostile_params_never_panic`, everything in `tests::robustness`,+- `solidcraft-engine`: `tests::hostile_params_never_panic`, everything in `tests::robustness`,`pattern_suppress_tests::enclosure_arc_extinction_keeps_a_real_sharp_inner_lip_after_resize_and_reopen`,`pattern_suppress_tests::enclosure_datums_follow_wall_height_and_board_depth_with_material_proofs`,`cmd::plastic::tests::enclosure_snap_fit_follows_resized_front_wall`-- `solvecraft-kernel`: `tests::boolean_identity_on_tangent_primitives`-- `solvecraft-ui-egui` scenarios: `acceptance_sensor_enclosure`+- `solidcraft-kernel`: `tests::boolean_identity_on_tangent_primitives`+- `solidcraft-ui-egui` scenarios: `acceptance_sensor_enclosure`To run exactly what a pull request runs: `cargo nextest run --cargo-profile ci --profile ci`;add `--ignore-default-filter` for the full set. A new test that takes over a minute on CI candiff --git a/docs/book/src/guide/files.md b/docs/book/src/guide/files.mdindex de42425d53..56923e508f 100644--- a/docs/book/src/guide/files.md+++ b/docs/book/src/guide/files.md@@ -2,7 +2,7 @@| Format | Read | Write ||---|---|---|-| `.solvecraft` (JSON design, versioned) | yes | yes |+| `.solidcraft` (JSON design, versioned) | yes | yes || STEP (AP203, AP214, AP242) | solids, assemblies, units, names, colours | AP242 with names, colours and the component tree || IGES 5.3 | manifold solids, or trimmed surfaces sewn into solids | manifold solids with names and colours || 3MF, STL, OBJ | mesh bodies | yes |@@ -53,7 +53,7 @@ another device.1. Open the File menu and choose **Open** to show **Files in this browser**.2. Choose **Download open design** for the current design, including its unsaved changes,or **Download** beside a stored file for its last saved contents.-3. Find the `.solvecraft` file in your browser's downloads. Whether a folder chooser appears+3. Find the `.solidcraft` file in your browser's downloads. Whether a folder chooser appearsdepends on your browser's download settings.Use **Open from computer…** in the same panel to reopen a downloaded design. The web appdiff --git a/docs/book/src/guide/getting-started.md b/docs/book/src/guide/getting-started.mdindex a6fd738609..d94b5586be 100644--- a/docs/book/src/guide/getting-started.md+++ b/docs/book/src/guide/getting-started.md@@ -1,8 +1,8 @@# Getting started-SolidCraft keeps its compatibility names: the desktop executable is `solvecraft`, the CLI-is `solvecraft-cli`, and saved designs remain `.solvecraft`. Published 0.2.0 and 0.2.1 packages-were released under the SolveCraft name.+The desktop executable is `solidcraft`, the CLI is `solidcraft-cli`, and designs are saved as+`.solidcraft`. Designs, settings and setups from builds released under the previous product name keep+working (see the [compatibility notes](https://github.com/bherbruck/solidcraft/blob/main/docs/compatibility.md)).## Desktop@@ -15,20 +15,16 @@ git clone https://github.com/bherbruck/solidcraft && cd solidcraftcargo run --release -p solidcraft -- --sample # opens with a sample part```-`solvecraft part.step` opens a STEP, IGES, 3MF, STL or OBJ file as a new design, and-`solvecraft design.solvecraft` opens a saved design. Windows builds cross-compile from Linux with+`solidcraft part.step` opens a STEP, IGES, 3MF, STL or OBJ file as a new design, and+`solidcraft design.solidcraft` opens a saved design. Windows builds cross-compile from Linux with`cargo xwin build --release --target x86_64-pc-windows-msvc -p solidcraft`.### macOSOpen the release `.dmg` and drag `SolidCraft.app` onto Applications.-When updating from an older `SolveCraft.app`, quit the app and rename the existing-app in Applications to `SolidCraft.app` first. Then drag the new app onto Applications-and choose **Replace**. If you already have both names installed, move the old-`SolveCraft.app` to the Trash. The DMG does not remove old installations automatically.-Remove any Dock shortcut with the old name, open the new app from Applications, and-choose **Options > Keep in Dock**. Designs, settings and the bundle ID are unchanged.+When updating from a build released under the previous product name, follow the+[macOS upgrade notes](https://github.com/bherbruck/solidcraft/blob/main/docs/compatibility.md#macos) so you replace it rather than install a second copy.### Linux Flatpak@@ -38,21 +34,20 @@ to the same user installation:```shflatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo-flatpak remote-add --user --if-not-exists solvecraft https://bherbruck.github.io/solidcraft/flatpak/solvecraft.flatpakrepo-flatpak install --user solvecraft ai.storyteller.solvecraft+flatpak remote-add --user --if-not-exists solidcraft https://bherbruck.github.io/solidcraft/flatpak/solidcraft.flatpakrepo+flatpak install --user solidcraft ai.storyteller.solvecraftflatpak run ai.storyteller.solvecraft```-The application ID and remote name retain their compatibility names. To update an existing-remote that still uses the former website address, run-`flatpak remote-modify --user --url=https://bherbruck.github.io/solidcraft/flatpak/repo/ solvecraft`-and then `flatpak update --user`.+The application ID is unchanged, so existing installations keep+receiving updates under whatever remote name they were added with (see the+[compatibility notes](https://github.com/bherbruck/solidcraft/blob/main/docs/compatibility.md#package-ids)).Alternatively, download the release's `.flatpak` file for your architecture and run-`flatpak install --user ./solvecraft-VERSION-linux-ARCH.flatpak`. The bundle supplies the+`flatpak install --user ./solidcraft-VERSION-linux-ARCH.flatpak`. The bundle supplies theFlathub runtime repository address; installation still needs internet access to fetch anymissing runtime. Launch with `flatpak run ai.storyteller.solvecraft`, rather than looking for-a host `solvecraft` binary. Files chosen through Open/Save use the desktop file-chooser portal;+a host `solidcraft` binary. Files chosen through Open/Save use the desktop file-chooser portal;command-line paths outside Documents may need a specific additional filesystem permission.## Web@@ -63,12 +58,12 @@ file storage, which needs HTTPS or localhost. To build it yourself:```shrustup target add wasm32-unknown-unknown-cd apps/solvecraft-web && trunk serve --release+cd apps/solidcraft-web && trunk serve --release```## CLI-`solvecraft-cli` runs the same commands without a window:+`solidcraft-cli` runs the same commands without a window:```shcargo run --release -p solidcraft-cli -- commands # every command, as JSON@@ -90,7 +85,7 @@ A script is a list of commands:]}```-+Units are millimetres and degrees unless an expression says otherwise (`"1 in"`, `"30 deg"`),and Z is up.diff --git a/docs/book/src/introduction.md b/docs/book/src/introduction.mdindex 595c031ab2..bb4ed4e8f3 100644--- a/docs/book/src/introduction.md+++ b/docs/book/src/introduction.md@@ -11,7 +11,7 @@ It runs as:- a **desktop app** for Windows and Linux (egui + wgpu);- a **web app** in the browser (wasm, WebGPU or WebGL2), [try it here](app/);-- a **headless CLI**, `solvecraft-cli`, that runs command scripts, measures and exports;+- a **headless CLI**, `solidcraft-cli`, that runs command scripts, measures and exports;- an **MCP server** that AI agents model with, headless or driving the running app.Everything the user can do is a *command* with JSON parameters. The toolbar, the dialogs, scripts,@@ -24,7 +24,7 @@ and a plastic-enclosure subset work; surfaces, drawings, CAM and simulation arethe [feature list](dev/features.md) lists every command by area, and the[reference tests](dev/oracle.md) check modelling results against analytic and FreeCAD values.-Existing `.solvecraft` designs and `solvecraft-cli` commands keep their names and behavior.+Existing `.solidcraft` designs and `solidcraft-cli` commands keep their names and behavior.This book has two halves: the **user guide** for people modelling with SolidCraft, and the**developer guide** for people working on it. The [command reference](reference/commands.md) isdiff --git a/docs/compatibility.md b/docs/compatibility.mdindex 4b69dc2c8c..45516df818 100644--- a/docs/compatibility.md+++ b/docs/compatibility.md@@ -1,26 +1,129 @@-# Compatibility shims for the SolveCraft → SolidCraft rename+# Compatibility with the SolveCraft name-The product is SolidCraft everywhere. The old name survives only in the shims listed here,-each kept so that existing installs, scripts and files keep working. Remove a shim only in a-release whose notes say so.+SolidCraft was first called SolveCraft, and builds up to 0.4 kept that name in their+identifiers after the displayed name changed. 0.5.0 renamed the binaries, release assets and+packages; the release after it renames everything else: crates `solidcraft-*`, binaries `solidcraft` and `solidcraft-cli`, `.solidcraft`+designs, the `"format": "solidcraft/N"` tag, `SOLIDCRAFT_*` environment variables, settings+and recovery folders, the MCP server name, docs, CI and packaging.-## Programs and packages (since 0.5.0)+The old name survives **only** in the shims below (plus their tests, this file, and changelog /+release notes). `git grep -i solvecraft` must list nothing else. When you add or remove a+shim, update this file in the same PR.-| Shim | Where | Why | Test |+## 1. `.solvecraft` design files++New designs are saved as `.solidcraft`. Files with the old extension still open everywhere:++| Path in | Where |+|---|---|+| Extension → design format | `crates/io/src/lib.rs` (`LEGACY_DESIGN_EXT`, format detection) |+| Open dialog filters (desktop) | `apps/solidcraft/src/main.rs` (`services`) |+| Drag-drop, recent files, `doc.open`, MCP `open`, CLI `eval`/`run` | go through the same format detection in `solidcraft_io` |+| Browser file picker | `apps/solidcraft-web/src/files.rs` (`accept`) |+| Windows | `packaging/windows/solidcraft.wxs`: the `.solvecraft` extension on the design ProgId and in `SupportedTypes` |+| macOS | `packaging/macos/Info.plist.in`: `solvecraft` in the design document type's extensions |+| Linux / FreeBSD / Flatpak | `packaging/linux/ai.storyteller.solvecraft.mime.xml`: `*.solvecraft` glob and the `application/x-solvecraft` alias |++Recent-files entries that point at a `.solvecraft` file keep working: they are plain paths and+open through the same detection. The browser app also lists designs it stored under the old+extension, and keyboard-shortcut files exported as `solvecraft-shortcuts/1` still import+(`crates/ui-egui/src/toolbar_custom.rs`). Tests: `crates/io` (`Format::from_name`,+`is_design_path`), `legacy_extension_and_format_tag_still_open` (CLI, `run_results.rs`) and+`legacy_design_files_and_resource_uris` (MCP `open`).++## 2. The `solvecraft/N` format tag++Designs record their format as `"format": "solidcraft/N"`. Files saved by builds up to 0.5 say+`"format": "solvecraft/N"`; `crates/doc/src/format.rs` (`version_of`) reads both prefixes and+upgrades them as usual (the file is re-tagged `solidcraft/N` when saved).++Not backward-compatible: builds up to 0.5 don't know the new tag and refuse files saved by+later builds. Test: `version_of` accepts both prefixes; legacy-tagged designs load and are+re-tagged on save.++## 3. `SOLVECRAFT_*` environment variables++Every runtime variable is read through one helper, `solidcraft_geom::env` (`var`, `var_os`):+it reads `SOLIDCRAFT_<NAME>` and falls back to `SOLVECRAFT_<NAME>` when the new one is unset.+The shell entry points do the same: `packaging/linux/AppRun`+(`SOLIDCRAFT_NO_DESKTOP_INTEGRATION`) and `packaging/env.sh` (`SOLIDCRAFT_VERSION`,+`SOLIDCRAFT_BUILD_DATE`). Tests: the helper's unit tests (new wins, old is the fallback,+neither → unset).++## 4. Settings, preferences, autosave and recovery folders++New folders use the SolidCraft name:++| | Linux | macOS | Windows ||---|---|---|---|-| `solvecraft-cli` alias binary: forwards every argument and stream to `solidcraft-cli`, prints a one-line deprecation note on stderr, exits with its status | `apps/solvecraft-cli/src/alias.rs`; shipped by every package (deb, rpm, tar.gz, AppImage, Flatpak, FreeBSD, MSI, portable zip, macOS CLI zip, Nix) | scripts and MCP client setups (`claude mcp add solvecraft -- solvecraft-cli mcp`) keep working for at least one release | `apps/solvecraft-cli/tests/legacy_alias.rs`; release workflow checks the deb contents |-| Linux app ID `ai.storyteller.solvecraft` (Flatpak ID, desktop entry, metainfo, MIME and icon file names, Wayland app_id) | `packaging/env.sh` (`APP_ID`), `packaging/linux/*`, the app's `with_app_id` | a new Flatpak ID would be a different app: installed Flatpaks would never update. The desktop entry, metainfo and Wayland app_id must equal the Flatpak ID | packaging-lint workflow; Flatpak smoke test |-| MSI `UpgradeCode` `6A145FD6-D285-428D-AE84-A69570CDF4DB` (a GUID, no name in it) | `packaging/windows/solidcraft.wxs` | the new MSI upgrades an existing install in place. The install folder moves to `Program Files\SolidCraft` (registry `Software\SolidCraft`); a custom folder chosen for an earlier version is not carried over this once | release workflow (MSI build) |-| deb `Replaces`/`Conflicts`/`Provides: solvecraft`, rpm `Obsoletes`/`Provides: solvecraft` | `packaging/linux/nfpm.yaml` | installing the `solidcraft` package replaces the old `solvecraft` one instead of clashing with its files | release workflow checks the deb fields |-| A copy of each AppImage's `.zsync` under the old name `solvecraft-<ver>-linux-<arch>.AppImage.zsync` | `packaging/linux/package.sh` | earlier AppImages carry update information that looks for that name; the copy points at the new AppImage | release workflow |-| `solvecraft.flatpakrepo` next to `solidcraft.flatpakrepo` | `packaging/flatpak-site.sh` | links in earlier instructions keep working (existing remotes use the repository URL, which is unchanged) | Pages workflow |-| `.solvecraft` file associations (Windows ProgId extension, macOS document type, freedesktop MIME glob and `application/x-solvecraft` alias) | `packaging/windows/solidcraft.wxs`, `packaging/macos/Info.plist.in`, `packaging/linux/ai.storyteller.solvecraft.mime.xml` | existing design files keep opening in SolidCraft from the file manager | packaging-lint workflow |-| `SOLVECRAFT_VERSION`, `SOLVECRAFT_BUILD_DATE`, `SOLVECRAFT_MAINTAINER`, `SOLVECRAFT_NO_DESKTOP_INTEGRATION` read when the `SOLIDCRAFT_*` name is unset | `packaging/env.sh`, `packaging/linux/package.sh`, `packaging/linux/AppRun` | build scripts and AppImage users' environments keep working | packaging tests |--## Not kept--- The macOS bundle identifier is now `ai.storyteller.solidcraft`: apps are installed by dragging- from the DMG and there is no updater keyed on it. The first launch may ask again for Gatekeeper- approval.-- The GUI binary has no alias: every package's launcher, shortcut and file association runs- `solidcraft`.+| Preferences, graphics settings | `~/.local/share/solidcraft` | `~/Library/Application Support/SolidCraft` | `%APPDATA%\SolidCraft\data` |+| Recovery (autosave) | `…/solidcraft/recovery` | `…/SolidCraft/recovery` | `%LOCALAPPDATA%\SolidCraft\recovery` |++On first launch, if the new folder doesn't exist but the old one (`solvecraft` / `SolveCraft`)+does, it is **copied** to the new location; the old folder is never deleted or changed. The+window and UI state that eframe kept under `ai.storyteller.solvecraft` is copied the same way.+Autosaves copied from the old folder (`<id>.solvecraft`) are listed and recovered like new ones.+The preferences key in eframe's storage is `solidcraft.prefs`; `solvecraft.prefs` is read when+it is missing (desktop and browser, `solidcraft_ui_egui::prefs::stored`). The browser app also+reads files and the autosave it kept under the old names in local storage and OPFS+(`apps/solidcraft-web/src/files.rs`). A 3DxWare profile the driver made for the old executable+name is read until it makes a new one (`apps/solidcraft/src/space_mouse.rs`).+The thumbnail cache is not migrated; it is rebuilt. The copy helper is+`solidcraft_io::adopt_legacy_dir`, used by the desktop app (`adopt_legacy_settings`) and+`solidcraft_engine::recovery::default_dir`. Tests: `legacy_dir` (copy once, never overwrite,+old folder intact), `first_launch_adopts_the_previous_release_settings`,+`autosave_from_a_legacy_folder_is_listed_and_loads`, `recovery_dirs_and_their_legacy_names`,+`stored_prefs_fall_back_to_the_legacy_key`.++## 5. `solvecraft-cli` alias++A tiny `solvecraft-cli` binary (`apps/solidcraft-cli/src/alias.rs`) ships in every package for+at least one release (since 0.5.0). It prints a one-line deprecation note to stderr and runs the+`solidcraft-cli` next to it with the same arguments, stdin/stdout and exit code, so scripts+and MCP client configs that call `solvecraft-cli` keep working. Test: `apps/solidcraft-cli/tests/legacy_alias.rs` (forwards `--version` and the exit status;+the note goes to stderr only, so stdout stays clean for MCP).++There is no alias for the desktop binary: launchers, file associations and Start-menu entries+installed by the packages point at `solidcraft`.++## 6. MCP++`serverInfo.name` is now `solidcraft`. The name a client shows is chosen by the user when the+server is added, so an existing setup such as++```sh+claude mcp add solvecraft -- solvecraft-cli mcp+```++keeps working (through the alias above). New setups use:++```sh+claude mcp add solidcraft -- solidcraft-cli mcp+```++Switch before the alias is removed. Resources are listed as `solidcraft://design` and+`solidcraft://commands`; the old `solvecraft://` URIs still read (`crates/mcp/src/server.rs`,+test `legacy_design_files_and_resource_uris`).++## Package IDs++| Package | Decision | Why |+|---|---|---|+| Flatpak app ID / Linux desktop ID `ai.storyteller.solvecraft` | **kept** | A new Flatpak ID is a different app: existing installs would stop receiving updates. The `.desktop`, metainfo and MIME file names and the Wayland `app_id` must match it, so they keep it too. |+| Flatpak remote file | `solidcraft.flatpakrepo`, plus a legacy `solvecraft.flatpakrepo` copy | Old links keep working; existing remotes point at the repo URL, which is unchanged. |+| macOS bundle ID | changed to `ai.storyteller.solidcraft` | No updater depends on it; the app is drag-installed. macOS may ask again on first launch (unsigned builds). |+| MSI `UpgradeCode` | **kept** | So the new MSI upgrades the old install in place. Product name is SolidCraft; the default folder becomes `Program Files\SolidCraft` (the major upgrade removes the old folder). A custom install folder isn't remembered across this one upgrade. |+| deb / rpm package name | renamed to `solidcraft`; deb `Replaces`/`Conflicts`/`Provides: solvecraft`, rpm `Obsoletes`/`Provides: solvecraft` | Installing the new package replaces the old one instead of installing side by side. |+| AppImage | `solidcraft-<version>-linux-<arch>.AppImage`; the release also carries a copy of its `.zsync` under the old `solvecraft-…` name | AppImages already installed look for the old-named `.zsync`, so AppImageUpdate keeps finding updates. |++## macOS++Releases before 0.4 were installed as `SolveCraft.app`. To update, quit the app, drag+`SolidCraft.app` from the DMG onto Applications, move `SolveCraft.app` to the Trash, and+replace any Dock shortcut with the old name (open `SolidCraft.app`, then+**Options > Keep in Dock**). Designs and settings are kept (see 4).++## Flatpak remotes added from the former website address++`flatpak remote-modify --user --url=https://bherbruck.github.io/solidcraft/flatpak/repo/ solvecraft`+(use your remote's name), then `flatpak update --user`.diff --git a/docs/control-protocol.md b/docs/control-protocol.mdindex a82d2191cb..c9a4cd99b5 100644--- a/docs/control-protocol.md+++ b/docs/control-protocol.md@@ -1,6 +1,6 @@# Control protocol-`solvecraft --control PORT` (or `SOLVECRAFT_CONTROL_PORT=PORT`) listens on `127.0.0.1:PORT` for+`solidcraft --control PORT` (or `SOLIDCRAFT_CONTROL_PORT=PORT`) listens on `127.0.0.1:PORT` forJSON lines. Each request is one line `{"id": …, "method": "…", "params": {…}}`; each reply is oneline `{"id": …, "ok": true, "result": …}` or `{"id": …, "ok": false, "error": "…"}`. Requests arehandled on the UI thread between frames; pointer and keyboard input is injected as real egui@@ -23,7 +23,7 @@ answered within 60 seconds is replied to with `{"ok": false, "error": "timeout"}| `engine.commands` | — | every command: id, label, tab, panel, icon, shortcut, params doc, enabled || `document.inspect` | `measure?`: bool | parameters, timeline (errors, timings), bodies, sketches, selection |-Commands never open dialogs when run this way. `solvecraft-cli commands` prints the same registry.+Commands never open dialogs when run this way. `solidcraft-cli commands` prints the same registry.Every `sketch.*` command that changes a sketch adds `created: {points, curves, constraints,dimensions}` to its result (and `wires` for 3D curves): the ids of what it added, in creation@@ -85,7 +85,7 @@ unit regardless of the design, pass an expression with one: `"value": "50 mm"` o## MCP-`solvecraft-cli mcp --connect 127.0.0.1:PORT` bridges an MCP client (an AI agent) to this+`solidcraft-cli mcp --connect 127.0.0.1:PORT` bridges an MCP client (an AI agent) to thischannel; see [mcp.md](mcp.md).## Examplediff --git a/docs/crash-reports.md b/docs/crash-reports.mdindex a383f7e1a0..76e85c4561 100644--- a/docs/crash-reports.md+++ b/docs/crash-reports.md@@ -8,15 +8,15 @@ until you review and submit it, and the design is not part of the draft.## Where they are-`<data dir>/solvecraft/crashes/`, next to the recovery folder:+`<data dir>/solidcraft/crashes/`, next to the recovery folder:| System | Folder ||---|---|-| Linux | `~/.local/share/solvecraft/crashes` (or `$XDG_DATA_HOME/solvecraft/crashes`) |-| Windows | `%LOCALAPPDATA%\SolveCraft\crashes` |-| macOS | `~/Library/Application Support/SolveCraft/crashes` |+| Linux | `~/.local/share/solidcraft/crashes` (or `$XDG_DATA_HOME/solidcraft/crashes`) |+| Windows | `%LOCALAPPDATA%\SolidCraft\crashes` |+| macOS | `~/Library/Application Support/SolidCraft/crashes` |-`SOLVECRAFT_CRASH_DIR` overrides the folder. `solvecraft --crash-log` and+`SOLIDCRAFT_CRASH_DIR` overrides the folder. `solidcraft --crash-log` and`solidcraft-cli crashes dir` print it.## For agents@@ -32,10 +32,10 @@ All of these read the same folder:**Reproduce:** `solidcraft-cli crashes replay <id>` opens the report's design, runs itscommands, and reports whether the same internal error happens again (same place and message).-Without the CLI, run `solidcraft-cli run <report>/replay.json --in <report>/design.solvecraft`.+Without the CLI, run `solidcraft-cli run <report>/replay.json --in <report>/design.solidcraft`.A fixed crash turns into a regression test with the same two files.-**Check that reporting works:** with `SOLVECRAFT_CRASH_TEST=1` set for the app, the command+**Check that reporting works:** with `SOLIDCRAFT_CRASH_TEST=1` set for the app, the command`diagnostics.crash_test` has three modes:- `panic`: an internal error in a command- `kernel`: an internal error inside the geometry kernel@@ -45,7 +45,7 @@ A fixed crash turns into a regression test with the same two files.A folder `crashes/<YYYYMMDD-HHMMSS>-<signature>/`:-- `report.json` (`"format": "solvecraft-crash/1"`):+- `report.json` (`"format": "solidcraft-crash/1"`):- `kind`: one of- `command_panic`: a command hit an internal error; it was caught and the design was left unchanged- `kernel_panic_recovered`: the third-party geometry kernel panicked and was caught. This is harmless on the desktop, but it would crash the web build.@@ -59,7 +59,7 @@ A folder `crashes/<YYYYMMDD-HHMMSS>-<signature>/`:- `base`: what the replay starts from (the design before the command, an autosave, a saved file or a new design)- `count`, `first_seen`, `last_seen`: the same crash repeats only increase `count`- `notes`: what is missing and why, for example a design too large to copy-- `design.solvecraft`: the design the replay starts from+- `design.solidcraft`: the design the replay starts from- `replay.json`: `{"commands": [{command, params}, …]}`## How it stays cheap and smalldiff --git a/docs/features.md b/docs/features.mdindex 91ad8e93fe..097c5648de 100644--- a/docs/features.md+++ b/docs/features.md@@ -1,6 +1,6 @@# Features-SolidCraft's commands by area, generated by `cargo xtask features` from the command registry (`solvecraft-cli commands`). **314 commands.** Every command runs the same way from the toolbar, a script, `solvecraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the [command reference](book/src/reference/commands.md) (`cargo xtask book`). Status and plans: [ROADMAP](../ROADMAP.md).+SolidCraft's commands by area, generated by `cargo xtask features` from the command registry (`solidcraft-cli commands`). **314 commands.** Every command runs the same way from the toolbar, a script, `solidcraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the [command reference](book/src/reference/commands.md) (`cargo xtask book`). Status and plans: [ROADMAP](../ROADMAP.md).## Sketch (97)diff --git a/docs/localization.md b/docs/localization.mdindex df90c115a4..c6ee236d6f 100644--- a/docs/localization.md+++ b/docs/localization.md@@ -35,7 +35,7 @@ The desktop host tries system CJK fonts across Windows, macOS and Linux, as wellin native desktop distribution packages; native builds rely entirely on existing operating system fontsor craft-fonts.-In the browser, `solvecraft-web` bundles a self-hosted Japanese font (`BIZUDPGothic-Regular.ttf`, licensed+In the browser, `solidcraft-web` bundles a self-hosted Japanese font (`BIZUDPGothic-Regular.ttf`, licensedunder SIL OFL 1.1) within the web distribution artifacts only. The font is loaded asynchronously from the sameorigin (`./fonts/BIZUDPGothic-Regular.ttf`) on-demand when the interface language is set to Japanese, withoutcontacting any external CDNs or third-party servers. For users with an English interface, no font downloaddiff --git a/docs/mcp.md b/docs/mcp.mdindex e2d67c1452..67db4d7360 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -9,14 +9,14 @@ toolbar, palette, scripts and control channel use, and never opens a dialog.```sh# Headless: an in-process design session, no window (CPU renders for screenshots).-solvecraft-cli mcp+solidcraft-cli mcp# Headless, starting from a design file or a command script.-solvecraft-cli mcp --in part.solvecraft+solidcraft-cli mcp --in part.solidcraft# Bridged to the running app, so you can watch the agent model:-solvecraft --control 7878 &-solvecraft-cli mcp --connect 127.0.0.1:7878+solidcraft --control 7878 &+solidcraft-cli mcp --connect 127.0.0.1:7878```stdout carries only protocol messages; errors go to stderr. Bridged screenshots are written to a@@ -24,12 +24,13 @@ temporary file by the app and read back by the server, so both must run on the s### Client configuration-Claude Code (project `.mcp.json`, or `claude mcp add solvecraft -- solvecraft-cli mcp`):+Claude Code (project `.mcp.json`, or `claude mcp add solidcraft -- solidcraft-cli mcp`; a setup+added under the previous name keeps working, see the [compatibility notes](https://github.com/bherbruck/solidcraft/blob/main/docs/compatibility.md#mcp)):```json{"mcpServers": {- "solvecraft": { "command": "solvecraft-cli", "args": ["mcp"] }+ "solidcraft": { "command": "solidcraft-cli", "args": ["mcp"] }}}```@@ -39,7 +40,7 @@ Claude Desktop (`claude_desktop_config.json`), bridged to a running app:```json{"mcpServers": {- "solvecraft": { "command": "/path/to/solvecraft-cli", "args": ["mcp", "--connect", "127.0.0.1:7878"] }+ "solidcraft": { "command": "/path/to/solidcraft-cli", "args": ["mcp", "--connect", "127.0.0.1:7878"] }}}```@@ -60,7 +61,7 @@ Claude Desktop (`claude_desktop_config.json`), bridged to a running app:| `undo`, `redo` | — | Undo / redo one change. || `crash_reports` | `id?`, `limit?` | The crash reports on this computer, newest first; with `id`, the whole report (backtrace, command, recent commands, `design_path`/`replay_path`). See [crash-reports.md](crash-reports.md). || `new_design` | `name?` | Start an empty design. |-| `open` | `path` | Open a `.solvecraft` design, a STEP file (`.step`/`.stp`) as a new design holding its bodies (an Import base feature), or a 3MF/STL file as mesh bodies. |+| `open` | `path` | Open a `.solidcraft` design, a STEP file (`.step`/`.stp`) as a new design holding its bodies (an Import base feature), or a 3MF/STL file as mesh bodies. || `save` | `path?` | Save the design (to its current file without `path`). |To change a feature after it is made, read its definition with `execute` `timeline.inspect`@@ -68,7 +69,7 @@ To change a feature after it is made, read its definition with `execute` `timeli`{"extent": {"distance": "30"}}`). The fields per feature type are listed in the book's*Solid features* chapter.-Resources: `solvecraft://design` (inspect JSON with measurements) and `solvecraft://commands`+Resources: `solidcraft://design` (inspect JSON with measurements) and `solidcraft://commands`(the catalog).Errors: an unknown tool or arguments that don't match the tool's schema are JSON-RPC@@ -83,8 +84,8 @@ the batch added to the undo history.)## Demo: an enclosure built over MCP-`examples/demo/enclosure_mcp.py` is a small MCP client. It drives a running app (`solvecraft---control PORT`) through `solvecraft-cli mcp --connect` and builds an electronics enclosure one+`examples/demo/enclosure_mcp.py` is a small MCP client. It drives a running app (`solidcraft+--control PORT`) through `solidcraft-cli mcp --connect` and builds an electronics enclosure one`execute` call at a time (`enclosure_steps.json`): a rounded box, shelled open at the top, aUSB port cut through a side wall, four screw bosses, and then a change of the `width`parameter that the timeline rebuilds. `examples/demo/record.sh` records the run with ffmpeg,diff --git a/docs/nix.md b/docs/nix.mdindex 84b5fb00da..9ae2d3fa83 100644--- a/docs/nix.md+++ b/docs/nix.md@@ -14,7 +14,7 @@ nix run github:bherbruck/solidcraft#solidcraft -- --sample```Inside a checkout, `nix run .` and `nix run .#solidcraft` launch the desktop app.-`nix run .#cli -- --version` launches the CLI. The legacy `.#solvecraft` app name+`nix run .#cli -- --version` launches the CLI. The legacy `.#solidcraft` app namealso works. These commands use the flake's exact wrapped binary, rather than anolder executable already on your shell's `PATH`.@@ -26,8 +26,8 @@ nix build github:bherbruck/solidcraft#solidcraft./result/bin/solidcraft --sample```-The result contains `solidcraft`, the compatible `solvecraft` binary name, and-`solvecraft-cli`. **Building does not install a desktop-menu entry.** For a user+The result contains `solidcraft`, `solidcraft-cli` and the deprecated old-name CLI alias+(see [compatibility.md](compatibility.md)). **Building does not install a desktop-menu entry.** For a userprofile installation, run:```sh@@ -41,19 +41,19 @@ sizes alongside the commands. On macOS the package contains the binaries only; f`packages.${system}.solidcraft` in `environment.systemPackages`/`home.packages`.If a non-NixOS desktop does not discover profile-installed launchers, ensure thatits session includes `~/.nix-profile/share` in `XDG_DATA_DIRS`, then log out and-back in. The existing `ai.storyteller.solvecraft` desktop/application ID and-`.solvecraft` design files remain compatible.+back in. The desktop/application ID is unchanged (see+[compatibility.md](compatibility.md#package-ids)).Check which executable a plain terminal command would run:```sh-type -a solidcraft solvecraft+type -a solidcraftreadlink -f "$(command -v solidcraft)"solidcraft --versionnix run github:bherbruck/solidcraft#solidcraft -- --version```-An unrelated old `solvecraft` executable on `PATH` is not updated by `nix build`.+An unrelated old executable on `PATH` is not updated by `nix build`.Use the flake app or `./result/bin/solidcraft` to verify the package you just built.## Graphics and file dialogs@@ -85,7 +85,7 @@ OpenGL rendering uses 1x anti-aliasing to avoid the multisampled black-frame faiVulkan and other backends keep the requested sample count; saved preferences are preserved.For older builds, including 0.3.0, set Anti-aliasing to 1x and restart when using OpenGL.If that window cannot show the settings dialog, edit only the `msaa` field to `1` in-`~/.local/share/solvecraft/graphics.json`; preserve any other settings.+`~/.local/share/solidcraft/graphics.json`; preserve any other settings.## Wayland, XWayland and niri@@ -97,12 +97,12 @@ under niri's XWayland. The trade-off: **on native Wayland, dropping files onto twindow does not work**; use File > Open or pass the file on the command line.This applies to every build, not only the Nix package.-Override the choice with `SOLVECRAFT_WAYLAND=1` (always native Wayland) or-`SOLVECRAFT_WAYLAND=0` (XWayland whenever an X display is available).+Override the choice with `SOLIDCRAFT_WAYLAND=1` (always native Wayland) or+`SOLIDCRAFT_WAYLAND=0` (XWayland whenever an X display is available).## Development shells`nix develop` supplies runtime libraries and uses the Rust/C toolchain already onyour `PATH`. `nix develop .#rust` supplies the pinned toolchain, C linker and`target/nix` build directory. Both retain the GUI and CLI's existing Cargo package-names (`solvecraft`, `solvecraft-cli`).+names (`solidcraft`, `solidcraft-cli`).diff --git a/docs/perf.md b/docs/perf.mdindex 713337bb79..8b24c83221 100644--- a/docs/perf.md+++ b/docs/perf.md@@ -39,14 +39,14 @@ Cross-part scheduling, parallel B-rep reconstruction and later display meshes reReproduce after compiling, without other builds running:```sh-cargo test -p solvecraft-kernel --profile ci benchmark_independent_step_solids --no-run-SOLVECRAFT_STEP_BENCH_COUNT=512 SOLVECRAFT_STEP_BENCH_KIND=cylinder \- cargo test -p solvecraft-kernel --profile ci benchmark_independent_step_solids \+cargo test -p solidcraft-kernel --profile ci benchmark_independent_step_solids --no-run+SOLIDCRAFT_STEP_BENCH_COUNT=512 SOLIDCRAFT_STEP_BENCH_KIND=cylinder \+ cargo test -p solidcraft-kernel --profile ci benchmark_independent_step_solids \-- --ignored --nocapture --test-threads=1```Use `torus` or `box` for the other fixtures and repeat in three fresh processes.-`SOLVECRAFT_STEP_BENCH_FIXTURE` optionally writes the original STEP for native inspection.+`SOLIDCRAFT_STEP_BENCH_FIXTURE` optionally writes the original STEP for native inspection.No timing threshold runs in CI. Regressions compare serial and threaded imports withdifferent worker counts: exact display meshes, measures, body/face source identities,names, colours/opacity, units, rotated assembly placements, duplicates and partial failures@@ -64,7 +64,7 @@ across edits.The reproducible microbenchmark is:```sh-cargo test -p solvecraft-doc --profile ci benchmark_prepared_extrude_sources -- --ignored --nocapture+cargo test -p solidcraft-doc --profile ci benchmark_prepared_extrude_sources -- --ignored --nocapture```Three Windows x64 optimized `ci` runs, during other compilation, compared the previous@@ -89,9 +89,9 @@ straight-line projection and exact surface-refinement reuse changes:| Local Pi case assembly, 25 features, 2,990 bodies | 14.75 s | 11.57 s | 21.6% |These are geometry rebuild times, not complete desktop opening times. The public fixture-can be generated with `solvecraft-cli run examples/acceptance/sensor_enclosure.json---save sensor.solvecraft --quiet`, then measured with `solvecraft-cli bench-open-sensor.solvecraft`. Each benchmark starts a new process; this does not measure a warm+can be generated with `solidcraft-cli run examples/acceptance/sensor_enclosure.json+--save sensor.solidcraft --quiet`, then measured with `solidcraft-cli bench-open+sensor.solidcraft`. Each benchmark starts a new process; this does not measure a warmtimeline-cache hit. The local assembly is private and is not part of the repository.Straight segments now use guarded algebraic closest-point projection instead of sampling@@ -109,7 +109,7 @@ Both saved fixtures retain exactly the same body names, face/edge/vertex/shell cbounds, volumes, and surface areas. Focused tests compare cached and uncached refinementcoordinates and normals bit for bit on periodic, singular and transformed surfaces.-For desktop phase profiling, set `SOLVECRAFT_PROFILE_OPEN=1` before launching the app.+For desktop phase profiling, set `SOLIDCRAFT_PROFILE_OPEN=1` before launching the app.Interactive Open reports geometry, placement, tessellation, thumbnail and total workertimes to stderr without logging the source path. Thumbnails were about 0.1 seconds ofthe slow assembly's open and were not the main bottleneck. Further cold Boolean and@@ -132,7 +132,7 @@ ready: 13.04 s geometry, 2.20 s placement, 0.53 s meshing and 0.07 s thumbnails.the optimized `ci` profile and actual Vulkan rendering, with isolated settings and caches.Linux and Windows timings are separate measurements and must not be compared as a speedup.-`solvecraft-cli bench-open design.solvecraft` reports JSON lines for file reading,+`solidcraft-cli bench-open design.solidcraft` reports JSON lines for file reading,JSON decoding and migrations (including input-name repair), timeline evaluation, individualfeatures, and world placement/display meshing. `--parse-only` stops before geometry evaluation.The parse timer includes document validation and repair, not just the JSON parser.@@ -205,7 +205,7 @@ every row's place.# Recompute performance-`solvecraft-cli bench-edit <script> <param> "(<old>) * 1.02"` builds a design from its script+`solidcraft-cli bench-edit <script> <param> "(<old>) * 1.02"` builds a design from its script(timing the build), then times a parameter edit, setting the parameter back to its oldexpression, undo and redo. Each cell is before → after the evaluation cache, with the number offeatures recomputed in parentheses. Release build, on a machine shared with other build jobs (load average about 45; the@@ -268,7 +268,7 @@ Pi case in 15.2 s and 10.5 s. During those jobs, median `ui.inspect` round tripsand 8.3 ms; the slowest were 33.7 ms and 28.6 ms. This fixes the window freeze, not theremaining cost of cold geometry evaluation.-Recent thumbnails are 240 × 150 PNG files in `SolveCraft/thumbnails` under the platform+Recent thumbnails are 240 × 150 PNG files in `SolidCraft/thumbnails` under the platformcache directory (`LOCALAPPDATA` on Windows). Their keys include the source path, file sizeand modification time. Open and Save render from the model already in memory. Cachedrecents decode the PNG without reading or rebuilding a document, and run before cold@@ -277,7 +277,7 @@ No thumbnail or base64 image is added to the design JSON. A regression test verisource bytes remain unchanged, a cached picture works even without a parseable sourcefile, and changing the source invalidates the cache.-`solvecraft-cli bench-open` also accepts STEP/IGES. For exchange files its `parse` phase+`solidcraft-cli bench-open` also accepts STEP/IGES. For exchange files its `parse` phaseincludes constructing and checking the imported B-rep, not merely decoding STEP syntax.The live test loaded both cached recent cards in 21 ms and inserted the 2 MB lightweight@@ -299,7 +299,7 @@ drag's steps are a quarter of the smallest held size instead of an eighth, excepran out of budget: the rest of that drag goes in eighths, as before, and continuation keepsthe branch the seed no longer places.-`cargo run --release -p solvecraft-sketch --example solve_bench`, macOS arm64, load average+`cargo run --release -p solidcraft-sketch --example solve_bench`, macOS arm64, load average45–75 (best of 5):| Grid (origin corner fixed, rows horizontal, columns vertical, every edge a distance) | Start | Before | After |diff --git a/docs/releasing.md b/docs/releasing.mdindex f1bdc15335..b96fe631a4 100644--- a/docs/releasing.md+++ b/docs/releasing.md@@ -6,16 +6,14 @@ GitHub Release. Publishing that verified draft is a separate operation. Pushingpushing a tag does not start the release workflow. There is no automatic commit-message-basedversion bump and no patch release for every merge.-## Compatibility names and deployment--SolidCraft is the product display name. Keep existing release asset filenames, including-`SolveCraft-{version}-windows-x64.exe` and `solvecraft-cli` archives, together-with installed package IDs and settings paths. The macOS DMG now contains `SolidCraft.app`-with a `SolidCraft` bundle executable and icon; its bundle ID remains-`ai.storyteller.solvecraft`. Include the one-time macOS upgrade instructions from-`.github/release-notes.md` so users replace an existing `SolveCraft.app` rather than-installing a second copy. Do not rewrite published 0.2.0 or 0.2.1 assets,-checksums, tags or historical release notes.+## Names and deployment++Every release asset, binary, installer product name and package uses the SolidCraft name+(`solidcraft-<version>-linux-<arch>.AppImage`, `SolidCraft-<version>-windows-x64.exe`,+`solidcraft-cli` archives, …). The old name survives only in the shims listed in+[compatibility.md](compatibility.md) (the Linux app ID, the legacy `.zsync` and `.flatpakrepo`+copies, the deprecated old-name CLI alias); keep them until that document says they can go. Do not+rewrite published assets, checksums, tags or historical release notes of earlier versions.Project Pages publishes the documentation, browser app and published-release Flatpakrepository under `/solidcraft/`. Do not add a separate owner-site publisher or permanentdiff --git a/docs/robustness.md b/docs/robustness.mdindex b5f3fa7a1b..52e9576b0c 100644--- a/docs/robustness.md+++ b/docs/robustness.md@@ -7,8 +7,8 @@ robustness runs build random but realistic designs and check every step.## How it runs```-solvecraft-cli fuzz --from 0 --count 1000 --jobs 8 --timeout 90 --out runs/ --report report.md-solvecraft-cli fuzz-one <seed> --minimise # one design, cut down to the steps that matter+solidcraft-cli fuzz --from 0 --count 1000 --jobs 8 --timeout 90 --out runs/ --report report.md+solidcraft-cli fuzz-one <seed> --minimise # one design, cut down to the steps that matter````--count` seeds are run starting at `--from`. A range that exceeds `u64::MAX` isdiff --git a/docs/step-import.md b/docs/step-import.mdindex 62032213de..b6fa01092c 100644--- a/docs/step-import.md+++ b/docs/step-import.md@@ -2,7 +2,7 @@SolidCraft reads STEP (ISO 10303-21; AP203, AP214 and AP242 geometry) with its own reader in `crates/kernel/src/step_in` (written from the public standards; no third-party STEP code). A STEP file becomes an **Import** base feature on the timeline: it holds the file's B-rep (the STEP text is kept in the design, so the design reopens without the file) and later features — fillets, holes, cuts sketched on its faces, shells — build on its bodies.-- **Open**: File → Open (`doc.open`) accepts `.step`/`.stp` in any case and starts a new design; `solvecraft part.step`; `solvecraft-cli eval part.step`, `solvecraft-cli run script.json --in part.step`; the MCP `open` tool.+- **Open**: File → Open (`doc.open`) accepts `.step`/`.stp` in any case and starts a new design; `solidcraft part.step`; `solidcraft-cli eval part.step`, `solidcraft-cli run script.json --in part.step`; the MCP `open` tool.- **Insert** into the current design: File → Insert STEP… or SOLID → INSERT (`file.insert_step {path}`).- **Drag and drop** a STEP file on the window: inserted when the design has features, opened otherwise.diff --git a/docs/wip-reconciliation.md b/docs/wip-reconciliation.mdindex 7078f30d47..7cc9ec466a 100644--- a/docs/wip-reconciliation.md+++ b/docs/wip-reconciliation.md@@ -5,13 +5,13 @@ dotted ids and reconciled with the current implementation.| Branches | Result ||---|---|-| `solvecraft-sk`, `solvecraft-d2` | Ported `62d22e2` and `e0b3138`: sketches/projections see placed components; cache keys include placements; moved feature dialogs resolve world picks; Joints uses Browser rows. |-| `solvecraft-b4` | Ported `2c18dac`: canvases carry component ownership and named joint origins follow component placements. |-| `solvecraft-asm` | Ported `bc05805`: joint snap feedback, Drive limits, joint menus, and Motion Study editing/playback controls. |-| `solvecraft-shell`, `solvecraft-shell-b` | Browser chevrons, shared occurrence Move triad, toolbar customization, workspace switcher and status labels are already present on main. Their scenarios remain active; the Joints chevron scenario is now active too. |-| `solvecraft-kdev3`, `solvecraft-kdev`, `solvecraft-kdev2` | Previously landed as `67c79ec`; the old refs were already removed. |-| `solvecraft-kdev4` | The earlier robustness, shell, blends, wasm and measurement work is already present. Ported the remaining `9f98449` stacked-prism sewing and repaired curved-boundary face picking. |-| `solvecraft-params(-build)` | Previously landed as `517b7a9`. |+| `solidcraft-sk`, `solidcraft-d2` | Ported `62d22e2` and `e0b3138`: sketches/projections see placed components; cache keys include placements; moved feature dialogs resolve world picks; Joints uses Browser rows. |+| `solidcraft-b4` | Ported `2c18dac`: canvases carry component ownership and named joint origins follow component placements. |+| `solidcraft-asm` | Ported `bc05805`: joint snap feedback, Drive limits, joint menus, and Motion Study editing/playback controls. |+| `solidcraft-shell`, `solidcraft-shell-b` | Browser chevrons, shared occurrence Move triad, toolbar customization, workspace switcher and status labels are already present on main. Their scenarios remain active; the Joints chevron scenario is now active too. |+| `solidcraft-kdev3`, `solidcraft-kdev`, `solidcraft-kdev2` | Previously landed as `67c79ec`; the old refs were already removed. |+| `solidcraft-kdev4` | The earlier robustness, shell, blends, wasm and measurement work is already present. Ported the remaining `9f98449` stacked-prism sewing and repaired curved-boundary face picking. |+| `solidcraft-params(-build)` | Previously landed as `517b7a9`. |The source WIP refs are retained until this batch merges. Delete them only after the mergedmain contains the reconciled changes and passes CI.diff --git a/examples/demo/enclosure_mcp.py b/examples/demo/enclosure_mcp.pyindex a9ca3cb341..d8d6277790 100755--- a/examples/demo/enclosure_mcp.py+++ b/examples/demo/enclosure_mcp.py@@ -1,10 +1,10 @@#!/usr/bin/env python3-"""Build an electronics enclosure in a running SolveCraft over MCP, one command at a time.+"""Build an electronics enclosure in a running SolidCraft over MCP, one command at a time.- solvecraft --control 7878 &+ solidcraft --control 7878 &python3 examples/demo/enclosure_mcp.py --port 7878-The script is a minimal MCP client: it starts `solvecraft-cli mcp --connect 127.0.0.1:PORT`+The script is a minimal MCP client: it starts `solidcraft-cli mcp --connect 127.0.0.1:PORT`(stdio, JSON-RPC 2.0, one message per line), initializes, then sends one `execute` tool callper step of enclosure_steps.json, waiting `pause` seconds after each so the timeline can bewatched growing. Camera moves (fit, home view, the closing orbit) go over the app's control@@ -24,7 +24,7 @@ HERE = os.path.dirname(os.path.abspath(__file__))class Mcp:- """A stdio MCP client for `solvecraft-cli mcp`."""+ """A stdio MCP client for `solidcraft-cli mcp`."""def __init__(self, argv):self.p = subprocess.Popen(argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True, bufsize=1)@@ -79,7 +79,7 @@ def control(port, method, params=None):def main():ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])ap.add_argument("--port", type=int, default=7878, help="the app's --control port")- ap.add_argument("--cli", default="solvecraft-cli", help="path to solvecraft-cli")+ ap.add_argument("--cli", default="solidcraft-cli", help="path to solidcraft-cli")ap.add_argument("--steps", default=os.path.join(HERE, "enclosure_steps.json"))ap.add_argument("--pause", type=float, default=2.5, help="seconds after each step (unless the step says)")ap.add_argument("--log", help="write a JSON line per step: {t, caption, command}")diff --git a/examples/demo/enclosure_ui_mcp.py b/examples/demo/enclosure_ui_mcp.pyindex 05aea3698b..fb12dd9fcb 100644--- a/examples/demo/enclosure_ui_mcp.py+++ b/examples/demo/enclosure_ui_mcp.py@@ -1,13 +1,13 @@#!/usr/bin/env python3-"""Demo v2/v3: build an electronics enclosure in a running SolveCraft the way a person would,+"""Demo v2/v3: build an electronics enclosure in a running SolidCraft the way a person would,with the parametric steps sent over MCP.--story v3 (default): one standoff placed from the parameters and patterned 2 x 2 in theRectangular Pattern dialog, then width and wall changed in the Parameters dialog.--story v2: four standoffs from one sketch, then the width changed over MCP.- solvecraft --control 7878 &- python3 examples/demo/enclosure_ui_mcp.py --port 7878 --cli solvecraft-cli [--story v2|v3]+ solidcraft --control 7878 &+ python3 examples/demo/enclosure_ui_mcp.py --port 7878 --cli solidcraft-cli [--story v2|v3]Modelling steps go through the app's UI over its control channel: the pointer glides to atoolbar button and clicks it (the real dialog opens), glides to the face or point it picks and@@ -15,7 +15,7 @@ clicks, and values are typed into the dialog, as by hand. The port and boss sketdirectly to the enclosure's side face and inner floor, as in the original demo.The camera follows like a user's would (Look At on a new sketch, back out to a 3/4 view onFinish Sketch, a little orbit between features). The parameters and the dimensions that use them-are MCP `execute` calls through `solvecraft-cli mcp --connect` (enclosure_mcp.py's client).+are MCP `execute` calls through `solidcraft-cli mcp --connect` (enclosure_mcp.py's client).--log writes one JSON line per caption and per pointer event, which record.sh turns into burnt-incaptions and a drawn cursor (the app gets synthetic pointer events, so the screen's own pointer@@ -398,7 +398,7 @@ def run_v3(d):def main():ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])ap.add_argument("--port", type=int, default=7878, help="the app's --control port")- ap.add_argument("--cli", default="solvecraft-cli", help="path to solvecraft-cli")+ ap.add_argument("--cli", default="solidcraft-cli", help="path to solidcraft-cli")ap.add_argument("--log", help="write a JSON line per caption and pointer event")ap.add_argument("--story", choices=["v2", "v3"], default="v3", help="v2: standoffs from one sketch, width over MCP; v3: one standoff patterned, Parameters dialog")ap.add_argument("--until", type=int, default=10**6, help="stop before step N (trying the script out)")diff --git a/examples/demo/record.sh b/examples/demo/record.shindex 0ff8851eff..4d348a3b47 100755--- a/examples/demo/record.sh+++ b/examples/demo/record.sh@@ -5,7 +5,7 @@set -eDISP=${1:-:0}; PORT=${2:-7878}; OUT=${3:-.}HERE=$(cd "$(dirname "$0")" && pwd)-CLI=${SOLVECRAFT_CLI:-solvecraft-cli}+CLI=${SOLIDCRAFT_CLI:-solidcraft-cli}mkdir -p "$OUT"# x11grab stamps frames with the wall clock: its "start:" is when the first frame was taken.ffmpeg -loglevel info -nostats -y -f x11grab -draw_mouse 0 -video_size 1920x1080 -framerate 30 -i "$DISP" \diff --git a/examples/demo/record_ui.sh b/examples/demo/record_ui.shindex 3f8e13eb72..974b698e69 100755--- a/examples/demo/record_ui.sh+++ b/examples/demo/record_ui.sh@@ -5,17 +5,17 @@# gets synthetic pointer events, so the screen's own pointer never moves). Needs ffmpeg with# x11grab and libass.# PLAYBACK_RATE defaults to 1; label accelerated previews with their rate when publishing.-# SOLVECRAFT_DEMO_NAME overrides the filename stem; PAUSE scales UI pauses, CAPTION is the+# SOLIDCRAFT_DEMO_NAME overrides the filename stem; PAUSE scales UI pauses, CAPTION is the# minimum real-time caption duration, and HOLD keeps the live completed model on screen.-# For a readable 4x preview use SOLVECRAFT_DEMO_CAPTION=4 and SOLVECRAFT_DEMO_HOLD=8.+# For a readable 4x preview use SOLIDCRAFT_DEMO_CAPTION=4 and SOLIDCRAFT_DEMO_HOLD=8.set -eDISP=${1:-:0}; PORT=${2:-7878}; OUT=$(cd "${3:-.}" && pwd); STORY=${4:-v3}; RATE=${5:-1}HERE=$(cd "$(dirname "$0")" && pwd)-CLI=${SOLVECRAFT_CLI:-solvecraft-cli}-NAME=${SOLVECRAFT_DEMO_NAME:-enclosure-demo-$STORY}-PAUSE=${SOLVECRAFT_DEMO_PAUSE:-0.55}-CAPTION=${SOLVECRAFT_DEMO_CAPTION:-1.4}-HOLD=${SOLVECRAFT_DEMO_HOLD:-1}+CLI=${SOLIDCRAFT_CLI:-solidcraft-cli}+NAME=${SOLIDCRAFT_DEMO_NAME:-enclosure-demo-$STORY}+PAUSE=${SOLIDCRAFT_DEMO_PAUSE:-0.55}+CAPTION=${SOLIDCRAFT_DEMO_CAPTION:-1.4}+HOLD=${SOLIDCRAFT_DEMO_HOLD:-1}python3 -c 'import math,sys; r=float(sys.argv[1]); assert math.isfinite(r) and 0<r<=16' "$RATE"# Frame the actual app at capture resolution before the first recorded blank viewport.python3 - "$HERE" "$PORT" <<'PY'@@ -38,7 +38,7 @@ FF=$!# Waiting lets ffmpeg write the MP4 index so the failed take remains inspectable.trap 'kill -INT $FF 2>/dev/null || true; wait $FF 2>/dev/null || true' EXITsleep 1-python3 "$HERE/enclosure_ui_mcp.py" --port "$PORT" --cli "$CLI" --story "$STORY" --speed "$PAUSE" --minimum-caption "$CAPTION" --log "$OUT/steps.log" --save "$OUT/enclosure-$STORY.solvecraft"+python3 "$HERE/enclosure_ui_mcp.py" --port "$PORT" --cli "$CLI" --story "$STORY" --speed "$PAUSE" --minimum-caption "$CAPTION" --log "$OUT/steps.log" --save "$OUT/enclosure-$STORY.solidcraft"sleep "$HOLD"kill -INT $FF; wait $FF || trueSTART=$(grep -o "start: [0-9.]*" "$OUT/ffmpeg.log" | head -1 | cut -d" " -f2)diff --git a/flake.nix b/flake.nixindex fcc6e3c13c..44b829da78 100644--- a/flake.nix+++ b/flake.nix@@ -25,8 +25,8 @@# that is the driver stack the compositor runs on. Verified on an Intel LNL iGPU under# Wayland: wgpu picks the GL backend through this loader and draws.# The X11 libraries are the ones the app actually uses on a Wayland desktop: with `DISPLAY`- # set and `SOLVECRAFT_WAYLAND` unset, winit runs through XWayland (file drag and drop exists- # only there). The Wayland ones are for `SOLVECRAFT_WAYLAND=1`, and both are needed under+ # set and `SOLIDCRAFT_WAYLAND` unset, winit runs through XWayland (file drag and drop exists+ # only there). The Wayland ones are for `SOLIDCRAFT_WAYLAND=1`, and both are needed under# `xvfb-run` on a machine with no display at all.runtimeLibs =pkgs:diff --git a/packaging/linux/flatpak-smoke.py b/packaging/linux/flatpak-smoke.pyindex f92667fd3f..d2bb5e356e 100644--- a/packaging/linux/flatpak-smoke.py+++ b/packaging/linux/flatpak-smoke.py@@ -166,8 +166,8 @@ def probe(gl_saved_four=False):shell = SANDBOX_PROBEif gl_saved_four:shell = shell.replace('solidcraft --control',- 'mkdir -p "$XDG_DATA_HOME/solvecraft"\n'- 'printf \'{"msaa":4}\' >"$XDG_DATA_HOME/solvecraft/graphics.json"\n'+ 'mkdir -p "$XDG_DATA_HOME/solidcraft"\n'+ 'printf \'{"msaa":4}\' >"$XDG_DATA_HOME/solidcraft/graphics.json"\n''export WGPU_BACKEND=gl\nsolidcraft --control')result = subprocess.run(["flatpak", "run", "--user", "--command=bash", APP_ID, "-c", shell],text=True, capture_output=True, timeout=125)@@ -202,7 +202,7 @@ def run_backend(backend):env.pop("WAYLAND_SOCKET", None)env.pop("DISPLAY", None)env.pop("SOLIDCRAFT_WAYLAND", None)- env.pop("SOLVECRAFT_WAYLAND", None)+ env.pop("SOLVECRAFT_WAYLAND", None) # the legacy name is still readcommand = ["dbus-run-session", "--"]compositor = Nonewith (Path(temporary) / "weston.log").open("wb") as log:diff --git a/packaging/macos/README.txt b/packaging/macos/README.txtindex f18f1e73dc..a248ea47e2 100644--- a/packaging/macos/README.txt+++ b/packaging/macos/README.txt@@ -11,4 +11,6 @@ Some earlier releases were installed as SolveCraft.app. Move that one to the Traonce SolidCraft.app is in Applications, and replace any Dock shortcut with theold name (open SolidCraft.app, then choose Options > Keep in Dock).-Your designs and settings are not affected by the update.+Designs saved as .solvecraft still open, and SolidCraft copies your settings+and recovery files from the old SolveCraft folder on its first launch.+New designs are saved as .solidcraft.diff --git a/packaging/web/package.sh b/packaging/web/package.shindex 0c64784657..e3ea47c42a 100755--- a/packaging/web/package.sh+++ b/packaging/web/package.sh@@ -13,7 +13,7 @@ set -euo pipefailif [ "${1:-}" != "--skip-build" ]; thencommand -v trunk >/dev/null || { echo "error: trunk not found (cargo install trunk --locked)" >&2; exit 1; }- (cd "$ROOT/apps/solvecraft-web" && trunk build --release)+ (cd "$ROOT/apps/solidcraft-web" && trunk build --release)fiSITE="$ROOT/dist/web"diff --git a/tools/freecad-oracle/README.md b/tools/freecad-oracle/README.mdindex cec7e3efe0..c35d43e31c 100644--- a/tools/freecad-oracle/README.md+++ b/tools/freecad-oracle/README.md@@ -22,7 +22,7 @@ volume, area, centre of mass, bounding box) and the triangulated surface in `ref- `build.py`: runs inside FreeCAD. Reads a case's `recipe.json` and builds the part withFreeCAD's modelling operations, following the meaning SolidCraft gives the recipe- (`apps/solvecraft-cli/src/recipe.rs`): sketches (solved by FreeCAD's sketcher when the recipe+ (`apps/solidcraft-cli/src/recipe.rs`): sketches (solved by FreeCAD's sketcher when the recipeconstrains them, otherwise at their recorded coordinates), extrude (distance, symmetric, twosides, through all, taper), revolve, sweep, loft, holes (simple, drilled tip, counterbore,countersink), rectangular/circular/path patterns and mirror (each source feature's tool moved@@ -54,4 +54,4 @@ script; it needs no display.The values were produced with FreeCAD 1.1.4. A different FreeCAD version may differ in the lastdigits; regenerate only when a recipe changes, and check the new values against SolidCraft-(`solvecraft-cli oracle`) before committing them.+(`solidcraft-cli oracle`) before committing them.diff --git a/tools/freecad-oracle/build.py b/tools/freecad-oracle/build.pyindex eef0f5b950..0a88c8a76a 100644--- a/tools/freecad-oracle/build.py+++ b/tools/freecad-oracle/build.py@@ -8,7 +8,7 @@# ORACLE_OUT path of a JSON file to write the measured result to# ORACLE_STL optional: path of a binary STL to write (reference.stl)#-# The recipe format and its meaning are SolidCraft's (apps/solvecraft-cli/src/recipe.rs and the+# The recipe format and its meaning are SolidCraft's (apps/solidcraft-cli/src/recipe.rs and the# engine in crates/); this file re-implements that meaning with FreeCAD's modelling operations.import jsondiff --git a/vendor/README.md b/vendor/README.mdindex 5808b0e492..9839a2e206 100644--- a/vendor/README.md+++ b/vendor/README.md@@ -1,8 +1,8 @@# Vendored third-party crates-Copies of third-party crates that SolveCraft builds with local fixes, wired in with+Copies of third-party crates that SolidCraft builds with local fixes, wired in with`[patch.crates-io]` in the workspace `Cargo.toml`. They keep their own licence; changed lines-are marked `SolveCraft:` in the source.+are marked `SolidCraft:` in the source.## truck-shapeops 0.4.0 (Apache-2.0, © RICOS Co. Ltd., https://github.com/ricosjp/truck)@@ -31,7 +31,7 @@ Changes:## truck-stepio 0.3.0 (Apache-2.0, © RICOS Co. Ltd., https://github.com/ricosjp/truck)-Only the writer (`out`) is used; SolveCraft reads STEP with its own reader.+Only the writer (`out`) is used; SolidCraft reads STEP with its own reader.Changes:- `out/geometry.rs`: an `INTERSECTION_CURVE`'s second surface was written at the firstdiff --git a/vendor/matext4cgmath/src/lib.rs b/vendor/matext4cgmath/src/lib.rsindex 08c8d2a22c..f2a4d1d671 100644--- a/vendor/matext4cgmath/src/lib.rs+++ b/vendor/matext4cgmath/src/lib.rs@@ -1,6 +1,6 @@//! Unofficial third-party cgmath extensions for calculate eigenvalues, operator norms and Iwasawa decomposition.-// SolveCraft: compiler warnings no longer fail the build.+// SolidCraft: compiler warnings no longer fail the build.#![deny(clippy::all, rust_2018_idioms)]#![warn(missing_docs,diff --git a/vendor/matext4cgmath/src/solver.rs b/vendor/matext4cgmath/src/solver.rsindex 8713ce3dc5..43b30abb8d 100644--- a/vendor/matext4cgmath/src/solver.rs+++ b/vendor/matext4cgmath/src/solver.rs@@ -92,7 +92,7 @@ pub fn pre_solve_cubic<F: BaseFloat>(p: F, q: F) -> [Complex<F>; 3] {res.iter_mut().for_each(|x| {let mut f = *x * *x * *x + *x * p + q;let mut f_prime = *x * *x * three + p;- // SolveCraft: at most 100 steps. Near a double root (the eigenvalues of a+ // SolidCraft: at most 100 steps. Near a double root (the eigenvalues of a// translation matrix) the iteration can cycle forever without meeting the tolerance.let mut steps = 0;while f.norm() > eps_2 * f_prime.norm() && steps < 100 {@@ -193,7 +193,7 @@ pub fn pre_solve_quartic<F: BaseFloat>(p: F, q: F, r: F) -> [Complex<F>; 4] {res.iter_mut().for_each(|x| {let mut f = *x * *x * *x * *x + *x * *x * p + *x * q + r;let mut f_prime = *x * *x * *x * four + *x * p * two + q;- // SolveCraft: at most 100 steps. Near a double root (the eigenvalues of a+ // SolidCraft: at most 100 steps. Near a double root (the eigenvalues of a// translation matrix) the iteration can cycle forever without meeting the tolerance.let mut steps = 0;while f.norm() > eps_2 * f_prime.norm() && steps < 100 {diff --git a/vendor/truck-meshalgo/src/lib.rs b/vendor/truck-meshalgo/src/lib.rsindex 797256171d..a7f0f06a35 100644--- a/vendor/truck-meshalgo/src/lib.rs+++ b/vendor/truck-meshalgo/src/lib.rs@@ -1,6 +1,6 @@//! Mesh algorigthms, include tessellations of the shape.-// SolveCraft: compiler warnings no longer fail the build.+// SolidCraft: compiler warnings no longer fail the build.#![deny(clippy::all, rust_2018_idioms)]#![warn(missing_docs,diff --git a/vendor/truck-meshalgo/src/tessellation/triangulation.rs b/vendor/truck-meshalgo/src/tessellation/triangulation.rsindex 7a09c452a0..8b7d05337b 100644--- a/vendor/truck-meshalgo/src/tessellation/triangulation.rs+++ b/vendor/truck-meshalgo/src/tessellation/triangulation.rs@@ -20,7 +20,7 @@ pub(super) trait SP<S>:}impl<S, F> SP<S> for F where F: Fn(&S, Point3, Option<(f64, f64)>) -> Option<(f64, f64)> + Parallelizable {}-/// SolveCraft: a parameter inside the surface's bounded, non-periodic ranges.+/// SolidCraft: a parameter inside the surface's bounded, non-periodic ranges.fn in_domain<S: ParametricSurface>(surface: &S, (u, v): (f64, f64)) -> bool {let ok = |x: f64, range: Option<(f64, f64)>, period: Option<f64>| {x.is_finite()@@ -36,7 +36,7 @@ fn in_domain<S: ParametricSurface>(surface: &S, (u, v): (f64, f64)) -> bool {ok(u, ur, surface.u_period()) && ok(v, vr, surface.v_period())}-/// SolveCraft: the parameter clamped into the surface's bounded, non-periodic ranges.+/// SolidCraft: the parameter clamped into the surface's bounded, non-periodic ranges.fn clamped<S: ParametricSurface>(surface: &S, (u, v): (f64, f64)) -> (f64, f64) {let c = |x: f64, range: Option<(f64, f64)>, period: Option<f64>| match (range, period) {(Some((a, b)), None) => x.clamp(a.min(b), a.max(b)),@@ -46,7 +46,7 @@ fn clamped<S: ParametricSurface>(surface: &S, (u, v): (f64, f64)) -> (f64, f64)(c(u, ur, surface.u_period()), c(v, vr, surface.v_period()))}-/// SolveCraft: a nearest-parameter search can run off a B-spline's domain and extrapolate to+/// SolidCraft: a nearest-parameter search can run off a B-spline's domain and extrapolate to/// thousands of parameter units (meshing that grid never finishes). Outside the nominal domain/// keep the result only if it is really closer to the point than the clamped one (planes report/// a nominal unit range but extend for ever).@@ -260,7 +260,7 @@ fn shell_create_polygon<S: PreMeshableSurface>(let boundary = PolyBoundary::new(preboundary?, &surface, tol);Some(trimming_tessellation(surface, &boundary, tol, cap))})();- // SolveCraft: faces with seam edges (a loop running along an edge both ways, as STEP+ // SolidCraft: faces with seam edges (a loop running along an edge both ways, as STEP// writes cylinders) are valid here; `debug_new` asserts simple loops in debug builds.let mut new_face = Face::new_unchecked(wires, polygon);if !orientation {@@ -344,7 +344,7 @@ fn get_mindiff(u: f64, u0: f64, up: f64) -> f64 {(-2..=2).map(closure).min_by(abs_diff(u0)).unwrap()}-/// SolveCraft: the second field holds each loop's parameter box, so `include` skips loops that+/// SolidCraft: the second field holds each loop's parameter box, so `include` skips loops that/// cannot hold the point (a face with hundreds of holes meshed in quadratic time).#[derive(Debug, Default, Clone)]struct PolyBoundary(Vec<Vec<Point2>>, Vec<BoundingBox<Point2>>);@@ -495,7 +495,7 @@ impl PolyBoundary {fn include(&self, c: Point2) -> bool {let t = 2.0 * std::f64::consts::PI * HashGen::hash1(c);let r = Vector2::new(f64::cos(t), f64::sin(t));- // SolveCraft: a closed loop whose box is clear of `c` winds zero times around it, and+ // SolidCraft: a closed loop whose box is clear of `c` winds zero times around it, and// no crossing with it lies within the tolerance of `c`: it changes nothing here.let margin = 2.0 * TOLERANCE;let near = |bdb: &BoundingBox<Point2>| {@@ -642,19 +642,19 @@ fn insert_surface(});}-/// SolveCraft: most grid points a face gets (keeps hostile or huge faces bounded).+/// SolidCraft: most grid points a face gets (keeps hostile or huge faces bounded).pub(super) const MAX_GRID: usize = 150_000;-/// SolveCraft: grid points shared by all faces of one shell; many faces get fewer each.+/// SolidCraft: grid points shared by all faces of one shell; many faces get fewer each.pub(super) const SHELL_GRID_BUDGET: usize = 10_000_000;-/// SolveCraft: most points on one edge's polyline.+/// SolidCraft: most points on one edge's polyline.const MAX_EDGE_POINTS: usize = 20_000;-/// SolveCraft: the grid budget of each face of a shell with `faces` faces.+/// SolidCraft: the grid budget of each face of a shell with `faces` faces.pub(super) fn face_cap(faces: usize) -> usize {(SHELL_GRID_BUDGET / faces.max(1)).clamp(2_000, MAX_GRID)}-/// SolveCraft: truck's curve division, bounded: at most `MAX_EDGE_POINTS` points and a+/// SolidCraft: truck's curve division, bounded: at most `MAX_EDGE_POINTS` points and a/// bisection depth of 24; a midpoint that does not evaluate (NaN) counts as flat (truck's/// version recursed on it 100 levels deep, which never finishes).fn bounded_polyline<C: PolylineableCurve>(curve: &C, range: (f64, f64), tol: f64) -> PolylineCurve {@@ -679,7 +679,7 @@ fn bounded_polyline<C: PolylineableCurve>(curve: &C, range: (f64, f64), tol: f64PolylineCurve(out)}-/// SolveCraft: truck's surface division, bounded: stops refining when the grid would exceed+/// SolidCraft: truck's surface division, bounded: stops refining when the grid would exceed/// `cap` points or after 24 rounds; cells that do not evaluate (NaN) are not refined.fn bounded_surface_division<S: PreMeshableSurface>(surface: &S, (ur, vr): ((f64, f64), (f64, f64)), tol: f64, cap: usize) -> (Vec<f64>, Vec<f64>) {let (mut udiv, mut vdiv) = (vec![ur.0, ur.1], vec![vr.0, vr.1]);@@ -739,7 +739,7 @@ fn bounded_surface_division<S: PreMeshableSurface>(surface: &S, (ur, vr): ((f64,(udiv, vdiv)}-/// SolveCraft: refine the parameter grid so its cells are not much longer in one direction than+/// SolidCraft: refine the parameter grid so its cells are not much longer in one direction than/// the other. A ruled surface (cylinder, cone) needs no division along its rulings, and the/// triangles that then join a trimming loop to the far ends of the grid cut through the/// surface (a cylinder with a hole lost volume this way).diff --git a/vendor/truck-shapeops/src/lib.rs b/vendor/truck-shapeops/src/lib.rsindex 89277a7686..753309c678 100644--- a/vendor/truck-shapeops/src/lib.rs+++ b/vendor/truck-shapeops/src/lib.rs@@ -1,6 +1,6 @@//! Crate for operationg shapes. Provides boolean operations to Solid, and shape healing for importing shapes from other CAD systems.-// SolveCraft: warnings are not errors in the vendored copy (newer compilers flag more).+// SolidCraft: warnings are not errors in the vendored copy (newer compilers flag more).#![allow(dead_code)]#![warn(clippy::all, rust_2018_idioms)]#![warn(@@ -14,7 +14,7 @@unused_qualifications)]-/// SolveCraft: report where an operation gives up (set `SHAPEOPS_TRACE`).+/// SolidCraft: report where an operation gives up (set `SHAPEOPS_TRACE`).macro_rules! tr {($e:expr, $tag:expr) => {match $e {@@ -37,7 +37,7 @@ pub use transversal::{and, and_with_history, or, or_with_history, EdgeOrigin, FaceIndex, FaceOrigin, History, ShapeOpsCurve,ShapeOpsSurface,};-// SolveCraft: exercised by kernel regressions in the workspace CI.+// SolidCraft: exercised by kernel regressions in the workspace CI.#[doc(hidden)]pub use transversal::IntersectionCurveWithParameters;mod alternative;diff --git a/vendor/truck-shapeops/src/transversal/divide_face/mod.rs b/vendor/truck-shapeops/src/transversal/divide_face/mod.rsindex 4b1b176151..75c2a77486 100644--- a/vendor/truck-shapeops/src/transversal/divide_face/mod.rs+++ b/vendor/truck-shapeops/src/transversal/divide_face/mod.rs@@ -21,7 +21,7 @@ where{let surface = face.surface();let pt = wire.front_vertex().unwrap().point();- // SolveCraft: intersection-curve points lie on the surface only within the tolerance; fall+ // SolidCraft: intersection-curve points lie on the surface only within the tolerance; fall// back to the nearest parameter when the exact search fails.let p: Point2 = surface.search_parameter(pt, None, 100)@@ -87,7 +87,7 @@ where}negative_wires.into_iter().try_for_each(|chunk| {let pt = chunk.poly.front();- // SolveCraft: the innermost piece that holds the loop (nested intersection loops, such+ // SolidCraft: the innermost piece that holds the loop (nested intersection loops, such// as both walls of a tube crossing one face), never the loop's own twin.let hole = -chunk.poly.area();let op = crate::tr!(diff --git a/vendor/truck-shapeops/src/transversal/faces_classification/mod.rs b/vendor/truck-shapeops/src/transversal/faces_classification/mod.rsindex 6d69b70dd5..fddc201f86 100644--- a/vendor/truck-shapeops/src/transversal/faces_classification/mod.rs+++ b/vendor/truck-shapeops/src/transversal/faces_classification/mod.rs@@ -26,7 +26,7 @@ impl<P, C, S> FacesClassification<P, C, S> {pub fn and_or_unknown(&self) -> [Shell<P, C, S>; 3] {let [mut and, mut or, mut unknown] = <[Shell<P, C, S>; 3]>::default();for face in &self.shell {- // SolveCraft: no panics (wasm can't catch them).+ // SolidCraft: no panics (wasm can't catch them).match self.status.get(&face.id()) {Some(ShapesOpStatus::And) => and.push(face.clone()),Some(ShapesOpStatus::Or) => or.push(face.clone()),diff --git a/vendor/truck-shapeops/src/transversal/history.rs b/vendor/truck-shapeops/src/transversal/history.rsindex 33dadcba0b..e25bdbb90a 100644--- a/vendor/truck-shapeops/src/transversal/history.rs+++ b/vendor/truck-shapeops/src/transversal/history.rs@@ -1,4 +1,4 @@-//! SolveCraft: where each face and edge of a boolean's result came from, recorded by the code+//! SolidCraft: where each face and edge of a boolean's result came from, recorded by the code//! that builds them (never reconstructed from geometry).//!//! Topology ids are addresses of shared data, so they identify a face or an edge only while itdiff --git a/vendor/truck-shapeops/src/transversal/integrate/mod.rs b/vendor/truck-shapeops/src/transversal/integrate/mod.rsindex 7f64a2ddf0..d5252a477d 100644--- a/vendor/truck-shapeops/src/transversal/integrate/mod.rs+++ b/vendor/truck-shapeops/src/transversal/integrate/mod.rs@@ -55,7 +55,7 @@ fn process_one_pair_of_shells<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(lineage: &mut Lineage<C, S>,) -> Option<[Shell<Point3, C, S>; 2]> {nonpositive_tolerance!(tol);- // SolveCraft: robust meshing (boundaries from earlier operations lie on surfaces only+ // SolidCraft: robust meshing (boundaries from earlier operations lie on surfaces only// within tolerance).let poly_shell0 = shell0.robust_triangulation(tol);let poly_shell1 = shell1.robust_triangulation(tol);@@ -70,7 +70,7 @@ fn process_one_pair_of_shells<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(cls1.integrate_by_component();let [mut and0, mut or0, unknown0] = cls0.and_or_unknown();unknown0.into_iter().try_for_each(|face| {- // SolveCraft: no panics (wasm can't catch them).+ // SolidCraft: no panics (wasm can't catch them).let pt = face.boundaries().first()?.vertex_iter().next()?.point();let dir = hash::take_one_unit(pt);let count = poly_shell1.iter().try_fold(0, |count, face| {@@ -86,7 +86,7 @@ fn process_one_pair_of_shells<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(})?;let [mut and1, mut or1, unknown1] = cls1.and_or_unknown();unknown1.into_iter().try_for_each(|face| {- // SolveCraft: no panics (wasm can't catch them).+ // SolidCraft: no panics (wasm can't catch them).let pt = face.boundaries().first()?.vertex_iter().next()?.point();let dir = hash::take_one_unit(pt);let count = poly_shell0.iter().try_fold(0, |count, face| {@@ -123,7 +123,7 @@ pub fn or<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(boolean(solid0, solid1, tol, |[_, or]| or).map(|(solid, _)| solid)}-/// SolveCraft: AND operation between two solids, with where each face and edge of the result+/// SolidCraft: AND operation between two solids, with where each face and edge of the result/// came from (operand 0 is `solid0`, operand 1 is `solid1`): the same result as [`and`], and/// its history, `None` when a face or edge of it was not recorded. The operands must not share/// faces or edges.@@ -135,7 +135,7 @@ pub fn and_with_history<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(boolean(solid0, solid1, tol, |[and, _]| and)}-/// SolveCraft: OR operation between two solids, with where each face and edge of the result+/// SolidCraft: OR operation between two solids, with where each face and edge of the result/// came from (operand 0 is `solid0`, operand 1 is `solid1`): the same result as [`or`], and/// its history, `None` when a face or edge of it was not recorded. The operands must not share/// faces or edges.@@ -170,7 +170,7 @@ fn boolean<C: ShapeOpsCurve<S>, S: ShapeOpsSurface>(Some((solid, history))}-// SolveCraft: truck's connected components come out in hash order of face addresses, so the+// SolidCraft: truck's connected components come out in hash order of face addresses, so the// result's face order changed from run to run. Keep the shell's own order instead.fn components_in_order<C, S>(shell: &Shell<Point3, C, S>) -> Vec<Shell<Point3, C, S>> {let pos: rustc_hash::FxHashMap<_, usize> = shell.face_iter().enumerate().map(|(i, f)| (f.id(), i)).collect();diff --git a/vendor/truck-shapeops/src/transversal/integrate/tests.rs b/vendor/truck-shapeops/src/transversal/integrate/tests.rsindex 2e033ad596..2d1ecaf9f6 100644--- a/vendor/truck-shapeops/src/transversal/integrate/tests.rs+++ b/vendor/truck-shapeops/src/transversal/integrate/tests.rs@@ -20,7 +20,7 @@ fn punched_cube() {obj::write(&poly, file).unwrap();}-// SolveCraft: boolean history.+// SolidCraft: boolean history.use crate::{EdgeOrigin, FaceIndex, History};diff --git a/vendor/truck-shapeops/src/transversal/intersection_curve/mod.rs b/vendor/truck-shapeops/src/transversal/intersection_curve/mod.rsindex 203d68de3d..e4e006ce30 100644--- a/vendor/truck-shapeops/src/transversal/intersection_curve/mod.rs+++ b/vendor/truck-shapeops/src/transversal/intersection_curve/mod.rs@@ -19,14 +19,14 @@ impl<S> From<IntersectionCurveWithParameters<S>> for IntersectionCurve<PolylineCimpl<S> IntersectionCurveWithParameters<S>where S: ParametricSurface3D + SearchNearestParameter<D2, Point = Point3>{- /// SolveCraft: construct a projected curve, returning `None` for degenerate input.+ /// SolidCraft: construct a projected curve, returning `None` for degenerate input.pub fn try_new(surface0: S,surface1: S,poly: PolylineCurve<Point3>,tol: f64,) -> Option<Self> {- // SolveCraft: a point contact is not a curve. Reject it before indexing the+ // SolidCraft: a point contact is not a curve. Reject it before indexing the// endpoints, and reject collapsed/non-finite segments before normalizing.if poly.len() < 2 || poly.windows(2).any(|p| {let length2 = (p[1] - p[0]).magnitude2();diff --git a/vendor/truck-shapeops/src/transversal/loops_store/mod.rs b/vendor/truck-shapeops/src/transversal/loops_store/mod.rsindex a8339675bb..9ae116fa53 100644--- a/vendor/truck-shapeops/src/transversal/loops_store/mod.rs+++ b/vendor/truck-shapeops/src/transversal/loops_store/mod.rs@@ -173,7 +173,7 @@ impl<P: Copy, C: Clone> Loops<P, C> {})}- // SolveCraft: `replaced(old, new)` is told of every edge rebuilt on the new vertex.+ // SolidCraft: `replaced(old, new)` is told of every edge rebuilt on the new vertex.fn change_vertex(&mut self,old_vertex: &Vertex<P>,diff --git a/vendor/truck-shapeops/src/transversal/mod.rs b/vendor/truck-shapeops/src/transversal/mod.rsindex 1d661fedce..1778ad6ac2 100644--- a/vendor/truck-shapeops/src/transversal/mod.rs+++ b/vendor/truck-shapeops/src/transversal/mod.rs@@ -3,7 +3,7 @@ mod faces_classification;mod history;mod integrate;mod intersection_curve;-// SolveCraft: expose the constructor for workspace regression coverage of the vendored fix.+// SolidCraft: expose the constructor for workspace regression coverage of the vendored fix.#[doc(hidden)]pub use intersection_curve::IntersectionCurveWithParameters;mod loops_store;diff --git a/vendor/truck-stepio/src/lib.rs b/vendor/truck-stepio/src/lib.rsindex 2bde80e537..3c27350182 100644--- a/vendor/truck-stepio/src/lib.rs+++ b/vendor/truck-stepio/src/lib.rs@@ -6,7 +6,7 @@//! Shapes created by set operations cannot be output yet.//! Input will come further down the road.-// SolveCraft: compiler warnings no longer fail the build.+// SolidCraft: compiler warnings no longer fail the build.#![deny(clippy::all, rust_2018_idioms)]#![warn(missing_docs,diff --git a/vendor/truck-stepio/src/out/geometry.rs b/vendor/truck-stepio/src/out/geometry.rsindex 89be913999..293cdfa5eb 100644--- a/vendor/truck-stepio/src/out/geometry.rs+++ b/vendor/truck-stepio/src/out/geometry.rs@@ -364,7 +364,7 @@ where))?;self.leader().fmt(curve_idx, f)?;self.surface0().fmt(surface0_idx, f)?;- // SolveCraft: the second surface was written at the first one's index (duplicate ids).+ // SolidCraft: the second surface was written at the first one's index (duplicate ids).self.surface1().fmt(surface1_idx, f)}}@@ -773,7 +773,7 @@ impl<C: StepLength> StepLength for Processor<RevolutedCurve<C>, Matrix4> {fn step_length(&self) -> usize { self.entity().step_length() }}-// SolveCraft: the written surface revolves the transformed profile about the transformed+// SolidCraft: the written surface revolves the transformed profile about the transformed// axis; a mirroring transform reverses the turn, and with it the normal (was `!orientation`,// right only without mirroring). The STEP normal is the opposite of truck's (see above).impl<C> StepSurface for Processor<RevolutedCurve<C>, Matrix4> {@@ -803,7 +803,7 @@ impl StepLength for ModelingSurface {}}-// SolveCraft: was the default (`true`), which dropped an inverted revolution's orientation.+// SolidCraft: was the default (`true`), which dropped an inverted revolution's orientation.impl StepSurface for ModelingSurface {fn same_sense(&self) -> bool {match self {diff --git a/xtask/src/book.rs b/xtask/src/book.rsindex 5894a56fba..3a243e87ec 100644--- a/xtask/src/book.rs+++ b/xtask/src/book.rs@@ -1,8 +1,8 @@//! `cargo xtask book`: generate the book's command reference and screenshots, then build it.//!//! The command reference (`docs/book/src/reference/commands.md`) comes from-//! `solvecraft-cli commands`, so it can't drift from the registry. The screenshots in-//! `docs/book/src/generated/` are CPU renders by `solvecraft-cli snapshot` of `examples/*.json`+//! `solidcraft-cli commands`, so it can't drift from the registry. The screenshots in+//! `docs/book/src/generated/` are CPU renders by `solidcraft-cli snapshot` of `examples/*.json`//! and `docs/book/scripts/*.json`, plus the app screenshot from `docs/screenshots/`. Both are//! gitignored and attributed in ATTRIBUTION.md. The book itself is built by `mdbook` (a separate//! tool, not a dependency) into `target/book`.@@ -23,9 +23,9 @@ pub fn run(root: &Path, build: bool) -> Result<(), String> {c.args(["build", "-q", "--release", "-p", "solidcraft-cli"]);crate::run(c, "cargo build -p solidcraft-cli")?;- let out = cli().arg("commands").output().map_err(|e| format!("solvecraft-cli: {e}"))?;+ let out = cli().arg("commands").output().map_err(|e| format!("solidcraft-cli: {e}"))?;if !out.status.success() {- return Err(format!("solvecraft-cli commands failed:\n{}", String::from_utf8_lossy(&out.stderr)));+ return Err(format!("solidcraft-cli commands failed:\n{}", String::from_utf8_lossy(&out.stderr)));}let cmds: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("commands JSON: {e}"))?;let md = reference(cmds.as_array().map(Vec::as_slice).unwrap_or_default());@@ -40,7 +40,7 @@ pub fn run(root: &Path, build: bool) -> Result<(), String> {let png = gen_dir.join(format!("{stem}.png"));let mut c = cli();c.arg("snapshot").arg(s).arg("--out").arg(&png).args(["--width", SNAPSHOT_SIZE.0, "--height", SNAPSHOT_SIZE.1]);- let o = c.output().map_err(|e| format!("solvecraft-cli snapshot: {e}"))?;+ let o = c.output().map_err(|e| format!("solidcraft-cli snapshot: {e}"))?;if !o.status.success() {return Err(format!("snapshot of {} failed:\n{}", s.display(), String::from_utf8_lossy(&o.stderr)));}@@ -58,7 +58,7 @@ pub fn run(root: &Path, build: bool) -> Result<(), String> {Ok(())}-/// The release solvecraft-cli just built.+/// The release solidcraft-cli just built.fn cli() -> std::process::Command {let mut c = cargo();c.args(["run", "-q", "--release", "-p", "solidcraft-cli", "--"]);@@ -83,8 +83,8 @@ fn json_files(dir: &Path) -> Result<Vec<std::path::PathBuf>, String> {fn reference(cmds: &[Value]) -> String {let s = |c: &Value, k: &str| c[k].as_str().unwrap_or_default().to_string();let mut md = format!(- "# Command reference\n\nGenerated by `cargo xtask book` from `solvecraft-cli commands` ({} commands). Every command runs the same \- way from the toolbar, a script, `solvecraft-cli exec <id> '<json>'`, the control channel and MCP. Parameters marked `?` are \+ "# Command reference\n\nGenerated by `cargo xtask book` from `solidcraft-cli commands` ({} commands). Every command runs the same \+ way from the toolbar, a script, `solidcraft-cli exec <id> '<json>'`, the control channel and MCP. Parameters marked `?` are \optional; `expr` is a number or an expression with units.\n",cmds.len());diff --git a/xtask/src/features.rs b/xtask/src/features.rsindex de866c7188..3eea96efe1 100644--- a/xtask/src/features.rs+++ b/xtask/src/features.rs@@ -2,7 +2,7 @@//!//! The page lists every registered command by area (the first part of its dotted id), with its//! label, id and toolbar place. It comes only from SolidCraft's command registry-//! (`solvecraft-cli commands`), so it can't drift from what the program does; it compares with+//! (`solidcraft-cli commands`), so it can't drift from what the program does; it compares with//! nothing else.use std::path::Path;@@ -32,9 +32,9 @@ pub fn run(root: &Path) -> Result<(), String> {let out = crate::cargo().args(["run", "-q", "--release", "-p", "solidcraft-cli", "--", "commands"]).output()- .map_err(|e| format!("solvecraft-cli: {e}"))?;+ .map_err(|e| format!("solidcraft-cli: {e}"))?;if !out.status.success() {- return Err(format!("solvecraft-cli commands failed:\n{}", String::from_utf8_lossy(&out.stderr)));+ return Err(format!("solidcraft-cli commands failed:\n{}", String::from_utf8_lossy(&out.stderr)));}let cmds: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("commands JSON: {e}"))?;let list = cmds.as_array().map(Vec::as_slice).unwrap_or_default();@@ -61,8 +61,8 @@ pub fn page(cmds: &[Value]) -> String {}let mut md = format!("# Features\n\nSolidCraft's commands by area, generated by `cargo xtask features` from the command registry \- (`solvecraft-cli commands`). **{} commands.** Every command runs the same way from the toolbar, a script, \- `solvecraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the \+ (`solidcraft-cli commands`). **{} commands.** Every command runs the same way from the toolbar, a script, \+ `solidcraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the \[command reference](book/src/reference/commands.md) (`cargo xtask book`). Status and plans: [ROADMAP](../ROADMAP.md).\n",cmds.len());diff --git a/xtask/src/layers.rs b/xtask/src/layers.rsindex 559cbb03e3..3d5df57543 100644--- a/xtask/src/layers.rs+++ b/xtask/src/layers.rs@@ -32,7 +32,7 @@ impl Class {}}-/// The layering table. Names are package names without the `solvecraft-`+/// The layering table. Names are package names without the `solidcraft-`/// prefix.pub const TABLE: &[(&str, Class)] = &[("geom", Class::Layer(0)),@@ -47,7 +47,7 @@ pub const TABLE: &[(&str, Class)] = &[("testkit", Class::Testkit),// apps and tooling("solidcraft", Class::Exempt),- ("solidcraft-cli", Class::Exempt),+ ("cli", Class::Exempt),("web", Class::Exempt),("xtask", Class::Exempt),];@@ -71,7 +71,7 @@ pub const UI_CRATES: &[&str] = &["egui", "eframe", "egui-wgpu", "wgpu", "winit",pub const UI_MIN_LAYER: u8 = 5;pub fn short_name(pkg: &str) -> &str {- pkg.strip_prefix("solvecraft-").unwrap_or(pkg)+ pkg.strip_prefix("solidcraft-").unwrap_or(pkg)}pub fn classify(pkg: &str) -> Option<Class> {@@ -129,7 +129,7 @@ impl std::fmt::Display for Violation {write!(f, "{krate}: standalone crate must not depend on workspace crate {dep}")}Violation::TestkitAsNormalDep { krate } => {- write!(f, "{krate}: solvecraft-testkit may only be a dev-dependency")+ write!(f, "{krate}: solidcraft-testkit may only be a dev-dependency")}Violation::UiBelowL5 { krate, dep, layer } => {write!(f, "{krate} (L{layer}) depends on UI crate `{dep}`; UI toolkits are only allowed in L5+")@@ -236,67 +236,67 @@ mod tests {#[test]fn clean_downward_graph_passes() {let g = [- c("solvecraft-geom", &[("kurbo", Normal, false)]),- c("solvecraft-doc", &[("solvecraft-geom", Normal, true)]),- c("solvecraft-engine", &[("solvecraft-doc", Normal, true), ("solvecraft-testkit", Dev, true)]),- c("solvecraft-ui-egui", &[("solvecraft-engine", Normal, true), ("egui", Normal, false)]),- c("solidcraft-cli", &[("solvecraft-ui-egui", Normal, true)]),+ c("solidcraft-geom", &[("kurbo", Normal, false)]),+ c("solidcraft-doc", &[("solidcraft-geom", Normal, true)]),+ c("solidcraft-engine", &[("solidcraft-doc", Normal, true), ("solidcraft-testkit", Dev, true)]),+ c("solidcraft-ui-egui", &[("solidcraft-engine", Normal, true), ("egui", Normal, false)]),+ c("solidcraft-cli", &[("solidcraft-ui-egui", Normal, true)]),];assert!(check(&g).is_empty(), "{:?}", check(&g));}#[test]fn upward_dependency_flagged() {- let v = check(&[c("solvecraft-doc", &[("solvecraft-engine", Normal, true)])]);+ let v = check(&[c("solidcraft-doc", &[("solidcraft-engine", Normal, true)])]);assert!(matches!(v[..], [Violation::Upward { from: 2, to: 4, .. }]));}#[test]fn sideways_dependency_flagged() {- let v = check(&[c("solvecraft-kernel", &[("solvecraft-sketch", Normal, true)])]);+ let v = check(&[c("solidcraft-kernel", &[("solidcraft-sketch", Normal, true)])]);assert!(matches!(v[..], [Violation::Upward { from: 1, to: 1, .. }]));}#[test]fn self_dev_dependency_ignored() {- assert!(check(&[c("solvecraft-doc", &[("solvecraft-doc", Dev, true)])]).is_empty());+ assert!(check(&[c("solidcraft-doc", &[("solidcraft-doc", Dev, true)])]).is_empty());}#[test]fn upward_dev_dependency_flagged() {- let v = check(&[c("solvecraft-geom", &[("solvecraft-doc", Dev, true)])]);+ let v = check(&[c("solidcraft-geom", &[("solidcraft-doc", Dev, true)])]);assert!(matches!(v[..], [Violation::Upward { kind: Dev, .. }]));}#[test]fn ui_crates_below_l6_flagged() {for dep in ["egui", "eframe", "winit", "egui_kittest", "rfd", "bevy_ecs", "bevy"] {- let v = check(&[c("solvecraft-engine", &[(dep, Normal, false)])]);+ let v = check(&[c("solidcraft-engine", &[(dep, Normal, false)])]);assert!(matches!(v[..], [Violation::UiBelowL5 { layer: 4, .. }]), "{dep}");}- assert!(check(&[c("solvecraft-engine", &[("egui_extras_not", Normal, false)])]).is_empty());- assert!(check(&[c("solvecraft-ui-egui", &[("winit", Normal, false)])]).is_empty());+ assert!(check(&[c("solidcraft-engine", &[("egui_extras_not", Normal, false)])]).is_empty());+ assert!(check(&[c("solidcraft-ui-egui", &[("winit", Normal, false)])]).is_empty());}#[test]fn unregistered_crate_is_error() {- let v = check(&[c("solvecraft-mystery", &[])]);- assert!(matches!(&v[..], [Violation::Unregistered { krate }] if krate == "solvecraft-mystery"));+ let v = check(&[c("solidcraft-mystery", &[])]);+ assert!(matches!(&v[..], [Violation::Unregistered { krate }] if krate == "solidcraft-mystery"));assert!(v[0].to_string().contains("register"));}#[test]fn testkit_only_as_dev_dependency() {- let v = check(&[c("solvecraft-doc", &[("solvecraft-testkit", Normal, true)])]);+ let v = check(&[c("solidcraft-doc", &[("solidcraft-testkit", Normal, true)])]);assert!(matches!(v[..], [Violation::TestkitAsNormalDep { .. }]));- assert!(check(&[c("solvecraft-doc", &[("solvecraft-testkit", Dev, true)])]).is_empty());- assert!(check(&[c("solvecraft-testkit", &[("solvecraft-engine", Normal, true)])]).is_empty());+ assert!(check(&[c("solidcraft-doc", &[("solidcraft-testkit", Dev, true)])]).is_empty());+ assert!(check(&[c("solidcraft-testkit", &[("solidcraft-engine", Normal, true)])]).is_empty());}#[test]fn apps_and_xtask_exempt() {for app in ["solidcraft", "solidcraft-cli", "xtask"] {- assert!(check(&[c(app, &[("egui", Normal, false), ("solvecraft-ui-egui", Normal, true)])]).is_empty());+ assert!(check(&[c(app, &[("egui", Normal, false), ("solidcraft-ui-egui", Normal, true)])]).is_empty());}}@@ -304,17 +304,17 @@ mod tests {fn metadata_parsing() {let meta: Value = serde_json::from_str(r#"{"packages":[- {"name":"solvecraft-doc","dependencies":[- {"name":"solvecraft-geom","kind":null,"path":"/x/crates/geom"},+ {"name":"solidcraft-doc","dependencies":[+ {"name":"solidcraft-geom","kind":null,"path":"/x/crates/geom"},{"name":"serde","kind":null},{"name":"proptest","kind":"dev"}]},- {"name":"solvecraft-geom","dependencies":[]}+ {"name":"solidcraft-geom","dependencies":[]}]}"#,).unwrap();let g = from_metadata(&meta).unwrap();assert_eq!(g.len(), 2);- let doc = g.iter().find(|c| c.name == "solvecraft-doc").unwrap();+ let doc = g.iter().find(|c| c.name == "solidcraft-doc").unwrap();assert!(doc.deps[0].workspace && !doc.deps[1].workspace);assert_eq!(doc.deps[2].kind, Dev);assert!(check(&g).is_empty());diff --git a/xtask/src/licences.rs b/xtask/src/licences.rsindex 1a74b0de92..691ef50eff 100644--- a/xtask/src/licences.rs+++ b/xtask/src/licences.rs@@ -1,7 +1,7 @@//! `cargo xtask licences [--check]`: THIRD-PARTY-LICENSES.txt, the licences of every crate built-//! into the shipped programs (solvecraft, solvecraft-cli, solvecraft-web), read from+//! into the shipped programs (solidcraft, solidcraft-cli, solidcraft-web), read from//! `cargo metadata` and the crates' own licence files. The programs embed it (Help ▸ About ▸-//! Licences, `solvecraft-cli licences`), so a release download needs no licence files beside it.+//! Licences, `solidcraft-cli licences`), so a release download needs no licence files beside it.//! `--check` (part of `cargo xtask ci`) fails when the committed file is out of date, e.g. after a//! dependency changed.@@ -13,7 +13,7 @@ use serde_json::Value;use crate::cargo;pub const FILE: &str = "THIRD-PARTY-LICENSES.txt";-const ROOTS: &[&str] = &["solidcraft", "solidcraft-cli", "solvecraft-web"];+const ROOTS: &[&str] = &["solidcraft", "solidcraft-cli", "solidcraft-web"];pub fn run(root: &Path, check: bool) -> Result<(), String> {let text = generate(root)?;@@ -119,7 +119,7 @@ fn licence_files(dir: &Path, p: &Value) -> Vec<(String, String)> {fn render(root: &Path, crates: &[Crate]) -> String {let rule = "=".repeat(80);let mut out = format!(- "Third-party software in SolidCraft\n\nSolidCraft (the desktop app, solvecraft-cli and the web app) is built from the {} crates below.\n\+ "Third-party software in SolidCraft\n\nSolidCraft (the desktop app, solidcraft-cli and the web app) is built from the {} crates below.\n\Generated by `cargo xtask licences` from Cargo.lock and the crates' own licence files.\n\SolidCraft's own licence is in LICENSE-MIT and LICENSE-APACHE, and NOTICE.\n\n",crates.len()@@ -165,11 +165,11 @@ fn render(root: &Path, crates: &[Crate]) -> String {- LiberationSans-Regular.ttf (crates/sketch/fonts/LiberationSans-Regular.ttf)\n \Copyright 2012 Red Hat, Inc. (Liberation Fonts 2.x; digitized data Google)\n \Source: https://github.com/liberationfonts\n\n\- - BIZUDPGothic-Regular.ttf (apps/solvecraft-web/fonts/BIZUDPGothic-Regular.ttf)\n \+ - BIZUDPGothic-Regular.ttf (apps/solidcraft-web/fonts/BIZUDPGothic-Regular.ttf)\n \Copyright 2022 The BIZ UDGothic Project Authors (https://github.com/googlefonts/morisawa-biz-ud-mincho)\n \Source: https://github.com/googlefonts/morisawa-biz-ud-gothic\n\n");- let ofl_path = root.join("apps/solvecraft-web/fonts/OFL.txt");+ let ofl_path = root.join("apps/solidcraft-web/fonts/OFL.txt");let fallback_path = root.join("crates/sketch/fonts/OFL.txt");let ofl_text = std::fs::read_to_string(&ofl_path).or_else(|_| std::fs::read_to_string(&fallback_path)).unwrap_or_default();let ofl_clean = ofl_text.replace("\r\n", "\n").trim().to_string();diff --git a/xtask/src/main.rs b/xtask/src/main.rsindex d29a182367..6fea98e090 100644--- a/xtask/src/main.rs+++ b/xtask/src/main.rs@@ -22,7 +22,7 @@ commands:features list SolidCraft's commands by area in docs/features.md (from the registry)oracle [--cli BIN]replay the reference tests (tests/oracle/*/recipe.json), compare with each- case's expected.json and write docs/oracle.md (--cli: a solvecraft-cli+ case's expected.json and write docs/oracle.md (--cli: a solidcraft-clialready built, instead of cargo run --release)book [--no-build]generate docs/book's command reference and screenshots, then mdbook build@@ -173,7 +173,7 @@ fn cmd_oracle(cli: Option<&str>) -> Result<(), String> {for c in &cases {cmd.arg(c.strip_prefix(root()).unwrap_or(c));}- let out = cmd.output().map_err(|e| format!("solvecraft-cli: {e}"))?;+ let out = cmd.output().map_err(|e| format!("solidcraft-cli: {e}"))?;let results: serde_json::Value =serde_json::from_slice(&out.stdout).map_err(|e| format!("oracle JSON: {e}\n{}", String::from_utf8_lossy(&out.stderr)))?;let list = results.as_array().cloned().unwrap_or_default();@@ -275,7 +275,7 @@ fn wasm_check() -> Result<(Command, usize), String> {let crates = layers::from_metadata(&metadata()?)?;let mut set: Vec<String> =crates.iter().filter(|c| matches!(layers::classify(&c.name), Some(layers::Class::Layer(_)))).map(|c| c.name.clone()).collect();- set.push("solvecraft-web".into());+ set.push("solidcraft-web".into());let mut c = cargo();c.args(["check", "--target", "wasm32-unknown-unknown", "--profile", "ci"]);for p in &set {