Compare commits

..

1 Commits

Author SHA1 Message Date
jyviko 43f6ee6a98 Contributing: kernel operations migrate to solidcore; features call its API
AGENTS.md, CONTRIBUTING.md and the contributing skill say how the work is
split since 0.40: SolidCraft is the application and calls the solidcore API;
geometry math (evaluators, intersections, solvers, tessellation, kernel cases)
is added to solidcore first. New features are discussed on Discord, then get
an issue and a claim, after a search of all issues and pull requests, open and
closed, for similar work. Work begun before 0.40 is ported onto today's code
before it lands. The kernel-paused section becomes "Kernel work goes to
solidcore".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 17:23:31 -05:00
535 changed files with 6946 additions and 31857 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# While a new geometry kernel is evaluated, new issues and discussions about kernel work, and new
# pull requests that change the kernel directories, are labelled `kernel-paused` for a maintainer to
# answer (CONTRIBUTING.md, "Kernel work is paused"). The logic is in scripts/kernel-paused/ (tested
# answer (CONTRIBUTING.md, "Kernel work goes to solidcore"). The logic is in scripts/kernel-paused/ (tested
# in ci.yml).
name: Kernel paused
+7 -9
View File
@@ -3,15 +3,15 @@
SolidCraft is a clean-room, pure-Rust parametric 3D CAD app (sketch solver, feature timeline, B-rep kernel, an egui UI that agents drive). This file is a router: the hard rules, then the skill to read for your task. Humans: CONTRIBUTING.md.
## Start here
Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelled `help wanted`, `good first issue`, `needs-triage`; architecture in `docs/architecture.md`. Local `plan/` notes are optional.
Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelled `help wanted`, `good first issue`, `needs-triage`; architecture in `docs/architecture.md`. Act when the code, docs and rules settle a question; ask only when it changes what users see.
## Hard rules (what enforces each)
- Independent: never copy another product's code, icons, text or templates; never drive or take data from commercial CAD. `skills/solidcraft-ground-rules/SKILL.md`.
- No GPL/LGPL/AGPL code, not even reading it (OpenCASCADE, FreeCAD, SolveSpace, CadQuery, LibreCAD, QCAD): `cargo xtask licences --check`.
- Every asset is original or openly licensed with a row in ATTRIBUTION.md; read `assets/AGENTS.md` before icon work: `cargo xtask assets`, `cargo xtask icons`.
- Never crash: no unwrap/expect/panic/unsafe in non-test code, errors are `Result`, input is hostile: clippy `-D warnings`, `hostile_params_never_panic`.
- Never crash: no unwrap/expect/panic/unsafe in non-test code (unsafe allowlist in crash-safety), errors are `Result`, input is hostile: clippy `-D warnings`, `hostile_params_never_panic`.
- Model decisions (what an operation does, which bodies it touches, which face or edge a point or name means, depths, nearness) use exact geometry; a mesh is for display, export, previews and mesh bodies (`xtask/mesh-decisions.txt` only shrinks): `cargo xtask mesh-decisions`.
- New kernel cases go to solidcore: `cargo xtask lists`.
- Kernel ops and math go to solidcore; features call its API: `cargo xtask lists`.
- Everything is a command and programmatic calls never open dialogs: `skills/solidcraft-commands/SKILL.md`.
- Layering (geom, sketch/kernel/render, doc, io, engine, ui-egui, apps); only `crates/kernel` uses truck: `cargo xtask layers`.
- One outer UI container, one camera path (`navigation::handle`), colours from theme tokens: `cargo xtask ui-containers`.
@@ -21,19 +21,17 @@ Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelle
- A design-format change is ONE new file in `crates/doc/src/format/pending/`: `scripts/test-format-pending.sh`.
- A command has input and output schemas (will become required; `schema/unconverted.txt` only shrinks): `skills/solidcraft-commands/SKILL.md`.
- New UI strings go in `assets/locales/pending/<slug>.json`, ATTRIBUTION rows in `attribution/pending/<slug>.md`: `cargo xtask lists`.
- A changed default keeps the old behaviour behind a preference and fills the PR's `Changes a default:` line: `pr-checks.yml`.
- A changed default keeps the old behaviour behind a preference and fills the PR's `Changes a default:` line, and no second PR for an issue a lower-numbered one closes: `pr-checks.yml`.
- A regression test goes in the area's existing test file, never a per-bug file (#3226).
- Look at open PRs first, claim with a draft PR (lowest number wins), one topic per PR: `skills/solidcraft-contributing/SKILL.md`.
- Look at open PRs first, claim with a draft PR (lowest number wins), one topic per PR, never force-push `main`, no pushes just to catch up with `main`: `skills/solidcraft-contributing/SKILL.md`.
- A PR's title and first sentence make sense to someone who never saw your chat or the issue: `skills/solidcraft-contributing/SKILL.md`.
- Code, comments, commit messages and docs are in English, always: `skills/solidcraft-contributing/SKILL.md` ("Working as an agent").
- Independent work runs in parallel, dependent work stays sequential: `skills/solidcraft-contributing/SKILL.md` ("Working as an agent").
- Show observable changes with real screenshots or a recording, captured yourself.
- Run `cargo xtask ci` before every commit. `cargo xtask skills` keeps this file and `skills/` honest.
- Run `cargo xtask ci` before every commit, without switching branches while it runs. `cargo xtask skills` keeps this file and `skills/` honest.
## Working on X: read the skill first
| Working on | Read |
|---|---|
| A PR, a claim, review, CI or evidence | `skills/solidcraft-contributing/SKILL.md` |
| A feature, PR, claim, review, CI, evidence | `skills/solidcraft-contributing/SKILL.md` |
| Licences, assets, clean-room, the name | `skills/solidcraft-ground-rules/SKILL.md` |
| Non-test Rust, hostile input, a crash report | `skills/solidcraft-crash-safety/SKILL.md` |
| A command, a crate boundary | `skills/solidcraft-commands/SKILL.md` |
+2 -31
View File
@@ -798,36 +798,6 @@ Original SolidCraft drawings, Open for owner review; no runtime assignments.
| docs/book/src/media/ui-tour/window.png | SolidCraft contributors | screenshot of SolidCraft 0.29.0 itself (`solidcraft --sample`, default dark theme, software renderer, 1280x800) with original numbered callouts (digits set in DejaVu Sans Bold), captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/ui-tour/navigate.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (`--sample`, default dark theme, software renderer) orbiting, panning and zooming, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| assets/locales/pending/sketch-tool-hints.json | carlymx | Original sketch tool hints and engine error translations | MIT OR Apache-2.0 |
| assets/locales/pending/primitive-pick-field-tips.json | SolidCraft contributors | Original primitive pick-field tooltip translations | MIT OR Apache-2.0 |
| assets/locales/pending/ribbon-panel-hover.json | SolidCraft contributors | Original ribbon panel menu preference labels and translations | MIT OR Apache-2.0 |
| docs/screenshots/box-insert-designer.gif | Shawn Marx | original recording made with BoxInsertDesigner's own Motion export (its three.js viewer) of its example game `examples/ccg-example` (https://github.com/ShawnMarx/BoxInsertDesigner): a card game box insert whose trays were built by SolidCraft through `solidcraft-cli`; the published card, board and box art in it is pixelated beyond recognition, and no logos or game names are shown (2.5× playback, 800 px wide) | MIT OR Apache-2.0 |
| docs/screenshots/box-insert-designer.mp4 | Shawn Marx | original recording made with BoxInsertDesigner's own Motion export (its three.js viewer) of its example game `examples/ccg-example` (https://github.com/ShawnMarx/BoxInsertDesigner): a card game box insert whose trays were built by SolidCraft through `solidcraft-cli`; the published card, board and box art in it is pixelated beyond recognition, and no logos or game names are shown (1280×720) | MIT OR Apache-2.0 |
| assets/locales/pending/agent-http-consent.json | SolidCraft contributors | Original endpoint-specific HTTP consent messages and translations | MIT OR Apache-2.0 |
| assets/locales/pending/ground-shadow-placement.json | SolidCraft contributors | Original ground-shadow placement preference messages and translations | MIT OR Apache-2.0 |
| docs/book/src/media/assemblies/components.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) making components from two original hinge-leaf bodies, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/assemblies/joint.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) creating a revolute joint between two hinge leaves, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/assemblies/drag.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) dragging a jointed hinge leaf, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/assemblies/drive.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) driving a revolute joint between two hinge leaves, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/extrude.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) extruding a sketch's profile, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/shell.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) shelling a block, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/fillet.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) filleting four edges, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/edit.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) editing a feature from the timeline, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/hole.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) placing a hole, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/features/pattern.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) patterning a hole around an axis, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/parameters/dialog.png | SolidCraft contributors | screenshot of SolidCraft 0.29.0 itself (default dark theme, software renderer) showing the Parameters dialog, with original numbered callouts (digits set in DejaVu Sans Bold), captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/files/menu.png | SolidCraft contributors | screenshot of SolidCraft 0.29.0 itself (`--sample`, default dark theme, software renderer) showing the File menu, with original numbered callouts (digits set in DejaVu Sans Bold), captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/getting-started/start.png | SolidCraft contributors | screenshot of SolidCraft 0.29.0 itself (default dark theme, software renderer, 1280x800) showing the start page with its built-in sample thumbnails, with original numbered callouts (digits set in DejaVu Sans Bold), captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/getting-started/sample.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) opening the built-in Sample Plate from the start page, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sheet-metal/base.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) making a sheet metal base flange, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sheet-metal/flange.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) adding sheet metal edge flanges, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sheet-metal/flat.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) showing a sheet metal flat pattern, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/create.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) starting a sketch on the Top plane, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/draw.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) drawing a rectangle and a circle with typed values, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/dimension.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) dimensioning a sketch until it is fully constrained, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/parts.png | SolidCraft contributors | screenshot of SolidCraft 0.29.0 itself (default dark theme, software renderer, 1280x800) showing a fully constrained sketch, with original numbered callouts (digits set in DejaVu Sans Bold), captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/offset.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) offsetting a sketch outline, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| docs/book/src/media/sketching/trim.mp4 | SolidCraft contributors | original screen recording of the actual SolidCraft 0.29.0 English desktop UI (default dark theme, software renderer) trimming a notch in a sketch, with the original drawn pointer of examples/demo/overlay.py and labels set in DejaVu Sans Bold, captured with examples/demo/doc_shots.py | MIT OR Apache-2.0 |
| assets/locales/ca.json | carlymx | Catalan translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
## Code adapted from sibling projects
@@ -897,10 +867,11 @@ copied into SolidCraft.
| Directory | Source | Licence | Changes |
|---|---|---|---|
| vendor/accesskit_macos | accesskit_macos 0.26.3, https://github.com/AccessKit/accesskit (The AccessKit contributors) | MIT OR Apache-2.0 | the subclassing adapter and its tests from 0.27.2: dropping the adapter keeps AppKit's key-value observers (vendor/README.md) |
## Vendored renderer compatibility fix
`vendor/egui-wgpu` is egui-wgpu 0.37.0 from https://github.com/emilk/egui
`vendor/egui-wgpu` is egui-wgpu 0.36.2 from https://github.com/emilk/egui
(MIT OR Apache-2.0; both original licence texts are included). Rust sources and
its original `egui.wgsl` shader are retained; no images or other artwork are copied.
SolidCraft's narrow patch selects a safe 1x MSAA path on the chosen OpenGL adapter
+26 -13
View File
@@ -17,15 +17,27 @@ Before choosing a task, check the [command inventory](docs/features.md) and
Questions, ideas or want to say what you're working on? Join the [Discord](https://discord.gg/FtU4NQNVDH).
## Kernel work is paused
## Kernel work goes to solidcore
We're moving to a new geometry kernel. Until that's done, please don't open pull requests that
change `crates/kernel/`, `crates/geom/` or `vendor/truck*`, or issues and discussions about kernel
work: booleans, fillets, chamfers, shell, offsets, sweeps and lofts, threads and holes, STEP/IGES
import and export, or tessellation. The pinned issue on the tracker explains it. New ones get the
`kernel-paused` label (`.github/workflows/kernel-paused.yml`) and a maintainer answers them. Crashes
and data loss are still taken as issues. Pull requests outside those directories carry on as normal,
including the dialogs and tools for these features.
Since 0.40, SolidCraft's geometry kernel is [solidcore](https://github.com/tangency-labs/solidcore),
and the kernel operations still in this repository are migrating there. The split:
- **SolidCraft** is the application: commands, the timeline, sketches, the UI, file handling. A new
feature calls the solidcore API and builds on the operations it offers.
- **solidcore** holds the geometry: evaluators, intersections, booleans, blends, shells, sweeps,
tessellation and the rest of the math. If a feature needs kernel functionality solidcore does not
have yet, add it to solidcore first (its own issue and PR), then use it here.
So pull requests that add geometry math to SolidCraft (`crates/kernel/`, `crates/geom/`, or a new
evaluator or solver anywhere else) are not taken; they get the `kernel-paused` label
(`.github/workflows/kernel-paused.yml`) and a maintainer points them to solidcore. Crashes and data
loss are still taken as issues here, and the dialogs and tools for kernel features carry on as
normal.
Work started before 0.40 was written against the earlier kernel. It is still welcome: port it onto
today's code, calling solidcore for the geometry, before it can land. Expect a substantial rework
for anything that touched the kernel. Designs keep opening and rebuilding on the new kernel; where a
result changes, the PR says so and why.
## Get it running (about 10 minutes on a fast machine)
@@ -88,8 +100,6 @@ The [architecture page](docs/architecture.md) has the layer table. The short ver
- `crates/geom`: vectors, planes, meshes, measures.
- `crates/sketch`: our own constraint solver, plus profile finding.
- `crates/dynamics`: multibody dynamics: rigid bodies, joint constraints, gravity and springs,
integrated in time (RFC #9719). It depends only on `geom`.
- `crates/kernel`: the B-rep kernel boundary. It wraps [truck](https://github.com/ricosjp/truck),
and it's the only crate allowed to touch truck. Fillets, chamfers, shell/offset, Delete Face,
Split Face, STEP/IGES read and write, and face provenance are our own code here. Patched
@@ -331,8 +341,11 @@ and a fresh CI run:
1. Work is tracked in [GitHub issues](https://github.com/tangency-labs/solidcraft/issues), labelled
by area (`area:kernel`, `area:sketch`, `area:doc`, `area:ui`, `area:infra`). For anything
bigger than a bug fix that has no issue yet, open one first. **Claim the issue with a draft
PR** before you start, so two people don't build the same thing:
bigger than a bug fix that has no issue yet, discuss it on [Discord](https://discord.gg/FtU4NQNVDH)
first, then open an issue. Before you start, search **all** issues and pull requests, open and
closed, for similar work (`gh issue list -R tangency-labs/solidcraft --state all --search "<words>"`,
and the same with `gh pr list`). **Claim the issue with a draft PR** before you start, so two
people don't build the same thing:
- Check nobody has it: `gh pr list -R tangency-labs/solidcraft --state open --search "#N"`.
- Branch from the latest `main`, commit `git commit --allow-empty -m "claim: #N"`, push, and
open a **draft** PR titled `<summary> (#N)`, e.g. `Fillet: variable radius along a chain (#123)`.
@@ -445,7 +458,7 @@ correct them freely and it won't put them back.
## Where help is wanted most
**Kernel speed (slow fillets, booleans, STEP):** please don't rewrite the current kernel code for speed; it is being replaced by [solidcore](https://github.com/bherbruck/solidcore) ([progress](https://tangency-labs.github.io/solidcore/)). Report slow cases with a file under the `kernel-perf` label, and put kernel effort into solidcore instead. See [#1597](https://github.com/tangency-labs/solidcraft/issues/1597).
**Kernel speed (slow fillets, booleans, STEP):** please don't rewrite the current kernel code for speed; the kernel is [solidcore](https://github.com/tangency-labs/solidcore) ([progress](https://tangency-labs.github.io/solidcore/)). Report slow cases with a file under the `kernel-perf` label, and put kernel effort into solidcore instead. See [#1597](https://github.com/tangency-labs/solidcraft/issues/1597).
See the [`help wanted`](https://github.com/tangency-labs/solidcraft/labels/help%20wanted) and
[`good first issue`](https://github.com/tangency-labs/solidcraft/labels/good%20first%20issue) labels.
Generated
+162 -178
View File
@@ -4,9 +4,9 @@ version = 4
[[package]]
name = "accesskit"
version = "0.25.2"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e883d1d28c5fd5568c79ed2d2bd48d9f2fd3945c8974ed0f53690ceddb051be"
checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"
dependencies = [
"enumn",
"serde",
@@ -15,12 +15,12 @@ dependencies = [
[[package]]
name = "accesskit_atspi_common"
version = "0.21.1"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f5baf62e34a4a6c30e3d697e4782f821a7337049c44c3b40576a27dfbb580d"
checksum = "1e8c61bee90b42a772d39d06a740207dc71a4e780004ace1db8d99fb1baaa954"
dependencies = [
"accesskit",
"accesskit_consumer",
"accesskit_consumer 0.36.0",
"atspi-common",
"phf",
"serde",
@@ -29,37 +29,41 @@ dependencies = [
[[package]]
name = "accesskit_consumer"
version = "0.39.2"
version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3da8f27636015191b2264ee1df681503170a632cafd832fdc1edfdd4e3a2fd3"
checksum = "53cf47daed85312e763fbf85ceca136e0d7abc68e0a7e12abe11f48172bc3b10"
dependencies = [
"accesskit",
"hashbrown 0.17.1",
"hashbrown 0.16.1",
]
[[package]]
name = "accesskit_ios"
version = "0.2.2"
name = "accesskit_consumer"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5280724673bbfa8b30a838c013500b719392989be3b97c5a9964062c252c232"
checksum = "25e0d7e25d06f4dc21d1774d67146e9e80d6789216cbd4d1e88185b0095dba60"
dependencies = [
"accesskit",
"accesskit_consumer",
"hashbrown 0.17.1",
"objc2 0.5.3",
"objc2-foundation 0.2.2",
"objc2-ui-kit 0.2.2",
"hashbrown 0.16.1",
]
[[package]]
name = "accesskit_consumer"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"
dependencies = [
"accesskit",
"hashbrown 0.16.1",
]
[[package]]
name = "accesskit_macos"
version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "123828ceeec755b05255e3976cb0852993202de98a0626c97dd8d34246991f84"
version = "0.26.3"
dependencies = [
"accesskit",
"accesskit_consumer",
"hashbrown 0.17.1",
"accesskit_consumer 0.38.0",
"hashbrown 0.16.1",
"objc2 0.5.3",
"objc2-app-kit 0.2.2",
"objc2-foundation 0.2.2",
@@ -67,9 +71,9 @@ dependencies = [
[[package]]
name = "accesskit_unix"
version = "0.24.1"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d5192871228c54f1b0fb4a85cef000e11a3804f25d2165f14afa0daa67f3f6"
checksum = "b016ca8db0ea0ea2ceff29a9d6240391492d960716aa471967c00e8cc8cb197c"
dependencies = [
"accesskit",
"accesskit_atspi_common",
@@ -85,13 +89,13 @@ dependencies = [
[[package]]
name = "accesskit_windows"
version = "0.35.2"
version = "0.32.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "498668b90da9995302a0055aaecad4756932333da2ddef6baee1c00844c430fc"
checksum = "eff7009f1a532e917d66970a1e80c965140c6cfbbabbdde3d64e5431e6c78e21"
dependencies = [
"accesskit",
"accesskit_consumer",
"hashbrown 0.17.1",
"accesskit_consumer 0.35.0",
"hashbrown 0.16.1",
"static_assertions",
"windows",
"windows-core",
@@ -99,12 +103,11 @@ dependencies = [
[[package]]
name = "accesskit_winit"
version = "0.34.2"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd4ab4437b520ff03088fbe48676a11e7d44a929535e64b31432c1073e48dbcc"
checksum = "1fe9a94394896352cc4660ca2288bd4ef883d83238853c038b44070c8f134313"
dependencies = [
"accesskit",
"accesskit_ios",
"accesskit_macos",
"accesskit_unix",
"accesskit_windows",
@@ -200,7 +203,6 @@ dependencies = [
"parking_lot",
"percent-encoding",
"windows-sys 0.60.2",
"wl-clipboard-rs",
"x11rb",
]
@@ -685,18 +687,42 @@ dependencies = [
"thiserror 1.0.69",
]
[[package]]
name = "calloop"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e"
dependencies = [
"bitflags 2.13.2",
"polling",
"rustix 1.1.5",
"tracing",
]
[[package]]
name = "calloop-wayland-source"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [
"calloop",
"calloop 0.13.0",
"rustix 0.38.44",
"wayland-backend",
"wayland-client",
]
[[package]]
name = "calloop-wayland-source"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
dependencies = [
"calloop 0.14.5",
"rustix 1.1.5",
"wayland-backend",
"wayland-client",
]
[[package]]
name = "cbc"
version = "0.1.2"
@@ -1097,9 +1123,9 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
[[package]]
name = "ecolor"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31bcbef0d4263a63eb32c4834e5d711613035ce1333468e107d928923e21e6e2"
checksum = "0656a7530b9e2841ee7a5f983965bdd9840c32f4012f759cfd44b912cced6b34"
dependencies = [
"bytemuck",
"emath",
@@ -1108,9 +1134,9 @@ dependencies = [
[[package]]
name = "eframe"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c5642501a65ca657d05f00c643a5c14ff2346cb3818032bfe23d58e1f8e5f84"
checksum = "55ad41fac6e3149abb4866e93df37dbd33baa95db525c3368c944584e95a5dc2"
dependencies = [
"ahash",
"bytemuck",
@@ -1133,7 +1159,6 @@ dependencies = [
"profiling",
"raw-window-handle",
"ron",
"send_wrapper",
"serde",
"static_assertions",
"wasm-bindgen",
@@ -1146,9 +1171,9 @@ dependencies = [
[[package]]
name = "egui"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bec9144f49b7a28b5f395d3147e325b4fe3e77ba686eac11d1bdf0a7da3f375f"
checksum = "dc938cc27cd911415e1e4d151bc56ff9df063d8db081374e87aeb805ea74b2ba"
dependencies = [
"accesskit",
"ahash",
@@ -1168,7 +1193,7 @@ dependencies = [
[[package]]
name = "egui-wgpu"
version = "0.37.0"
version = "0.36.2"
dependencies = [
"ahash",
"bytemuck",
@@ -1186,34 +1211,32 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4e449f4c4a2a60c7ccb4ba7fa4078417bfe1f9ddc03b5e05ce75748e33a70de"
checksum = "98466000559d66ba4db786a30448b01483946add4188e7f10f522a27b4fb89cc"
dependencies = [
"accesskit_winit",
"arboard",
"block2 0.6.2",
"bytemuck",
"egui",
"log",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
"objc2-ui-kit 0.3.2",
"profiling",
"raw-window-handle",
"serde",
"smithay-clipboard",
"web-time",
"webbrowser",
"windows-sys 0.61.2",
"winit",
]
[[package]]
name = "egui_glow"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9275ca5cc35a6b7c94e0e8cedf22542f66cb0cf45ed8ab2657c78ff49fec7268"
checksum = "606ed4167daf341e5753d703285c4c1d562324b2c07aa8f405cd7d066fe58f3b"
dependencies = [
"bytemuck",
"egui",
@@ -1231,9 +1254,9 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
[[package]]
name = "emath"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e73ce90f54750be8672c02be0743fe47530e6f251e066f0ee2869b59eb297af5"
checksum = "52c8d4141cf0f60fb2f7aefaf352d3ffa5171ef0ab09731c64391801e95e48f1"
dependencies = [
"bytemuck",
"serde",
@@ -1307,9 +1330,9 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97bac86ae3dde93fc3951e790951caea739ff39a6c89d909cdaf1d9278dbb1bd"
checksum = "a0ec0308dc23130fc1a7d4623a8534c2ed069c6dc84e258ee4f3de99615aa1a3"
dependencies = [
"ahash",
"bytemuck",
@@ -1327,16 +1350,15 @@ dependencies = [
"skrifa",
"smallvec",
"unicode-general-category",
"unicode-properties",
"unicode-segmentation",
"vello_cpu",
]
[[package]]
name = "epaint_default_fonts"
version = "0.37.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfc1cc505827f4c23eedc297975a0fd038268d41293f389dd8ff3b574aefab19"
checksum = "773fa9c96dd0dbef887e39d0ed6177f141cce4d68e6041df77570aa3702dfa13"
[[package]]
name = "equivalent"
@@ -1422,12 +1444,6 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484"
[[package]]
name = "fixedbitset"
version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
[[package]]
name = "flate2"
version = "1.1.10"
@@ -1439,12 +1455,6 @@ dependencies = [
"zlib-rs",
]
[[package]]
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "foldhash"
version = "0.2.0"
@@ -1641,12 +1651,12 @@ dependencies = [
[[package]]
name = "glifo"
version = "0.3.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282a26c1e23de04bdab3e34a21b6f877a479b96737792516b9b8b8f69b6661be"
checksum = "ed4a1bb24121291d27230c1b1b44e07d6a9b28cefdb32fe1581dfb84e14f940a"
dependencies = [
"bytemuck",
"foldhash 0.2.0",
"foldhash",
"hashbrown 0.17.1",
"log",
"peniko",
@@ -1816,15 +1826,6 @@ dependencies = [
"smallvec",
]
[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash 0.1.5",
]
[[package]]
name = "hashbrown"
version = "0.16.1"
@@ -1833,7 +1834,7 @@ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash 0.2.0",
"foldhash",
]
[[package]]
@@ -1842,7 +1843,7 @@ version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
dependencies = [
"foldhash 0.2.0",
"foldhash",
]
[[package]]
@@ -2499,15 +2500,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]]
name = "nom"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
dependencies = [
"memchr",
]
[[package]]
name = "num"
version = "0.4.3"
@@ -2964,16 +2956,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "os_pipe"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
"windows-sys 0.61.2",
]
[[package]]
name = "parking"
version = "2.2.1"
@@ -3022,22 +3004,11 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "petgraph"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455"
dependencies = [
"fixedbitset",
"hashbrown 0.15.5",
"indexmap",
]
[[package]]
name = "phf"
version = "0.14.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "010378780309880b08997fae13be7834dba947d36393bd372f2b1556deb2a2f6"
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
dependencies = [
"phf_macros",
"phf_shared",
@@ -3046,9 +3017,9 @@ dependencies = [
[[package]]
name = "phf_generator"
version = "0.14.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aeb62e0959d5a1bebc965f4d15d9e2b7cea002b6b0f5ba8cde6cc26738467100"
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
dependencies = [
"fastrand",
"phf_shared",
@@ -3056,9 +3027,9 @@ dependencies = [
[[package]]
name = "phf_macros"
version = "0.14.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fa8d0ca26d424d27630da600c6624696e7dec8bf7b3b492b383c5dc49e5e085"
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
dependencies = [
"phf_generator",
"phf_shared",
@@ -3069,9 +3040,9 @@ dependencies = [
[[package]]
name = "phf_shared"
version = "0.14.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fd9027e2d9319be6349febd1db4e8d02aa544921200c9b777720ac34a3aa89"
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
dependencies = [
"siphasher",
]
@@ -3791,12 +3762,6 @@ version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
[[package]]
name = "send_wrapper"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
version = "1.0.229"
@@ -4021,8 +3986,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
dependencies = [
"bitflags 2.13.2",
"calloop",
"calloop-wayland-source",
"calloop 0.13.0",
"calloop-wayland-source 0.3.0",
"cursor-icon",
"libc",
"log",
@@ -4039,6 +4004,44 @@ dependencies = [
"xkeysym",
]
[[package]]
name = "smithay-client-toolkit"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0"
dependencies = [
"bitflags 2.13.2",
"calloop 0.14.5",
"calloop-wayland-source 0.4.1",
"cursor-icon",
"libc",
"log",
"memmap2",
"rustix 1.1.5",
"thiserror 2.0.21",
"wayland-backend",
"wayland-client",
"wayland-csd-frame",
"wayland-cursor",
"wayland-protocols",
"wayland-protocols-experimental",
"wayland-protocols-misc",
"wayland-protocols-wlr",
"wayland-scanner",
"xkeysym",
]
[[package]]
name = "smithay-clipboard"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226"
dependencies = [
"libc",
"smithay-client-toolkit 0.20.0",
"wayland-backend",
]
[[package]]
name = "smol_str"
version = "0.2.2"
@@ -4150,17 +4153,6 @@ dependencies = [
"web-time",
]
[[package]]
name = "solidcraft-dynamics"
version = "0.40.0-rc.2"
dependencies = [
"serde",
"serde_json",
"solidcore-record",
"solidcraft-geom",
"thiserror 2.0.21",
]
[[package]]
name = "solidcraft-engine"
version = "0.40.0-rc.2"
@@ -4660,6 +4652,7 @@ version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -4685,17 +4678,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tree_magic_mini"
version = "3.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6"
dependencies = [
"memchr",
"nom",
"petgraph",
]
[[package]]
name = "ttf-parser"
version = "0.25.1"
@@ -4770,12 +4752,6 @@ version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
[[package]]
name = "unicode-properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"
[[package]]
name = "unicode-segmentation"
version = "1.13.3"
@@ -4859,9 +4835,9 @@ dependencies = [
[[package]]
name = "vello_common"
version = "0.2.0"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb2141a2bca6e6d598e471fd4d1d7eed8e020aad6a28187edda07f091a325dd"
checksum = "b2e9aed918117e8152c9eddfd8362d73c465c23f26c44786aa331707b8a64fa2"
dependencies = [
"bytemuck",
"fearless_simd",
@@ -4874,9 +4850,9 @@ dependencies = [
[[package]]
name = "vello_cpu"
version = "0.2.0"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace506ca414548966fcf3c283be94eb1cad8254de488791ee698bf438b0890a9"
checksum = "ac7349e1f55f6b801c7c277958df4ea53e7f20f21e8014910ad888b2ecda93ea"
dependencies = [
"bytemuck",
"glifo",
@@ -5051,6 +5027,32 @@ dependencies = [
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-experimental"
version = "20250721.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1"
dependencies = [
"bitflags 2.13.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-misc"
version = "0.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8"
dependencies = [
"bitflags 2.13.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-plasma"
version = "0.3.12"
@@ -5628,7 +5630,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.5.1",
"bytemuck",
"calloop",
"calloop 0.13.0",
"cfg_aliases",
"concurrent-queue",
"core-foundation 0.9.4",
@@ -5649,7 +5651,7 @@ dependencies = [
"raw-window-handle",
"redox_syscall 0.4.1",
"rustix 0.38.44",
"smithay-client-toolkit",
"smithay-client-toolkit 0.19.2",
"smol_str",
"tracing",
"unicode-segmentation",
@@ -5692,24 +5694,6 @@ version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]]
name = "wl-clipboard-rs"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "959c7ac3b8afde864f7a7448ac16f29b2b83350b7eccbf77fb781c3999aa6848"
dependencies = [
"libc",
"log",
"os_pipe",
"rustix 1.1.5",
"thiserror 2.0.21",
"tree_magic_mini",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-protocols-wlr",
]
[[package]]
name = "writeable"
version = "0.6.4"
+7 -6
View File
@@ -22,7 +22,6 @@ solidcraft-kernel = { path = "crates/kernel" }
solidcraft-smlib = { path = "crates/smlib" }
solidcraft-step = { path = "crates/step" }
solidcraft-render = { path = "crates/render" }
solidcraft-dynamics = { path = "crates/dynamics" }
solidcraft-gpu = { path = "crates/gpu" }
solidcraft-doc = { path = "crates/doc" }
solidcraft-io = { path = "crates/io" }
@@ -103,12 +102,11 @@ tiny-skia = { version = "0.12", default-features = false, features = ["std", "si
toml = "1"
# ui
# default_fonts: the built-in Hack is the UI's symbol fallback (#2955); 0.37 no longer turns it on.
egui = { version = "0.37", features = ["default_fonts"] }
eframe = { version = "0.37", default-features = false, features = ["persistence"] }
egui = "0.36"
eframe = { version = "0.36", default-features = false, features = ["persistence"] }
# Instant/SystemTime that also work in the browser (std panics on wasm32-unknown-unknown).
web-time = "1"
egui-wgpu = "0.37"
egui-wgpu = "0.36"
# the wgpu egui-wgpu uses, for compute (crates/gpu); backends come from the apps' features
wgpu = { version = "30", default-features = false, features = ["std", "wgsl"] }
naga = { version = "30", default-features = false }
@@ -163,9 +161,12 @@ debug = "line-tables-only"
egui-wgpu = { path = "vendor/egui-wgpu" }
# Deliver trackpad pinch and rotation gestures on Wayland (zwp_pointer_gestures_v1), which
# winit 0.30 never binds and eframe 0.37 still requires winit 0.30.
# winit 0.30 never binds and eframe 0.36 still requires winit 0.30.
winit = { path = "vendor/winit" }
# macOS: dropping the accessibility adapter leaves AppKit's key-value observers intact (#7535).
accesskit_macos = { path = "vendor/accesskit_macos" }
# Mutation testing (cargo-mutants, docs/mutation-testing.md): the ci profile with incremental
# builds, since every mutant rebuilds the crates above the one it changes.
[profile.mutants]
-6
View File
@@ -225,12 +225,6 @@ completed drawings publish atomically. The browser still exports synchronously.
## Render foundation
- Wood surface images (#1345): native CPU and GPU opaque rendering share physical
repeat frames and filtered mip chains. Imported maps retain exact bytes and
declared provenance in the design, reopen offline, and expose grain-angle
controls. Scalar face appearances suppress body maps. Planar projection and
CPU encoding/optical limits remain explicit; see [portable surfaces](docs/render-portable-surfaces-and-stages.md).
- Original starter appearances (#1722): 34 opaque recipes through existing commands, with six explicitly unavailable glass recipes and preserved legacy looks; see [the contract](docs/render-starter-appearances.md).
- Bounded linear film accumulation (#1696) supplies caller-admitted mean/variance storage and complete-pass views; actual progressive consumers remain separate. See [the film contract](docs/render-film.md).
+115 -274
View File
@@ -1,17 +1,18 @@
Third-party software in SolidCraft
SolidCraft (the desktop app, solidcraft-cli and the web app) is built from the 540 crates below.
SolidCraft (the desktop app, solidcraft-cli and the web app) is built from the 537 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.
accesskit 0.25.2 (MIT OR Apache-2.0)
accesskit_atspi_common 0.21.1 (MIT OR Apache-2.0)
accesskit_consumer 0.39.2 (MIT OR Apache-2.0)
accesskit_ios 0.2.2 (MIT OR Apache-2.0)
accesskit_macos 0.27.2 (MIT OR Apache-2.0)
accesskit_unix 0.24.1 (MIT OR Apache-2.0)
accesskit_windows 0.35.2 (MIT OR Apache-2.0)
accesskit_winit 0.34.2 (Apache-2.0)
accesskit 0.24.1 (MIT OR Apache-2.0)
accesskit_atspi_common 0.18.1 (MIT OR Apache-2.0)
accesskit_consumer 0.35.0 (MIT OR Apache-2.0)
accesskit_consumer 0.36.0 (MIT OR Apache-2.0)
accesskit_consumer 0.38.0 (MIT OR Apache-2.0)
accesskit_macos 0.26.3 (MIT OR Apache-2.0)
accesskit_unix 0.21.1 (MIT OR Apache-2.0)
accesskit_windows 0.32.1 (MIT OR Apache-2.0)
accesskit_winit 0.32.2 (Apache-2.0)
adler2 2.0.1 (0BSD OR MIT OR Apache-2.0)
aes 0.8.4 (MIT OR Apache-2.0)
ahash 0.8.12 (MIT OR Apache-2.0)
@@ -64,7 +65,9 @@ cadmpeg-core 0.6.7 (Apache-2.0)
cadmpeg-ir 0.6.7 (Apache-2.0)
cadmpeg-registry 0.6.7 (Apache-2.0)
calloop 0.13.0 (MIT)
calloop 0.14.5 (MIT)
calloop-wayland-source 0.3.0 (MIT)
calloop-wayland-source 0.4.1 (MIT)
cbc 0.1.2 (MIT OR Apache-2.0)
cfg-if 1.0.5 (MIT OR Apache-2.0)
cgl 0.3.2 (MIT / Apache-2.0)
@@ -106,21 +109,21 @@ document-features 0.2.12 (MIT OR Apache-2.0)
downcast-rs 1.2.1 (MIT/Apache-2.0)
dpi 0.1.2 (Apache-2.0 AND MIT)
dyn-clone 1.0.20 (MIT OR Apache-2.0)
ecolor 0.37.0 (MIT OR Apache-2.0)
eframe 0.37.0 (MIT OR Apache-2.0)
egui 0.37.0 (MIT OR Apache-2.0)
egui-wgpu 0.37.0 (MIT OR Apache-2.0)
egui-winit 0.37.0 (MIT OR Apache-2.0)
egui_glow 0.37.0 (MIT OR Apache-2.0)
ecolor 0.36.2 (MIT OR Apache-2.0)
eframe 0.36.2 (MIT OR Apache-2.0)
egui 0.36.2 (MIT OR Apache-2.0)
egui-wgpu 0.36.2 (MIT OR Apache-2.0)
egui-winit 0.36.2 (MIT OR Apache-2.0)
egui_glow 0.36.2 (MIT OR Apache-2.0)
either 1.19.0 (MIT OR Apache-2.0)
emath 0.37.0 (MIT OR Apache-2.0)
emath 0.36.2 (MIT OR Apache-2.0)
encoding_rs 0.8.42 ((Apache-2.0 OR MIT) AND BSD-3-Clause)
endi 1.1.1 (MIT)
enumflags2 0.7.12 (MIT OR Apache-2.0)
enumflags2_derive 0.7.12 (MIT OR Apache-2.0)
enumn 0.1.14 (MIT OR Apache-2.0)
epaint 0.37.0 (MIT OR Apache-2.0)
epaint_default_fonts 0.37.0 ((MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0)
epaint 0.36.2 (MIT OR Apache-2.0)
epaint_default_fonts 0.36.2 ((MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0)
equivalent 1.0.2 (Apache-2.0 OR MIT)
errno 0.3.14 (MIT OR Apache-2.0)
error-code 3.4.0 (BSL-1.0)
@@ -131,9 +134,7 @@ fastrand 2.5.0 (Apache-2.0 OR MIT)
fax 0.2.7 (MIT)
fdeflate 0.3.7 (MIT OR Apache-2.0)
fearless_simd 0.4.1 (Apache-2.0 OR MIT)
fixedbitset 0.5.7 (MIT OR Apache-2.0)
flate2 1.1.10 (MIT OR Apache-2.0)
foldhash 0.1.5 (Zlib)
foldhash 0.2.0 (Zlib)
font-types 0.12.6 (MIT OR Apache-2.0)
foreign-types 0.5.0 (MIT/Apache-2.0)
@@ -153,7 +154,7 @@ getrandom 0.2.17 (MIT OR Apache-2.0)
getrandom 0.3.4 (MIT OR Apache-2.0)
getrandom 0.4.3 (MIT OR Apache-2.0)
gif 0.14.2 (MIT OR Apache-2.0)
glifo 0.3.0 (Apache-2.0 OR MIT)
glifo 0.2.0 (Apache-2.0 OR MIT)
glow 0.17.0 (MIT OR Apache-2.0 OR Zlib)
gltf 1.4.1 (MIT OR Apache-2.0)
gltf-derive 1.4.1 (MIT OR Apache-2.0)
@@ -167,7 +168,6 @@ gpu-allocator 0.28.0 (MIT OR Apache-2.0)
guillotiere 0.7.0 (MIT/Apache-2.0)
half 2.7.1 (MIT OR Apache-2.0)
harfrust 0.12.0 (MIT)
hashbrown 0.15.5 (MIT OR Apache-2.0)
hashbrown 0.16.1 (MIT OR Apache-2.0)
hashbrown 0.17.1 (MIT OR Apache-2.0)
hermit-abi 0.5.3 (MIT OR Apache-2.0)
@@ -234,7 +234,6 @@ ndk-sys 0.6.0+11769913 (MIT OR Apache-2.0)
nix 0.29.0 (MIT)
nix 0.31.3 (MIT)
nohash-hasher 0.2.0 (Apache-2.0 OR MIT)
nom 8.0.0 (MIT)
num 0.4.3 (MIT OR Apache-2.0)
num-bigint 0.4.8 (MIT OR Apache-2.0)
num-complex 0.4.6 (MIT OR Apache-2.0)
@@ -276,17 +275,15 @@ orbclient 0.3.55 (MIT)
ordered-float 2.10.1 (MIT)
ordered-float 5.5.0 (MIT)
ordered-stream 0.2.0 (MIT OR Apache-2.0)
os_pipe 1.2.3 (MIT)
parking 2.2.1 (Apache-2.0 OR MIT)
parking_lot 0.12.5 (MIT OR Apache-2.0)
parking_lot_core 0.9.12 (MIT OR Apache-2.0)
peniko 0.6.1 (Apache-2.0 OR MIT)
percent-encoding 2.3.2 (MIT OR Apache-2.0)
petgraph 0.8.3 (MIT OR Apache-2.0)
phf 0.14.0 (MIT)
phf_generator 0.14.0 (MIT)
phf_macros 0.14.0 (MIT)
phf_shared 0.14.0 (MIT)
phf 0.13.1 (MIT)
phf_generator 0.13.1 (MIT)
phf_macros 0.13.1 (MIT)
phf_shared 0.13.1 (MIT)
pin-project 1.1.13 (Apache-2.0 OR MIT)
pin-project-internal 1.1.13 (Apache-2.0 OR MIT)
pin-project-lite 0.2.17 (Apache-2.0 OR MIT)
@@ -355,7 +352,6 @@ security-framework 3.7.0 (MIT OR Apache-2.0)
security-framework-sys 2.17.0 (MIT OR Apache-2.0)
self_cell 1.3.0 (Apache-2.0 OR GPL-2.0-only)
semver 1.0.28 (MIT OR Apache-2.0)
send_wrapper 0.6.0 (MIT/Apache-2.0)
serde 1.0.229 (MIT OR Apache-2.0)
serde-value 0.7.0 (MIT)
serde_core 1.0.229 (MIT OR Apache-2.0)
@@ -379,6 +375,8 @@ slab 0.4.12 (MIT)
slotmap 1.1.1 (Zlib)
smallvec 1.16.2 (MIT OR Apache-2.0)
smithay-client-toolkit 0.19.2 (MIT)
smithay-client-toolkit 0.20.0 (MIT)
smithay-clipboard 0.7.3 (MIT)
smol_str 0.2.2 (MIT OR Apache-2.0)
solidcore 1.0.1 (Apache-2.0)
solidcore-record 0.1.0 (Apache-2.0)
@@ -411,7 +409,6 @@ toml_writer 1.1.3+spec-1.1.0 (MIT OR Apache-2.0)
tracing 0.1.44 (MIT)
tracing-attributes 0.1.31 (MIT)
tracing-core 0.1.36 (MIT)
tree_magic_mini 3.2.2 (MIT)
ttf-parser 0.25.1 (MIT OR Apache-2.0)
twox-hash 2.1.5 (MIT)
type-map 0.5.1 (MIT/Apache-2.0)
@@ -422,7 +419,6 @@ uds_windows 1.2.1 (MIT)
unicode-bidi 0.3.18 (MIT OR Apache-2.0)
unicode-general-category 1.1.0 (Apache-2.0)
unicode-ident 1.0.26 ((MIT OR Apache-2.0) AND Unicode-3.0)
unicode-properties 0.1.5 ((MIT OR Apache-2.0) AND Unicode-3.0)
unicode-segmentation 1.13.3 (MIT OR Apache-2.0)
unicode-width 0.2.2 (MIT OR Apache-2.0)
untrusted 0.9.0 (ISC)
@@ -432,8 +428,8 @@ url 2.5.8 (MIT OR Apache-2.0)
utf8-zero 0.8.1 (MIT OR Apache-2.0)
utf8_iter 1.0.4 (Apache-2.0 OR MIT)
uuid 1.27.0 (Apache-2.0 OR MIT)
vello_common 0.2.0 (Apache-2.0 OR MIT)
vello_cpu 0.2.0 (Apache-2.0 OR MIT)
vello_common 0.1.0 (Apache-2.0 OR MIT)
vello_cpu 0.1.0 (Apache-2.0 OR MIT)
wasi 0.11.1+wasi-snapshot-preview1 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
wasip2 1.0.4+wasi-0.2.12 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
wasm-bindgen 0.2.129 (MIT OR Apache-2.0)
@@ -446,6 +442,8 @@ wayland-client 0.31.15 (MIT)
wayland-csd-frame 0.3.0 (MIT)
wayland-cursor 0.31.14 (MIT)
wayland-protocols 0.32.13 (MIT)
wayland-protocols-experimental 20250721.0.1 (MIT)
wayland-protocols-misc 0.3.12 (MIT)
wayland-protocols-plasma 0.3.12 (MIT)
wayland-protocols-wlr 0.3.12 (MIT)
wayland-scanner 0.31.11 (MIT)
@@ -502,7 +500,6 @@ winit 0.30.13 (Apache-2.0)
winnow 1.0.4 (MIT)
winreg 0.56.0 (MIT)
wit-bindgen 0.57.1 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
wl-clipboard-rs 0.9.5 (MIT OR Apache-2.0)
writeable 0.6.4 (Unicode-3.0)
x11-dl 2.21.0 (MIT)
x11rb 0.13.2 (MIT OR Apache-2.0)
@@ -573,14 +570,13 @@ num_enum 0.7.6, num_enum_derive 0.7.6, once_cell 1.21.4, ordered-stream 0.2.0, p
pin-project 1.1.13, pin-project-internal 1.1.13, pin-project-lite 0.2.17, piper 0.2.5, polling
3.11.0, portable-atomic 1.15.0, portable-atomic-util 0.2.8, proc-macro-crate 3.5.0, proc-macro2
1.0.107, quote 1.0.47, ref-cast 1.0.27, ref-cast-impl 1.0.27, rustc-hash 1.1.0, rustc-hash 2.1.3,
rustix 0.38.44, rustix 1.1.5, rustversion 1.0.23, semver 1.0.28, send_wrapper 0.6.0, serde 1.0.229,
serde_core 1.0.229, serde_derive 1.0.229, serde_derive_internals 0.30.0, serde_json 1.0.151,
serde_path_to_error 0.1.20, serde_repr 0.1.21, simd_cesu8 1.2.0, smol_str 0.2.2, syn 2.0.119, syn
3.0.6, thiserror 1.0.69, thiserror 2.0.21, thiserror-impl 1.0.69, thiserror-impl 2.0.21, typed-path
0.13.0, typeid 1.0.3, unicode-ident 1.0.26, utf8-zero 0.8.1, wasi 0.11.1+wasi-snapshot-preview1,
wasip2 1.0.4+wasi-0.2.12, wit-bindgen 0.57.1, x11-dl 2.21.0, xdg-home 1.3.0, zbus-lockstep 0.5.2,
zbus-lockstep-macros 0.5.2, zbus_names 3.0.0, zmij 1.0.23, zvariant_utils 2.1.0, zvariant_utils
4.2.0
rustix 0.38.44, rustix 1.1.5, rustversion 1.0.23, semver 1.0.28, serde 1.0.229, serde_core 1.0.229,
serde_derive 1.0.229, serde_derive_internals 0.30.0, serde_json 1.0.151, serde_path_to_error 0.1.20,
serde_repr 0.1.21, simd_cesu8 1.2.0, smol_str 0.2.2, syn 2.0.119, syn 3.0.6, thiserror 1.0.69,
thiserror 2.0.21, thiserror-impl 1.0.69, thiserror-impl 2.0.21, typed-path 0.13.0, typeid 1.0.3,
unicode-ident 1.0.26, utf8-zero 0.8.1, wasi 0.11.1+wasi-snapshot-preview1, wasip2 1.0.4+wasi-0.2.12,
wit-bindgen 0.57.1, x11-dl 2.21.0, xdg-home 1.3.0, zbus-lockstep 0.5.2, zbus-lockstep-macros 0.5.2,
zbus_names 3.0.0, zmij 1.0.23, zvariant_utils 2.1.0, zvariant_utils 4.2.0
================================================================================
Permission is hereby granted, free of charge, to any
@@ -1090,26 +1086,25 @@ ahash 0.8.12, arrayvec 0.7.8, async-channel 2.5.0, async-executor 1.14.0, async-
0.9.4, core-foundation-sys 0.8.7, core-graphics 0.23.2, core-graphics-types 0.1.3, core_detect
1.0.0, crossbeam-channel 0.5.17, crossbeam-deque 0.8.8, crossbeam-epoch 0.9.21, crossbeam-utils
0.8.23, dbus-secret-service 4.1.0, displaydoc 0.2.7, either 1.19.0, equivalent 1.0.2, errno 0.3.14,
euclid 0.22.14, event-listener 5.4.2, event-listener-strategy 0.5.4, fastrand 2.5.0, fixedbitset
0.5.7, flate2 1.1.10, form_urlencoded 1.2.2, futures-lite 2.6.1, gethostname 1.1.0, gif 0.14.2, glow
0.17.0, gltf 1.4.1, gltf-derive 1.4.1, gltf-json 1.4.1, hashbrown 0.15.5, hashbrown 0.16.1,
hashbrown 0.17.1, hermit-abi 0.5.3, httparse 1.10.1, idna 1.1.0, idna_adapter 1.2.2, indexmap
2.14.2, itertools 0.15.0, js-sys 0.3.106, keyboard-types 0.8.3, khronos-egl 6.0.0, lazy_static
1.5.1, linux-raw-sys 0.12.1, linux-raw-sys 0.4.15, lock_api 0.4.14, log 0.4.34, muda 0.21.2, num
0.4.3, num-bigint 0.4.8, num-complex 0.4.6, num-integer 0.1.47, num-iter 0.1.46, num-rational 0.4.2,
num-traits 0.2.19, once_cell 1.21.4, openssl-probe 0.2.1, ordered-stream 0.2.0, parking 2.2.1,
parking_lot 0.12.5, parking_lot_core 0.9.12, percent-encoding 2.3.2, petgraph 0.8.3, piper 0.2.5,
plain 0.2.3, png 0.18.1, polling 3.11.0, pollster 0.4.0, pollster 1.0.1, rayon 1.12.0, rayon-core
1.13.0, renderdoc-sys 1.1.0, robust 1.2.0, ron 0.12.2, roxmltree 0.21.1, rustc-hash 1.1.0, rustix
0.38.44, rustix 1.1.5, rustls 0.23.46, rustls-native-certs 0.8.5, scoped-tls 1.0.1, scopeguard
1.2.0, secret-service 4.0.0, security-framework 2.11.1, security-framework 3.7.0,
security-framework-sys 2.17.0, send_wrapper 0.6.0, signal-hook-registry 1.4.8, simd_cesu8 1.2.0,
smallvec 1.16.2, smol_str 0.2.2, stable_deref_trait 1.2.1, tempfile 3.27.0, ttf-parser 0.25.1,
unicode-bidi 0.3.18, unicode-properties 0.1.5, unicode-segmentation 1.13.3, unicode-width 0.2.2, url
2.5.8, uuid 1.27.0, wasi 0.11.1+wasi-snapshot-preview1, wasip2 1.0.4+wasi-0.2.12, wasm-bindgen
0.2.129, wasm-bindgen-futures 0.4.79, wasm-bindgen-macro 0.2.129, wasm-bindgen-macro-support
0.2.129, wasm-bindgen-shared 0.2.129, web-sys 0.3.106, weezl 0.1.12, wit-bindgen 0.57.1,
wl-clipboard-rs 0.9.5
euclid 0.22.14, event-listener 5.4.2, event-listener-strategy 0.5.4, fastrand 2.5.0, flate2 1.1.10,
form_urlencoded 1.2.2, futures-lite 2.6.1, gethostname 1.1.0, gif 0.14.2, glow 0.17.0, gltf 1.4.1,
gltf-derive 1.4.1, gltf-json 1.4.1, hashbrown 0.16.1, hashbrown 0.17.1, hermit-abi 0.5.3, httparse
1.10.1, idna 1.1.0, idna_adapter 1.2.2, indexmap 2.14.2, itertools 0.15.0, js-sys 0.3.106,
keyboard-types 0.8.3, khronos-egl 6.0.0, lazy_static 1.5.1, linux-raw-sys 0.12.1, linux-raw-sys
0.4.15, lock_api 0.4.14, log 0.4.34, muda 0.21.2, num 0.4.3, num-bigint 0.4.8, num-complex 0.4.6,
num-integer 0.1.47, num-iter 0.1.46, num-rational 0.4.2, num-traits 0.2.19, once_cell 1.21.4,
openssl-probe 0.2.1, ordered-stream 0.2.0, parking 2.2.1, parking_lot 0.12.5, parking_lot_core
0.9.12, percent-encoding 2.3.2, piper 0.2.5, plain 0.2.3, png 0.18.1, polling 3.11.0, pollster
0.4.0, pollster 1.0.1, rayon 1.12.0, rayon-core 1.13.0, renderdoc-sys 1.1.0, robust 1.2.0, ron
0.12.2, roxmltree 0.21.1, rustc-hash 1.1.0, rustix 0.38.44, rustix 1.1.5, rustls 0.23.46,
rustls-native-certs 0.8.5, scoped-tls 1.0.1, scopeguard 1.2.0, secret-service 4.0.0,
security-framework 2.11.1, security-framework 3.7.0, security-framework-sys 2.17.0,
signal-hook-registry 1.4.8, simd_cesu8 1.2.0, smallvec 1.16.2, smol_str 0.2.2, stable_deref_trait
1.2.1, tempfile 3.27.0, ttf-parser 0.25.1, unicode-bidi 0.3.18, unicode-segmentation 1.13.3,
unicode-width 0.2.2, url 2.5.8, uuid 1.27.0, wasi 0.11.1+wasi-snapshot-preview1, wasip2
1.0.4+wasi-0.2.12, wasm-bindgen 0.2.129, wasm-bindgen-futures 0.4.79, wasm-bindgen-macro 0.2.129,
wasm-bindgen-macro-support 0.2.129, wasm-bindgen-shared 0.2.129, web-sys 0.3.106, weezl 0.1.12,
wit-bindgen 0.57.1
================================================================================
Apache License
@@ -1315,7 +1310,7 @@ See the License for the specific language governing permissions and
limitations under the License.
================================================================================
allocator-api2 0.2.21, async-trait 0.1.92, dyn-clone 1.0.20, enumn 0.1.14, glifo 0.3.0, itoa 1.0.18,
allocator-api2 0.2.21, async-trait 0.1.92, dyn-clone 1.0.20, enumn 0.1.14, glifo 0.2.0, itoa 1.0.18,
libc 0.2.190, litrs 1.0.0, num_enum 0.7.6, num_enum_derive 0.7.6, proc-macro2 1.0.107, quote 1.0.47,
ref-cast 1.0.27, ref-cast-impl 1.0.27, rustc-hash 2.1.3, rustversion 1.0.23, semver 1.0.28, serde
1.0.229, serde_core 1.0.229, serde_derive 1.0.229, serde_derive_internals 0.30.0, serde_json
@@ -1535,7 +1530,7 @@ android-activity 0.6.1, arboard 3.6.1, color 0.3.3, fdeflate 0.3.7, fearless_sim
image 0.25.10, image-webp 0.2.4, linebender_resource_handle 0.1.1, miniz_oxide 0.8.9, miniz_oxide
0.9.1, naga 30.0.1, naga-types 30.0.1, pin-project 1.1.13, pin-project-internal 1.1.13,
pin-project-lite 0.2.17, portable-atomic 1.15.0, portable-atomic-util 0.2.8, range-alloc 0.1.5,
raw-window-handle 0.6.2, simdutf8 0.1.5, vello_common 0.2.0, vello_cpu 0.2.0, wgpu 30.0.1, wgpu-core
raw-window-handle 0.6.2, simdutf8 0.1.5, vello_common 0.1.0, vello_cpu 0.1.0, wgpu 30.0.1, wgpu-core
30.0.1, wgpu-core-deps-apple 30.0.1, wgpu-core-deps-emscripten 30.0.1, wgpu-core-deps-wasm 30.0.1,
wgpu-core-deps-windows-linux-android 30.0.1, wgpu-hal 30.0.1, wgpu-naga-bridge 30.0.1, wgpu-types
30.0.1
@@ -2593,7 +2588,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
bit-set 0.10.0, bit-vec 0.9.1, downcast-rs 1.2.1, egui-wgpu 0.37.0, presser 0.3.1
bit-set 0.10.0, bit-vec 0.9.1, downcast-rs 1.2.1, egui-wgpu 0.36.2, presser 0.3.1
================================================================================
Apache License
@@ -3139,7 +3134,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
calloop 0.13.0, smithay-client-toolkit 0.19.2
calloop 0.13.0, calloop 0.14.5, smithay-client-toolkit 0.19.2, smithay-client-toolkit 0.20.0
================================================================================
Copyright (c) 2018 Victor Berger
@@ -3163,7 +3158,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================================================
calloop-wayland-source 0.3.0
calloop-wayland-source 0.3.0, calloop-wayland-source 0.4.1
================================================================================
Copyright (c) 2023 Kirill Chibisov
@@ -5236,7 +5231,7 @@ have been licensed under extremely permissive terms.
------------------------------------------------------------------------------
================================================================================
egui-wgpu 0.37.0
egui-wgpu 0.36.2
================================================================================
Copyright (c) 2018-2021 Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
@@ -5266,7 +5261,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
either 1.19.0, itertools 0.15.0, petgraph 0.8.3
either 1.19.0, itertools 0.15.0
================================================================================
Copyright (c) 2015
@@ -5714,36 +5709,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
fixedbitset 0.5.7
================================================================================
Copyright (c) 2015-2017
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
flate2 1.1.10
================================================================================
@@ -5775,7 +5740,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
foldhash 0.1.5, foldhash 0.2.0
foldhash 0.2.0
================================================================================
Copyright (c) 2024 Orson Peters
@@ -6546,7 +6511,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================================================
glifo 0.3.0
glifo 0.2.0
================================================================================
Copyright 2025 the Vello Authors
@@ -7173,7 +7138,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================================================
hashbrown 0.15.5, hashbrown 0.16.1, hashbrown 0.17.1
hashbrown 0.16.1, hashbrown 0.17.1
================================================================================
Copyright (c) 2016 Amanieu d'Antras
@@ -9494,31 +9459,6 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================================================
nom 8.0.0
================================================================================
Copyright (c) 2014-2019 Geoffroy Couprie
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================================================
num_enum 0.7.6, num_enum_derive 0.7.6
================================================================================
@@ -9607,30 +9547,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
os_pipe 1.2.3
================================================================================
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================================================
parking 2.2.1
================================================================================
@@ -9646,7 +9562,7 @@ option. All files in the project carrying such notice may not be
copied, modified, or distributed except according to those terms.
================================================================================
phf 0.14.0, phf_generator 0.14.0, phf_macros 0.14.0, phf_shared 0.14.0
phf 0.13.1, phf_generator 0.13.1, phf_macros 0.13.1, phf_shared 0.13.1
================================================================================
The MIT License (MIT)
@@ -12461,6 +12377,30 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
smithay-clipboard 0.7.3
================================================================================
Copyright (c) 2018 Lucas Timmins & Victor Berger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================================================
solidcore 1.0.1
================================================================================
@@ -13033,32 +12973,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
tree_magic_mini 3.2.2
================================================================================
MIT License
Copyright (c) 2017 Aaron Hancock
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================================================
ttf-parser 0.25.1
================================================================================
@@ -13881,7 +13795,7 @@ carrying such notice may not be copied, modified, or distributed except
according to those terms.
================================================================================
unicode-bidi 0.3.18, unicode-properties 0.1.5, unicode-segmentation 1.13.3, unicode-width 0.2.2
unicode-bidi 0.3.18, unicode-segmentation 1.13.3, unicode-width 0.2.2
================================================================================
Copyright (c) 2015 The Rust Project Developers
@@ -13955,51 +13869,7 @@ dealings in these Data Files or Software without prior written
authorization of the copyright holder.
================================================================================
unicode-properties 0.1.5
================================================================================
UNICODE LICENSE V3
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2026 Unicode, Inc.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.
================================================================================
unicode-properties 0.1.5, unicode-segmentation 1.13.3, unicode-width 0.2.2
unicode-segmentation 1.13.3, unicode-width 0.2.2
================================================================================
Licensed under the Apache License, Version 2.0
@@ -14145,7 +14015,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
vello_common 0.2.0, vello_cpu 0.2.0
vello_common 0.1.0, vello_cpu 0.1.0
================================================================================
Copyright 2020 the Vello Authors
@@ -14176,8 +14046,8 @@ DEALINGS IN THE SOFTWARE.
================================================================================
wayland-backend 0.3.17, wayland-client 0.31.15, wayland-cursor 0.31.14, wayland-protocols 0.32.13,
wayland-protocols-plasma 0.3.12, wayland-protocols-wlr 0.3.12, wayland-scanner 0.31.11, wayland-sys
0.31.11
wayland-protocols-experimental 20250721.0.1, wayland-protocols-misc 0.3.12, wayland-protocols-plasma
0.3.12, wayland-protocols-wlr 0.3.12, wayland-scanner 0.31.11, wayland-sys 0.31.11
================================================================================
Copyright (c) 2015 Elinor Berger
@@ -15072,36 +14942,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================================================
wl-clipboard-rs 0.9.5
================================================================================
Copyright (c) 2019 Ivan Molodetskikh
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================================
x11rb 0.13.2, x11rb-protocol 0.13.2
================================================================================
@@ -16127,14 +15967,15 @@ Crates whose package carries no licence file (their licence is named in Cargo.to
texts are as in SolidCraft's own LICENSE-MIT and LICENSE-APACHE)
================================================================================
accesskit 0.25.2: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_atspi_common 0.21.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_consumer 0.39.2: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_ios 0.2.2: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_macos 0.27.2: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_unix 0.24.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_windows 0.35.2: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_winit 0.34.2: Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit 0.24.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_atspi_common 0.18.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_consumer 0.35.0: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_consumer 0.36.0: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_consumer 0.38.0: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_macos 0.26.3: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_unix 0.21.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_windows 0.32.1: MIT OR Apache-2.0 (https://github.com/AccessKit/accesskit)
accesskit_winit 0.32.2: Apache-2.0 (https://github.com/AccessKit/accesskit)
block2 0.5.1: MIT (https://github.com/madsmtm/objc2)
block2 0.6.2: MIT (https://github.com/madsmtm/objc2)
cadmpeg-codec-freecad 0.6.7: Apache-2.0 (https://github.com/cadmpeg/cadmpeg)
@@ -16147,14 +15988,14 @@ cadmpeg-registry 0.6.7: Apache-2.0 (https://github.com/cadmpeg/cadmpeg)
clipboard-win 5.4.1: BSL-1.0 (https://github.com/DoumanAsh/clipboard-win)
dispatch 0.2.0: MIT (http://github.com/SSheldon/rust-dispatch)
dispatch2 0.3.1: Zlib OR Apache-2.0 OR MIT (https://github.com/madsmtm/objc2)
ecolor 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui)
eframe 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/eframe)
egui 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui)
egui-winit 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/egui-winit)
egui_glow 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/egui_glow)
emath 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/emath)
epaint 0.37.0: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/epaint)
epaint_default_fonts 0.37.0: (MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0 (https://github.com/emilk/egui/tree/main/crates/epaint_default_fonts)
ecolor 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui)
eframe 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/eframe)
egui 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui)
egui-winit 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/egui-winit)
egui_glow 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/egui_glow)
emath 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/emath)
epaint 0.36.2: MIT OR Apache-2.0 (https://github.com/emilk/egui/tree/main/crates/epaint)
epaint_default_fonts 0.36.2: (MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0 (https://github.com/emilk/egui/tree/main/crates/epaint_default_fonts)
jni 0.22.4: MIT OR Apache-2.0 (https://github.com/jni-rs/jni-rs)
jni-macros 0.22.4: MIT OR Apache-2.0 (https://github.com/jni-rs/jni-rs)
jni-sys-macros 0.4.1: MIT OR Apache-2.0 (https://github.com/jni-rs/jni-sys)
+2 -2
View File
@@ -11,7 +11,7 @@ use std::process::{Command, ExitCode};
const TARGET: &str = "solidcraft-cli";
fn main() -> ExitCode {
solidcraft_engine::note!("solvecraft-cli is deprecated and will be removed in a later release: use solidcraft-cli");
eprintln!("solvecraft-cli is deprecated and will be removed in a later release: use solidcraft-cli");
let sibling = std::env::current_exe()
.ok()
.and_then(|exe| exe.parent().map(|dir| dir.join(format!("{TARGET}{}", std::env::consts::EXE_SUFFIX))))
@@ -23,7 +23,7 @@ fn main() -> ExitCode {
None => ExitCode::FAILURE,
},
Err(e) => {
solidcraft_engine::note!("solvecraft-cli: could not run {}: {e}", program.to_string_lossy());
eprintln!("solvecraft-cli: could not run {}: {e}", program.to_string_lossy());
ExitCode::FAILURE
}
}
+6 -9
View File
@@ -33,8 +33,8 @@ pub fn one(args: &[String]) -> Result<(), String> {
std::panic::set_hook(Box::new(|_| {
PANICS.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
}));
solidcraft_engine::note!("design {seed}");
let run = fuzz::run_with(seed, steps, &mut |st| solidcraft_engine::note!("step {}", serde_json::to_string(st).unwrap_or_default()));
eprintln!("design {seed}");
let run = fuzz::run_with(seed, steps, &mut |st| eprintln!("step {}", serde_json::to_string(st).unwrap_or_default()));
let mut design = json!({
"outcome": run.outcome,
"steps": run.steps.iter().map(|s| s.kind).collect::<Vec<_>>(),
@@ -45,13 +45,13 @@ pub fn one(args: &[String]) -> Result<(), String> {
if run.outcome.is_bug() {
design["script"] = run.script();
if minimise {
solidcraft_engine::note!("minimise");
eprintln!("minimise");
let m = fuzz::minimise(&run);
design["minimal"] = json!({"outcome": m.outcome, "steps": m.steps.iter().map(|s| s.kind).collect::<Vec<_>>(), "script": m.script()});
}
}
let (a, b) = solidcraft_engine::fuzz::boolean_shapes(seed);
solidcraft_engine::note!("boolean {seed} {} {}", serde_json::to_string(&a).unwrap_or_default(), serde_json::to_string(&b).unwrap_or_default());
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);
println!("{}", json!({"seed": seed, "design": design, "boolean": b, "boolean_panics": bp}));
@@ -162,14 +162,11 @@ fn record(v: &Value, out_dir: Option<&str>) {
let d = &v["design"];
let bug = matches!(d["outcome"]["kind"].as_str(), Some("failed" | "panic" | "invalid" | "volume"));
if bug || v.get("timeout").is_some() || v.get("crash").is_some() {
solidcraft_engine::note!(
"seed {seed}: {}",
if bug { format!("{} {}", d["outcome"]["kind"], d["outcome"]["detail"]) } else { format!("{v}") }
);
eprintln!("seed {seed}: {}", if bug { format!("{} {}", d["outcome"]["kind"], d["outcome"]["detail"]) } else { format!("{v}") });
}
let bk = v["boolean"]["outcome"].as_str().unwrap_or("ok");
if bk != "ok" {
solidcraft_engine::note!("seed {seed}: boolean {bk} {}", v["boolean"]["detail"]);
eprintln!("seed {seed}: boolean {bk} {}", v["boolean"]["detail"]);
}
if let Some(dir) = out_dir {
use std::io::Write;
+17 -25
View File
@@ -18,7 +18,7 @@
//! solidcraft-cli oracle <case-dir>... replay recipes and compare with expected.json
//! solidcraft-cli kernel-cases [--json] [--dumps=DIR] [--validation=MODE] <case-dir>... the kernel regression rig (tests/kernel-cases)
//! solidcraft-cli mcp [--headless] [--in design|script] [--connect HOST:PORT [--token T]] [--allow-path DIR]... [--allow-any-path]
//! [--param-check off|warn|strict] [--compact]
//! [--param-check off|warn|strict]
//! MCP server on stdio (docs/mcp.md)
//! solidcraft-cli mcp setup [--dry-run] [--client NAME] [--live] (alias: mcp install) add it to OpenCode, Claude Desktop, Claude Code, Cursor
//! solidcraft-cli licences SolidCraft's licence and the third-party licences
@@ -91,7 +91,7 @@ const USAGE_KERNEL_CASES: &str = " solidcraft-cli kernel-cases <case-dir>... [-
const USAGE_FUZZ: &str =
" solidcraft-cli fuzz [--from N] [--count N] [--jobs J] [--timeout S] [--steps N] [--minimise] [--out DIR] [--report FILE]\n";
/// `mcp`'s lines in the usage.
const USAGE_MCP: &str = " solidcraft-cli mcp [--headless] [--in design.sc|script.json] [--connect 127.0.0.1:PORT [--token T]] [--allow-path DIR]... [--allow-any-path]\n [--param-check off|warn|strict] [--render-gpu] [--compact]\n (--compact, SOLIDCRAFT_MCP_COMPACT=1 or the app's Preferences › AI (with --connect): compact tool output for\n agents: inspect_design summarises sketches and takes `sketches` by name and a `bodies` filter, and tool JSON\n is not pretty-printed; off by default)\n solidcraft-cli mcp setup [--dry-run] [--client opencode|claude-desktop|claude-code|cursor] [--live]\n (adds a `solidcraft` server, with this program's path, to each installed AI client; --live adds `solidcraft-live` for the running app; alias: mcp install)\n";
const USAGE_MCP: &str = " solidcraft-cli mcp [--headless] [--in design.sc|script.json] [--connect 127.0.0.1:PORT [--token T]] [--allow-path DIR]... [--allow-any-path]\n [--param-check off|warn|strict] [--render-gpu]\n solidcraft-cli mcp setup [--dry-run] [--client opencode|claude-desktop|claude-code|cursor] [--live]\n (adds a `solidcraft` server, with this program's path, to each installed AI client; --live adds `solidcraft-live` for the running app; alias: mcp install)\n";
/// `crashes`'s lines in the usage.
const USAGE_CRASHES: &str = " solidcraft-cli crashes [list [--json] | show <id> | replay <id> | dir | clear [<id>]]\n";
/// `licences`'s lines in the usage.
@@ -154,7 +154,7 @@ fn main() -> ExitCode {
}
};
if let Err(e) = max_file_size(&mut args) {
solidcraft_engine::note!("error: {e}");
eprintln!("error: {e}");
return ExitCode::FAILURE;
}
let r = match args.first().map(String::as_str) {
@@ -235,7 +235,7 @@ fn main() -> ExitCode {
match r {
Ok(()) => ExitCode::SUCCESS,
Err(e) => {
solidcraft_engine::note!("error: {e}");
eprintln!("error: {e}");
ExitCode::FAILURE
}
}
@@ -351,7 +351,7 @@ fn run_script_warning(s: &mut Session, path: &str, script: &Value) -> Result<Vec
/// Step `step`'s `param_warnings` on stderr, one per line, named after the script at `path`.
fn print_param_warnings(path: &str, step: usize, r: &Value) {
for w in r.get("param_warnings").and_then(Value::as_array).into_iter().flatten() {
solidcraft_engine::note!("{path}: step {}: {}", step + 1, w.as_str().unwrap_or_default());
eprintln!("{path}: step {}: {}", step + 1, w.as_str().unwrap_or_default());
}
}
@@ -598,10 +598,10 @@ fn cmd_script(args: &[String]) -> Result<(), String> {
let out = flag(args, "--out");
let r = s.execute("timeline.export_script", &json!({"path": out})).map_err(|e| e.to_string())?;
for what in r["omitted"].as_array().into_iter().flatten().filter_map(Value::as_str) {
solidcraft_engine::note!("note: the script leaves out {what}");
eprintln!("note: the script leaves out {what}");
}
match out {
Some(out) => solidcraft_engine::note!("{out}: {} steps", r["steps"]),
Some(out) => eprintln!("{out}: {} steps", r["steps"]),
None => println!("{}", pretty(&r["script"])),
}
Ok(())
@@ -632,7 +632,7 @@ fn cmd_gpu(args: &[String]) -> Result<(), String> {
);
match s.lands_on {
Some(solidcraft_gpu::select::Landing::Cpu) => {
solidcraft_engine::note!("warning: {}", solidcraft_engine::capture::CPU_WARNING);
eprintln!("warning: {}", solidcraft_engine::capture::CPU_WARNING);
Ok(())
}
Some(_) => Ok(()),
@@ -709,7 +709,7 @@ fn cmd_snapshot(args: &[String]) -> Result<(), String> {
std::fs::write(out, &png.bytes).map_err(|e| format!("{out}: {e}"))?;
let mut reply = json!({"path": out, "width": w, "height": h, "bytes": png.bytes.len(), "renderer": png.renderer});
if let Some(w) = solidcraft_engine::capture::warning(png.renderer) {
solidcraft_engine::note!("warning: {w}");
eprintln!("warning: {w}");
reply["warning"] = json!(w);
}
println!("{}", pretty(&reply));
@@ -792,15 +792,11 @@ fn cmd_mcp(args: &[String]) -> Result<(), String> {
return Err("mcp: --render-gpu installs a headless image host; a connected application owns its own device".into());
}
install_renderer();
let options = solidcraft_mcp::Options::from_args_and_env(args).map_err(|e| format!("mcp: {e}"))?;
if options.compact {
eprintln!("solidcraft mcp: compact output (inspect_design summarises sketches; tool JSON is not pretty-printed)");
}
let scope = (!args.iter().any(|a| a == "--allow-any-path"))
.then(|| solidcraft_mcp::agent_scope(flags(args, "--allow-path").into_iter().map(std::path::PathBuf::from)));
if let Some(s) = &scope {
let roots: Vec<String> = s.roots().iter().map(|r| r.display().to_string()).collect();
solidcraft_engine::note!(
eprintln!(
"solidcraft mcp: files limited to {} and the folders of designs opened or saved here (--allow-path DIR adds one, --allow-any-path lifts the limit)",
roots.join(", ")
);
@@ -808,7 +804,7 @@ fn cmd_mcp(args: &[String]) -> Result<(), String> {
.and_then(|p| std::path::Path::new(p).parent())
.map(|d| if d.as_os_str().is_empty() { std::path::Path::new(".") } else { d });
if let Some(why) = design_dir.and_then(solidcraft_engine::io::vfs::design_folder_refusal) {
solidcraft_engine::note!("solidcraft mcp: the design's folder is left out because {why}; add it with --allow-path if you mean it");
eprintln!("solidcraft mcp: the design's folder is left out because {why}; add it with --allow-path if you mean it");
}
}
// How calls that break a command's parameter contract are treated, headless or bridged.
@@ -822,7 +818,7 @@ fn cmd_mcp(args: &[String]) -> Result<(), String> {
// Serve without the app too: the tools connect once it runs, and say it isn't until then.
let mut remote = solidcraft_mcp::Remote::new(addr, flag(args, "--token")).with_param_check(param_check);
if let Err(e) = remote.try_connect() {
solidcraft_engine::note!(
eprintln!(
"solidcraft mcp: no SolidCraft app at {addr} yet ({e}); start it with `solidcraft --control {port}` \
(or SOLIDCRAFT_CONTROL_PORT={port}), tool calls connect once it runs"
);
@@ -839,9 +835,9 @@ fn cmd_mcp(args: &[String]) -> Result<(), String> {
(None, None) => {
let auto = !args.iter().any(|a| a == "--headless");
if auto && let Some(port) = discover_app() {
solidcraft_engine::note!("solidcraft mcp: bridged to the running app at 127.0.0.1:{port} (--headless starts a session of its own)");
eprintln!("solidcraft mcp: bridged to the running app at 127.0.0.1:{port} (--headless starts a session of its own)");
let remote = solidcraft_mcp::Remote::new(&format!("127.0.0.1:{port}"), flag(args, "--token")).with_param_check(param_check);
return serve_mcp(Box::new(remote), scope, options);
return serve_mcp(Box::new(remote), scope);
}
let mut headless = solidcraft_mcp::Headless::default();
headless.session.param_check = param_check;
@@ -856,17 +852,13 @@ fn cmd_mcp(args: &[String]) -> Result<(), String> {
}
}
};
serve_mcp(backend, scope, options)
serve_mcp(backend, scope)
}
fn serve_mcp(
backend: Box<dyn solidcraft_mcp::Backend>,
scope: Option<solidcraft_engine::io::vfs::PathScope>,
options: solidcraft_mcp::Options,
) -> Result<(), String> {
fn serve_mcp(backend: Box<dyn solidcraft_mcp::Backend>, scope: Option<solidcraft_engine::io::vfs::PathScope>) -> Result<(), String> {
let stdin = std::io::stdin();
let stdout = std::io::stdout();
solidcraft_mcp::Server::new(backend).with_path_scope(scope).with_options(options).serve(stdin.lock(), stdout.lock()).map_err(|e| e.to_string())
solidcraft_mcp::Server::new(backend).with_path_scope(scope).serve(stdin.lock(), stdout.lock()).map_err(|e| e.to_string())
}
/// The port of the running desktop app: the one its discovery file names, if something listens
-23
View File
@@ -188,26 +188,3 @@ fn max_file_size_raises_the_limit_and_refuses_bad_sizes() {
assert!(!output.status.success() && !stderr.contains("too large"), "{stderr}");
let _ = std::fs::remove_dir_all(&dir);
}
/// #10111: a line for a stderr whose reader has gone (the pipe closed before it, as an agent may
/// leave the MCP server's, and the app that one starts) is dropped, and the command ends as it
/// would with stderr open: here a script that isn't there fails with 1, where `eprintln!`
/// panicked with "failed printing to stderr" (101).
#[test]
fn a_closed_stderr_does_not_stop_the_cli() {
for _ in 0..5 {
let mut child = Command::new(env!("CARGO_BIN_EXE_solidcraft-cli"))
.args(["run", "no-such-script.json"])
.stdout(Stdio::null())
.stderr(Stdio::piped())
.spawn()
.unwrap();
drop(child.stderr.take());
assert_eq!(child.wait().unwrap().code(), Some(1));
}
// The old name's alias writes its deprecation notice first: an agent still configured with
// `solvecraft-cli mcp` must get the server, not that panic.
let mut child = Command::new(env!("CARGO_BIN_EXE_solvecraft-cli")).arg("--help").stdout(Stdio::null()).stderr(Stdio::piped()).spawn().unwrap();
drop(child.stderr.take());
assert_eq!(child.wait().unwrap().code(), Some(0));
}
-48
View File
@@ -1,48 +0,0 @@
//! `mcp --compact` and `SOLIDCRAFT_MCP_COMPACT` turn on compact tool output; without them the
//! server's tools are as they always were.
use std::io::Write;
use std::process::{Command, Stdio};
use serde_json::{Value, json};
/// `inspect_design`'s input schema as `solidcraft-cli mcp` with `args` and `env` lists it, or
/// the server's stderr when it does not start.
fn inspect_schema(args: &[&str], env: Option<&str>) -> Result<Value, String> {
let mut cmd = Command::new(env!("CARGO_BIN_EXE_solidcraft-cli"));
// --headless: never bridge to (and read the preference of) an app the developer has running.
cmd.args(["mcp", "--headless", "--allow-any-path"]).args(args).stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::piped());
match env {
Some(v) => cmd.env("SOLIDCRAFT_MCP_COMPACT", v),
None => cmd.env_remove("SOLIDCRAFT_MCP_COMPACT"),
};
let mut child = cmd.spawn().unwrap();
{
let mut stdin = child.stdin.take().unwrap();
// The server may refuse to start and close stdin first.
let _ = writeln!(stdin, "{}", json!({"jsonrpc": "2.0", "id": 1, "method": "tools/list"}));
}
let out = child.wait_with_output().unwrap();
if !out.status.success() {
return Err(String::from_utf8_lossy(&out.stderr).into_owned());
}
let reply: Value = serde_json::from_slice(&out.stdout).unwrap();
let tools = reply["result"]["tools"].as_array().cloned().unwrap_or_default();
Ok(tools.into_iter().find(|t| t["name"] == "inspect_design").map(|t| t["inputSchema"].clone()).unwrap_or(Value::Null))
}
#[test]
fn compact_output_is_off_unless_asked() {
let plain = inspect_schema(&[], None).unwrap();
assert_eq!(plain["properties"]["sketches"]["type"], "boolean", "{plain}");
assert!(plain["properties"].get("bodies").is_none(), "{plain}");
assert_eq!(inspect_schema(&[], Some("0")).unwrap(), plain);
for (args, env) in [(&["--compact"][..], None), (&[][..], Some("1")), (&[][..], Some("true"))] {
let compact = inspect_schema(args, env).unwrap();
assert!(compact["properties"]["bodies"].is_object(), "{args:?} {env:?}: {compact}");
}
let e = inspect_schema(&[], Some("maybe")).unwrap_err();
assert!(e.contains("SOLIDCRAFT_MCP_COMPACT"), "{e}");
}
+13 -34
View File
@@ -60,25 +60,15 @@ fn mcp_connect_serves_before_the_app_runs_and_reaches_it_once_it_does() {
let listener = TcpListener::bind(&addr).unwrap();
let app = std::thread::spawn(move || {
let (stream, _) = listener.accept().unwrap();
let mut lines = BufReader::new(stream.try_clone().unwrap());
loop {
let mut line = String::new();
lines.read_line(&mut line).unwrap();
let req: Value = serde_json::from_str(&line).unwrap();
// The server first asks for the agents' output options (the compact preference: off).
let options = req["method"] == "mcp.options";
let reply = if req["token"] != json!(token) {
json!({"id": req["id"], "ok": false, "error": format!("unauthorized: token {}", req["token"])})
} else if options {
json!({"id": req["id"], "ok": true, "result": {"compact": false}})
} else {
json!({"id": req["id"], "ok": true, "result": {"bodies": [], "method": req["method"]}})
};
writeln!(&stream, "{reply}").unwrap();
if !options {
break;
}
}
let mut line = String::new();
BufReader::new(stream.try_clone().unwrap()).read_line(&mut line).unwrap();
let req: Value = serde_json::from_str(&line).unwrap();
let reply = if req["token"] == json!(token) {
json!({"id": req["id"], "ok": true, "result": {"bodies": [], "method": req["method"]}})
} else {
json!({"id": req["id"], "ok": false, "error": format!("unauthorized: token {}", req["token"])})
};
writeln!(&stream, "{reply}").unwrap();
});
let r = ask(4, "tools/call", measure);
assert_ne!(r["result"]["isError"], true, "{r}");
@@ -121,21 +111,10 @@ fn mcp_without_arguments_finds_the_running_app() {
break (stream, line);
}
};
let mut lines = BufReader::new(stream.try_clone().unwrap());
let mut line = line;
// The server first asks for the agents' output options (the compact preference: off).
loop {
let req: Value = serde_json::from_str(&line).unwrap();
let ok = req["token"] == json!(token);
let options = req["method"] == "mcp.options";
let result = if options { json!({"compact": false}) } else { json!({"bodies": [], "method": req["method"]}) };
writeln!(&stream, "{}", json!({"id": req["id"], "ok": ok, "result": result, "error": "unauthorized"})).unwrap();
if !options {
break;
}
line.clear();
lines.read_line(&mut line).unwrap();
}
let req: Value = serde_json::from_str(&line).unwrap();
let ok = req["token"] == json!(token);
let reply = json!({"id": req["id"], "ok": ok, "result": {"bodies": [], "method": req["method"]}, "error": "unauthorized"});
writeln!(&stream, "{reply}").unwrap();
});
let mut child = Command::new(env!("CARGO_BIN_EXE_solidcraft-cli"))
.args(["mcp", "--allow-any-path"])
+1 -1
View File
@@ -25,7 +25,6 @@ solidcraft-engine = { workspace = true }
solidcraft-ui-egui = { workspace = true }
egui = { workspace = true }
log = { workspace = true }
serde_json = { workspace = true }
url = "2"
percent-encoding = "2"
@@ -34,6 +33,7 @@ eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
serde_json = { workspace = true }
web-sys = { version = "0.3", features = [
"Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "Location", "Navigator", "StorageManager",
"FileSystemHandle", "FileSystemDirectoryHandle", "FileSystemFileHandle", "FileSystemGetFileOptions", "FileSystemGetDirectoryOptions", "FileSystemWritableFileStream",
+1 -4
View File
@@ -553,7 +553,7 @@ mod web {
/// Open a design remembered from an earlier session (a recent one, after a reload): ask once
/// for access to the file (call in the click), read it into the engine's files and queue it
/// to open. A file that is gone is forgotten and dropped from the recent designs.
pub fn restore(files: &Rc<Files>, path: &str, on_opened: Option<Box<dyn FnOnce()>>) {
pub fn restore(files: &Rc<Files>, path: &str) {
let Some((id, name)) = parse(path) else { return };
let (files, path, id, name) = (files.clone(), path.to_string(), id.to_string(), name.to_string());
spawn_local(async move {
@@ -568,9 +568,6 @@ mod web {
files.opened.borrow_mut().push(path);
files.wake();
touch(&id).await;
if let Some(done) = on_opened {
done();
}
}
Err(e) => {
let gone = e.contains("NotFoundError") || e.contains("could not be found") || e.contains("no longer remembers");
+5 -175
View File
@@ -5,8 +5,7 @@
//! and go out as downloads (exports, and "Download design"). Where the File System Access API
//! exists a design also lives on the computer's disk, saved and opened through the browser's file
//! dialogs (`disk.rs`). An autosave of unsaved work is kept in OPFS and offered again after a
//! reload or a crash. With "keep unsaved work in this browser" on, each open design's unsaved
//! changes are kept there instead, one copy per design (`keep.rs`, #10220).
//! reload or a crash.
use std::cell::{Cell, RefCell};
use std::rc::Rc;
@@ -14,7 +13,7 @@ use std::rc::Rc;
use js_sys::{Array, Function, Object, Reflect, Uint8Array};
use solidcraft_engine::io::vfs;
use crate::{disk, keep};
use crate::disk;
use wasm_bindgen::{JsCast as _, JsValue, closure::Closure};
use wasm_bindgen_futures::{JsFuture, spawn_local};
use web_sys::{
@@ -80,16 +79,6 @@ pub struct Files {
pub recovery: RefCell<Option<(String, Option<String>)>>,
/// The app's context, to wake it when a browser call finishes.
pub ctx: RefCell<Option<egui::Context>>,
/// This page's id: the copies it keeps are named after it (`keep::entry_id`).
pub keep_page: RefCell<String>,
/// Kept copies stored by this page, and the design revision each holds once its write ended.
pub kept: RefCell<std::collections::HashMap<String, Option<u64>>>,
/// Kept copies being written or removed now (one browser call at a time per copy).
pub keeping: RefCell<std::collections::HashSet<String>>,
/// When (ms) the last write of a copy failed, to wait before trying again (`keep::may_write`).
pub kept_failed: RefCell<std::collections::HashMap<String, f64>>,
/// Copies earlier pages left, newer than their design's last save: offered at start.
pub keep_offered: RefCell<Vec<keep::Entry>>,
}
impl Files {
@@ -299,9 +288,6 @@ pub fn start(files: &Rc<Files>) {
let _ = JsFuture::from(p).await;
});
}
let page = keep::page_id(js_sys::Date::now(), js_sys::Math::random());
hold_page_lock(&page);
*files.keep_page.borrow_mut() = page;
let files = files.clone();
spawn_local(async move {
match disk::known_ids().await {
@@ -314,7 +300,6 @@ 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 kept = kept_copies(&all);
let has_recovery = all.iter().any(|(n, _, _)| n == RECOVERY);
let legacy = (!has_recovery).then(|| LEGACY_RECOVERY.into_iter().find(|l| all.iter().any(|(n, _, _)| n == l))).flatten();
for (name, bytes, modified) in all {
@@ -330,7 +315,7 @@ pub fn start(files: &Rc<Files>) {
*files.recovery.borrow_mut() = Some((n, meta["path"].as_str().map(str::to_string)));
continue;
}
if name != RECOVERY && keep::parse_name(&name).is_none() {
if name != RECOVERY {
entries.push(Entry { name: name.clone(), size: bytes.len() as u64, modified });
}
vfs::insert(&format!("{OPFS}{name}"), bytes);
@@ -341,7 +326,6 @@ pub fn start(files: &Rc<Files>) {
if !vfs::exists(&format!("{OPFS}{RECOVERY}")) {
*files.recovery.borrow_mut() = None;
}
sort_kept(&files, kept, &live_pages().await);
}
Err(e) => files.say(format!("browser storage: {e}"), true),
}
@@ -359,7 +343,7 @@ pub fn flush(files: &Rc<Files>) {
{
let mut e = files.entries.borrow_mut();
e.retain(|x| x.name != name);
if name != RECOVERY && name != RECOVERY_META && keep::parse_name(&name).is_none() {
if name != RECOVERY && name != RECOVERY_META {
e.push(Entry { name: name.clone(), size: bytes.len() as u64, modified: js_sys::Date::now() });
e.sort_by_key(|a| a.name.to_lowercase());
}
@@ -489,15 +473,7 @@ pub fn recovery_path() -> String {
/// A recovery file lives in OPFS, but its relative links belong to the original design's
/// folder (which can be on disk). Resolve them before Open sees the temporary file location.
pub fn prepare_recovery(original_path: Option<&str>) -> Result<String, String> {
prepare_copy(recovery_path(), original_path)
}
/// The same for a kept copy (#10220).
pub fn prepare_kept(id: &str, original_path: Option<&str>) -> Result<String, String> {
prepare_copy(format!("{OPFS}{}", keep::design_file(id)), original_path)
}
fn prepare_copy(path: String, original_path: Option<&str>) -> Result<String, String> {
let path = recovery_path();
let bytes = vfs::read(&path, solidcraft_engine::io::MAX_DESIGN_BYTES).map_err(|e| e.to_string())?;
let mut doc = solidcraft_engine::io::read_design(&bytes).map_err(|e| e.to_string())?;
solidcraft_engine::resolve_design_links(&mut doc, original_path);
@@ -670,149 +646,3 @@ pub fn take_drops(files: &Rc<Files>, raw: &mut egui::RawInput, theme: bool) {
});
}
}
/// Hold this page's browser lock while it runs, so other tabs know its kept copies are in use
/// (`keep.rs`). Browsers without the Web Locks API hold none; their copies are then offered by
/// any later page.
fn hold_page_lock(page: &str) {
let Some(locks) = web_locks() else { return };
let Ok(request) = Reflect::get(&locks, &"request".into()).and_then(|f| f.dyn_into::<Function>().map_err(JsValue::from)) else { return };
// A promise that never settles: the lock is let go only when the page goes.
let hold = Closure::<dyn FnMut(JsValue) -> js_sys::Promise>::new(|_lock: JsValue| js_sys::Promise::new(&mut |_, _| {}));
let name = format!("{}{page}", keep::LOCK_PREFIX);
if let Err(e) = request.call2(&locks, &name.into(), hold.as_ref().unchecked_ref()) {
log::info!("keep: no page lock: {}", err(e));
}
// The callback lives as long as the page.
hold.forget();
}
fn web_locks() -> Option<JsValue> {
let nav = web_sys::window()?.navigator();
Reflect::get(&nav, &"locks".into()).ok().filter(|l| l.is_object())
}
/// The pages still open (in this browser profile) that hold their lock.
async fn live_pages() -> Vec<String> {
let query = async {
let locks = web_locks().ok_or("no Web Locks")?;
let f: Function = Reflect::get(&locks, &"query".into()).map_err(err)?.dyn_into().map_err(|_| "no query".to_string())?;
let p: js_sys::Promise = f.call0(&locks).map_err(err)?.dyn_into().map_err(|_| "no promise".to_string())?;
let state = JsFuture::from(p).await.map_err(err)?;
let held: Array = Reflect::get(&state, &"held".into()).map_err(err)?.dyn_into().map_err(|_| "no list".to_string())?;
Ok::<_, String>(
held.iter()
.take(10_000)
.filter_map(|l| Reflect::get(&l, &"name".into()).ok()?.as_string())
.filter_map(|n| n.strip_prefix(keep::LOCK_PREFIX).map(str::to_string))
.collect(),
)
};
query.await.unwrap_or_else(|e| {
log::info!("keep: open pages unknown ({e})");
Vec::new()
})
}
/// The kept copies among the stored files: (copy, when its design's file was last written), and
/// the ids of designs stored without their metadata.
struct Found {
copies: Vec<(keep::Entry, Option<f64>)>,
orphans: Vec<String>,
}
fn kept_copies(all: &[(String, Vec<u8>, f64)]) -> Found {
let modified = |path: &str| path.strip_prefix(OPFS).and_then(|n| all.iter().find(|(name, _, _)| name == n)).map(|(_, _, m)| *m);
let mut copies = Vec::new();
let mut designs = Vec::new();
for (name, bytes, _) in all {
match keep::parse_name(name) {
Some((id, keep::Part::Meta)) => {
if let Some(e) = keep::Entry::parse(id, bytes) {
let saved = e.path.as_deref().and_then(modified);
copies.push((e, saved));
}
}
Some((id, keep::Part::Design)) => designs.push(id.to_string()),
None => {}
}
}
// A copy is whole only with its design.
copies.retain(|(e, _)| designs.contains(&e.id));
let orphans = designs.into_iter().filter(|id| !copies.iter().any(|(e, _)| &e.id == id)).collect();
Found { copies, orphans }
}
/// Offer the copies earlier pages left that hold unsaved work, and remove those their design's
/// later save made stale (and parts without the rest), leaving open pages' copies alone.
fn sort_kept(files: &Rc<Files>, found: Found, live: &[String]) {
let mut offered = Vec::new();
let mut gone = Vec::new();
for (e, saved) in found.copies {
match keep::fate(&e, live, saved) {
keep::Fate::Offer => offered.push(e),
keep::Fate::Drop => gone.push(e.id),
keep::Fate::Leave => {}
}
}
gone.extend(found.orphans.into_iter().filter(|id| !keep::page_of(id).is_some_and(|p| live.iter().any(|l| l == p))));
keep::order_offered(&mut offered);
*files.keep_offered.borrow_mut() = offered;
for id in gone {
remove_kept(files, &id);
}
}
/// The path (in the engine's files) a kept copy opens from.
pub fn kept_path(id: &str) -> String {
format!("{OPFS}{}", keep::design_file(id))
}
/// Write the copy of a design with unsaved changes (`bytes`, described by `entry`) that holds
/// its revision `revision`. Its metadata goes last, so a copy is never offered half written.
pub fn write_kept(files: &Rc<Files>, entry: &keep::Entry, bytes: Vec<u8>, revision: u64) {
let id = entry.id.clone();
if !files.keeping.borrow_mut().insert(id.clone()) {
return;
}
files.kept.borrow_mut().entry(id.clone()).or_insert(None);
let meta = entry.to_json();
let files = files.clone();
spawn_local(async move {
let r = async {
write_file(&keep::design_file(&id), &bytes).await?;
write_file(&keep::meta_file(&id), meta.as_bytes()).await
};
match r.await {
Ok(()) => {
files.kept.borrow_mut().insert(id.clone(), Some(revision));
files.kept_failed.borrow_mut().remove(&id);
}
Err(e) => {
files.kept_failed.borrow_mut().insert(id.clone(), js_sys::Date::now());
files.say(format!("keeping unsaved work in this browser: {e}"), true)
}
}
files.keeping.borrow_mut().remove(&id);
files.wake();
});
}
/// Remove kept copy `id` (its design was saved, closed, discarded or restored).
pub fn remove_kept(files: &Rc<Files>, id: &str) {
let id = id.to_string();
if !files.keeping.borrow_mut().insert(id.clone()) {
return;
}
let _ = vfs::remove(&kept_path(&id));
files.kept_failed.borrow_mut().remove(&id);
let files = files.clone();
spawn_local(async move {
// The metadata first: what's left without it is never offered.
let _ = remove_file(&keep::meta_file(&id)).await;
let _ = remove_file(&keep::design_file(&id)).await;
files.kept.borrow_mut().remove(&id);
files.keeping.borrow_mut().remove(&id);
files.wake();
});
}
-360
View File
@@ -1,360 +0,0 @@
//! Keep unsaved work in this browser (#10220): the decisions, in plain Rust (tested natively).
//!
//! With Preferences › General › "Keep unsaved work in this browser instead of asking when the tab
//! closes" on, each open design with unsaved changes has a copy in the browser's private storage:
//! `keep-<id>.sc` (the design) and `keep-<id>.json` (its name, its file and when it last
//! changed). The copy is written shortly after each change ([`due`]) and again when the page is
//! hidden, so it is already current when the tab closes; the page then doesn't ask through the
//! browser's "leave site?" box ([`asks_before_unload`]). A design that is saved, closed or
//! discarded has its copy removed. The next visit offers the copies newer than their design's
//! last save ([`fate`]) in SolidCraft's own window, answered with [`plan`].
//!
//! An id is `<page>-<n>`: the page that wrote it (each page load has its own) and the design's
//! number in that page. A page holds a browser lock named after it while it runs, so another tab
//! never offers, or removes, the copies of a page that is still open.
#![cfg_attr(not(target_arch = "wasm32"), allow(dead_code))]
use serde_json::{Value, json};
/// The start of every kept file's name.
pub const PREFIX: &str = "keep-";
/// The browser lock a page holds while it runs: this, then its page id.
pub const LOCK_PREFIX: &str = "solidcraft.keep.";
/// A copy is written once the design has been still this long (ms)…
pub const QUIET_MS: f64 = 800.0;
/// …or at the latest this long after the first change it doesn't hold yet (ms).
pub const MAX_WAIT_MS: f64 = 4000.0;
/// The most copies offered at once (the rest wait for the next visit).
pub const MAX_OFFERED: usize = 32;
const MAX_ID: usize = 64;
const MAX_NAME: usize = 256;
const MAX_PATH: usize = 4096;
/// Copies' metadata is small: a damaged or hostile one is not read.
pub const MAX_META_BYTES: usize = 64 * 1024;
/// Ids are short and safe in a file name: ASCII letters, digits and dashes, with a page part.
pub fn valid_id(id: &str) -> bool {
!id.is_empty() && id.len() <= MAX_ID && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') && page_of(id).is_some()
}
/// The page that wrote copy `id`.
pub fn page_of(id: &str) -> Option<&str> {
id.rsplit_once('-').map(|(page, _)| page).filter(|p| !p.is_empty())
}
/// This page's id, from the time it started (ms since 1970) and a random number in 0..1:
/// letters and digits only.
pub fn page_id(now_ms: f64, random: f64) -> String {
let now = if now_ms.is_finite() && now_ms > 0.0 { now_ms.min(1e15) as u64 } else { 0 };
let random = if random.is_finite() { (random.clamp(0.0, 1.0) * f64::from(0xff_ffff)) as u64 } else { 0 };
format!("{now:x}{random:06x}")
}
/// The copy of design `uid` (`Session::uid`) open in page `page`.
pub fn entry_id(page: &str, uid: u64) -> String {
format!("{page}-{uid}")
}
/// The stored file names of copy `id`: its design and its metadata.
pub fn design_file(id: &str) -> String {
format!("{PREFIX}{id}.{}", solidcraft_engine::io::DESIGN_EXT)
}
pub fn meta_file(id: &str) -> String {
format!("{PREFIX}{id}.json")
}
/// Which part of a copy a stored file is.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Part {
Design,
Meta,
}
/// A stored file's copy id and part; `None` for every other file.
pub fn parse_name(name: &str) -> Option<(&str, Part)> {
let rest = name.strip_prefix(PREFIX)?;
let (id, part) = if let Some(id) = rest.strip_suffix(".json") {
(id, Part::Meta)
} else {
(rest.strip_suffix(solidcraft_engine::io::DESIGN_EXT)?.strip_suffix('.')?, Part::Design)
};
valid_id(id).then_some((id, part))
}
/// A kept copy, as its metadata describes it.
#[derive(Clone, Debug, PartialEq)]
pub struct Entry {
pub id: String,
/// The design's name.
pub name: String,
/// Its file (`None`: never saved).
pub path: Option<String>,
/// When the design last changed (ms since 1970).
pub changed_at: f64,
}
impl Entry {
pub fn to_json(&self) -> String {
json!({"name": self.name, "path": self.path, "changed_at": self.changed_at}).to_string()
}
/// Read copy `id`'s metadata. Anything malformed, oversized or not finite is no copy.
pub fn parse(id: &str, bytes: &[u8]) -> Option<Entry> {
if !valid_id(id) || bytes.len() > MAX_META_BYTES {
return None;
}
let v: Value = serde_json::from_slice(bytes).ok()?;
let name = v.get("name")?.as_str()?.chars().take(MAX_NAME).collect::<String>();
let path = match v.get("path") {
None | Some(Value::Null) => None,
Some(p) => Some(p.as_str().filter(|p| !p.is_empty() && p.len() <= MAX_PATH)?.to_string()),
};
let changed_at = v.get("changed_at")?.as_f64().filter(|t| t.is_finite() && *t >= 0.0)?;
Some(Entry { id: id.to_string(), name, path, changed_at })
}
}
/// Whether a copy that last changed at `changed_at` holds work its design's file doesn't:
/// the file was last written at `saved_at` (ms since 1970; `None` or unknown: never saved, or
/// the time can't be read, so the copy is kept rather than lost).
pub fn newer_than_save(changed_at: f64, saved_at: Option<f64>) -> bool {
match saved_at {
Some(saved) if saved.is_finite() && saved > 0.0 => changed_at > saved,
_ => true,
}
}
/// What the next visit does with a copy it finds.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fate {
/// Offer it: "Restore unsaved design…?".
Offer,
/// Its design was saved after it: remove it without asking.
Drop,
/// Its page is still open (another tab): leave it alone.
Leave,
}
/// The copy `entry`, whose design's file was last written at `saved_at`, while the pages
/// `live` are open.
pub fn fate(entry: &Entry, live: &[String], saved_at: Option<f64>) -> Fate {
if page_of(&entry.id).is_some_and(|p| live.iter().any(|l| l == p)) {
Fate::Leave
} else if newer_than_save(entry.changed_at, saved_at) {
Fate::Offer
} else {
Fate::Drop
}
}
/// Copies to offer first: the most recently changed, at most [`MAX_OFFERED`].
pub fn order_offered(entries: &mut Vec<Entry>) {
entries.sort_by(|a, b| b.changed_at.total_cmp(&a.changed_at).then_with(|| a.id.cmp(&b.id)));
entries.truncate(MAX_OFFERED);
}
/// Whether a design's copy is due to be written at `now`: the design last changed at
/// `last_change`, and the copy has lacked a change since `first_unwritten` (all ms).
pub fn due(now: f64, first_unwritten: f64, last_change: f64) -> bool {
now - last_change >= QUIET_MS || now - first_unwritten >= MAX_WAIT_MS
}
/// How long after a failed write of a design's copy it isn't tried again (ms).
pub const RETRY_MS: f64 = 30_000.0;
/// Whether a copy whose write last failed at `failed_at` (ms; `None`: it hasn't) may be written
/// at `now`: not before [`RETRY_MS`] has passed, so a full or denied store isn't hit every tick.
pub fn may_write(now: f64, failed_at: Option<f64>) -> bool {
failed_at.is_none_or(|t| !(now >= t) || now - t >= RETRY_MS)
}
/// Whether `wanted` is the design now open, given the open design's path.
pub fn is_open(open: Option<&str>, wanted: &str) -> bool {
open == Some(wanted)
}
/// Whether leaving the page asks through the browser's "leave site?" box: there is unsaved work,
/// and either the user still wants to be asked or it isn't all kept in the browser yet (with the
/// keep preference off it never is, so there the box always stays).
pub fn asks_before_unload(persists: bool, keep: bool, also_ask: bool, any_unsaved: bool, all_kept: bool) -> bool {
persists && any_unsaved && (also_ask || !(keep && all_kept))
}
/// An answer in the "Restore unsaved design?" window.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Answer {
/// Open the copy, with its unsaved changes, as the design it was (saving goes to its file).
Restore,
/// Open the design's file as last saved; the copy goes.
OpenSaved,
/// The copy goes.
Discard,
}
/// What an answer does.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Plan {
/// Open the copy (and, once it is open, give it back its name and file).
pub open_copy: bool,
/// Open this saved file.
pub open_saved: Option<String>,
/// Remove the copy.
pub drop_copy: bool,
}
/// What `answer` does to copy `entry`; `saved_exists`: its file can still be opened. `None`: the
/// answer isn't offered for it (Open saved version of a design never saved, or gone).
pub fn plan(answer: Answer, entry: &Entry, saved_exists: bool) -> Option<Plan> {
match answer {
Answer::Restore => Some(Plan { open_copy: true, open_saved: None, drop_copy: true }),
Answer::OpenSaved => {
let path = entry.path.clone().filter(|_| saved_exists)?;
Some(Plan { open_copy: false, open_saved: Some(path), drop_copy: true })
}
Answer::Discard => Some(Plan { open_copy: false, open_saved: None, drop_copy: true }),
}
}
/// The answers the window offers for `entry`, in order.
pub fn answers(entry: &Entry, saved_exists: bool) -> Vec<Answer> {
[Answer::Restore, Answer::OpenSaved, Answer::Discard].into_iter().filter(|a| plan(*a, entry, saved_exists).is_some()).collect()
}
#[cfg(test)]
mod tests {
use super::*;
fn entry(id: &str, changed_at: f64, path: Option<&str>) -> Entry {
Entry { id: id.into(), name: "Bracket".into(), path: path.map(str::to_string), changed_at }
}
#[test]
fn a_failed_write_waits_before_the_next_try() {
assert!(may_write(1000.0, None));
assert!(!may_write(1000.0 + RETRY_MS - 1.0, Some(1000.0)));
assert!(may_write(1000.0 + RETRY_MS, Some(1000.0)));
// A clock that went back doesn't block for good.
assert!(may_write(10.0, Some(1000.0)));
}
#[test]
fn a_design_counts_as_opened_only_at_its_own_path() {
assert!(is_open(Some("a.sc"), "a.sc"));
assert!(!is_open(Some("b.sc"), "a.sc"));
assert!(!is_open(None, "a.sc"));
}
#[test]
fn copies_are_named_by_page_and_design_and_nothing_else_reads_as_one() {
let page = page_id(1_700_000_000_000.0, 0.5);
assert!(page.chars().all(|c| c.is_ascii_hexdigit()));
let id = entry_id(&page, 7);
assert!(valid_id(&id));
assert_eq!(page_of(&id), Some(page.as_str()));
assert_eq!(parse_name(&design_file(&id)), Some((id.as_str(), Part::Design)));
assert_eq!(parse_name(&meta_file(&id)), Some((id.as_str(), Part::Meta)));
for other in ["part.sc", "recovery.sc", "recovery.json", "keep-.sc", "keep-x.sc", "keep-a/b-1.sc", "keep-a-1.step", "keep-a-1sc"] {
assert_eq!(parse_name(other), None, "{other}");
}
// Hostile clocks still give a usable id.
for (now, random) in [(f64::NAN, f64::NAN), (f64::INFINITY, -1.0), (-5.0, 9.0)] {
assert!(valid_id(&entry_id(&page_id(now, random), 1)));
}
}
#[test]
fn metadata_round_trips_and_hostile_metadata_is_no_copy() {
let e = entry("a1-3", 1234.0, Some("/opfs/Bracket.sc"));
assert_eq!(Entry::parse("a1-3", e.to_json().as_bytes()), Some(e.clone()));
let never_saved = entry("a1-4", 99.0, None);
assert_eq!(Entry::parse("a1-4", never_saved.to_json().as_bytes()), Some(never_saved));
for bad in [
"",
"[]",
r#"{"name":"x","changed_at":"soon"}"#,
r#"{"name":"x","changed_at":-1}"#,
r#"{"name":"x","changed_at":1e999}"#,
r#"{"name":"x","path":7,"changed_at":1}"#,
r#"{"name":"x","path":"","changed_at":1}"#,
r#"{"changed_at":1}"#,
] {
assert_eq!(Entry::parse("a1-3", bad.as_bytes()), None, "{bad}");
}
assert_eq!(Entry::parse("../x", e.to_json().as_bytes()), None);
assert_eq!(Entry::parse("a1-3", &vec![b' '; MAX_META_BYTES + 1]), None);
let long = json!({"name": "n".repeat(10_000), "changed_at": 1}).to_string();
assert_eq!(Entry::parse("a1-3", long.as_bytes()).map(|e| e.name.len()), Some(MAX_NAME));
}
#[test]
fn a_copy_newer_than_the_last_save_is_offered_an_older_one_dropped_an_open_pages_left() {
let e = entry("p1-1", 2000.0, Some("/opfs/Bracket.sc"));
// Changed after the file was last written: offered.
assert_eq!(fate(&e, &[], Some(1000.0)), Fate::Offer);
// Saved since (in this tab or another): nothing to offer.
assert_eq!(fate(&e, &[], Some(2000.0)), Fate::Drop);
assert_eq!(fate(&e, &[], Some(3000.0)), Fate::Drop);
// Never saved, or the save time can't be read: kept rather than lost.
for saved in [None, Some(0.0), Some(f64::NAN), Some(f64::INFINITY), Some(-4.0)] {
assert_eq!(fate(&e, &[], saved), Fate::Offer, "{saved:?}");
}
// Its page is still open in another tab: neither offered nor removed.
assert_eq!(fate(&e, &["p1".into()], Some(1000.0)), Fate::Leave);
assert_eq!(fate(&e, &["p1".into()], Some(3000.0)), Fate::Leave);
assert_eq!(fate(&e, &["p2".into()], Some(1000.0)), Fate::Offer);
}
#[test]
fn the_newest_copies_are_offered_first_and_at_most_a_windowful() {
let mut list: Vec<Entry> = (0..40).map(|i| entry(&format!("p-{i}"), f64::from(i), None)).collect();
order_offered(&mut list);
assert_eq!(list.len(), MAX_OFFERED);
assert_eq!(list.first().map(|e| e.id.as_str()), Some("p-39"));
}
#[test]
fn a_copy_is_written_once_the_design_is_still_or_after_the_longest_wait() {
// Still changing, not waited long: not yet.
assert!(!due(1000.0, 900.0, 900.0));
// Still for QUIET_MS: due.
assert!(due(900.0 + QUIET_MS, 900.0, 900.0));
// Changing all the time: due after MAX_WAIT_MS anyway.
assert!(!due(5000.0, 2000.0, 4900.0));
assert!(due(2000.0 + MAX_WAIT_MS, 2000.0, 2000.0 + MAX_WAIT_MS - 1.0));
}
#[test]
fn the_browser_asks_before_unload_unless_told_not_to_and_every_copy_is_current() {
// Keeping off: exactly as before, unsaved work asks, whatever the second option says.
assert!(asks_before_unload(true, false, true, true, true));
assert!(asks_before_unload(true, false, true, true, false));
assert!(asks_before_unload(true, false, false, true, true));
// Keeping on, asking on (the default): both, the box and the copy.
assert!(asks_before_unload(true, true, true, true, true));
// Keeping on, asking off, every unsaved design kept: no browser box.
assert!(!asks_before_unload(true, true, false, true, true));
// Keeping on, asking off, a copy still being written (or failed): the browser still asks.
assert!(asks_before_unload(true, true, false, true, false));
// Nothing unsaved, or an embedded page that keeps nothing: never.
assert!(!asks_before_unload(true, true, true, false, false));
assert!(!asks_before_unload(true, false, true, false, false));
assert!(!asks_before_unload(false, false, true, true, false));
}
#[test]
fn restore_open_saved_and_discard_each_do_one_thing_and_always_remove_the_copy() {
let saved = entry("p-1", 5.0, Some("/opfs/Bracket.sc"));
assert_eq!(plan(Answer::Restore, &saved, true), Some(Plan { open_copy: true, open_saved: None, drop_copy: true }));
assert_eq!(
plan(Answer::OpenSaved, &saved, true),
Some(Plan { open_copy: false, open_saved: Some("/opfs/Bracket.sc".into()), drop_copy: true })
);
assert_eq!(plan(Answer::Discard, &saved, true), Some(Plan { open_copy: false, open_saved: None, drop_copy: true }));
assert_eq!(answers(&saved, true), [Answer::Restore, Answer::OpenSaved, Answer::Discard]);
// A design never saved, or whose file is gone, has no saved version to open.
let never = entry("p-2", 5.0, None);
assert_eq!(plan(Answer::OpenSaved, &never, true), None);
assert_eq!(plan(Answer::OpenSaved, &saved, false), None);
assert_eq!(answers(&never, false), [Answer::Restore, Answer::Discard]);
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ impl Download {
}
if solidcraft_ui_egui::documents::any_dirty(app) {
let mut answer = None;
let closed = ui_kit::Window::new(egui::Id::unique("open_link"), "status_warning", solidcraft_ui_egui::i18n::tr("web.open_link"))
let closed = ui_kit::Window::new(egui::Id::new("open_link"), "status_warning", solidcraft_ui_egui::i18n::tr("web.open_link"))
.required()
.show_body(ctx, |ui| {
ui.label(solidcraft_ui_egui::i18n::tr("web.open_link_confirm"));
+8 -257
View File
@@ -19,8 +19,6 @@ mod easyprint;
mod files;
#[cfg(target_arch = "wasm32")]
mod install;
#[cfg(any(target_arch = "wasm32", test))]
mod keep;
#[cfg(target_arch = "wasm32")]
mod linked;
#[cfg(any(target_arch = "wasm32", test))]
@@ -186,7 +184,6 @@ mod web {
use crate::api::Api;
use crate::disk::{self, SaveTarget};
use crate::files::{self, Files, Intent};
use crate::keep;
use crate::space_mouse::SpaceMouse;
const CANVAS_ID: &str = "solidcraft_canvas";
@@ -246,9 +243,7 @@ mod web {
}
/// The browser's "leave site? changes you made may not be saved" prompt while a design has
/// unsaved changes (the page can't show its own dialog when it is being closed). With "keep
/// unsaved work in this browser" on and "still ask" off, there is nothing to ask once every
/// unsaved design's copy is current (`keep::asks_before_unload`, #10220).
/// unsaved changes (the page can't show its own dialog when it is being closed).
fn ask_before_unload(window: &web_sys::Window) {
let on_unload = wasm_bindgen::closure::Closure::<dyn FnMut(web_sys::BeforeUnloadEvent)>::new(|e: web_sys::BeforeUnloadEvent| {
if UNSAVED.with(std::cell::Cell::get) {
@@ -261,50 +256,6 @@ mod web {
on_unload.forget();
}
/// With "keep unsaved work in this browser" on, the page brings every unsaved design's copy up
/// to date when it is hidden or goes (`pagehide`, `visibilitychange`): the browser may not
/// wait for that write, so the copies are written shortly after each change as well
/// (`Shell::keep_tick`, #10220).
fn keep_when_hidden(window: &web_sys::Window, runner: &eframe::WebRunner) {
let keep_now = {
let runner = runner.clone();
move || {
if let Some(mut shell) = runner.app_mut::<Shell>() {
shell.keep_tick(None, true);
}
}
};
let on_hide = {
let keep_now = keep_now.clone();
wasm_bindgen::closure::Closure::<dyn FnMut(web_sys::Event)>::new(move |_: web_sys::Event| keep_now())
};
let on_visibility = wasm_bindgen::closure::Closure::<dyn FnMut(web_sys::Event)>::new(move |_: web_sys::Event| {
let hidden = web_sys::window()
.and_then(|w| w.document())
.and_then(|d| js_sys::Reflect::get(&d, &"visibilityState".into()).ok())
.and_then(|v| v.as_string())
.is_some_and(|v| v == "hidden");
if hidden {
keep_now();
}
});
let _ = window.add_event_listener_with_callback("pagehide", on_hide.as_ref().unchecked_ref());
if let Some(document) = window.document() {
let _ = document.add_event_listener_with_callback("visibilitychange", on_visibility.as_ref().unchecked_ref());
}
// The listeners live as long as the page.
on_hide.forget();
on_visibility.forget();
}
/// One open design followed for its kept copy: its revision, when that last changed, and since
/// when its copy has lacked a change (`None`: current, or being written).
struct Track {
revision: u64,
last_change: f64,
first_unwritten: Option<f64>,
}
/// eframe cancels the browser's action for every Tab it gets, so the browser couldn't switch
/// tabs while the app has the keyboard. Its tab-switching keys stop here, on the way down to
/// the canvas, before eframe sees them; the browser then acts on them as usual.
@@ -377,10 +328,6 @@ mod web {
/// The settings this tab wrote or loaded last, and those another tab wrote since (#8644).
prefs_writer: crate::PrefsWriter,
other_tab_prefs: PrefsInbox,
/// The open designs followed for their kept copy, by `Session::uid` (#10220).
keep_track: std::collections::HashMap<u64, Track>,
/// Every unsaved design's kept copy is current (and the preference is on).
all_kept: bool,
}
impl Shell {
@@ -495,14 +442,8 @@ mod web {
self.sync_recents();
}
let now = ctx.input(|i| i.time);
// With "keep unsaved work in this browser" on, each design's own copy takes over from
// the single autosave (#10220).
if self.app.preferences.keep_unsaved_in_browser && self.autosaved.is_some() {
files::autosave(&self.files, None);
self.autosaved = None;
}
// Unsaved work is kept (at most every AUTOSAVE_S); saved work needs no autosave.
if self.files.ready.get() && self.files.recovery.borrow().is_none() && !self.app.preferences.keep_unsaved_in_browser {
if self.files.ready.get() && self.files.recovery.borrow().is_none() {
let s = &self.app.session;
let changed = s.is_dirty() && self.autosaved != Some(s.revision);
let wait = AUTOSAVE_S - (now - self.autosaved_at);
@@ -521,175 +462,6 @@ mod web {
if !self.files.ready.get() || !self.files.incoming.borrow().is_empty() {
ctx.request_repaint_after(std::time::Duration::from_millis(100));
}
self.all_kept = self.keep_tick(Some(ctx), false);
}
/// Keep each open design's unsaved changes in the browser, when the preference asks for
/// it: a design's copy is written once it has been still a moment (`keep::due`), or at
/// once with `now` (the page is being hidden); a copy whose design is saved or closed, or
/// with the preference off, goes. Answers whether every unsaved design's copy is current.
fn keep_tick(&mut self, ctx: Option<&egui::Context>, now: bool) -> bool {
if !self.launch.persists() || !self.files.ready.get() {
return false;
}
let Shell { app, files, keep_track, .. } = self;
let on = app.preferences.keep_unsaved_in_browser;
let time = js_sys::Date::now();
let page = files.keep_page.borrow().clone();
let mut wanted = std::collections::HashSet::new();
let mut all_kept = true;
let mut wake: Option<f64> = None;
let mut error = None;
let mut soon = |ms: f64| wake = Some(wake.map_or(ms, |w: f64| w.min(ms)));
if on {
for s in solidcraft_ui_egui::documents::open_sessions(app).into_iter().filter(|s| s.is_dirty()) {
let id = keep::entry_id(&page, s.uid);
wanted.insert(s.uid);
let t = keep_track.entry(s.uid).or_insert(Track { revision: s.revision, last_change: time, first_unwritten: None });
if t.revision != s.revision {
t.revision = s.revision;
t.last_change = time;
}
if files.kept.borrow().get(&id).copied().flatten() == Some(s.revision) {
t.first_unwritten = None;
continue;
}
all_kept = false;
if files.keeping.borrow().contains(&id) {
soon(100.0);
continue;
}
let first = *t.first_unwritten.get_or_insert(time);
let failed = files.kept_failed.borrow().get(&id).copied();
if !keep::may_write(time, failed) {
// The last write failed: try again after a while.
soon(keep::RETRY_MS);
continue;
}
if now || keep::due(time, first, t.last_change) {
match solidcraft_engine::io::write_design_container(&s.design()) {
Ok(bytes) => {
let entry = keep::Entry { id, name: s.doc.name.clone(), path: s.path.clone(), changed_at: t.last_change };
files::write_kept(files, &entry, bytes, s.revision);
t.first_unwritten = None;
}
Err(e) => {
files.kept_failed.borrow_mut().insert(id, time);
error = Some(format!("keeping unsaved work in this browser: {e}"));
}
}
soon(100.0);
} else {
soon((keep::QUIET_MS - (time - t.last_change)).min(keep::MAX_WAIT_MS - (time - first)).max(16.0));
}
}
}
// This page's copies no design needs any more: saved, closed, or the preference off.
let stale: Vec<String> = files
.kept
.borrow()
.keys()
.filter(|id| keep::page_of(id) == Some(page.as_str()))
.filter(|id| !wanted.iter().any(|uid| keep::entry_id(&page, *uid) == **id))
.cloned()
.collect();
for id in stale {
files::remove_kept(files, &id);
soon(100.0);
}
keep_track.retain(|uid, _| wanted.contains(uid));
if let Some(e) = error {
app.set_status(e, true);
}
if let (Some(ctx), Some(ms)) = (ctx, wake) {
ctx.request_repaint_after(std::time::Duration::from_secs_f64(ms / 1000.0));
}
on && all_kept
}
/// Offer the copies an earlier visit kept (#10220): "Restore unsaved design: <name>,
/// changed <time>?", one window for all of them, each with Restore, Open saved version
/// (when it has a file) and Discard.
fn keep_prompt(&mut self, ctx: &egui::Context) {
let offered = self.files.keep_offered.borrow().clone();
if offered.is_empty() || !self.files.ready.get() {
return;
}
let now = (js_sys::Date::now() / 1000.0) as u64;
let rows: Vec<_> = offered
.iter()
.map(|e| solidcraft_ui_egui::recovery_ui::BrowserCopy {
name: &e.name,
when: solidcraft_ui_egui::recovery_ui::ago_between(now, (e.changed_at / 1000.0) as u64),
open_saved: keep::answers(e, self.saved_exists(e)).contains(&keep::Answer::OpenSaved),
})
.collect();
let act = solidcraft_ui_egui::recovery_ui::browser_copies_window(ctx, &self.app.preferences.language, &rows);
let Some((index, answer)) = act else { return };
let Some(entry) = offered.get(index) else { return };
let answer = match answer {
solidcraft_ui_egui::recovery_ui::CopyAnswer::Restore => keep::Answer::Restore,
solidcraft_ui_egui::recovery_ui::CopyAnswer::OpenSaved => keep::Answer::OpenSaved,
solidcraft_ui_egui::recovery_ui::CopyAnswer::Discard => keep::Answer::Discard,
};
self.keep_answer(entry, answer);
}
/// Whether a kept copy's design file can still be opened: in the browser's storage, or a
/// file on the computer this browser remembers.
fn saved_exists(&self, e: &keep::Entry) -> bool {
e.path.as_deref().is_some_and(|p| vfs::exists(p) || disk::parse(p).is_some_and(|(id, _)| self.files.disk_known.borrow().contains(id)))
}
/// Act on an answer in the "Restore unsaved design?" window (`keep::plan`).
fn keep_answer(&mut self, entry: &keep::Entry, answer: keep::Answer) {
let Some(plan) = keep::plan(answer, entry, self.saved_exists(entry)) else { return };
if plan.open_copy {
let copy = match files::prepare_kept(&entry.id, entry.path.as_deref()) {
Ok(copy) => copy,
Err(error) => {
self.app.set_status(error, true);
return;
}
};
self.app.open_path(&copy);
if self.app.session.path.as_deref() != Some(copy.as_str()) {
// Not opened (the status says why): it stays offered.
return;
}
// It is its own design again (saving goes to its file), with its changes unsaved.
self.app.session.path = entry.path.clone();
self.app.session.doc_mut().name = entry.name.clone();
self.app.session.mark_unsaved();
self.app.home.open = false;
}
if let Some(path) = &plan.open_saved {
if vfs::exists(path) {
self.app.open_path(path);
if !keep::is_open(self.app.session.path.as_deref(), path) {
// Not opened (the status says why): the copy stays offered.
return;
}
} else {
// A file on the computer: the browser asks for access again, in this click.
// The copy goes once the file has opened, not before: if access is refused,
// the picker is dismissed or the file is gone, it stays offered.
let (files, id) = (self.files.clone(), entry.id.clone());
disk::restore(
&self.files,
path,
Some(Box::new(move || {
files.keep_offered.borrow_mut().retain(|e| e.id != id);
files::remove_kept(&files, &id);
})),
);
return;
}
}
if plan.drop_copy {
self.files.keep_offered.borrow_mut().retain(|e| e.id != entry.id);
files::remove_kept(&self.files, &entry.id);
}
}
/// The start page's recent designs are the stored ones: the remembered order first (those
@@ -726,7 +498,7 @@ mod web {
return;
}
let mut act: Option<(&'static str, String)> = None;
let closed = solidcraft_ui_egui::ui_kit::Window::new(egui::Id::unique("sc_browser_files"), "folder", "Files in this browser")
let closed = solidcraft_ui_egui::ui_kit::Window::new(egui::Id::new("sc_browser_files"), "folder", "Files in this browser")
// Room for long names; the kit still caps the window at the browser's width.
.cards(4.0)
.show_body(ctx, |ui| {
@@ -890,7 +662,7 @@ mod web {
fn recovery_prompt(&mut self, ctx: &egui::Context) {
let Some((name, path)) = self.files.recovery.borrow().clone() else { return };
let mut answer = None;
let _ = solidcraft_ui_egui::ui_kit::Window::new(egui::Id::unique("sc_browser_recovery"), "restore", "Recover unsaved work?")
let _ = solidcraft_ui_egui::ui_kit::Window::new(egui::Id::new("sc_browser_recovery"), "restore", "Recover unsaved work?")
.required()
.show_body(ctx, |ui| {
ui.label(format!("“{name}” had unsaved changes when this page last closed."));
@@ -926,13 +698,6 @@ mod web {
files::autosave(&self.files, None);
}
/// Whether leaving the page asks through the browser's own box (`keep::asks_before_unload`).
fn asks_before_unload(&self) -> bool {
let any = solidcraft_ui_egui::documents::any_dirty(&self.app);
let prefs = &self.app.preferences;
keep::asks_before_unload(self.launch.persists(), prefs.keep_unsaved_in_browser, prefs.keep_unsaved_also_asks, any, self.all_kept)
}
/// Whether the shell already has the on-demand face the live language needs.
fn script_font_ready(&self) -> bool {
match solidcraft_ui_egui::fonts::web_script_font_kind(solidcraft_ui_egui::i18n::effective_language(&self.app.preferences.language)) {
@@ -1044,7 +809,7 @@ mod web {
self.api.poll();
self.space_mouse.logic(&mut self.app, ctx);
self.files_tick(ctx);
UNSAVED.with(|u| u.set(self.asks_before_unload()));
UNSAVED.with(|u| u.set(solidcraft_ui_egui::documents::any_dirty(&self.app)));
DESIGN_SHOWN.with(|d| d.set(solidcraft_ui_egui::toolbar::design_shown(&self.app)));
}
fn raw_input_hook(&mut self, ctx: &egui::Context, raw: &mut egui::RawInput) {
@@ -1064,7 +829,7 @@ mod web {
}
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
self.linked.tick(&mut self.app, ui.ctx());
UNSAVED.with(|u| u.set(self.asks_before_unload()));
UNSAVED.with(|u| u.set(self.launch.persists() && solidcraft_ui_egui::documents::any_dirty(&self.app)));
if self.launch.embed {
ui_kit::Container::new(ui.ctx(), ui_kit::Surface::Chrome).edge("embed_header", ui_kit::Edge::Top).show(ui, |ui| {
if ui_kit::button(ui, solidcraft_ui_egui::i18n::tr("web.open_full"), ui_kit::Button::Normal).clicked()
@@ -1079,15 +844,10 @@ mod web {
if self.launch.persists() {
self.file_panel(&ctx);
self.recovery_prompt(&ctx);
self.keep_prompt(&ctx);
}
self.watch_text_for_font(&ctx);
self.store_prefs(&ctx);
}
#[cfg(target_arch = "wasm32")]
fn as_any_mut(&mut self) -> Option<&mut dyn std::any::Any> {
Some(&mut *self)
}
fn persist_egui_memory(&self) -> bool {
// eframe keeps this under one fixed key: only stable uses it, so a pre-release never rewrites it.
self.launch.persists() && crate::channel::current().is_empty()
@@ -1162,8 +922,7 @@ mod web {
{
create.instance_descriptor.backends = eframe::wgpu::Backends::GL;
}
let runner = eframe::WebRunner::new();
let result = runner
let result = eframe::WebRunner::new()
.start(
canvas,
options,
@@ -1207,7 +966,7 @@ mod web {
can_restore: Some(Box::new(move |path: &str| {
disk::parse(path).is_some_and(|(id, _)| restorable.disk_known.borrow().contains(id))
})),
restore_file: Some(Box::new(move |path: &str| disk::restore(&restorer, path, None))),
restore_file: Some(Box::new(move |path: &str| disk::restore(&restorer, path))),
download_design: Some(Box::new(files::download)),
easyprint_upload: Some(std::sync::Arc::new(crate::easyprint::upload)),
browser_files: Some(Box::new(move || shown.panel.set(true))),
@@ -1274,18 +1033,10 @@ mod web {
wheel_gestures: solidcraft_ui_egui::WebWheelGestures::default(),
prefs_writer: crate::PrefsWriter::default(),
other_tab_prefs,
keep_track: Default::default(),
all_kept: false,
}))
}),
)
.await;
if result.is_ok()
&& crate::Launch::parse(&query()).persists()
&& let Some(window) = web_sys::window()
{
keep_when_hidden(&window, &runner);
}
if let Some(el) = document.get_element_by_id(LOADING_ID) {
match result {
Ok(()) => dismiss_loading(el),
+9 -13
View File
@@ -68,9 +68,7 @@ pub fn start(listen_on: control_auth::Listen, ctx: egui::Context) -> Receiver<Co
Ok(l) => {
if let Some(port) = listen_on_listener(l, token.clone(), tx, ctx, false) {
if matches!(listen_on, control_auth::Listen::Default) {
solidcraft_engine::note!(
"solidcraft: control channel on the default port 127.0.0.1:{port} (Preferences > Assistant turns it off)"
);
eprintln!("solidcraft: control channel on the default port 127.0.0.1:{port} (Preferences > Assistant turns it off)");
}
// The discovery file: where `solidcraft-cli mcp` finds this app with no arguments.
match control_auth::write_current_port(port) {
@@ -79,14 +77,14 @@ pub fn start(listen_on: control_auth::Listen, ctx: egui::Context) -> Receiver<Co
*p = Some((port, token));
}
}
Err(e) => solidcraft_engine::note!("solidcraft: could not write the control discovery file ({e})"),
Err(e) => eprintln!("solidcraft: could not write the control discovery file ({e})"),
}
}
}
Err(e) => solidcraft_engine::note!("solidcraft: control server failed to bind 127.0.0.1: {e}"),
Err(e) => eprintln!("solidcraft: control server failed to bind 127.0.0.1: {e}"),
}
}
None => solidcraft_engine::note!("solidcraft: control server not started: no random token available"),
None => eprintln!("solidcraft: control server not started: no random token available"),
}
rx
}
@@ -97,13 +95,13 @@ pub fn start(listen_on: control_auth::Listen, ctx: egui::Context) -> Receiver<Co
/// requests go to `tx`, where the chat's gate reads them; one may wait long for the user's Allow.
pub fn listen_agent(tx: Sender<ControlRequest>, ctx: egui::Context) -> Option<u16> {
let Some(token) = new_token() else {
solidcraft_engine::note!("solidcraft: agent chat endpoint not started: no random token available");
eprintln!("solidcraft: agent chat endpoint not started: no random token available");
return None;
};
let listener = match TcpListener::bind(("127.0.0.1", 0)) {
Ok(l) => l,
Err(e) => {
solidcraft_engine::note!("solidcraft: control server failed to bind 127.0.0.1: {e}");
eprintln!("solidcraft: control server failed to bind 127.0.0.1: {e}");
return None;
}
};
@@ -117,21 +115,19 @@ fn listen_on_listener(listener: TcpListener, token: String, tx: Sender<ControlRe
match control_auth::token_path(port) {
Some(path) => match control_auth::write_token_file(&path, &token) {
Ok(()) => {
solidcraft_engine::note!("solidcraft: control server listening on 127.0.0.1:{port} (token in {})", path.display());
eprintln!("solidcraft: control server listening on 127.0.0.1:{port} (token in {})", path.display());
if let Ok(mut files) = TOKEN_FILES.lock() {
files.push((path, token.clone()));
}
}
Err(e) => solidcraft_engine::note!(
Err(e) => eprintln!(
"solidcraft: control server listening on 127.0.0.1:{port}, but its token file {} could not be written ({e}); \
clients need SOLIDCRAFT_CONTROL_TOKEN",
path.display()
),
},
None => {
solidcraft_engine::note!(
"solidcraft: control server listening on 127.0.0.1:{port}; no data folder for its token, clients need SOLIDCRAFT_CONTROL_TOKEN"
)
eprintln!("solidcraft: control server listening on 127.0.0.1:{port}; no data folder for its token, clients need SOLIDCRAFT_CONTROL_TOKEN")
}
}
let token = std::sync::Arc::new(token);
+1 -1
View File
@@ -112,7 +112,7 @@ pub fn restart(software: bool, lost_at: u64, reason: &str) {
pub fn end() -> ! {
let watchdog = std::thread::Builder::new().name("solidcraft-exit".into()).spawn(|| {
std::thread::sleep(END_GRACE);
solidcraft_engine::note!("SolidCraft graphics: still closing after the device was lost; aborting");
eprintln!("SolidCraft graphics: still closing after the device was lost; aborting");
std::process::abort();
});
if let Err(e) = watchdog {
+13 -16
View File
@@ -79,7 +79,7 @@ fn mark(step: &str) {
static START: std::sync::OnceLock<(std::time::Instant, bool)> = std::sync::OnceLock::new();
let (start, on) = START.get_or_init(|| (std::time::Instant::now(), solidcraft_engine::geom::env::var_os("PROFILE_STARTUP").is_some()));
if *on {
solidcraft_engine::note!("startup {:>6.0} ms {step}", start.elapsed().as_secs_f64() * 1000.0);
eprintln!("startup {:>6.0} ms {step}", start.elapsed().as_secs_f64() * 1000.0);
}
}
@@ -303,8 +303,6 @@ impl eframe::App for App {
log::warn!("a picture was still being drawn as the app closed");
}
solidcraft_ui_egui::recovery_ui::close(&mut self.solve);
// A GPU path tracer setup still running did not stop the app (#9236).
solidcraft_ui_egui::render_workspace::close(&mut self.solve);
solidcraft_ui_egui::open_elsewhere::close(&mut self.solve);
// Before a restart (`Drop for App`) starts the next instance, which would otherwise get
// nothing from the 3D mouse driver (`solidcraft_3dx_client::stop`).
@@ -368,7 +366,7 @@ impl App {
let Some(gpu) = self.gpu.as_mut().filter(|g| g.lost_at.is_none() && g.lost.is_lost()) else { return };
let reason = gpu.lost.reason().unwrap_or_default();
log::error!("graphics: the device was lost ({reason}); closing to start again");
solidcraft_engine::note!("SolidCraft graphics: the device was lost ({reason}); starting again");
eprintln!("SolidCraft graphics: the device was lost ({reason}); starting again");
solidcraft_engine::crash::phase(&format!("graphics device lost: {reason}"));
gpu.lost_at = Some(device_lost::now_secs());
gpu.reason = reason;
@@ -993,7 +991,7 @@ fn main() -> eframe::Result {
if let Some(value) = max_file_size {
let applied = startup::max_file_size(value.as_deref()).and_then(|bytes| solidcraft_engine::io::limits::set_override(Some(bytes)));
if let Err(error) = applied {
solidcraft_engine::note!("SolidCraft: {error}");
eprintln!("SolidCraft: {error}");
return Err(eframe::Error::AppCreation(std::io::Error::other(error).into()));
}
}
@@ -1025,7 +1023,7 @@ fn main() -> eframe::Result {
let fallback_note = std::env::var(startup::FALLBACK_NOTE_ENV).ok().map(|s| s.chars().take(4096).collect::<String>());
if let Some(note) = &fallback_note {
log::warn!("{note}");
solidcraft_engine::note!("SolidCraft: {note}");
eprintln!("SolidCraft: {note}");
notes.push(note.clone());
}
let saved_samples = if safe_mode { None } else { msaa() };
@@ -1138,13 +1136,13 @@ fn main() -> eframe::Result {
// Windows: the taskbar button shows the mark even when slow first frames keep the
// taskbar waiting for the window's icon.
if !native_frame::set_class_icon(cc) {
solidcraft_engine::note!("SolidCraft window: no class icon; the taskbar may show a generic one");
eprintln!("SolidCraft window: no class icon; the taskbar may show a generic one");
}
// The OS hit test offers the resize border, at the window's DPI, from the first
// message (#1381).
app.native_resize_border = custom_titlebar && native_frame::install(cc);
if custom_titlebar && !app.native_resize_border {
solidcraft_engine::note!("SolidCraft window: no native resize border; egui edge zones instead");
eprintln!("SolidCraft window: no native resize border; egui edge zones instead");
}
}
app.integrated_titlebar = cfg!(target_os = "macos");
@@ -1175,10 +1173,9 @@ fn main() -> eframe::Result {
.collect();
let info = rs.adapter.get_info();
if !app.preferences.graphics_adapter.is_empty() && !info.name.eq_ignore_ascii_case(app.preferences.graphics_adapter.as_str()) {
solidcraft_engine::note!(
eprintln!(
"SolidCraft graphics: preferred adapter {:?} was not used; using {:?} instead",
app.preferences.graphics_adapter,
info.name
app.preferences.graphics_adapter, info.name
);
}
let samples = scene_msaa_request(saved_samples);
@@ -1186,7 +1183,7 @@ fn main() -> eframe::Result {
eframe::egui_wgpu::supported_msaa_samples(&rs.adapter, &rs.device, rs.target_format, depth)
});
let scene_samples = scene_samples(info.backend, u32::from(samples), &supported);
solidcraft_engine::note!("SolidCraft graphics: {:?}, MSAA {scene_samples}x (requested {}x)", rs.adapter.get_info().backend, samples);
eprintln!("SolidCraft graphics: {:?}, MSAA {scene_samples}x (requested {}x)", rs.adapter.get_info().backend, samples);
solidcraft_engine::crash::phase("viewport pipelines (shader compile)");
let scene_samples = app.set_wgpu_split(rs, depth_bits, STENCIL_BITS, scene_samples);
app.msaa_supported = supported;
@@ -1347,7 +1344,7 @@ fn wgpu_options(cpu: bool, preference: Option<&str>) -> eframe::egui_wgpu::WgpuC
let retry = std::env::var(startup::RETRY_BACKEND_ENV).ok();
let preference = if cpu { preference } else { retry.as_deref().or(preference) };
if let Some(backends) = startup::choose_backends(cfg!(target_os = "windows"), env_set, cpu, preference, startup::has_hardware_adapter) {
solidcraft_engine::note!("SolidCraft graphics: starting {backends:?}");
eprintln!("SolidCraft graphics: starting {backends:?}");
setup.instance_descriptor.backends = backends;
}
let intel_mac = cfg!(all(target_os = "macos", target_arch = "x86_64"));
@@ -1373,7 +1370,7 @@ fn wgpu_options(cpu: bool, preference: Option<&str>) -> eframe::egui_wgpu::WgpuC
/// event loop or a failed device; each retry advances through the APIs, then software once.
fn no_window(error: eframe::Error, tried_cpu: bool, failed: eframe::wgpu::Backends, settings: Option<&std::path::Path>) -> eframe::Result {
log::error!("the window could not open: {error}");
solidcraft_engine::note!("SolidCraft: the window could not open: {error}");
eprintln!("SolidCraft: the window could not open: {error}");
// This failure was handled, so neither the marker nor the journal should call it a crash.
if let Some(dir) = settings {
startup::started(dir);
@@ -1386,7 +1383,7 @@ fn no_window(error: eframe::Error, tried_cpu: bool, failed: eframe::wgpu::Backen
let previous = std::env::var(startup::FALLBACK_NOTE_ENV).unwrap_or_default();
let note = startup::fallback_note(&previous, failed, next, &error.to_string());
log::warn!("{note}");
solidcraft_engine::note!("SolidCraft: {note}");
eprintln!("SolidCraft: {note}");
let mut command = std::process::Command::new(exe);
command.args(std::env::args_os().skip(1)).env(startup::FALLBACK_NOTE_ENV, note);
if next == "cpu" {
@@ -1792,7 +1789,7 @@ mod viewport_tests {
viewport.fullscreen = Some(fullscreen);
viewport.native_pixels_per_point = Some(retina);
super::fullscreen_content_insets(&mut raw, 32.0, zoom);
ctx.run_ui(raw, |ui| super::content_ui(app, ui)).textures_delta.clear();
let _ = ctx.run_ui(raw, |ui| super::content_ui(app, ui));
};
// Enter, leave, and enter again: no stale inset when returning to a normal window.
for fullscreen in [false, true, false, true] {
+1 -1
View File
@@ -434,7 +434,7 @@ mod tests {
let mut app = SolveApp::new(solidcraft_engine::Session::default(), solidcraft_ui_egui::Services::default());
app.home.open = false;
let ctx = Context::default();
ctx.run_ui(egui::RawInput { focused: true, ..Default::default() }, |_| {}).textures_delta.clear();
let _ = ctx.run_ui(egui::RawInput { focused: true, ..Default::default() }, |_| {});
let mut bridge = NavBridge { shared: Arc::new(Mutex::new(Shared::default())) };
let queue = |bridge: &NavBridge| {
let mut shared = bridge.shared.lock().unwrap();
-1
View File
@@ -1914,7 +1914,6 @@ mod tests {
fn wheel() -> egui::Event {
egui::Event::MouseWheel {
source: egui::MouseWheelSource::Unknown,
unit: egui::MouseWheelUnit::Line,
delta: egui::vec2(0.0, -1.0),
modifiers: Default::default(),
+17 -23
View File
@@ -40,10 +40,10 @@ fn connect_to(path: &Path) -> Option<UnixStream> {
/// The axes of one record, or `None` for a record that is not motion.
///
/// The daemon reports x to the right, y up and z away from the user; our raw HID frame is x
/// right, y towards the user and z down. Swap and negate y/z and ry/rz to match that frame.
/// With nothing set in `spnavcfg` the two readers give the same motion; what the user swaps
/// or inverts there then carries over.
/// The daemon's frame is right-handed with x to the right, y away from the user and z up; ours is
/// the device's raw one, x right, y towards the user and z down, so y and z (and the rotations
/// about them) change sign. With nothing set in `spnavcfg` the two give the same motion; what
/// the user swaps or inverts there then carries over.
fn decode(record: &[u8; RECORD_BYTES]) -> Option<Axes> {
let mut data = [0_i32; 8];
for (slot, bytes) in data.iter_mut().zip(record.as_chunks::<4>().0) {
@@ -51,8 +51,8 @@ fn decode(record: &[u8; RECORD_BYTES]) -> Option<Axes> {
}
let [kind, x, y, z, rx, ry, rz, _period] = data;
(kind == 0).then(|| Axes {
translation: [unit(x), unit(-i64::from(z)), unit(-i64::from(y))],
rotation: [unit(rx), unit(-i64::from(rz)), unit(-i64::from(ry))],
translation: [unit(x), unit(-i64::from(y)), unit(-i64::from(z))],
rotation: [unit(rx), unit(-i64::from(ry)), unit(-i64::from(rz))],
})
}
@@ -149,28 +149,22 @@ mod tests {
#[test]
fn motion_records_become_axes_in_the_devices_raw_frame() {
// Each daemon axis reaches only its matching raw HID axis, in both directions.
for (daemon_axis, raw_axis, sign) in [(0, 0, 1), (1, 2, -1), (2, 1, -1), (3, 3, 1), (4, 5, -1), (5, 4, -1)] {
for value in [-500, 500] {
let mut data = [0; 8];
data[daemon_axis + 1] = value;
let mut expected = [0; 6];
expected[raw_axis] = sign * (value * 350 / 500) as i16;
assert_eq!(decode(&record(data)), Some(Axes::from(expected)), "daemon axis {daemon_axis}, value {value}");
}
}
// Full deflection of the daemon's x, y and z is the device's full scale, and y and z flip.
assert_eq!(decode(&record([0, 500, 500, 500, 0, 0, 0, 8])), Some(Axes { translation: [350, -350, -350], rotation: [0; 3] }));
// Rotations follow translations: right-handed in both frames, so ry and rz flip as y and z do.
assert_eq!(decode(&record([0, 0, 0, 0, 250, 250, 250, 8])), Some(Axes { translation: [0; 3], rotation: [175, -175, -175] }));
// Rest is a motion record of zeros.
assert_eq!(decode(&record([0, 0, 0, 0, 0, 0, 0, 1200])), Some(Axes::default()));
}
#[test]
fn what_spnavcfg_swaps_reaches_the_view() {
// A push away is daemon z (raw y); swapping Y/Z makes it a lift (raw z).
// The same swap changes a sideways tilt (daemon rz, raw ry) into a twist (raw rz).
let before = decode(&record([0, 0, 0, 500, 0, 0, 250, 8]));
let after = decode(&record([0, 0, 500, 0, 0, 250, 0, 8]));
assert_eq!(before, Some(Axes { translation: [0, -350, 0], rotation: [0, -175, 0] }));
assert_eq!(after, Some(Axes { translation: [0, 0, -350], rotation: [0, 0, -175] }));
// The daemon sends a push away as y. With Y and Z swapped in spnavcfg it sends the same push
// as z, and the view gets a lift (raw z) instead of the zoom (raw y).
let before = decode(&record([0, 0, 500, 0, 0, 0, 0, 8])).map(|axes| axes.translation);
let after = decode(&record([0, 0, 0, 500, 0, 0, 0, 8])).map(|axes| axes.translation);
assert_eq!(before, Some([0, -350, 0]));
assert_eq!(after, Some([0, 0, -350]));
}
#[test]
@@ -185,7 +179,7 @@ mod tests {
// Nothing overflows on the extremes of `i32`.
let extreme = decode(&record([0, i32::MIN, i32::MIN, i32::MAX, i32::MAX, i32::MIN, i32::MIN, -1]));
assert_eq!(extreme.map(|axes| axes.translation[0]), Some(i16::MIN));
assert_eq!(extreme.map(|axes| axes.translation), Some([i16::MIN, i16::MIN, i16::MAX]));
assert_eq!(extreme.map(|axes| axes.translation[1]), Some(i16::MAX));
assert_eq!(extreme.map(|axes| axes.rotation[0]), Some(i16::MAX));
}
+6 -11
View File
@@ -311,18 +311,13 @@ pub const SYSTEM_VERSION_COMPAT_ENV: &str = "SYSTEM_VERSION_COMPAT";
#[cfg(target_os = "macos")]
pub const OCLP_NVRAM_KEY: &str = "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:OCLP-Version";
/// Where macOS keeps its `nvram` tool.
#[cfg(target_os = "macos")]
const NVRAM_TOOL: &str = "/usr/sbin/nvram";
/// `true` if the OCLP NVRAM key is present on this system.
///
/// Runs `/usr/sbin/nvram <key>` and treats exit 0 as present. The full path keeps a `PATH` that
/// lacks `/usr/sbin`, or lists a look-alike first, from changing the answer. Any error (missing
/// binary, permission denied, key absent) returns `false`: this is a best-effort probe.
/// Runs `nvram <key>` and treats exit 0 as present. Any error (missing binary,
/// permission denied, key absent) returns `false` — this is a best-effort probe.
#[cfg(target_os = "macos")]
pub fn oclp_nvram_present() -> bool {
std::process::Command::new(NVRAM_TOOL).arg(OCLP_NVRAM_KEY).output().map(|o| o.status.success()).unwrap_or(false)
std::process::Command::new("nvram").arg(OCLP_NVRAM_KEY).output().map(|o| o.status.success()).unwrap_or(false)
}
/// Whether to re-launch with `SYSTEM_VERSION_COMPAT=1`: it is not set yet and OCLP shows through
@@ -339,8 +334,8 @@ fn compat_wanted(compat_set: bool, nvram: impl FnOnce() -> bool) -> bool {
///
/// `SYSTEM_VERSION_COMPAT=1` must be present **before** the process starts: setting it
/// with `std::env::set_var` inside `main` is too late because the macOS frameworks have
/// already queried the OS version by then, so the program starts itself again with the variable
/// set and waits for that child.
/// already queried the OS version by then. Re-launching is the only safe approach that
/// works without `unsafe` (a true `execve` replacement would require it).
///
/// Returns `Ok(false)` immediately when:
/// - `SYSTEM_VERSION_COMPAT` is already set (re-launched process, no loop), or
@@ -357,7 +352,7 @@ pub fn relaunch_with_version_compat() -> Result<bool, String> {
return Ok(false);
}
log::info!("startup: OCLP detected; re-launching with {}=1", SYSTEM_VERSION_COMPAT_ENV);
solidcraft_engine::note!("SolidCraft: OCLP detected; re-launching with {}=1", SYSTEM_VERSION_COMPAT_ENV);
eprintln!("SolidCraft: OCLP detected; re-launching with {}=1", SYSTEM_VERSION_COMPAT_ENV);
let exe = std::env::current_exe().map_err(|e| format!("could not find own executable: {e}"))?;
let status = std::process::Command::new(&exe)
.args(std::env::args_os().skip(1))
+11
View File
@@ -79,6 +79,17 @@ pub(crate) fn snap_hint(painter: &egui::Painter, c: Pos2, kind: SnapKind, col: C
painter.circle_filled(c, 1.3, col);
}
/// A placed hole's drag handle: a ring round the hole's centre with a cross through it, filled
/// while it is hovered or dragged.
pub(crate) fn hole_handle(painter: &egui::Painter, c: Pos2, col: Color32, hot: bool) {
let ic = Tokens::get().icons;
let r = 6.0;
painter.circle_filled(c, r + 3.5, ic.marker_halo);
painter.circle(c, r, if hot { col } else { col.gamma_multiply(0.35) }, Stroke::new(1.6, col));
let ink = Stroke::new(1.3, if hot { ic.highlight } else { col });
painter.line_segment([c - vec2(r + 3.0, 0.0), c + vec2(r + 3.0, 0.0)], ink);
painter.line_segment([c - vec2(0.0, r + 3.0), c + vec2(0.0, r + 3.0)], ink);
}
pub(crate) fn glyph_icon(name: &str) -> Option<&'static str> {
Some(match name {
"Coincident" => "c_coincident",
+2 -1
View File
@@ -55,7 +55,8 @@ pub(crate) fn face_text(painter: &egui::Painter, face: &Facet, ink: Color32, fon
painter.ctx().add_plugin(LabelAtlas);
let text = Shape::Text(egui::epaint::TextShape::new(Pos2::ZERO, galley, ink));
let atlas = painter.ctx().fonts(|f| f.font_image_size());
let primitives = painter.ctx().tessellate(vec![egui::epaint::ClippedShape::new(Rect::EVERYTHING, text)], painter.ctx().pixels_per_point());
let primitives =
painter.ctx().tessellate(vec![egui::epaint::ClippedShape { clip_rect: Rect::EVERYTHING, shape: text }], painter.ctx().pixels_per_point());
for primitive in primitives {
if let egui::epaint::Primitive::Mesh(mut mesh) = primitive.primitive {
mesh.texture_id = LABEL_PIXELS;
+29 -107
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "تعطيل المجلدات المحددة",
"Suppressed": "مُعطّل",
"Surface": "السطح",
"Surface or face": "سطح أو وجه",
"Surface or faces": "سطح أو أوجه",
"Surface, or faces to turn over": "السطح، أو الأوجه المراد قلبها",
"Surfaces": "الأسطح",
"Swap Ends": "تبديل الطرفين",
@@ -644,7 +642,6 @@
"Target": "الهدف",
"Target Body": "الجسم الهدف",
"Target Face (optional)": "الوجه الهدف (اختياري)",
"Target edges": "الحواف المستهدفة",
"Tear": "تمزيق",
"Technical details": "التفاصيل التقنية",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "الرسم المتقطع دليل مستوى محفوظ. حدد وجهًا جديدًا لإصلاح الارتباط.",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "يجب أن يكون الاتجاه محورًا أو منحنى رسم مستقيمًا يقع في مستوى الرسم",
"The mirror line cannot also be mirrored": "لا يمكن عكس خط المرآة نفسه",
"The mirror line must be a straight curve of this sketch, not an origin axis": "يجب أن يكون خط المرآة منحنى مستقيمًا من هذا الرسم، وليس أحد محاور نقطة الأصل",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "محور الأصل عمودي على مستوى الرسم، لذا ليس له خط في المستوى",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "نسخة المؤلف المحفوظة مفقودة. حدد موضع مؤلف صالحًا قبل إعادة الربط.",
"Then": "ثم",
"These features will be deleted:": "ستُحذف هذه الميزات:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "جسم الحافة المحددة لم يعد موجودًا",
"add a key for a joint first": "أضف أولًا مفتاحًا لمفصل",
"ai.connected_toast": "أصبح SolidCraft متاحًا في {clients}. أعد تشغيلها لاستخدامه (التفضيلات > المساعد).",
"ai.http.allow": "السماح باتصال HTTP غير آمن",
"ai.http.confirm": "السماح لهذه النقطة الطرفية",
"ai.http.warning": "سيُرسَل مفتاح API والمحادثة دون تشفير. يمكن لأي شخص لديه وصول إلى الشبكة قراءتهما أو تغييرهما. استخدم هذا الخيار فقط على شبكة تثق بها.",
"ai.prefs.allow_control": "السماح لوكلاء الذكاء الاصطناعي بالاتصال",
"ai.prefs.allow_control_note": "قناة محلية (MCP). لا شيء يغادر هذا الحاسوب.\n\nيفتح قناة تحكم على هذا الحاسوب فقط (127.0.0.1، المنفذ 27878 أو أول منفذ متاح بعده). على البرنامج الذي يتصل أن يقدّم أيضًا رمزًا سريًا لا يقرؤه إلا حساب المستخدم الخاص بك، ويُنشأ من جديد عند كل تشغيل. يُطبّق في المرة القادمة التي يبدأ فيها SolidCraft. عند الإيقاف: لا شيء يستمع ما لم تشغّل SolidCraft مع --control.",
"ai.prefs.availability": "التوفر",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "تتبّع الكاميرا",
"ai.prefs.follow_camera_off": "تتبّع الكاميرا التلقائي متوقف.",
"ai.prefs.follow_camera_on": "تتجه الكاميرا نحو الرسومات التي ينشئها الوكيل.",
"ai.prefs.instructions": "تعليمات مخصصة",
"ai.prefs.instructions_note": "تُرسَل إلى الوكيل في بداية كل محادثة، بعد تعليمات SolidCraft الخاصة: طريقتك المفضلة في العمل والقواعد التي يجب الالتزام بها. يسري أي تغيير من المحادثة التالية (اتصال أو محادثة جديدة).",
"ai.prefs.intro": "وكلاء الذكاء الاصطناعي في SolidCraft.",
"ai.prefs.make_default": "تعيين افتراضيًا",
"ai.prefs.no_agents": "لا يوجد وكلاء بعد. أضف وكيلًا أو حدّث القائمة للعثور على الوكلاء المثبّتين.",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "تحريك فاصل مقارنة التصيير",
"cmd.render.result.discard": "تجاهل نتيجة التصيير",
"cmd.render.result.select": "تحديد نتيجة التصيير",
"cmd.render.surface.import": "استيراد خرائط السطح",
"cmd.render.texture.list": "عرض صور السطح المضمّنة",
"cmd.render.texture.remove": "إزالة صورة السطح المضمّنة",
"cmd.render_aging_describe": "تقادم السطح بالطبقات",
"cmd.render_backends": "محركات التصيير",
"cmd.render_batch": "تصيير كل اللقطات",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "علامة التبويب السابقة",
"cmd.view_rename": "إعادة تسمية عرض مسمّى",
"cmd.view_render_frame": "أدلة إطار التصيير",
"cmd.view_ribbon_tabs_only": "علامات تبويب الشريط فقط",
"cmd.view_right": "العرض الأيمن",
"cmd.view_save": "عرض مسمّى جديد",
"cmd.view_shots_strip": "شريط اللقطات",
@@ -1408,7 +1395,6 @@
"dialog.computing": "جارٍ الحساب… {seconds} ث",
"dialog.could_not_be_checked": "تعذّر فحصه",
"dialog.custom_axis": "↖ محور مخصص",
"dialog.cylinder_face_tip": "وجه النموذج أو رأسه الذي تقوم عليه الأسطوانة: انقر هنا ثم انقر عليه في العرض. إذا تُرك فارغًا، تحدد X وY وZ موضعها.",
"dialog.dimension_insert_hint": "انقر على بُعد قائد آخر لإدراج اسمه",
"dialog.dimension_name": "البُعد: {name}",
"dialog.dimension_step_down": "إنقاص بمقدار {step}",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "تعديل {title}",
"dialog.no_shown_body": "لا يوجد جسم ظاهر لتغييره: أظهر جسمًا، أو اختر «جسم جديد»",
"dialog.pattern_sketch_not_object": "اختر أجسامًا أو ميزات: الرسم ليس أيًّا منهما. كرّر منحنياته بأداة النمط أو المرآة داخل الرسم، أو ابثقه أولًا.",
"dialog.primitive_point_tip": "نقطة تملأ X وY وZ: انقر هنا ثم على رأس أو حافة أو وجه من النموذج، أو على نقطة من رسم، أو على نقطة الأصل.",
"dialog.reference_edge_tip": "حافة مستقيمة من الوجه المختار تُقاس منها المسافة أدناه: انقر هنا ثم على الحافة.",
"dialog.select": "↖ تحديد",
"dialog.selected_count": "↖ {count} محدد",
"dialog.selection_constraint": "قيد {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "منتقي الملفات الذي فُتح ليس تابعًا لسطح المكتب: في XWayland ترفض البوابة النافذة الأصلية.",
"file_load.built": "بُني حتى الآن: {built} من {total} ميزة.",
"file_load.converting": "تحويل الجسم الصلب {done} من {total}",
"file_load.inserted": "تم إدراج {name}",
"file_load.inserting": "إدراج الهندسة",
"file_load.link_item": "{name} ({done} من {total})",
"file_load.opened": "تم فتح {name}",
"file_load.opened_in_tab": "تم فتح {name} في علامة تبويب جديدة",
"file_load.opening": "فتح التصميم",
"file_load.preparing_thumbnail": "تجهيز الصورة المصغّرة...",
"file_load.preparing_view": "تجهيز العرض...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "يقرأ مسارات مخطط SVG إلى رسم بالمقياس والدوران والموضع الذي تحدده. استخدمه لتحويل شعار أو محيط متجهي إلى منحنيات يمكنك بثقها.",
"help.sketch.inspect": "يفتح تقريرًا عن الرسم المفتوح: عدد درجات الحرية المتبقية وهل هو مقيد بالكامل. استخدمه لمعرفة ما لا يزال يتحرك قبل إنهاء الرسم.",
"help.sketch.intersect": "يضيف المنحنيات أو النقاط التي تقطع فيها أجسام أو أوجه أو حواف أو رسوم أخرى مستوى الرسم. تبقى مرتبطة وتتبع النموذج عندما يتغير.",
"help.sketch.intersection_curve": "ينشئ منحنيات ثلاثية الأبعاد حيث يلتقي جسمان أو وجهان أو منحنيات رسوم أخرى، مرتبطة بهما. استخدمها مسارات أو قضبان توجيه تتبع النموذج.",
"help.sketch.intersection_curve": "ينشئ منحنيات ثلاثية الأبعاد حيث يلتقي جسمان أو وجهان، مرتبطة بهما. استخدمها مسارات أو قضبان توجيه تتبع النموذج.",
"help.sketch.isoparametric_curve": "ينشئ منحنى ثلاثي الأبعاد على اتجاه U أو V للوجه عبر نقطة تختارها، مرتبطًا بالوجه. استخدمه مسارًا أو خط تقسيم يتبع السطح.",
"help.sketch.line": "يرسم خطوطًا متصلة نقطة بنقطة، كسلسلة مفتوحة أو محيط مغلق. هو الأداة الأساسية لمعظم المقاطع.",
"help.sketch.line.midpoint": "يرسم خطًا من منتصفه إلى أحد طرفيه، ويعكس الطرف الآخر. استخدمه للخطوط المتمركزة على نقطة، مثل حافة متناظرة.",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "يدير العرض أو يُزيحه أو يغيّر تكبيره بخطوات، مثل ربع دورة إلى اليسار. استخدمه لتحريك الكاميرا بدقة بدلًا من السحب.",
"help.view.navigation_bar": "يُظهر شريط التنقل أسفل منطقة العرض أو يخفيه. أخفِه لمساحة أكبر، وأظهره للوصول إلى أدوات العرض بالفأرة.",
"help.view.rename": "يمنح عرضًا مسمّى محفوظًا اسمًا جديدًا. يبقى العرض نفسه كما هو.",
"help.view.ribbon_tabs_only": "يطوي الشريط إلى صف علامات التبويب، فتحصل منطقة العرض على المساحة التي كانت تشغلها لوحاته. انقر علامة تبويب لإظهار لوحاتها فوق منطقة العرض؛ واختر هذا الأمر مرة أخرى لإبقاء الشريط كاملًا ظاهرًا.",
"help.view.save": "يحفظ موضع الكاميرا الحالي كعرض مسمّى في التصميم. استخدمه للعودة إلى الزاوية نفسها لاحقًا، مثلًا للقطات الشاشة.",
"help.view.spin": "يدوّر العرض حول النموذج باستمرار حتى النقرة أو المفتاح التالي. استخدمه لعرض النموذج من جميع الجهات.",
"help.view.tool": "يثبّت أداة كاميرا، التدوير أو الإزاحة أو التكبير، بحيث يحرّك السحب بزر الفأرة الأيسر العرض حتى توقفها. استخدمه على لوحة اللمس أو بدون زر فأرة أوسط.",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "ضم أو جسم جديد أو قص، حسب ما تلامسه المادة.",
"prefs.axes": "المحاور",
"prefs.axis": "المحور",
"prefs.background_choose": "اختيار صورة…",
"prefs.background_image": "الصورة",
"prefs.background_unreadable": "تعذرت قراءة صورة الخلفية",
"prefs.blur_cost": "تكلفة العرض النسبية. زيادة الأشرطة تعني عادةً مزيدًا من العمل.",
"prefs.blur_device": "غير متاح على جهاز الرسوميات أو مسار العرض هذا",
"prefs.blur_guard": "خُفّضت جودة التمويه للحفاظ على استجابة الإطارات. لم يتغير نصف القطر.",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "أيقونة الإظهار بجانب سهم الطي",
"prefs.browser_eye_left_note": "تعرض صفوف المستعرض أيقونة الإظهار/الإخفاء بجانب سهم الطي كما كانت من قبل، بدلًا من عمود عند نهاية الصفوف.",
"prefs.browser_reveal_on_hover": "إظهار عند مرور المؤشر",
"prefs.browser_rows_start_closed": "صفوف المستعرض تبدأ مغلقة",
"prefs.browser_rows_start_closed_note": "تبدأ المواضع والمجلدات في المستعرض مغلقة، فيعرض التصميم الذي يضم مكونات كثيرة صفوفه العليا. يُفتح كل صف بسهمه أو بـ«توسيع الكل» أو بـ«البحث في المستعرض» الذي يفتح الصفوف المؤدية إلى الجسم فقط، ويغلق من جديد الصفوف التي فتحها البحث السابق. اختيار جسم في العرض ثلاثي الأبعاد يترك المستعرض كما هو. عند إيقافه تبدأ المجلدات مفتوحة، وتبدأ المواضع كما يحدّد خيار «المكوّنات مفتوحة من البداية»، ويفتح الاختيار في العرض ثلاثي الأبعاد المستعرضَ حتى صف الجسم، كما كان من قبل.",
"prefs.browser_show_note": "«ظاهر» يُبقي المستعرض على الشاشة. «إظهار عند مرور المؤشر» يُخفيه حتى يمر المؤشر فوق مكانه أو فوق الشريط الرفيع عند حافته اليسرى، ويبقى مفتوحًا ما دام المؤشر داخله أو كانت قائمة منه مفتوحة.",
"prefs.browser_shown": "ظاهر",
"prefs.built_in": "مدمج",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "السابق",
"prefs.choose_font": "اختيار ملف خط…",
"prefs.click": "نقر",
"prefs.command_dialog_values": "مربعات حوار الأوامر",
"prefs.contact_shading": "تظليل التلامس الناعم",
"prefs.contact_shading_note": "تظليل ناعم حيث تقترب القطع من بعضها.",
"prefs.context_menu": "القائمة السياقية",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "الأسطح والحواف",
"prefs.graphics_page.view_bar": "أيضًا في شريط العرض",
"prefs.graphics_presets_note": "الإعدادات المسبقة تضبط الخيارات أدناه معًا.",
"prefs.ground_shadow_follows_model": "ظل الأرض يتبع النموذج",
"prefs.ground_shadow_follows_model_help": "ضع الظل أسفل أدنى جسم مرئي. عند التعطيل، يبقى ظل النماذج المرفوعة على مستوى الأرض عند نقطة الأصل.",
"prefs.hide_constraint_glyphs_zoomed_out": "إخفاء رموز القيود عند التصغير",
"prefs.hide_constraint_glyphs_zoomed_out_note": "تختفي رموز القيود من العرض عندما يُصغَّر الرسم بقدر يجعلها تزحمه. معطّل: تبقى بحجم ثابت على الشاشة عند أي مستوى تكبير.",
"prefs.history": "السجل",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "سهما التدوير المنحنيان عند زاوية المكعب يدوران العرض داخل مستوى الشاشة. عند التشغيل: سهم التدوير مع عقارب الساعة يدور عكسها، وسهم العكس يدور معها. عند الإيقاف: يدور كل سهم بالعرض حسب انحنائه.",
"prefs.invert_navigator_arrows": "عكس أسهم تدوير مكعب العرض",
"prefs.invert_navigator_arrows_note": "تدوّر الأسهم المحيطة بالمكعب الكاميرا في الاتجاه الذي تشير إليه، كما في Fusion وInventor: السهم الموجود على اليسار يشير إلى اليمين ويدوّر الكاميرا إلى اليمين. عند الإيقاف: يدوّر السهم المكعب نحو الجهة التي يقع فيها، فيدوّر السهم الأيسر الكاميرا إلى اليسار. لا يتأثر سهما الدوران المنحنيان.",
"prefs.keep_unsaved_also_asks": "السؤال أيضًا عند إغلاق علامة التبويب",
"prefs.keep_unsaved_also_asks_tip": "عند إيقاف هذا الخيار، تُغلق علامة التبويب دون مربع المتصفح بعد تحديث نسخة كل تصميم غير محفوظ.",
"prefs.keep_unsaved_in_browser": "الاحتفاظ بالعمل غير المحفوظ في هذا المتصفح",
"prefs.keep_unsaved_in_browser_tip": "تُحدَّث التغييرات غير المحفوظة لكل تصميم مفتوح باستمرار في التخزين الخاص بهذا المتصفح. وتعرض الزيارة التالية استعادتها.",
"prefs.keep_work_on_tab_switch": "إبقاء مربعات الحوار والأدوات مفتوحة عند التبديل بين التصاميم",
"prefs.keep_work_on_tab_switch_note": "تحتفظ كل علامة تبويب تصميم بمربع الحوار أو الأداة المفتوحة، بما حددته وكتبته فيها، وبعلامة تبويب شريط الأدوات. وتجدها كما هي عند العودة إلى التصميم. عند الإيقاف: يؤدي التبديل بين التصاميم إلى إلغائها وعرض علامة التبويب «النموذج».",
"prefs.labels": "التسميات",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "بطاقة",
"prefs.layout_page.column": "عمود",
"prefs.layout_page.hover": "عند مرور المؤشر",
"prefs.layout_page.hover_panel_menus": "تبديل قوائم اللوحات عند مرور المؤشر",
"prefs.layout_page.hover_panel_menus_help": "انقر على اسم لوحة في الشريط لفتح قائمتها. مرّر المؤشر فوق اسم لوحة أخرى للتبديل. حرّك المؤشر خارج الشريط والقائمة المفتوحة لإغلاقها.",
"prefs.layout_page.icons_labels": "الأيقونات + التسميات",
"prefs.layout_page.ok_cancel": "موافق وإلغاء",
"prefs.layout_page.on_hover": "عند مرور المؤشر",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "أنعم",
"prefs.quick_measure": "قياس سريع في زاوية العرض",
"prefs.quick_measure_note": "مقاس العناصر المحددة في الزاوية اليمنى السفلية من العرض: طول الحافة (أو Ø وR للحافة الدائرية)، ومساحة الوجه، وموضع النقطة، والمسافة والزاوية بين عنصرين، ومجموع عدة حواف أو أوجه. النقر ينسخه.",
"prefs.remember_dialog_values": "تذكّر قيم مربعات حوار الأوامر",
"prefs.remember_dialog_values.help": "معطّل افتراضيًا. عند تفعيله، بعد نجاح الأمر، يُعاد استخدام قيمه وخياراته الآمنة في المرة التالية التي تفتح فيها الأمر نفسه، حتى إغلاق SolidCraft.",
"prefs.render_previous_geometry_budget": "استخدام ميزانية الهندسة السابقة لمعاينة التصيير",
"prefs.render_previous_geometry_budget_help": "استعادة حد الهندسة الثابت السابق (512 ميبيبايت على سطح المكتب 64 بت، و128 ميبيبايت على المنصات الأخرى) بدلًا من الميزانية المعتمدة على الجهاز.",
"prefs.reports_saved": "{n} محفوظة",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "النقر على زر الشريط المضيء لأداة الرسم المستخدمة ينهي الأداة، فيعود النقر في العرض إلى التحديد. عند الإيقاف: يبدأ النقر الأداة من جديد.",
"prefs.ribbon_reveal": "إظهار مكان نتائج البحث في الشريط",
"prefs.ribbon_reveal_note": "عند تمرير المؤشر فوق نتيجة في «البحث في الأوامر» يظهر مكان الأمر في الشريط: تبويبه أو زره أو صفه في القائمة المنسدلة للوحة. ويومض هناك الأمر الذي بدأ من البحث، ويُعلِّم الأمر الجاري من قائمة منسدلة لوحتَه.",
"prefs.ribbon_tabs_only": "إظهار علامات تبويب الشريط فقط",
"prefs.ribbon_tabs_only_note": "يُطوى الشريط إلى صف علامات التبويب. يؤدي النقر على علامة تبويب إلى إظهار لوحاتها فوق منطقة العرض حتى يبدأ أمر أو يغادرها المؤشر. يبدّل الأمر «علامات تبويب الشريط فقط» في تبويب العرض، أو اختصاره، هذا الخيار.",
"prefs.right_click": "نقر أيمن",
"prefs.saving": "البدء والحفظ",
"prefs.scale_note": "أو Ctrl + / Ctrl − في النافذة. الأزرار 28 px عند 100%.",
@@ -2598,8 +2560,8 @@
"prefs.section_hatch_by_part": "حسب الجزء",
"prefs.section_hatch_one": "نمط واحد",
"prefs.select": "تحديد",
"prefs.select_hidden_edges": "تحديد الحواف المخفية في نمط «مظلل مع الحواف المخفية»",
"prefs.select_hidden_edges_help": "يتيح تحديد الحواف عبر الأوجه عند تفعيل نمط «مظلل مع الحواف المخفية»، بما في ذلك عند استخدام التقويس. عند الإيقاف يبقى سلوك التحديد كما في v0.30.1. تظل الأجسام المخفية غير قابلة للتحديد.",
"prefs.select_hidden_edges": "تحديد الحواف المخفية في العرض المظلل مع الحواف المخفية",
"prefs.select_hidden_edges_help": "يتيح تحديد الحواف عبر الأسطح عند تفعيل العرض المظلل مع الحواف المخفية، بما في ذلك استخدام أداة Fillet. يحافظ إيقافه على سلوك التحديد في v0.30.1. تظل الأجسام المخفية غير قابلة للتحديد.",
"prefs.select_one_item": "تحديد عنصر واحد",
"prefs.select_other_hidden": "تحديد العناصر الهندسية المخفية باستخدام «تحديد عنصر آخر»",
"prefs.select_other_hidden_help": "عند التفعيل: تضمين الأجسام والمخططات المخفية والحواف المحجوبة قرب المؤشر. عند التعطيل: استخدام القائمة الأصلية للعناصر الهندسية المرئية أسفل المؤشر.",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "الآن",
"recovery.min_ago": "قبل {count} دقيقة",
"recovery.never_saved": "لم يُحفظ قط",
"recovery.open_saved": "فتح النسخة المحفوظة",
"recovery.restore": "استعادة",
"recovery.restore_intro": "التغييرات التي لم تُحفظ عند آخر إغلاق لهذه الصفحة محفوظة في هذا المتصفح.",
"recovery.restore_row": "{name}، تغيّر {when}",
"recovery.restore_title": "استعادة التصاميم غير المحفوظة؟",
"recovery.restore_title_one": "استعادة التصميم غير المحفوظ: {name}، تغيّر {when}؟",
"refused.change": "تعذّر تغيير {body}.",
"refused.cut": "تعذّر قطع {body}.",
"refused.face_curved": "أحد أوجهه المنحنية لا يمكن استخدامه في النمذجة.",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · عريض",
"render.gpu_depth": "أقصى عمق للمسار",
"render.gpu_options_help": "تُحفظ العيّنات والعمق والبذرة والتعريض مع هذا الإعداد. تُحفظ طريقة الصورة النشطة فقط.",
"render.gpu_path_crashed": "أُغلق SolidCraft أثناء إعداده على محوّل الرسوميات هذا في المرة السابقة، على الأرجح داخل برنامج تشغيل الرسوميات، لذا لن يُعاد إعداده تلقائيًا. استخدم تتبع الأشعة على المعالج المركزي بدلًا منه، أو حاول مرة أخرى (يعيد تحديث برنامج التشغيل المحاولة أيضًا).",
"render.gpu_path_failed": "متتبع المسارات على GPU غير متاح",
"render.gpu_path_first_setup": "قد يستغرق الإعداد الأول على وحدة GPU هذه عدة دقائق؛ ويبقى SolidCraft قابلًا للاستخدام أثناءها. تعيد المرات اللاحقة استخدام المظللات المترجمة حيث يحتفظ بها برنامج التشغيل.",
"render.gpu_path_preparing": "متتبع المسارات على GPU: ترجمة المظللات…",
"render.gpu_path_retry": "حاول مرة أخرى",
"render.gpu_seed": "البذرة العشوائية",
"render.gpu_unavailable": "تتبع المسارات على GPU غير جاهز على هذا الجهاز.",
"render.ground_apply": "ملاءمة الأرضية وحفظها",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "الامتداد",
"render.stage_panels.fit_save": "ملاءمة وحفظ",
"render.stage_panels.gpu_required": "يتطلب تتبّع المسار على GPU",
"render.stage_panels.grain_angle": "زاوية عروق الخشب",
"render.stage_panels.keep": "احتفاظ",
"render.stage_panels.kept": "ما يُحتفظ به",
"render.stage_panels.kept_fields": "الكاميرا، وأخذ العيّنات، والأبعاد، والروابط البصرية، وهندسة CAD، والخصائص الهندسية.",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "مسار عشوائي للتشتت الداخلي",
"render.subsurface_help": "للعوازل المغلقة فقط. التشتت وامتصاص RGB معاملان منفصلان لكل mm. تتشتت المسارات داخل الهندسة الفعلية، ثم تنكسر أو تنعكس عند الحد. عطّل نفاذ الظل المستقيم وإزالة تشويش السطح والحجم الخارجي؛ واستخدم طبقة فرينل واحدة. ليس مظلل انتشار ولا شبكة كثافة ولا مادة مقيسة. الأوساط الكثيفة قد تحتاج مزيدًا من العيّنات وعمق المسار.",
"render.subsurface_rate": "معدل اصطدامات التشتت",
"render.surface_import.author": "المؤلف",
"render.surface_import.busy": "جارٍ استيراد الصورة…",
"render.surface_import.complete": "اختر صورة وأدخل مؤلفها ومصدرها وترخيصها.",
"render.surface_import.embedded": "صورة مستوردة",
"render.surface_import.failed": "لم يكتمل استيراد الصورة.",
"render.surface_import.license": "الترخيص / الملكية",
"render.surface_import.raytrace_required": "تتطلب الصور تتبع الأشعة على CPU أو GPU. اختره في الإخراج.",
"render.surface_import.repeat_u": "تكرار U",
"render.surface_import.repeat_v": "تكرار V",
"render.surface_import.save": "حفظ الصورة على الجسم",
"render.surface_import.saved_cpu": "احفظ الخرائط لاستخدامها في التصيير على CPU.",
"render.surface_import.source": "المصدر",
"render.surface_import.title": "استيراد صورة",
"render.tone_aces_fitted": "ACES مُلاءَم",
"render.tone_reinhard": "راينهارد",
"render.transmission_scope": "يدعم زجاج GPU الأوساط المنفصلة المعتمدة. لا تتوفر الأوساط المتداخلة غير المقيدة ولا مقدّر نفاذ خالٍ من التشويش.",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "لوح نموذجي",
"sample.vents.about": "شقوق في نمط مستطيلي: الصفوف والأعمدة والخطوة معاملات",
"sample.vents.name": "لوح تهوية",
"scale.per_axis": "لكل محور",
"scale.uniform": "موحّد",
"search.command_keys": "Enter تشغيل Shift+Enter تشغيل مع الإبقاء مفتوحًا Esc إغلاق",
"search.commands": "الأوامر",
"search.design": "في هذا التصميم",
@@ -4240,32 +4178,32 @@
"sketch.dof_left": "تبقّت {count} درجات حرية",
"sketch.dof_left_one": "تبقّت {count} درجة حرية",
"sketch.draw_curves": "الرسم كـ {linetype}",
"sketch.error.closed_curve_two_crossings": "يحتاج المنحنى المغلق إلى نقطتي تقاطع لقصّه",
"sketch.error.nothing_to_break": "لا يوجد هنا ما يمكن كسره",
"sketch.error.offset_fillet_chamfer": "`{id}` منحنى إزاحة، وزواياه تتبع منحنياته المصدر: قوّس زوايا المنحنيات المصدر أو اشطفها قبل الإزاحة، أو فك ارتباط الإزاحة أولًا",
"sketch.error.offset_trim": "`{id}` منحنى إزاحة، وأطرافه تتبع منحنياته المصدر: عدّل المنحنيات المصدر بدلًا من ذلك، أو فك ارتباط الإزاحة أولًا",
"sketch.hint.arc.center_point": "قوس: انقر المركز ثم البداية، ودُر في أي اتجاه وانقر النهاية، أو اكتب زاوية القوس بإشارة موجبة أو سالبة",
"sketch.hint.arc.three_point": "قوس: انقر البداية ثم النهاية، ثم نقطة على القوس",
"sketch.hint.arc3d": "قوس ثلاثي الأبعاد: انقر البداية ثم النهاية، ثم نقطة على القوس (يمكن أن تقع النقاط خارج مستوى الرسم)",
"sketch.hint.break": "كسر: انقر على منحنى في الموضع الذي يُقسم عنده",
"sketch.hint.circle.center": "دائرة: انقر المركز، ثم نقطة على الدائرة",
"sketch.hint.constraint.generic": "قيد: اختر عناصر الرسم",
"sketch.hint.constraint.horizontal_vertical": "أفقي/رأسي: اختر خطًا، أو نقطتين، أو نقطة وخطًا؛ اضغط Shift مع الاستمرار لاختيار منتصف خط",
"sketch.hint.constraint.midpoint": "نقطة المنتصف: اختر نقطة وخطًا، أو خطين لتوسيط الثاني على الأول",
"sketch.hint.dimension": "البُعد: اختر عنصرًا أو عنصرين واكتب القيمة (أو انقر لوضعه أولًا)؛ انقر على بُعد لتعديله؛ اضغط Enter للتطبيق",
"sketch.hint.extend": "تمديد: انقر على منحنى قرب الطرف المراد تمديده (Shift: انقر منحنيين لتمديدهما معًا حتى نقطة التقائهما)",
"sketch.hint.fallback": "انقر في الرسم",
"sketch.hint.line": "خط: انقر النقاط؛ انقر بالزر الأيمن أو اضغط Esc للإنهاء",
"sketch.hint.line3d": "خط ثلاثي الأبعاد: انقر نقاطًا في الفضاء؛ انقر بالزر الأيمن أو اضغط Esc للإنهاء (يمكن أن تقع النقاط خارج مستوى الرسم)",
"sketch.hint.open_done": "تم الفتح",
"sketch.hint.point3d": "نقطة ثلاثية الأبعاد: انقر حيث توضع النقطة ثلاثية الأبعاد",
"sketch.hint.rectangle.center": "مستطيل من المركز: انقر المركز، ثم زاوية",
"sketch.hint.rectangle.rounded": "مستطيل مستدير الزوايا: انقر زاويتين متقابلتين (اضغط Tab للانتقال إلى خانة نصف القطر وكتابة نصف قطر الزوايا)",
"sketch.hint.rectangle.three_point": "مستطيل بثلاث نقاط: انقر نقطتين على أحد الأضلاع، ثم العرض",
"sketch.hint.rectangle.two_point": "مستطيل: انقر زاويتين متقابلتين",
"sketch.hint.slot": "شق: انقر الطرفين، ثم العرض",
"sketch.hint.spline3d": "منحنى شريحي ثلاثي الأبعاد: انقر نقاط الملاءمة في الفضاء ثلاثي الأبعاد؛ انقر بالزر الأيمن أو اضغط Esc للإنهاء",
"sketch.hint.trim": "قص: انقر على الجزء المراد إزالته من المنحنى، أو اسحب عبر الأجزاء المراد إزالتها",
"sketch.error.closed_curve_two_crossings": "a closed curve needs two crossings to trim",
"sketch.error.nothing_to_break": "nothing to break here",
"sketch.error.offset_fillet_chamfer": "`{id}` is an offset, and its corners follow its source curves: round or cut the source corners before offsetting, or break the offset association first",
"sketch.error.offset_trim": "`{id}` is an offset, and its ends follow its source curves: edit the source curves instead, or break the offset association first",
"sketch.hint.arc.center_point": "Arc: click center and start, go round either way and click the end, or type a signed sweep",
"sketch.hint.arc.three_point": "Arc: click start, end, then a point on the arc",
"sketch.hint.arc3d": "3D Arc: click start, end, then a point on the arc (points may leave the sketch plane)",
"sketch.hint.break": "Break: click a curve where it should split",
"sketch.hint.circle.center": "Circle: click the center, then a point on the circle",
"sketch.hint.constraint.generic": "Constraint: pick the sketch entities",
"sketch.hint.constraint.horizontal_vertical": "Horizontal/Vertical: pick a line, two points, or a point and a line; hold Shift to pick a line midpoint",
"sketch.hint.constraint.midpoint": "MidPoint: pick a point and a line, or two lines to center the second on the first",
"sketch.hint.dimension": "Dimension: pick one or two entities and type the value (or click to place it first); click a dimension to edit it; Enter applies",
"sketch.hint.extend": "Extend: click a curve near the end to extend (Shift: click two curves to extend both to where they meet)",
"sketch.hint.fallback": "Click in the sketch",
"sketch.hint.line": "Line: click points; right-click or Esc to finish",
"sketch.hint.line3d": "3D Line: click world points; right-click or Esc to finish (points may leave the sketch plane)",
"sketch.hint.open_done": "Open done",
"sketch.hint.point3d": "3D Point: click where a 3D point goes",
"sketch.hint.rectangle.center": "Center rectangle: click the center, then a corner",
"sketch.hint.rectangle.rounded": "Rounded rectangle: click two opposite corners (Tab to the radius box to type the corner radius)",
"sketch.hint.rectangle.three_point": "3-point rectangle: click two points of one edge, then the width",
"sketch.hint.rectangle.two_point": "Rectangle: click two opposite corners",
"sketch.hint.slot": "Slot: click both ends, then the width",
"sketch.hint.spline3d": "3D Spline: click fit points in 3D; right-click or Esc to finish",
"sketch.hint.trim": "Trim: click the piece of a curve to remove, or drag across the pieces to remove",
"sketch.make_selection": "تحويل التحديد إلى {linetype}",
"sketch.open_ends": "مفتوحة {count}",
"sketch.status_conflict": "تعارض القيود",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "رسم ثلاثي الأبعاد",
"ui.activate": "تنشيط",
"ui.active_component": "المكوّن النشط",
"ui.addToQuickAccess": "إضافة إلى الوصول السريع",
"ui.add_configuration": "إضافة تكوين",
"ui.add_parameter": "إضافة معامل",
"ui.agent_chat": "محادثة الوكيل",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "النقر يحدد الأجسام كاملة",
"ui.click_then_press_key": "انقر ثم اضغط المفتاح الجديد",
"ui.close": "إغلاق",
"ui.close_tab": "إغلاق علامة التبويب",
"ui.coil": "ملف حلزوني",
"ui.coincident": "متطابق",
"ui.collapse": "طي",
@@ -5040,11 +4976,6 @@
"ui.factor": "المعامل",
"ui.fade": "تلاشٍ",
"ui.fade_length": "طول التلاشي",
"ui.fair_iterations": "عدد التكرارات",
"ui.fair_keep_edges": "الحفاظ على الحواف",
"ui.fair_strength": "شدة التنعيم",
"ui.fair_surface_title": "تنعيم السطح",
"ui.fair_tolerance_default": "0.001 من حجم الجسم",
"ui.feature_history": "سجل الميزات",
"ui.feature_options": "خيارات الميزة",
"ui.features": "الميزات",
@@ -5230,7 +5161,6 @@
"ui.inspect": "فحص",
"ui.instances": "النسخ",
"ui.intersect": "تقاطع",
"ui.intersection_curve_second_pick": "منحنى التقاطع: انقر على الوجه أو المنحنى الثاني (انقر بزر الماوس الأيمن للبدء من جديد)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "عزل",
"ui.join": "ضم",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "السحب الحر للمُعالج أيضًا مع Alt/Option",
"ui.manipulator_free_alt_tip": "عند التفعيل: Alt/Option أو Ctrl/Cmd على أسهم البثق / أداة التحويل يعطّل التقاط القيم. عند الإيقاف: Ctrl/Cmd فقط.",
"ui.manufacture": "التصنيع",
"ui.match_surface_title": "مطابقة السطح",
"ui.material_review.axes": "محاور محلية للمادة؛ لم يُحدد اتجاه للجسم.",
"ui.material_review.claims": "المصادر والتراخيص ادعاءات غير موثّقة. القيم المفقودة تبقى مجهولة.",
"ui.material_review.compressive_strength": "مقاومة الانضغاط",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "مراجعة بيانات المادة الفيزيائية",
"ui.material_review.unknown": "مجهول",
"ui.material_review.yield_strength": "مقاومة الخضوع",
"ui.mcp_agents": "الوكلاء عبر MCP",
"ui.mcp_compact": "مخرجات مضغوطة",
"ui.mcp_compact_note": "للوكلاء المتصلين عبر خادم MCP ‏(solidcraft-cli mcp): يلخّص inspect_design الرسومات، ولا تُنسَّق نتائج الأدوات، فتستهلك رموزًا أقل. يسري على جلسات الوكلاء التي تبدأ بعد التغيير؛ ويفعّله أيضًا ‎--compact أو SOLIDCRAFT_MCP_COMPACT=1.",
"ui.measure": "قياس",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "3MF مع وسوم الأوجه",
@@ -5326,7 +5252,6 @@
"ui.options": "الخيارات",
"ui.orbit": "تدوير العرض",
"ui.orbit_around": "التدوير حول",
"ui.organize": "تنظيم",
"ui.orientation": "الاتجاه",
"ui.origin": "نقطة الأصل",
"ui.palette_construction_mode": "وضع الخطوط المساعدة (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "إضافة مرشح…",
"ui.point_cloud_auto_range": "نطاق تلقائي",
"ui.point_cloud_color_by": "التلوين حسب",
"ui.point_cloud_dots": "نقاط منفردة",
"ui.point_cloud_file_colors": "ألوان الملف",
"ui.point_cloud_filter_by": "التصفية حسب",
"ui.point_cloud_height_high": "أعلى ارتفاع",
@@ -5416,7 +5340,6 @@
"ui.quality": "الجودة",
"ui.quantity": "الكمية",
"ui.quantity_2": "الكمية 2",
"ui.quick_access_full": "يتسع شريط الوصول السريع لـ {count} أمرًا؛ أزل أحدها لإضافة آخر",
"ui.quit": "خروج",
"ui.radial_context_menu": "قائمة سياقية دائرية",
"ui.radius": "نصف القطر",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "هذا المكوّن غير مرتبط بتصميم مصدر.",
"ui.relink_select_one": "حدد مكوّنًا مرتبطًا واحدًا أو إحدى نسخه أولًا.",
"ui.relink_source_all": "إعادة ربط المصدر (كل النسخ)…",
"ui.removeFromQuickAccess": "إزالة من الوصول السريع",
"ui.removeFromToolbar": "إزالة من شريط الأدوات",
"ui.removeSection": "إزالة المقطع",
"ui.render": "التصيير",
+1 -1
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Učitava putanje SVG crteža u skicu, skalirane, zakrenute i postavljene gdje zadate. Koristite ga da logotip ili vektorski obris pretvorite u krive koje možete ekstrudirati.",
"help.sketch.inspect": "Otvara izvještaj o otvorenoj skici: koliko je stepeni slobode preostalo i je li potpuno ograničena. Koristite ga da saznate šta se još pomjera prije nego što završite skicu.",
"help.sketch.intersect": "Dodaje krive ili tačke gdje tijela, lica, ivice ili druge skice sijeku ravan skice. Ostaju povezane i prate model kada se promijeni.",
"help.sketch.intersection_curve": "Pravi 3D krive tamo gdje se dva tijela, lica ili krive drugih skica sastaju, povezane s njima. Koristite ih kao putanje ili vodilice koje prate model.",
"help.sketch.intersection_curve": "Pravi 3D krive tamo gdje se dva tijela ili lica sastaju, povezane s njima. Koristite ih kao putanje ili vodilice koje prate model.",
"help.sketch.isoparametric_curve": "Pravi 3D krivu u smjeru U ili V lica kroz tačku koju izaberete, povezanu s licem. Koristite je kao putanju ili liniju razdvajanja koja prati površ.",
"help.sketch.line": "Crta povezane linije tačku po tačku, kao otvoreni lanac ili zatvoren obris. To je osnovni alat za većinu profila.",
"help.sketch.line.midpoint": "Crta liniju od njene središnje tačke do jednog kraja, a drugi kraj se preslikava. Koristite je za linije centrirane na tački, npr. simetričnu ivicu.",
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Načte cesty výkresu SVG do náčrtu, ve zvoleném měřítku, natočení a poloze. Použijte to k přeměně loga nebo vektorového obrysu na křivky, které lze vysunout.",
"help.sketch.inspect": "Otevře zprávu o otevřeném náčrtu: kolik stupňů volnosti zbývá a zda je plně zavazbený. Použijte to ke zjištění, co se ještě hýbe, než náčrt dokončíte.",
"help.sketch.intersect": "Přidá křivky nebo body, kde tělesa, plochy, hrany nebo jiné náčrty protínají rovinu náčrtu. Zůstanou propojené a sledují model, když se změní.",
"help.sketch.intersection_curve": "Vytvoří 3D křivky tam, kde se setkávají dvě tělesa, plochy nebo křivky jiných náčrtů, propojené s nimi. Použijte je jako cesty nebo vodicí dráhy, které sledují model.",
"help.sketch.intersection_curve": "Vytvoří 3D křivky tam, kde se setkávají dvě tělesa nebo plochy, propojené s nimi. Použijte je jako cesty nebo vodicí dráhy, které sledují model.",
"help.sketch.isoparametric_curve": "Vytvoří 3D křivku ve směru U nebo V plochy bodem, který vyberete, propojenou s plochou. Použijte ji jako cestu nebo dělicí čáru, která sleduje povrch.",
"help.sketch.line": "Kreslí spojené úsečky bod po bodu, jako otevřený řetězec nebo uzavřený obrys. Je to základní nástroj pro většinu profilů.",
"help.sketch.line.midpoint": "Nakreslí úsečku od jejího středu k jednomu konci, přičemž druhý konec se zrcadlí. Použijte to pro úsečky vystředěné na bod, například souměrnou hranu.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Ukázková deska",
"sample.vents.about": "Drážky v obdélníkovém poli: řádky, sloupce a rozteč jsou parametry",
"sample.vents.name": "Větrací deska",
"scale.per_axis": "Podle os",
"scale.uniform": "Rovnoměrně",
"search.command_keys": "Enter spustit Shift+Enter spustit a ponechat otevřené Esc zavřít",
"search.commands": "Příkazy",
"search.design": "V tomto návrhu",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Læser stierne i en SVG-tegning ind i en skitse, skaleret, drejet og placeret, som du angiver. Brug den til at gøre et logo eller en vektorkontur til kurver, du kan ekstrudere.",
"help.sketch.inspect": "Åbner en rapport om den åbne skitse: hvor mange frihedsgrader der er tilbage, og om den er fuldt bundet. Brug den til at finde ud af, hvad der stadig kan bevæge sig, før du afslutter skitsen.",
"help.sketch.intersect": "Tilføjer de kurver eller punkter, hvor emner, flader, kanter eller andre skitser krydser skitseplanet. De forbliver linkede og følger modellen, når den ændres.",
"help.sketch.intersection_curve": "Opretter 3D-kurver, hvor to emner, flader eller kurver fra andre skitser mødes, linket til dem. Brug dem som baner eller styrekurver, der følger modellen.",
"help.sketch.intersection_curve": "Opretter 3D-kurver, hvor to emner eller flader mødes, linket til dem. Brug dem som baner eller styrekurver, der følger modellen.",
"help.sketch.isoparametric_curve": "Opretter en 3D-kurve langs en flades U- eller V-retning gennem et punkt, du vælger, linket til fladen. Brug den som bane eller delelinje, der følger overfladen.",
"help.sketch.line": "Tegner forbundne linjer punkt for punkt som en åben kæde eller en lukket kontur. Det er det grundlæggende værktøj til de fleste profiler.",
"help.sketch.line.midpoint": "Tegner en linje fra dens midtpunkt ud til den ene ende, og den anden ende spejles. Brug den til linjer centreret om et punkt, f.eks. en symmetrisk kant.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Eksempelplade",
"sample.vents.about": "Slidser i et rektangulært mønster: Rækker, kolonner og deling er parametre",
"sample.vents.name": "Ventilationsplade",
"scale.per_axis": "Per akse",
"scale.uniform": "Ensartet",
"search.command_keys": "Enter kør Shift+Enter kør og hold åben Esc luk",
"search.commands": "Kommandoer",
"search.design": "I dette design",
+1 -57
View File
@@ -628,8 +628,6 @@
"Suppress Selected Folders": "Ausgewählte Ordner unterdrücken",
"Suppressed": "Unterdrückt",
"Surface": "Flächenkörper",
"Surface or face": "Flächenkörper oder Fläche",
"Surface or faces": "Flächenkörper oder Flächen",
"Surface, or faces to turn over": "Fläche oder umzudrehende Flächen",
"Surfaces": "Flächen",
"Swap Ends": "Enden vertauschen",
@@ -643,7 +641,6 @@
"Target": "Ziel",
"Target Body": "Zielkörper",
"Target Face (optional)": "Zielfläche (optional)",
"Target edges": "Zielkanten",
"Tear": "Reißen",
"Technical details": "Technische Details",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "Die gestrichelte Skizze ist eine gespeicherte Ebenenführung. Wählen Sie eine neue Fläche, um die Anbindung zu reparieren.",
@@ -651,7 +648,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "Die Richtung muss eine Achse oder eine gerade Skizzenkurve in der Skizzenebene sein",
"The mirror line cannot also be mirrored": "Die Spiegellinie kann nicht gleichzeitig gespiegelt werden",
"The mirror line must be a straight curve of this sketch, not an origin axis": "Die Spiegellinie muss eine gerade Kurve dieser Skizze sein, keine Ursprungsachse",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "Die Ursprungsachse steht senkrecht auf der Skizzenebene und hat daher keine Linie in ihr",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "Das gespeicherte Autorvorkommen fehlt. Wählen Sie vor dem erneuten Anbinden eine gültige Autorplatzierung.",
"Then": "Then",
"These features will be deleted:": "Diese Merkmale werden gelöscht:",
@@ -743,9 +739,6 @@
"a picked edge's body is gone": "der Körper einer gewählten Kante existiert nicht mehr",
"add a key for a joint first": "zuerst einen Schlüssel für ein Gelenk hinzufügen",
"ai.connected_toast": "SolidCraft ist jetzt in {clients} verfügbar. Starten Sie diese neu, um es zu nutzen (Einstellungen > Assistent).",
"ai.http.allow": "Unsicheres HTTP erlauben",
"ai.http.confirm": "Für diesen Endpunkt erlauben",
"ai.http.warning": "Der API-Schlüssel und die Unterhaltung werden unverschlüsselt gesendet. Jeder mit Zugriff auf das Netzwerk kann sie lesen oder verändern. Verwenden Sie dies nur in einem vertrauenswürdigen Netzwerk.",
"ai.prefs.allow_control": "KI-Agenten verbinden lassen",
"ai.prefs.allow_control_note": "Ein lokaler Kanal (MCP). Nichts verlässt diesen Computer.\n\nÖffnet einen Steuerkanal nur auf diesem Computer (127.0.0.1, Port 27878 oder der nächste freie). Ein verbindendes Programm muss zusätzlich ein geheimes Token vorweisen, das nur Ihr Benutzerkonto lesen kann und bei jedem Start neu erzeugt wird. Wirkt ab dem nächsten Start von SolidCraft. Aus: Es wartet nichts auf Verbindungen, außer Sie starten SolidCraft mit --control.",
"ai.prefs.availability": "Verfügbarkeit",
@@ -1081,9 +1074,6 @@
"cmd.render.compare.divider": "Render-Vergleichstrenner verschieben",
"cmd.render.result.discard": "Renderergebnis verwerfen",
"cmd.render.result.select": "Renderergebnis auswählen",
"cmd.render.surface.import": "Oberflächentexturen importieren",
"cmd.render.texture.list": "Eingebettete Oberflächenbilder auflisten",
"cmd.render.texture.remove": "Eingebettetes Oberflächenbild entfernen",
"cmd.render_aging_describe": "Mehrschichtige Oberflächenalterung",
"cmd.render_backends": "Render-Backends",
"cmd.render_batch": "Alle Aufnahmen rendern",
@@ -1398,7 +1388,6 @@
"dialog.computing": "Wird berechnet… {seconds} s",
"dialog.could_not_be_checked": "nicht prüfbar",
"dialog.custom_axis": "↖ Eigene Achse",
"dialog.cylinder_face_tip": "Die Fläche oder der Eckpunkt des Modells, auf dem der Zylinder steht: hier klicken, dann in der Ansicht darauf klicken. Leer gelassen platzieren ihn X, Y und Z.",
"dialog.dimension_insert_hint": "Doppelklicken Sie auf eine andere steuernde Bemaßung, um ihren Namen einzufügen",
"dialog.dimension_name": "Bemaßung: {name}",
"dialog.dimension_step_down": "Um {step} verringern",
@@ -1407,8 +1396,6 @@
"dialog.edit_title": "{title} bearbeiten",
"dialog.no_shown_body": "Kein sichtbarer Körper zum Ändern vorhanden. Blenden Sie einen Körper ein oder wählen Sie „Neuer Körper“.",
"dialog.pattern_sketch_not_object": "Körper oder Funktionen wählen: Eine Skizze ist keines von beiden. Ihre Kurven mit Muster oder Spiegeln in der Skizze wiederholen oder sie zuerst extrudieren.",
"dialog.primitive_point_tip": "Ein Punkt, der X, Y und Z füllt: hier klicken, dann einen Eckpunkt, eine Kante oder Fläche des Modells, einen Punkt einer Skizze oder den Ursprung anklicken.",
"dialog.reference_edge_tip": "Eine gerade Kante der gewählten Fläche, von der aus der Abstand darunter gemessen wird: hier klicken, dann die Kante anklicken.",
"dialog.select": "↖ Auswählen",
"dialog.selected_count": "↖ {count} ausgewählt",
"dialog.selection_constraint": "Bedingung {id}",
@@ -1456,11 +1443,8 @@
"file.open.portal_fallback.xwayland": "Die geöffnete Dateiauswahl ist nicht die des Desktops: Unter XWayland lehnt das Portal das Elternfenster ab.",
"file_load.built": "Bisher erstellt: {built} von {total} Merkmalen.",
"file_load.converting": "Volumenkörper {done} von {total} wird konvertiert",
"file_load.inserted": "{name} eingefügt",
"file_load.inserting": "Geometrie wird eingefügt",
"file_load.link_item": "{name} ({done} von {total})",
"file_load.opened": "{name} geöffnet",
"file_load.opened_in_tab": "{name} in neuem Tab geöffnet",
"file_load.opening": "Design wird geöffnet",
"file_load.preparing_thumbnail": "Vorschaubild wird vorbereitet...",
"file_load.preparing_view": "Ansicht wird vorbereitet...",
@@ -1696,7 +1680,7 @@
"help.sketch.insert_svg": "Liest die Pfade einer SVG-Zeichnung in eine Skizze ein, skaliert, gedreht und an der gewünschten Stelle. Damit machen Sie aus einem Logo oder einer Vektorkontur Kurven, die sich extrudieren lassen.",
"help.sketch.inspect": "Öffnet einen Bericht zur offenen Skizze: wie viele Freiheitsgrade übrig sind und ob sie vollständig bestimmt ist. Damit sehen Sie, was sich noch bewegt, bevor Sie die Skizze abschließen.",
"help.sketch.intersect": "Fügt die Kurven oder Punkte hinzu, an denen Körper, Flächen, Kanten oder andere Skizzen die Skizzenebene schneiden. Sie bleiben verknüpft und folgen Änderungen am Modell.",
"help.sketch.intersection_curve": "Erzeugt 3D-Kurven, wo sich zwei Körper, Flächen oder Kurven anderer Skizzen treffen, mit diesen verknüpft. Als Pfade oder Leitkurven, die dem Modell folgen.",
"help.sketch.intersection_curve": "Erzeugt 3D-Kurven, wo sich zwei Körper oder Flächen treffen, mit diesen verknüpft. Als Pfade oder Leitkurven, die dem Modell folgen.",
"help.sketch.isoparametric_curve": "Erzeugt eine 3D-Kurve in U- oder V-Richtung einer Fläche durch einen gewählten Punkt, mit der Fläche verknüpft. Als Pfad oder Trennlinie, die der Fläche folgt.",
"help.sketch.line": "Zeichnet verbundene Linien Punkt für Punkt, als offene Kette oder geschlossene Kontur. Das Grundwerkzeug für die meisten Profile.",
"help.sketch.line.midpoint": "Zeichnet eine Linie von ihrem Mittelpunkt zu einem Ende, das andere Ende gespiegelt. Für Linien, die auf einem Punkt mittig liegen, etwa eine symmetrische Kante.",
@@ -2294,8 +2278,6 @@
"prefs.browser_eye_left": "Auge neben dem Aufklapppfeil",
"prefs.browser_eye_left_note": "Browserzeilen zeigen ihr Auge zum Ein- und Ausblenden wie bisher neben dem Aufklapppfeil statt in einer Spalte am rechten Zeilenende.",
"prefs.browser_reveal_on_hover": "Beim Überfahren einblenden",
"prefs.browser_rows_start_closed": "Browser-Zeilen beginnen geschlossen",
"prefs.browser_rows_start_closed_note": "Platzierungen und Ordner im Browser beginnen geschlossen, sodass ein Entwurf mit vielen Komponenten seine obersten Zeilen zeigt. Jede öffnet sich mit ihrem Pfeil, „Alle ausklappen“ oder „Im Browser suchen“, das nur die Zeilen bis zu seinem Körper öffnet und die von der letzten Suche geöffneten wieder schließt. Ein in der 3D-Ansicht gewählter Körper lässt den Browser, wie er ist. Ist es aus, beginnen die Ordner geöffnet, Platzierungen so, wie „Komponenten zu Beginn aufgeklappt“ es festlegt, und eine Auswahl in der 3D-Ansicht öffnet den Browser bis zu ihrem Körper, wie bisher.",
"prefs.browser_show_note": "Angezeigt lässt den Browser auf dem Bildschirm. Beim Überfahren einblenden blendet ihn aus, bis der Zeiger über seinen Platz oder die schmale Lasche an seinem linken Rand kommt; er bleibt offen, solange der Zeiger darin ist oder ein Menü daraus offen ist.",
"prefs.browser_shown": "Angezeigt",
"prefs.built_in": "Integriert",
@@ -2306,7 +2288,6 @@
"prefs.carousel_previous": "Zurück",
"prefs.choose_font": "Schriftdatei auswählen…",
"prefs.click": "Klicken",
"prefs.command_dialog_values": "Befehlsdialoge",
"prefs.contact_shading": "Weiche Kontaktschattierung",
"prefs.contact_shading_note": "Erzeugt weiche Schatten an Stellen, an denen sich Bauteile nahekommen.",
"prefs.context_menu": "Kontextmenü",
@@ -2402,8 +2383,6 @@
"prefs.graphics_page.surfaces_edges": "Flächen und Kanten",
"prefs.graphics_page.view_bar": "Auch in der Ansichtsleiste",
"prefs.graphics_presets_note": "Mit den Profilen werden die unten aufgeführten Optionen gemeinsam eingestellt.",
"prefs.ground_shadow_follows_model": "Bodenschatten folgt dem Modell",
"prefs.ground_shadow_follows_model_help": "Den Schatten unter dem niedrigsten sichtbaren Körper platzieren. Wenn deaktiviert, bleibt der Schatten angehobener Modelle auf der Bodenebene durch den Ursprung.",
"prefs.hide_constraint_glyphs_zoomed_out": "Bindungssymbole bei starkem Herauszoomen ausblenden",
"prefs.hide_constraint_glyphs_zoomed_out_note": "Bindungssymbole verschwinden, wenn die Skizze so weit herausgezoomt ist, dass sie sie überladen würden. Aus: sie behalten bei jedem Zoom eine feste Bildschirmgröße.",
"prefs.history": "Verlauf",
@@ -2439,8 +2418,6 @@
"prefs.layout_page.card": "Karte",
"prefs.layout_page.column": "Spalte",
"prefs.layout_page.hover": "Bei Mauszeiger",
"prefs.layout_page.hover_panel_menus": "Bereichsmenüs beim Darüberfahren wechseln",
"prefs.layout_page.hover_panel_menus_help": "Klicken Sie auf einen Bereichsnamen, um das Menü zu öffnen. Bewegen Sie den Zeiger auf einen anderen Bereichsnamen, um das Menü zu wechseln. Außerhalb des Menübands und des geöffneten Menüs schließt es sich.",
"prefs.layout_page.icons_labels": "Symbole + Beschriftungen",
"prefs.layout_page.ok_cancel": "OK und Abbrechen",
"prefs.layout_page.on_hover": "Bei Mauszeiger",
@@ -2543,8 +2520,6 @@
"prefs.quality_smoother": "Stärker geglättet",
"prefs.quick_measure": "Schnellmessung in der Ecke der Ansicht",
"prefs.quick_measure_note": "Zeigt unten rechts in der Ansicht die Größe der Auswahl an: bei einer Kante die Länge, bei einer kreisförmigen Kante zusätzlich Durchmesser (Ø) und Radius (R), bei einer Fläche den Flächeninhalt, bei einem Punkt die Position, bei zwei Elementen Abstand und Winkel sowie bei mehreren Kanten oder Flächen die Gesamtlänge bzw. Gesamtfläche. Ein Klick kopiert den Messwert.",
"prefs.remember_dialog_values": "Befehlsdialogwerte merken",
"prefs.remember_dialog_values.help": "Standardmäßig aus. Wenn aktiviert, werden nach erfolgreicher Ausführung eines Befehls seine sicheren Werte und Optionen beim nächsten Öffnen desselben Befehls wiederverwendet, bis SolidCraft geschlossen wird.",
"prefs.render_previous_geometry_budget": "Bisheriges Geometriebudget für die Render-Vorschau verwenden",
"prefs.render_previous_geometry_budget_help": "Stellt die bisherige feste Obergrenze für die Geometrie wieder her (512 MiB auf 64-Bit-Desktop-Systemen, andernfalls 128 MiB) anstelle des geräteabhängigen Budgets.",
"prefs.reports_saved": "{n} gespeichert",
@@ -3278,11 +3253,9 @@
"render.frame_wide": "16:9 · Breitbild",
"render.gpu_depth": "Maximale Pfadtiefe",
"render.gpu_options_help": "Samples, Tiefe, Startwert und Belichtung werden mit diesem Setup gespeichert. Es wird nur die aktive Bildmethode gespeichert.",
"render.gpu_path_crashed": "SolidCraft wurde beim letzten Einrichten auf diesem Grafikadapter beendet, wahrscheinlich im Grafiktreiber, und richtet ihn deshalb nicht von selbst erneut ein. Verwenden Sie stattdessen Raytracing auf der CPU oder versuchen Sie es erneut (nach einem Treiberupdate wird es ebenfalls erneut versucht).",
"render.gpu_path_failed": "GPU-Pathtracer nicht verfügbar",
"render.gpu_path_first_setup": "Das erste Setup auf dieser GPU kann mehrere Minuten dauern; SolidCraft bleibt währenddessen bedienbar. Spätere Starts verwenden die kompilierten Shader erneut, sofern der Treiber sie behält.",
"render.gpu_path_preparing": "GPU-Pathtracer: Shader werden kompiliert…",
"render.gpu_path_retry": "Erneut versuchen",
"render.gpu_seed": "Zufallsstartwert",
"render.gpu_unavailable": "GPU-Pathtracing ist auf diesem Gerät nicht bereit.",
"render.ground_apply": "Boden anpassen und speichern",
@@ -3896,7 +3869,6 @@
"render.stage_panels.extent": "Ausdehnung",
"render.stage_panels.fit_save": "Einpassen und speichern",
"render.stage_panels.gpu_required": "Benötigt GPU-Pfadverfolgung",
"render.stage_panels.grain_angle": "Maserungswinkel",
"render.stage_panels.keep": "Behalten",
"render.stage_panels.kept": "Beibehalten",
"render.stage_panels.kept_fields": "Kamera, Abtastung, Abmessungen, optische Bindungen, CAD-Geometrie und technische Eigenschaften.",
@@ -4015,19 +3987,6 @@
"render.subsurface_enable": "Random Walk für innere Streuung",
"render.subsurface_help": "Nur für geschlossene Dielektrika. Streuung und RGB-Absorption sind getrennte Koeffizienten pro mm. Pfade streuen innerhalb der tatsächlichen Geometrie und werden dann an der Grenzfläche gebrochen oder reflektiert. Deaktivieren Sie die Transmission gerader Schattenstrahlen, das Entrauschen von Oberflächen und das äußere Volumen; verwenden Sie eine Fresnel-Schicht. Kein Diffusions-Shader, kein Dichtegitter und kein gemessenes Material. Dichte Medien können mehr Samples und Pfadtiefe benötigen.",
"render.subsurface_rate": "Streukollisionsrate",
"render.surface_import.author": "Autor",
"render.surface_import.busy": "Bild wird importiert…",
"render.surface_import.complete": "Wählen Sie ein Bild und geben Sie Autor, Quelle und Lizenz an.",
"render.surface_import.embedded": "Importiertes Bild",
"render.surface_import.failed": "Der Bildimport wurde nicht abgeschlossen.",
"render.surface_import.license": "Lizenz / Eigentum",
"render.surface_import.raytrace_required": "Bilder erfordern CPU- oder GPU-Raytracing. Wählen Sie es unter Ausgabe.",
"render.surface_import.repeat_u": "Wiederholung U",
"render.surface_import.repeat_v": "Wiederholung V",
"render.surface_import.save": "Bild am Körper speichern",
"render.surface_import.saved_cpu": "Speichern Sie Texturen für das CPU-Rendering.",
"render.surface_import.source": "Quelle",
"render.surface_import.title": "Bild importieren",
"render.tone_aces_fitted": "ACES angepasst",
"render.tone_reinhard": "Reinhard",
"render.transmission_scope": "GPU-Glas unterstützt zertifizierte getrennte Medien. Unbeschränkt verschachtelte Medien und ein rauschfreier Transmissionsschätzer werden nicht bereitgestellt.",
@@ -4104,8 +4063,6 @@
"sample.plate.name": "Beispielplatte",
"sample.vents.about": "Langlöcher in einem Rechteckmuster: Zeilen, Spalten und Abstand sind Parameter",
"sample.vents.name": "Lüftungsplatte",
"scale.per_axis": "Je Achse",
"scale.uniform": "Gleichmäßig",
"search.command_keys": "Eingabe ausführen Umschalt+Eingabe ausführen und offen lassen Esc schließen",
"search.commands": "Befehle",
"search.design": "In diesem Design",
@@ -4748,7 +4705,6 @@
"ui.click_selects_whole_bodies": "Klick wählt ganze Körper aus",
"ui.click_then_press_key": "Klicken, dann die neue Taste drücken",
"ui.close": "Schließen",
"ui.close_tab": "Tab schließen",
"ui.coil": "Schraube",
"ui.coincident": "Koinzident",
"ui.collapse": "Einklappen",
@@ -4964,11 +4920,6 @@
"ui.factor": "Faktor",
"ui.fade": "Auslauf",
"ui.fade_length": "Auslauflänge",
"ui.fair_iterations": "Iterationen",
"ui.fair_keep_edges": "Kanten behalten",
"ui.fair_strength": "Stärke",
"ui.fair_surface_title": "FLÄCHENBEGRADIGUNG",
"ui.fair_tolerance_default": "0,001 der Körpergröße",
"ui.feature_history": "Feature-Verlauf",
"ui.feature_options": "Funktionsoptionen",
"ui.features": "Funktionen",
@@ -5151,7 +5102,6 @@
"ui.inspect": "Prüfen",
"ui.instances": "Instanzen",
"ui.intersect": "Schnitt",
"ui.intersection_curve_second_pick": "Schnittkurve: zweite Fläche oder Kurve anklicken (Rechtsklick zum Neubeginn)",
"ui.isolate": "Isolieren",
"ui.join": "Verbinden",
"ui.joint_play": "▶ Abspielen",
@@ -5179,7 +5129,6 @@
"ui.manipulator_free_alt": "Freies Ziehen des Manipulators auch mit Alt/Option",
"ui.manipulator_free_alt_tip": "An: Alt/Option oder Strg/Cmd auf Extrusions-/Gizmo-Pfeilen deaktiviert das Einrasten von Werten. Aus: nur Strg/Cmd.",
"ui.manufacture": "Fertigung",
"ui.match_surface_title": "FLÄCHENANPASSUNG",
"ui.material_review.axes": "Materiallokale Achsen; keine Körperausrichtung zugewiesen.",
"ui.material_review.claims": "Quellen und Lizenzen sind ungeprüfte Angaben. Fehlende Werte bleiben unbekannt.",
"ui.material_review.compressive_strength": "Druckfestigkeit",
@@ -5202,9 +5151,6 @@
"ui.material_review.title": "Physikalische Materialdaten prüfen",
"ui.material_review.unknown": "Unbekannt",
"ui.material_review.yield_strength": "Streckgrenze",
"ui.mcp_agents": "Agenten über MCP",
"ui.mcp_compact": "Kompakte Ausgabe",
"ui.mcp_compact_note": "Für Agenten, die über den MCP-Server (solidcraft-cli mcp) verbunden sind: inspect_design fasst Skizzen zusammen und Werkzeugergebnisse werden nicht formatiert, sodass sie weniger Tokens verbrauchen. Gilt für Agentensitzungen, die nach der Änderung beginnen; --compact oder SOLIDCRAFT_MCP_COMPACT=1 schalten es ebenfalls ein.",
"ui.measure": "Messen",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "3MF mit Flächenmarken",
@@ -5246,7 +5192,6 @@
"ui.options": "Optionen",
"ui.orbit": "Drehen",
"ui.orbit_around": "Umkreisen um",
"ui.organize": "Organisieren",
"ui.orientation": "Ausrichtung",
"ui.origin": "Ursprung",
"ui.palette_construction_mode": "Konstruktionsmodus (X)",
@@ -5291,7 +5236,6 @@
"ui.point_cloud_add_filter": "Filter hinzufügen…",
"ui.point_cloud_auto_range": "Bereich automatisch",
"ui.point_cloud_color_by": "Färben nach",
"ui.point_cloud_dots": "Einzelpunkte",
"ui.point_cloud_file_colors": "Farben der Datei",
"ui.point_cloud_filter_by": "Filtern nach",
"ui.point_cloud_height_high": "Oberste Höhe",
-3
View File
@@ -235,8 +235,6 @@
"render.studio_area_help": "Up to four one-sided rectangles. Orthogonal half-edges U and V define size; U × V faces the lit side. Coordinates are world-space millimetres.",
"render.studio_center": "Centre X, Y, Z (mm)",
"render.studio_hdr_help": "Radiance .hdr, 2:1 panorama, up to 2048 × 1024. EXR is unavailable. The colour assumption applies only when primaries are unspecified.",
"render.surface_import.complete": "Choose an image and enter its author, source and licence.",
"render.surface_import.license": "Licence / ownership",
"sketch.hint.arc.center_point": "Arc: click centre and start, go round either way and click the end, or type a signed sweep",
"sketch.hint.circle.center": "Circle: click the centre, then a point on the circle",
"sketch.hint.constraint.midpoint": "MidPoint: pick a point and a line, or two lines to centre the second on the first",
@@ -268,7 +266,6 @@
"ui.layout_compact": "Compact",
"ui.layout_floating": "Floating",
"ui.material_review.claims": "Sources and licences are unverified claims. Missing values remain unknown.",
"ui.organize": "Organise",
"ui.point_cloud_color_by": "Colour By",
"ui.point_cloud_file_colors": "File Colours",
"ui.point_cloud_no_file_colors": "The file has no colours",
+1 -79
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "Suppress Selected Folders",
"Suppressed": "Suppressed",
"Surface": "Surface",
"Surface or face": "Surface or face",
"Surface or faces": "Surface or faces",
"Surface, or faces to turn over": "Surface, or faces to turn over",
"Surfaces": "Surfaces",
"Swap Ends": "Swap Ends",
@@ -644,7 +642,6 @@
"Target": "Target",
"Target Body": "Target Body",
"Target Face (optional)": "Target Face (optional)",
"Target edges": "Target edges",
"Tear": "Tear",
"Technical details": "Technical details",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "The dashed sketch is a saved plane guide. Select a new face to repair the attachment.",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "The direction must be an axis or a straight sketch curve that lies in the sketch plane",
"The mirror line cannot also be mirrored": "The mirror line cannot also be mirrored",
"The mirror line must be a straight curve of this sketch, not an origin axis": "The mirror line must be a straight curve of this sketch, not an origin axis",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "The origin axis is perpendicular to the sketch plane, so it has no line in the plane",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "The saved author occurrence is missing. Select a valid author placement before rebinding.",
"Then": "Then",
"These features will be deleted:": "These features will be deleted:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "a picked edge's body is gone",
"add a key for a joint first": "add a key for a joint first",
"ai.connected_toast": "SolidCraft is now available in {clients}. Restart them to use it (Preferences > Assistant).",
"ai.http.allow": "Allow insecure HTTP",
"ai.http.confirm": "Allow for this endpoint",
"ai.http.warning": "The API key and conversation will be sent unencrypted. Anyone with access to the network may read or change them. Use this only on a network you trust.",
"ai.prefs.allow_control": "Let AI agents connect",
"ai.prefs.allow_control_note": "A local channel (MCP). Nothing leaves this computer.\n\nOpens a control channel on this computer only (127.0.0.1, port 27878 or the next free one). A program that connects must also show a secret token that only your user account can read, made fresh at every start. Takes effect the next time SolidCraft starts. Off: nothing listens unless you start SolidCraft with --control.",
"ai.prefs.availability": "Availability",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "Follow the camera",
"ai.prefs.follow_camera_off": "Automatic camera following is off.",
"ai.prefs.follow_camera_on": "The camera turns to face sketches the agent creates.",
"ai.prefs.instructions": "Custom instructions",
"ai.prefs.instructions_note": "Sent to the agent at the start of every chat, after SolidCraft's own instructions: how you like to work, rules to keep to. A change applies from the next chat (Connect or New chat).",
"ai.prefs.intro": "AI agents in SolidCraft.",
"ai.prefs.make_default": "Make default",
"ai.prefs.no_agents": "No agents yet. Add an agent or refresh to find installed agents.",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "Move Render Comparison Divider",
"cmd.render.result.discard": "Discard Render Result",
"cmd.render.result.select": "Select Render Result",
"cmd.render.surface.import": "Import Surface Maps",
"cmd.render.texture.list": "List Embedded Surface Images",
"cmd.render.texture.remove": "Remove Embedded Surface Image",
"cmd.render_aging_describe": "Layered Surface Aging",
"cmd.render_backends": "Render Backends",
"cmd.render_batch": "Render All Shots",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "Previous Tab",
"cmd.view_rename": "Rename Named View",
"cmd.view_render_frame": "Render Frame Guides",
"cmd.view_ribbon_tabs_only": "Ribbon Tabs Only",
"cmd.view_right": "Right View",
"cmd.view_save": "New Named View",
"cmd.view_shots_strip": "Shots Strip",
@@ -1408,7 +1395,6 @@
"dialog.computing": "Computing… {seconds} s",
"dialog.could_not_be_checked": "could not be checked",
"dialog.custom_axis": "↖ Custom Axis",
"dialog.cylinder_face_tip": "The face or vertex of the model the cylinder stands on: click here, then click it in the view. Left empty, X, Y and Z place it.",
"dialog.dimension_insert_hint": "Click another driving dimension to insert its name",
"dialog.dimension_name": "Dimension: {name}",
"dialog.dimension_step_down": "Down by {step}",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "EDIT {title}",
"dialog.no_shown_body": "No shown body to change: show one, or choose New Body",
"dialog.pattern_sketch_not_object": "Pick bodies or features: a sketch is neither. Repeat its curves with the sketch's own Pattern or Mirror, or extrude it first.",
"dialog.primitive_point_tip": "A point that fills X, Y and Z: click here, then click a vertex, edge or face of the model, a point of a sketch, or the origin.",
"dialog.reference_edge_tip": "A straight edge of the picked face to measure the distance below from: click here, then click the edge.",
"dialog.select": "↖ Select",
"dialog.selected_count": "↖ {count} selected",
"dialog.selection_constraint": "Constraint {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "The file chooser that opened is not the desktop's own: under XWayland the portal refuses the parent window.",
"file_load.built": "Built so far: {built} of {total} features.",
"file_load.converting": "Converting solid {done} of {total}",
"file_load.inserted": "Inserted {name}",
"file_load.inserting": "Inserting geometry",
"file_load.link_item": "{name} ({done} of {total})",
"file_load.opened": "Opened {name}",
"file_load.opened_in_tab": "Opened {name} in a new tab",
"file_load.opening": "Opening design",
"file_load.preparing_thumbnail": "Preparing the thumbnail...",
"file_load.preparing_view": "Preparing the view...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "Reads the paths of an SVG drawing into a sketch, scaled, turned and placed where you set. Use it to turn a logo or vector outline into curves you can extrude.",
"help.sketch.inspect": "Opens a report on the open sketch: how many degrees of freedom are left and whether it is fully constrained. Use it to find out what still moves before you finish the sketch.",
"help.sketch.intersect": "Adds the curves or points where bodies, faces, edges or other sketches cross the sketch plane. They stay linked and follow the model when it changes.",
"help.sketch.intersection_curve": "Creates 3D curves where two bodies, faces or curves of other sketches meet, linked to them. Use them as paths or guide rails that follow the model.",
"help.sketch.intersection_curve": "Creates 3D curves where two bodies or faces meet, linked to them. Use them as paths or guide rails that follow the model.",
"help.sketch.isoparametric_curve": "Creates a 3D curve along a face's U or V direction through a point you pick, linked to the face. Use it as a path or split line that follows the surface.",
"help.sketch.line": "Draws connected lines point by point, as an open chain or a closed outline. It is the basic tool for most profiles.",
"help.sketch.line.midpoint": "Draws a line from its midpoint out to one end, with the other end mirrored. Use it for lines centred on a point, such as a symmetric edge.",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "Turns, pans or zooms the view by steps, such as a quarter turn left. Use it to move the camera precisely instead of dragging.",
"help.view.navigation_bar": "Shows or hides the navigation bar at the bottom of the viewport. Hide it for more room, show it to reach the view tools by mouse.",
"help.view.rename": "Gives a saved named view a new name. The view itself stays the same.",
"help.view.ribbon_tabs_only": "Folds the ribbon to its tab row, so the view gets the room its panels took. Click a tab to show its panels over the view; choose this again to keep the whole ribbon shown.",
"help.view.save": "Saves the current camera position as a named view in the design. Use it to come back to the same angle later, for example for screenshots.",
"help.view.spin": "Orbits the view around the model continuously until the next click or key. Use it to present a model from all sides.",
"help.view.tool": "Latches a camera tool, orbit, pan or zoom, so that dragging with the left mouse button moves the view until you switch it off. Use it on a trackpad or without a middle mouse button.",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "Join, New Body or Cut, from what the material touches.",
"prefs.axes": "Axes",
"prefs.axis": "Axis",
"prefs.background_choose": "Choose picture…",
"prefs.background_image": "Picture",
"prefs.background_unreadable": "Could not read the background picture",
"prefs.blur_cost": "Relative rendering cost. More bars usually mean more work.",
"prefs.blur_device": "Unavailable on this graphics device or rendering path",
"prefs.blur_guard": "Blur quality was reduced to keep frames responsive. The radius is unchanged.",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "Eye beside the fold arrow",
"prefs.browser_eye_left_note": "Browser rows show their show/hide eye next to the fold arrow, as before, instead of in a column at the right end of the rows.",
"prefs.browser_reveal_on_hover": "Reveal on hover",
"prefs.browser_rows_start_closed": "Browser rows start closed",
"prefs.browser_rows_start_closed_note": "Placements and folders in the Browser start closed, so a design with many components shows its top-level rows. Each opens with its arrow, Expand All or Find in Browser, which opens just the rows down to its body and closes again the ones the last find opened. A body picked in the 3D view leaves the Browser as it is. When off, folders start open, placements start as Components start open says, and a pick in the 3D view opens the Browser down to its body, as before.",
"prefs.browser_show_note": "Shown keeps the browser on screen. Reveal on hover keeps it out of sight until the pointer comes over its place or the thin tab at its left edge, and it stays open while the pointer is inside it or a menu from it is open.",
"prefs.browser_shown": "Shown",
"prefs.built_in": "Built in",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "Previous",
"prefs.choose_font": "Choose font file…",
"prefs.click": "Click",
"prefs.command_dialog_values": "Command dialogs",
"prefs.contact_shading": "Soft contact shading",
"prefs.contact_shading_note": "Soft shading where parts come close.",
"prefs.context_menu": "Context menu",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "Surfaces and edges",
"prefs.graphics_page.view_bar": "Also in the view bar",
"prefs.graphics_presets_note": "Presets set the choices below together.",
"prefs.ground_shadow_follows_model": "Ground shadow follows the model",
"prefs.ground_shadow_follows_model_help": "Place the shadow below the lowest visible body. When off, raised models keep their shadow on the origin ground plane.",
"prefs.hide_constraint_glyphs_zoomed_out": "Hide constraint glyphs when zoomed out",
"prefs.hide_constraint_glyphs_zoomed_out_note": "Constraint glyphs leave the view when the sketch is zoomed out far enough that they would clutter it. Off: they stay at a fixed screen size at every zoom.",
"prefs.history": "History",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "The two curved arrows at the cube's corner roll the view within the screen plane. On: the clockwise arrow rolls counterclockwise and the counterclockwise arrow rolls clockwise. Off: each arrow rolls the view the way it curls.",
"prefs.invert_navigator_arrows": "Invert the view cube rotation arrows",
"prefs.invert_navigator_arrows_note": "The arrows around the cube orbit the camera the way they point, as in Fusion and Inventor: the arrow on the left points right and swings the camera right. Off: an arrow rotates the cube toward the side it sits on, so the left arrow swings the camera left. The curved roll arrows are not affected.",
"prefs.keep_unsaved_also_asks": "Still ask when the tab closes",
"prefs.keep_unsaved_also_asks_tip": "With this off, the tab closes without the browser's box once every unsaved design's copy is current.",
"prefs.keep_unsaved_in_browser": "Keep unsaved work in this browser",
"prefs.keep_unsaved_in_browser_tip": "Each open design's unsaved changes are kept up to date in this browser's private storage. The next visit offers to restore them.",
"prefs.keep_work_on_tab_switch": "Keep dialogs and tools open when switching designs",
"prefs.keep_work_on_tab_switch_note": "Each design tab keeps its open dialog or tool, with what you picked and typed in it, and its toolbar tab. They are there again when you come back to the design. Off: switching designs cancels them and shows the Model tab.",
"prefs.labels": "Labels",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "Card",
"prefs.layout_page.column": "Column",
"prefs.layout_page.hover": "Hover",
"prefs.layout_page.hover_panel_menus": "Switch panel menus on hover",
"prefs.layout_page.hover_panel_menus_help": "Click a ribbon panel name to open its menu. Hover another panel name to switch. Move outside the ribbon and open menu to close it.",
"prefs.layout_page.icons_labels": "Icons + labels",
"prefs.layout_page.ok_cancel": "OK and Cancel",
"prefs.layout_page.on_hover": "On hover",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "smoother",
"prefs.quick_measure": "Quick measurement in the view's corner",
"prefs.quick_measure_note": "The selection's size in the view's bottom right corner: an edge's length, or Ø and R for a round one, a face's area, a point's position, two items' distance and angle, several edges' or faces' total. A click copies it.",
"prefs.remember_dialog_values": "Remember command dialog values",
"prefs.remember_dialog_values.help": "Off by default. When on, after a command succeeds, its safe values and options are reused the next time you open the same command, until SolidCraft closes.",
"prefs.render_previous_geometry_budget": "Use previous Render preview geometry budget",
"prefs.render_previous_geometry_budget_help": "Restore the previous fixed geometry limit (512 MiB on 64-bit desktop, 128 MiB elsewhere) instead of the device-based budget.",
"prefs.reports_saved": "{n} saved",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "A click on the lit ribbon button of the sketch tool in use ends the tool, so clicks in the view select again. Off: the click starts the tool again.",
"prefs.ribbon_reveal": "Show search results in the ribbon",
"prefs.ribbon_reveal_note": "Hovering a result in Search commands shows where the command sits in the ribbon: its tab, its button or its row in a panel's drop-down. A command started from the search blinks there, and a running command from a drop-down marks its panel.",
"prefs.ribbon_tabs_only": "Show only the ribbon's tabs",
"prefs.ribbon_tabs_only_note": "The ribbon folds to its tab row. Clicking a tab shows its panels over the view until a command starts or the pointer leaves them. Ribbon Tabs Only in the View tab, or its shortcut, switches this.",
"prefs.right_click": "Right click",
"prefs.saving": "Start and save",
"prefs.scale_note": "Also Ctrl + / Ctrl − in the window. Buttons are 28 px at 100%.",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "just now",
"recovery.min_ago": "{count} min ago",
"recovery.never_saved": "never saved",
"recovery.open_saved": "Open saved version",
"recovery.restore": "Restore",
"recovery.restore_intro": "Changes that weren't saved when this page last closed are kept in this browser.",
"recovery.restore_row": "{name}, changed {when}",
"recovery.restore_title": "Restore unsaved designs?",
"recovery.restore_title_one": "Restore unsaved design: {name}, changed {when}?",
"refused.change": "Couldn't change {body}.",
"refused.cut": "Couldn't cut {body}.",
"refused.face_curved": "One of its curved faces can't be used for modelling.",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · Widescreen",
"render.gpu_depth": "Maximum path depth",
"render.gpu_options_help": "Samples, depth, seed and exposure are saved with this setup. Only the active image method is saved.",
"render.gpu_path_crashed": "SolidCraft closed while setting it up on this graphics adapter last time, most likely inside the graphics driver, so it is not set up again by itself. Choose CPU ray tracing instead, or try again (a driver update also tries again).",
"render.gpu_path_failed": "GPU path tracer unavailable",
"render.gpu_path_first_setup": "The first setup on this GPU can take several minutes; SolidCraft stays usable meanwhile. Later starts reuse the compiled shaders where the driver keeps them.",
"render.gpu_path_preparing": "GPU path tracer: compiling shaders…",
"render.gpu_path_retry": "Try again",
"render.gpu_seed": "Random seed",
"render.gpu_unavailable": "GPU path tracing is not ready on this device.",
"render.ground_apply": "Fit and save ground",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "Extent",
"render.stage_panels.fit_save": "Fit and save",
"render.stage_panels.gpu_required": "Needs GPU path tracing",
"render.stage_panels.grain_angle": "Grain angle",
"render.stage_panels.keep": "Keep",
"render.stage_panels.kept": "Kept",
"render.stage_panels.kept_fields": "Camera, sampling, dimensions, optical bindings, CAD geometry and engineering properties.",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "Interior scattering random walk",
"render.subsurface_help": "Closed dielectric only. Scattering and RGB absorption are separate per-mm coefficients. Paths scatter inside actual geometry, then refract or reflect at the boundary. Disable straight shadow transmission, surface denoising and exterior volume; use one Fresnel stratum. Not a diffusion shader, density grid or measured material. Dense media may need more samples and path depth.",
"render.subsurface_rate": "Scattering collision rate",
"render.surface_import.author": "Author",
"render.surface_import.busy": "Importing image…",
"render.surface_import.complete": "Choose an image and enter its author, source and license.",
"render.surface_import.embedded": "Imported image",
"render.surface_import.failed": "The image import did not finish.",
"render.surface_import.license": "License / ownership",
"render.surface_import.raytrace_required": "Images require CPU or GPU ray tracing. Choose it in Output.",
"render.surface_import.repeat_u": "Repeat U",
"render.surface_import.repeat_v": "Repeat V",
"render.surface_import.save": "Save image on body",
"render.surface_import.saved_cpu": "Save maps to use them with CPU rendering.",
"render.surface_import.source": "Source",
"render.surface_import.title": "Import image",
"render.tone_aces_fitted": "ACES fitted",
"render.tone_reinhard": "Reinhard",
"render.transmission_scope": "GPU glass supports certified disjoint media. Unrestricted nested media and a noise-free transmission estimator are not provided.",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "Sample Plate",
"sample.vents.about": "Slots in a rectangular pattern: rows, columns and pitch are parameters",
"sample.vents.name": "Vent Plate",
"scale.per_axis": "Per axis",
"scale.uniform": "Uniform",
"search.command_keys": "Enter run Shift+Enter run and keep open Esc close",
"search.commands": "Commands",
"search.design": "In this design",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "3D Sketch",
"ui.activate": "Activate",
"ui.active_component": "Active component",
"ui.addToQuickAccess": "Add to Quick Access",
"ui.add_configuration": "Add configuration",
"ui.add_parameter": "Add parameter",
"ui.agent_chat": "Agent chat",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "Click selects whole bodies",
"ui.click_then_press_key": "Click, then press the new key",
"ui.close": "Close",
"ui.close_tab": "Close tab",
"ui.coil": "Coil",
"ui.coincident": "Coincident",
"ui.collapse": "Collapse",
@@ -5040,11 +4976,6 @@
"ui.factor": "Factor",
"ui.fade": "Fade",
"ui.fade_length": "Fade Length",
"ui.fair_iterations": "Iterations",
"ui.fair_keep_edges": "Keep edges",
"ui.fair_strength": "Strength",
"ui.fair_surface_title": "FAIR SURFACE",
"ui.fair_tolerance_default": "0.001 of body size",
"ui.feature_history": "Feature history",
"ui.feature_options": "Feature Options",
"ui.features": "Features",
@@ -5230,7 +5161,6 @@
"ui.inspect": "Inspect",
"ui.instances": "Instances",
"ui.intersect": "Intersect",
"ui.intersection_curve_second_pick": "Intersection curve: click the second face or curve (right-click to start over)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "Isolate",
"ui.join": "Join",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "Manipulator free drag also on Alt/Option",
"ui.manipulator_free_alt_tip": "On: Alt/Option or Ctrl/Cmd on extrude / gizmo arrows disables value snapping. Off: Ctrl/Cmd only.",
"ui.manufacture": "Manufacture",
"ui.match_surface_title": "MATCH SURFACE",
"ui.material_review.axes": "Material-local axes; no body orientation is assigned.",
"ui.material_review.claims": "Sources and licenses are unverified claims. Missing values remain unknown.",
"ui.material_review.compressive_strength": "Compressive strength",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "Review Physical Material Data",
"ui.material_review.unknown": "Unknown",
"ui.material_review.yield_strength": "Yield strength",
"ui.mcp_agents": "Agents through MCP",
"ui.mcp_compact": "Compact output",
"ui.mcp_compact_note": "For agents connected through the MCP server (solidcraft-cli mcp): inspect_design summarises sketches and tool results are not pretty-printed, so they use fewer tokens. Applies to agent sessions started after the change; --compact or SOLIDCRAFT_MCP_COMPACT=1 also turn it on.",
"ui.measure": "Measure",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "3MF with face tags",
@@ -5326,7 +5252,6 @@
"ui.options": "Options",
"ui.orbit": "Orbit",
"ui.orbit_around": "Orbit around",
"ui.organize": "Organize",
"ui.orientation": "Orientation",
"ui.origin": "Origin",
"ui.palette_construction_mode": "Construction mode (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "Add filter…",
"ui.point_cloud_auto_range": "Automatic Range",
"ui.point_cloud_color_by": "Color By",
"ui.point_cloud_dots": "Dots",
"ui.point_cloud_file_colors": "File Colors",
"ui.point_cloud_filter_by": "Filter by",
"ui.point_cloud_height_high": "Highest",
@@ -5416,7 +5340,6 @@
"ui.quality": "Quality",
"ui.quantity": "Quantity",
"ui.quantity_2": "Quantity 2",
"ui.quick_access_full": "The quick-access bar holds {count} commands; remove one to add another",
"ui.quit": "Quit",
"ui.radial_context_menu": "Radial context menu",
"ui.radius": "Radius",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "This component is not linked to a source design.",
"ui.relink_select_one": "Select one linked component or one of its instances first.",
"ui.relink_source_all": "Relink Source (All Instances)…",
"ui.removeFromQuickAccess": "Remove from Quick Access",
"ui.removeFromToolbar": "Remove from Toolbar",
"ui.removeSection": "Remove Section",
"ui.render": "Render",
-6
View File
@@ -1392,7 +1392,6 @@
"dialog.computing": "Calculando… {seconds} s",
"dialog.could_not_be_checked": "no se pudo comprobar",
"dialog.custom_axis": "↖ Eje personalizado",
"dialog.cylinder_face_tip": "La cara o el vértice del modelo sobre el que se apoya el cilindro: haz clic aquí y después haz clic en él en la vista. Si se deja vacío, lo colocan X, Y y Z.",
"dialog.dimension_insert_hint": "Haga doble clic en otra cota de control para insertar su nombre",
"dialog.dimension_name": "Cota: {name}",
"dialog.dimension_step_down": "Bajar {step}",
@@ -1401,8 +1400,6 @@
"dialog.edit_title": "EDITAR {title}",
"dialog.no_shown_body": "No hay cuerpo mostrado para cambiar: muestra uno, o elige Nuevo cuerpo",
"dialog.pattern_sketch_not_object": "Selecciona cuerpos o operaciones: un boceto no es ninguno. Repite sus curvas con el Patrón o Espejo del propio boceto, o extrúdelas primero.",
"dialog.primitive_point_tip": "Un punto que rellena X, Y y Z: haz clic aquí y después en un vértice, una arista o una cara del modelo, en un punto de un boceto o en el origen.",
"dialog.reference_edge_tip": "Una arista recta de la cara elegida desde la que se mide la distancia de abajo: haz clic aquí y después en la arista.",
"dialog.select": "↖ Seleccionar",
"dialog.selected_count": "↖ {count} seleccionados",
"dialog.selection_constraint": "Restricción {id}",
@@ -4079,8 +4076,6 @@
"sample.plate.name": "Placa de ejemplo",
"sample.vents.about": "Ranuras en un patrón rectangular: las filas, las columnas y el paso son parámetros",
"sample.vents.name": "Placa de ventilación",
"scale.per_axis": "Por eje",
"scale.uniform": "Uniforme",
"search.command_keys": "Intro ejecutar Mayús+Intro ejecutar y mantener abierto Esc cerrar",
"search.commands": "Comandos",
"search.design": "En este diseño",
@@ -4752,7 +4747,6 @@
"ui.click_selects_whole_bodies": "Un clic selecciona cuerpos completos",
"ui.click_then_press_key": "Haz clic y pulsa la nueva tecla",
"ui.close": "Cerrar",
"ui.close_tab": "Cerrar pestaña",
"ui.coil": "Hélice",
"ui.coincident": "Coincidente",
"ui.collapse": "Contraer",
-2
View File
@@ -4077,8 +4077,6 @@
"sample.plate.name": "Esimerkkilevy",
"sample.vents.about": "Urat suorakulmaisessa kuviossa: rivit, sarakkeet ja jako ovat parametreja",
"sample.vents.name": "Tuuletuslevy",
"scale.per_axis": "Akseleittain",
"scale.uniform": "Tasainen",
"search.command_keys": "Enter suorita Shift+Enter suorita ja pidä auki Esc sulje",
"search.commands": "Komennot",
"search.design": "Tässä mallissa",
+1 -10
View File
@@ -1363,14 +1363,11 @@
"dialog.computing": "Calcul… {seconds} s",
"dialog.could_not_be_checked": "non vérifiable",
"dialog.custom_axis": "↖ Axe personnalisé",
"dialog.cylinder_face_tip": "La face ou le sommet du modèle sur lequel le cylindre est posé : cliquer ici, puis dessus dans la vue. Laissé vide, X, Y et Z le placent.",
"dialog.dimension_insert_hint": "Double-cliquez sur une autre cote pilotante pour insérer son nom",
"dialog.dimension_name": "Cote : {name}",
"dialog.edit_title": "MODIFIER {title}",
"dialog.no_shown_body": "Aucun corps affiché à modifier : affichez-en un ou choisissez Nouveau corps",
"dialog.pattern_sketch_not_object": "Choisissez des corps ou des fonctions : une esquisse n'est ni l'un ni l'autre. Répétez ses courbes avec la Répétition ou la Symétrie de l'esquisse, ou extrudez-la d'abord.",
"dialog.primitive_point_tip": "Un point qui remplit X, Y et Z : cliquer ici, puis sur un sommet, une arête ou une face du modèle, sur un point d'une esquisse ou sur l'origine.",
"dialog.reference_edge_tip": "Une arête droite de la face choisie, depuis laquelle la distance ci-dessous est mesurée : cliquer ici, puis sur l'arête.",
"dialog.select": "↖ Sélectionner",
"dialog.selected_count": "↖ {count} sélectionné(s)",
"dialog.selection_constraint": "Contrainte {id}",
@@ -1624,7 +1621,7 @@
"help.sketch.insert_svg": "Lit les tracés d'un dessin SVG dans une esquisse, mis à l'échelle, tournés et placés comme vous le définissez. À utiliser pour transformer un logo ou un contour vectoriel en courbes que vous pouvez extruder.",
"help.sketch.inspect": "Ouvre un rapport sur l'esquisse ouverte : combien de degrés de liberté il reste et si elle est entièrement contrainte. À utiliser pour savoir ce qui bouge encore avant de terminer l'esquisse.",
"help.sketch.intersect": "Ajoute les courbes ou points où des corps, faces, arêtes ou d'autres esquisses traversent le plan d'esquisse. Ils restent liés et suivent le modèle lorsqu'il change.",
"help.sketch.intersection_curve": "Crée des courbes 3D là où deux corps, faces ou courbes d'autres esquisses se rencontrent, liées à eux. À utiliser comme trajectoires ou rails guides qui suivent le modèle.",
"help.sketch.intersection_curve": "Crée des courbes 3D là où deux corps ou faces se rencontrent, liées à eux. À utiliser comme trajectoires ou rails guides qui suivent le modèle.",
"help.sketch.isoparametric_curve": "Crée une courbe 3D le long de la direction U ou V d'une face, par un point que vous choisissez, liée à la face. À utiliser comme trajectoire ou ligne de partage qui suit la surface.",
"help.sketch.line": "Dessine des lignes connectées point par point, en chaîne ouverte ou en contour fermé. C'est l'outil de base de la plupart des profils.",
"help.sketch.line.midpoint": "Dessine une ligne de son milieu vers une extrémité, l'autre extrémité étant son symétrique. À utiliser pour des lignes centrées sur un point, comme une arête symétrique.",
@@ -3002,11 +2999,9 @@
"render.frame_wide": "16:9 · Écran large",
"render.gpu_depth": "Profondeur maximale des chemins",
"render.gpu_options_help": "Les échantillons, la profondeur, la graine et l'exposition sont enregistrés avec ce préréglage. Seule la méthode d'image active est enregistrée.",
"render.gpu_path_crashed": "SolidCraft s’est fermé pendant sa dernière préparation sur cet adaptateur graphique, très probablement dans le pilote graphique ; il n’est donc plus préparé de lui-même. Utilisez le lancer de rayons sur le CPU, ou réessayez (une mise à jour du pilote réessaie aussi).",
"render.gpu_path_failed": "Traceur de chemins GPU indisponible",
"render.gpu_path_first_setup": "La première initialisation sur ce GPU peut prendre plusieurs minutes ; SolidCraft reste utilisable pendant ce temps. Les démarrages suivants réutilisent les shaders compilés lorsque le pilote les conserve.",
"render.gpu_path_preparing": "Traceur de chemins GPU : compilation des shaders…",
"render.gpu_path_retry": "Réessayer",
"render.gpu_seed": "Graine aléatoire",
"render.gpu_unavailable": "Le tracé de chemins GPU n'est pas prêt sur cet appareil.",
"render.ground_apply": "Ajuster et enregistrer le sol",
@@ -3814,8 +3809,6 @@
"sample.plate.name": "Plaque d'exemple",
"sample.vents.about": "Rainures en répétition rectangulaire : lignes, colonnes et pas sont des paramètres",
"sample.vents.name": "Plaque d'aération",
"scale.per_axis": "Par axe",
"scale.uniform": "Uniforme",
"search.command_keys": "Entrée exécuter Maj+Entrée exécuter et garder ouvert Échap fermer",
"search.commands": "Commandes",
"search.design": "Dans cette conception",
@@ -4445,7 +4438,6 @@
"ui.click_selects_whole_bodies": "Un clic sélectionne des corps entiers",
"ui.click_then_press_key": "Cliquer, puis appuyer sur la nouvelle touche",
"ui.close": "Fermer",
"ui.close_tab": "Fermer l’onglet",
"ui.coil": "Hélice",
"ui.coincident": "Coïncidence",
"ui.collapse": "Réduire",
@@ -4929,7 +4921,6 @@
"ui.point_cloud_add_filter": "Ajouter un filtre…",
"ui.point_cloud_auto_range": "Plage automatique",
"ui.point_cloud_color_by": "Colorer par",
"ui.point_cloud_dots": "Points isolés",
"ui.point_cloud_file_colors": "Couleurs du fichier",
"ui.point_cloud_filter_by": "Filtrer par",
"ui.point_cloud_height_high": "Plus haut",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Le os trazados dun debuxo SVG nun bosquexo, escalados, xirados e colocados onde indiques. Úsao para converter un logotipo ou un contorno vectorial en curvas que podes extruír.",
"help.sketch.inspect": "Abre un informe do bosquexo aberto: cantos graos de liberdade quedan e se está totalmente restrinxido. Úsao para saber o que aínda se move antes de rematar o bosquexo.",
"help.sketch.intersect": "Engade as curvas ou os puntos onde corpos, caras, arestas ou outros bosquexos cruzan o plano do bosquexo. Quedan ligados e seguen o modelo cando cambia.",
"help.sketch.intersection_curve": "Crea curvas 3D onde se atopan dous corpos, caras ou curvas doutros bosquexos, ligadas a eles. Úsaas como traxectorias ou guías que seguen o modelo.",
"help.sketch.intersection_curve": "Crea curvas 3D onde se atopan dous corpos ou caras, ligadas a eles. Úsaas como traxectorias ou guías que seguen o modelo.",
"help.sketch.isoparametric_curve": "Crea unha curva 3D na dirección U ou V dunha cara por un punto que escollas, ligada á cara. Úsaa como traxectoria ou liña de división que segue a superficie.",
"help.sketch.line": "Debuxa liñas conectadas punto a punto, como cadea aberta ou como contorno pechado. É a ferramenta básica para a maioría dos perfís.",
"help.sketch.line.midpoint": "Debuxa unha liña desde o seu punto medio ata un extremo, co outro extremo reflectido. Úsao para liñas centradas nun punto, como unha aresta simétrica.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Placa de exemplo",
"sample.vents.about": "Ranuras nun patrón rectangular: filas, columnas e paso son parámetros",
"sample.vents.name": "Placa de ventilación",
"scale.per_axis": "Por eixo",
"scale.uniform": "Uniforme",
"search.command_keys": "Intro executar Maiús+Intro executar e manter aberto Esc pechar",
"search.commands": "Ordes",
"search.design": "Neste deseño",
+1 -79
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "השבתת התיקיות שנבחרו",
"Suppressed": "מושבת",
"Surface": "משטח",
"Surface or face": "משטח או פאה",
"Surface or faces": "משטח או פאות",
"Surface, or faces to turn over": "משטח, או פאות להיפוך",
"Surfaces": "משטחים",
"Swap Ends": "החלפת קצוות",
@@ -644,7 +642,6 @@
"Target": "יעד",
"Target Body": "גוף יעד",
"Target Face (optional)": "פאת יעד (אופציונלי)",
"Target edges": "מקצועות יעד",
"Tear": "קריעה",
"Technical details": "פרטים טכניים",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "הסקיצה המקווקוות מסמנת מישור שמור. יש לבחור פאה חדשה כדי לתקן את ההצמדה.",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "הכיוון חייב להיות ציר או עקומת סקיצה ישרה הנמצאת במישור הסקיצה",
"The mirror line cannot also be mirrored": "אי אפשר לשקף גם את קו השיקוף עצמו",
"The mirror line must be a straight curve of this sketch, not an origin axis": "קו השיקוף חייב להיות עקומה ישרה של הסקיצה הזו, ולא אחד מצירי הראשית",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "ציר הראשית ניצב למישור הסקיצה, ולכן אין לו קו במישור",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "מופע היצירה השמור חסר. יש לבחור מיקום יצירה תקין לפני הקישור מחדש.",
"Then": "אז",
"These features will be deleted:": "הפיצ'רים הבאים יימחקו:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "הגוף של המקצוע שנבחר כבר לא קיים",
"add a key for a joint first": "יש להוסיף תחילה מפתח למפרק",
"ai.connected_toast": "SolidCraft זמין עכשיו ב־{clients}. יש להפעיל אותם מחדש כדי להשתמש בו (הגדרות > עוזר).",
"ai.http.allow": "אפשר HTTP לא מאובטח",
"ai.http.confirm": "אפשר עבור נקודת קצה זו",
"ai.http.warning": "מפתח ה־API והשיחה יישלחו ללא הצפנה. כל מי שיש לו גישה לרשת יכול לקרוא או לשנות אותם. יש להשתמש באפשרות זו רק ברשת מהימנה.",
"ai.prefs.allow_control": "לאפשר לסוכני AI להתחבר",
"ai.prefs.allow_control_note": "ערוץ מקומי (MCP). שום דבר לא יוצא מהמחשב הזה.\n\nפותח ערוץ בקרה במחשב זה בלבד (127.0.0.1, פורט 27878 או הפנוי הבא). תוכנה שמתחברת צריכה גם להציג אסימון סודי שרק חשבון המשתמש שלך יכול לקרוא, ונוצר מחדש בכל הפעלה. ייכנס לתוקף בהפעלה הבאה של SolidCraft. כבוי: שום דבר אינו מאזין, אלא אם SolidCraft מופעל עם --control.",
"ai.prefs.availability": "זמינות",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "לעקוב אחר המצלמה",
"ai.prefs.follow_camera_off": "מעקב המצלמה האוטומטי כבוי.",
"ai.prefs.follow_camera_on": "המצלמה פונה אל הסקיצות שהסוכן יוצר.",
"ai.prefs.instructions": "הוראות מותאמות אישית",
"ai.prefs.instructions_note": "נשלחות לסוכן בתחילת כל צ'אט, אחרי ההוראות של SolidCraft עצמה: דרך העבודה המועדפת עליך וכללים שיש להקפיד עליהם. שינוי חל מהצ'אט הבא (התחברות או צ'אט חדש).",
"ai.prefs.intro": "סוכני AI ב־SolidCraft.",
"ai.prefs.make_default": "לקבוע כברירת מחדל",
"ai.prefs.no_agents": "אין עדיין סוכנים. אפשר להוסיף סוכן או לרענן כדי למצוא סוכנים מותקנים.",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "הזז את מחיצת ההשוואה של הרינדור",
"cmd.render.result.discard": "השלך תוצאת רינדור",
"cmd.render.result.select": "בחר תוצאת רינדור",
"cmd.render.surface.import": "ייבוא מפות משטח",
"cmd.render.texture.list": "הצגת תמונות משטח מוטמעות",
"cmd.render.texture.remove": "הסרת תמונת משטח מוטמעת",
"cmd.render_aging_describe": "הזדקנות משטח בשכבות",
"cmd.render_backends": "מנועי הדמיה",
"cmd.render_batch": "רינדור כל הצילומים",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "הכרטיסייה הקודמת",
"cmd.view_rename": "שינוי שם תצוגה שמורה",
"cmd.view_render_frame": "מדריכי מסגרת רינדור",
"cmd.view_ribbon_tabs_only": "רק לשוניות הסרט",
"cmd.view_right": "תצוגה ימנית",
"cmd.view_save": "תצוגה שמורה חדשה",
"cmd.view_shots_strip": "סרגל צילומים",
@@ -1408,7 +1395,6 @@
"dialog.computing": "מחשב… {seconds} שנ'",
"dialog.could_not_be_checked": "לא ניתן היה לבדוק",
"dialog.custom_axis": "↖ ציר מותאם",
"dialog.cylinder_face_tip": "הפאה או הקודקוד של המודל שעליהם הגליל ניצב: יש ללחוץ כאן ואז עליהם בתצוגה. אם נשאר ריק, X, Y ו-Z ממקמים אותו.",
"dialog.dimension_insert_hint": "יש ללחוץ על מידה מניעה אחרת כדי להוסיף את שמה",
"dialog.dimension_name": "מידה: {name}",
"dialog.dimension_step_down": "הפחתה ב־{step}",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "עריכת {title}",
"dialog.no_shown_body": "אין גוף מוצג לשינוי: הציגו גוף, או בחרו „גוף חדש”",
"dialog.pattern_sketch_not_object": "בחרו גופים או פיצ'רים: סקיצה אינה אף אחד מהם. חזרו על העקומות שלה בעזרת המערך או השיקוף של הסקיצה עצמה, או בצעו לה שליפה קודם.",
"dialog.primitive_point_tip": "נקודה שממלאת את X, Y ו-Z: יש ללחוץ כאן ואז על קודקוד, מקצוע או פאה של המודל, על נקודה של סקיצה, או על הראשית.",
"dialog.reference_edge_tip": "מקצוע ישר של הפאה שנבחרה שממנו נמדד המרחק שלמטה: יש ללחוץ כאן ואז על המקצוע.",
"dialog.select": "↖ בחירה",
"dialog.selected_count": "↖ {count} נבחרו",
"dialog.selection_constraint": "אילוץ {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "בורר הקבצים שנפתח אינו של שולחן העבודה: תחת XWayland הפורטל דוחה את חלון האב.",
"file_load.built": "נבנו עד כה: {built} מתוך {total} פיצ'רים.",
"file_load.converting": "המרת גוף מוצק {done} מתוך {total}",
"file_load.inserted": "{name} הוכנס",
"file_load.inserting": "הוספת גאומטריה",
"file_load.link_item": "{name} ({done} מתוך {total})",
"file_load.opened": "{name} נפתח",
"file_load.opened_in_tab": "{name} נפתח בלשונית חדשה",
"file_load.opening": "פותח את התכן",
"file_load.preparing_thumbnail": "מכין את התמונה הממוזערת...",
"file_load.preparing_view": "מכין את התצוגה...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "קריאת הנתיבים של שרטוט SVG לתוך סקיצה, בקנה המידה, בסיבוב ובמיקום שנקבעו. כך הופכים לוגו או קו מתאר וקטורי לעקומות שניתן לשחל.",
"help.sketch.inspect": "פותח דוח על הסקיצה הפתוחה: כמה דרגות חופש נותרו והאם היא מאולצת במלואה. השתמשו בו כדי לגלות מה עדיין זז לפני שמסיימים את הסקיצה.",
"help.sketch.intersect": "מוסיף את העקומות או הנקודות שבהן גופים, פאות, קצוות או סקיצות אחרות חותכים את מישור הסקיצה. הן נשארות מקושרות ועוקבות אחר המודל כשהוא משתנה.",
"help.sketch.intersection_curve": "יוצר עקומות תלת־ממדיות במקום שבו שני גופים, פאות או עקומות של סקיצות אחרות נפגשים, מקושרות אליהם. מתאים למסלולים או למסילות הנחיה שעוקבים אחר המודל.",
"help.sketch.intersection_curve": "יוצר עקומות תלת־ממדיות במקום שבו שני גופים או פאות נפגשים, מקושרות אליהם. מתאים למסלולים או למסילות הנחיה שעוקבים אחר המודל.",
"help.sketch.isoparametric_curve": "יוצר עקומה תלת־ממדית לאורך כיוון U או V של פאה דרך נקודה שבוחרים, מקושרת לפאה. מתאים למסלול או לקו פיצול שעוקבים אחר המשטח.",
"help.sketch.line": "משרטט ישרים מחוברים נקודה אחר נקודה, כשרשרת פתוחה או כקו מתאר סגור. זה הכלי הבסיסי לרוב הפרופילים.",
"help.sketch.line.midpoint": "משרטט ישר מנקודת האמצע שלו אל אחד הקצוות, כשהקצה השני משוקף. מתאים לישרים הממורכזים סביב נקודה, כמו קצה סימטרי.",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "סיבוב, הזזה או זום של התצוגה בצעדים, כמו רבע סיבוב שמאלה. מתאים להזזה מדויקת של המצלמה במקום גרירה.",
"help.view.navigation_bar": "הצגה או הסתרה של סרגל הניווט בתחתית חלון התצוגה. אפשר להסתיר אותו לשטח נוסף, או להציג אותו כדי להגיע אל כלי התצוגה בעכבר.",
"help.view.rename": "מתן שם חדש לתצוגה שמורה. התצוגה עצמה נשארת כפי שהיא.",
"help.view.ribbon_tabs_only": "מקפל את הסרט לשורת הלשוניות שלו, כך שחלון התצוגה מקבל את המקום שתפסו הלוחות. לחיצה על לשונית מציגה את הלוחות שלה מעל התצוגה; בחירה חוזרת בפקודה משאירה את הסרט כולו מוצג.",
"help.view.save": "שמירת מיקום המצלמה הנוכחי כתצוגה בשם בתכן. מתאים לחזרה לאותה זווית בהמשך, למשל לצילומי מסך.",
"help.view.spin": "הקפת המודל בתצוגה באופן רציף עד ללחיצה או למקש הבא. מתאים להצגת מודל מכל הצדדים.",
"help.view.tool": "נעילת כלי מצלמה, מסלול, הזזה או זום, כך שגרירה בכפתור השמאלי של העכבר מזיזה את התצוגה עד שמכבים אותו. מתאים למשטח מגע או כשאין כפתור עכבר אמצעי.",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "איחוד, גוף חדש או חיתוך, לפי מה שהחומר נוגע בו.",
"prefs.axes": "צירים",
"prefs.axis": "ציר",
"prefs.background_choose": "בחירת תמונה…",
"prefs.background_image": "תמונה",
"prefs.background_unreadable": "לא ניתן לקרוא את תמונת הרקע",
"prefs.blur_cost": "עלות עיבוד יחסית. יותר פסים מציינים בדרך כלל יותר עבודה.",
"prefs.blur_device": "לא זמין בהתקן הגרפי או בנתיב העיבוד הזה",
"prefs.blur_guard": "איכות הטשטוש הופחתה כדי לשמור על תגובתיות הפריימים. הרדיוס לא השתנה.",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "סמל העין ליד חץ הקיפול",
"prefs.browser_eye_left_note": "שורות עץ התכן מציגות את סמל העין ליד חץ הקיפול, כמו קודם, במקום בעמודה בקצה הימני של השורות.",
"prefs.browser_reveal_on_hover": "הצגה בריחוף",
"prefs.browser_rows_start_closed": "שורות עץ התכן מוצגות סגורות",
"prefs.browser_rows_start_closed_note": "מיקומים ותיקיות בעץ התכן מוצגים סגורים, כך שתכן עם רכיבים רבים מציג את השורות העליונות שלו. כל שורה נפתחת בחץ שלה, ב„הרחבת הכול” או ב„איתור בעץ התכן”, שפותח רק את השורות שמובילות לגוף שלו וסוגר שוב את אלה שהאיתור הקודם פתח. גוף שנבחר בתצוגה התלת־ממדית משאיר את עץ התכן כפי שהוא. כשהאפשרות כבויה התיקיות מוצגות פתוחות, המיקומים מוצגים כפי שקובעת האפשרות „רכיבים פתוחים מההתחלה”, ובחירה בתצוגה התלת־ממדית פותחת את עץ התכן עד לגוף שלה, כמו קודם.",
"prefs.browser_show_note": "״מוצג״ משאיר את הדפדפן על המסך. ״הצגה בריחוף״ מסתיר אותו עד שהמצביע מגיע למקומו או ללשונית הדקה בקצהו השמאלי, והוא נשאר פתוח כל עוד המצביע בתוכו או שתפריט ממנו פתוח.",
"prefs.browser_shown": "מוצג",
"prefs.built_in": "מובנה",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "הקודם",
"prefs.choose_font": "בחירת קובץ גופן…",
"prefs.click": "לחיצה",
"prefs.command_dialog_values": "תיבות דו-שיח של פקודות",
"prefs.contact_shading": "הצללת מגע רכה",
"prefs.contact_shading_note": "הצללה רכה במקומות שבהם חלקים מתקרבים.",
"prefs.context_menu": "תפריט הקשר",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "משטחים וקצוות",
"prefs.graphics_page.view_bar": "גם בסרגל התצוגה",
"prefs.graphics_presets_note": "הגדרות קבועות מראש קובעות יחד את הבחירות שלמטה.",
"prefs.ground_shadow_follows_model": "צל הקרקע עוקב אחר המודל",
"prefs.ground_shadow_follows_model_help": "מקם את הצל מתחת לגוף הגלוי הנמוך ביותר. כשהאפשרות כבויה, הצל של מודלים מוגבהים נשאר במישור הקרקע העובר בראשית הצירים.",
"prefs.hide_constraint_glyphs_zoomed_out": "הסתרת סמלי אילוצים בהקטנה",
"prefs.hide_constraint_glyphs_zoomed_out_note": "סמלי האילוצים נעלמים כשהשרטוט מוקטן מספיק כדי שלא יעמיסו על התצוגה. כבוי: הם נשארים בגודל מסך קבוע בכל זום.",
"prefs.history": "ציר הזמן",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "שני החצים המעוגלים בפינת הקובייה מסובבים את התצוגה במישור המסך. פועל: החץ עם כיוון השעון מסובב נגד כיוון השעון, והחץ נגד כיוון השעון מסובב עם כיוון השעון. כבוי: כל חץ מסובב את התצוגה לפי העקום שלו.",
"prefs.invert_navigator_arrows": "היפוך חצי סיבוב קוביית התצוגה",
"prefs.invert_navigator_arrows_note": "החצים סביב הקובייה מחוויים את המצלמה לכיוון שהחץ מצביע, כמו ב-Fusion ו-Inventor: החץ שמשמאל מצביע ימימה ומניע את המצלמה ימימה. כבוי: החץ מסובב את הקובייה אל הצד שבו הוא יושב, כך שחץ שמאל מניע את המצלמה שמאלה. חצי הגלילה המעוגלים אינם מושפעים.",
"prefs.keep_unsaved_also_asks": "לשאול גם כשהכרטיסייה נסגרת",
"prefs.keep_unsaved_also_asks_tip": "כשאפשרות זו כבויה, הכרטיסייה נסגרת ללא חלון הדפדפן לאחר שהעותק של כל תכן שלא נשמר עודכן.",
"prefs.keep_unsaved_in_browser": "לשמור עבודה שלא נשמרה בדפדפן זה",
"prefs.keep_unsaved_in_browser_tip": "השינויים שלא נשמרו בכל תכן פתוח נשמרים מעודכנים באחסון הפרטי של דפדפן זה. בביקור הבא תוצע שחזורם.",
"prefs.keep_work_on_tab_switch": "השארת תיבות דו־שיח וכלים פתוחים במעבר בין עיצובים",
"prefs.keep_work_on_tab_switch_note": "כל לשונית עיצוב שומרת את תיבת הדו־שיח או הכלי הפתוחים בה, עם מה שבחרת והקלדת בהם, ואת לשונית סרגל הכלים שלה. הם מחכים לך כשתחזור לעיצוב. כבוי: מעבר בין עיצובים מבטל אותם ומציג את הלשונית מודל.",
"prefs.labels": "תוויות",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "כרטיס",
"prefs.layout_page.column": "עמודה",
"prefs.layout_page.hover": "מעבר עכבר",
"prefs.layout_page.hover_panel_menus": "מעבר בין תפריטי לוחות בריחוף",
"prefs.layout_page.hover_panel_menus_help": "לחצו על שם לוח ברצועת הכלים כדי לפתוח את התפריט שלו. העבירו את הסמן מעל שם של לוח אחר כדי לעבור לתפריט שלו. הזיזו את הסמן אל מחוץ לרצועת הכלים ולתפריט הפתוח כדי לסגור אותו.",
"prefs.layout_page.icons_labels": "סמלים + תוויות",
"prefs.layout_page.ok_cancel": "אישור וביטול",
"prefs.layout_page.on_hover": "בעת מעבר עכבר",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "חלק יותר",
"prefs.quick_measure": "מדידה מהירה בפינת התצוגה",
"prefs.quick_measure_note": "מציג את מידות הבחירה בפינה הימנית התחתונה של התצוגה, מעל ההיסטוריה: אורך מקצוע (או Ø ו-R למקצוע עגול), שטח פאה, מיקום נקודה, המרחק והזווית בין שני פריטים, והסכום של כמה מקצועות או פאות. לחיצה מעתיקה אותו.",
"prefs.remember_dialog_values": "זכור ערכים בתיבות דו-שיח של פקודות",
"prefs.remember_dialog_values.help": "כבוי כברירת מחדל. כשהוא פועל, לאחר הצלחת פקודה, הערכים והאפשרויות הבטוחים שלה ישמשו שוב בפעם הבאה שתפתח את אותה פקודה, עד לסגירת SolidCraft.",
"prefs.render_previous_geometry_budget": "שימוש בתקציב הגאומטריה הקודם לתצוגה מקדימה של רינדור",
"prefs.render_previous_geometry_budget_help": "שחזור מגבלת הגאומטריה הקבועה הקודמת (512 MiB במחשב שולחני של 64 סיביות, 128 MiB בפלטפורמות אחרות) במקום התקציב המבוסס על ההתקן.",
"prefs.reports_saved": "{n} שמורים",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "לחיצה על לחצן הסרט המודגש של כלי השרטוט שבשימוש מסיימת את הכלי, כך שלחיצות בתצוגה בוחרות שוב. כבוי: הלחיצה מפעילה את הכלי מחדש.",
"prefs.ribbon_reveal": "הצגת תוצאות חיפוש בסרט",
"prefs.ribbon_reveal_note": "מעבר עם הסמן מעל תוצאה בחיפוש פקודות מראה היכן הפקודה נמצאת בסרט: הלשונית, הכפתור או השורה שלה בתפריט הנפתח של לוח. פקודה שהופעלה מהחיפוש מהבהבת שם, ופקודה פעילה מתפריט נפתח מסמנת את הלוח שלה.",
"prefs.ribbon_tabs_only": "הצגת לשוניות הסרט בלבד",
"prefs.ribbon_tabs_only_note": "הסרט מתקפל לשורת הלשוניות שלו. לחיצה על לשונית מציגה את הלוחות שלה מעל התצוגה עד שפקודה מתחילה או שהמצביע עוזב אותם. הפקודה ״רק לשוניות הסרט״ בלשונית תצוגה, או קיצור המקשים שלה, מחליפה הגדרה זו.",
"prefs.right_click": "לחיצה ימנית",
"prefs.saving": "הפעלה ושמירה",
"prefs.scale_note": "גם Ctrl + / Ctrl − בחלון. הכפתורים בגודל 28 px ב־100%.",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "זה עתה",
"recovery.min_ago": "לפני {count} דק'",
"recovery.never_saved": "לא נשמר מעולם",
"recovery.open_saved": "פתיחת הגרסה השמורה",
"recovery.restore": "שחזור",
"recovery.restore_intro": "שינויים שלא נשמרו כשדף זה נסגר לאחרונה שמורים בדפדפן זה.",
"recovery.restore_row": "{name}, שונה {when}",
"recovery.restore_title": "לשחזר תכנים שלא נשמרו?",
"recovery.restore_title_one": "לשחזר תכן שלא נשמר: {name}, שונה {when}?",
"refused.change": "לא ניתן היה לשנות את {body}.",
"refused.cut": "לא ניתן היה לחתוך את {body}.",
"refused.face_curved": "אחת הפאות המעוקלות שלו אינה ניתנת לשימוש במידול.",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · רחב",
"render.gpu_depth": "עומק מסלול מרבי",
"render.gpu_options_help": "הדגימות, העומק, הזרע והחשיפה נשמרים עם ההגדרה הזאת. נשמרת רק שיטת התמונה הפעילה.",
"render.gpu_path_crashed": "SolidCraft נסגר בזמן ההכנה על מתאם גרפי זה בפעם הקודמת, ככל הנראה בתוך מנהל ההתקן הגרפי, ולכן ההכנה לא תתבצע שוב מעצמה. יש להשתמש במעקב קרניים על המעבד במקום זאת, או לנסות שוב (עדכון מנהל ההתקן גם מנסה שוב).",
"render.gpu_path_failed": "מעקב המסלולים ב־GPU אינו זמין",
"render.gpu_path_first_setup": "ההגדרה הראשונה ב־GPU הזה עשויה להימשך כמה דקות; SolidCraft נשאר זמין לשימוש בינתיים. הפעלות מאוחרות יותר משתמשות שוב בשיידרים שהודרו, כשמנהל ההתקן שומר אותן.",
"render.gpu_path_preparing": "מעקב מסלולים ב־GPU: הידור שיידרים…",
"render.gpu_path_retry": "לנסות שוב",
"render.gpu_seed": "זרע אקראי",
"render.gpu_unavailable": "מעקב מסלולים ב־GPU אינו מוכן במכשיר הזה.",
"render.ground_apply": "התאמת הקרקע ושמירתה",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "ממדי התחום",
"render.stage_panels.fit_save": "התאמה ושמירה",
"render.stage_panels.gpu_required": "נדרש מעקב נתיב ב-GPU",
"render.stage_panels.grain_angle": "זווית סיבי העץ",
"render.stage_panels.keep": "שמור",
"render.stage_panels.kept": "נשמר",
"render.stage_panels.kept_fields": "מצלמה, דגימה, ממדים, קישורים אופטיים, גאומטריית CAD ותכונות הנדסיות.",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "הילוך אקראי לפיזור פנימי",
"render.subsurface_help": "לדיאלקטרי סגור בלבד. פיזור ובליעת RGB הם מקדמים נפרדים לכל mm. המסלולים מתפזרים בתוך הגאומטריה בפועל, ואז נשברים או מוחזרים בגבול. יש לבטל העברת צל ישרה, הסרת רעש משטחית ונפח חיצוני; ולהשתמש בשכבת פרנל אחת. אינו שיידר דיפוזיה, אינו רשת צפיפות ואינו חומר מדוד. תווך צפוף עשוי לדרוש יותר דגימות ועומק מסלול.",
"render.subsurface_rate": "קצב התנגשויות הפיזור",
"render.surface_import.author": "יוצר",
"render.surface_import.busy": "מתבצע ייבוא תמונה…",
"render.surface_import.complete": "בחר תמונה והזן את היוצר, המקור והרישיון שלה.",
"render.surface_import.embedded": "תמונה מיובאת",
"render.surface_import.failed": "ייבוא התמונה לא הושלם.",
"render.surface_import.license": "רישיון / בעלות",
"render.surface_import.raytrace_required": "תמונות מחייבות מעקב קרניים ב־CPU או ב־GPU. יש לבחור זאת תחת פלט.",
"render.surface_import.repeat_u": "חזרת U",
"render.surface_import.repeat_v": "חזרת V",
"render.surface_import.save": "שמירת תמונה על הגוף",
"render.surface_import.saved_cpu": "יש לשמור את המפות לשימוש בהדמיה ב־CPU.",
"render.surface_import.source": "מקור",
"render.surface_import.title": "ייבוא תמונה",
"render.tone_aces_fitted": "ACES מותאם",
"render.tone_reinhard": "ריינהרד",
"render.transmission_scope": "זכוכית GPU תומכת בתווכים נפרדים מאושרים. תווכים מקוננים ללא הגבלה ומעריך העברה ללא רעש אינם מסופקים.",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "לוח לדוגמה",
"sample.vents.about": "חריצים במערך מלבני: מספר השורות, מספר העמודות והפסיעה הם פרמטרים",
"sample.vents.name": "לוח אוורור",
"scale.per_axis": "לפי ציר",
"scale.uniform": "אחיד",
"search.command_keys": "Enter הרצה Shift+Enter הרצה והשארה פתוח Esc סגירה",
"search.commands": "פקודות",
"search.design": "בתכן זה",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "סקיצה תלת־ממדית",
"ui.activate": "הפעלה",
"ui.active_component": "רכיב פעיל",
"ui.addToQuickAccess": "הוספה לגישה מהירה",
"ui.add_configuration": "הוספת תצורה",
"ui.add_parameter": "הוספת פרמטר",
"ui.agent_chat": "צ'אט עם סוכן",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "לחיצה בוחרת גופים שלמים",
"ui.click_then_press_key": "יש ללחוץ ואז להקיש על המקש החדש",
"ui.close": "סגירה",
"ui.close_tab": "סגירת הלשונית",
"ui.coil": "סליל",
"ui.coincident": "מתלכד",
"ui.collapse": "כיווץ",
@@ -5040,11 +4976,6 @@
"ui.factor": "מקדם",
"ui.fade": "דעיכה",
"ui.fade_length": "אורך דעיכה",
"ui.fair_iterations": "מספר איטרציות",
"ui.fair_keep_edges": "שמירה על המקצועות",
"ui.fair_strength": "עוצמה",
"ui.fair_surface_title": "החלקת משטח",
"ui.fair_tolerance_default": "0.001 מגודל הגוף",
"ui.feature_history": "ציר הזמן",
"ui.feature_options": "אפשרויות פיצ'ר",
"ui.features": "פיצ'רים",
@@ -5230,7 +5161,6 @@
"ui.inspect": "בדיקה",
"ui.instances": "מופעים",
"ui.intersect": "חיתוך משותף",
"ui.intersection_curve_second_pick": "עקומת חיתוך: יש ללחוץ על הפאה או העקומה השנייה (לחיצה ימנית להתחלה מחדש)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "בידוד",
"ui.join": "איחוד",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "גרירה חופשית של הידית גם עם Alt/Option",
"ui.manipulator_free_alt_tip": "פעיל: Alt/Option או Ctrl/Cmd על חיצי השליפה / הידית מבטלים הצמדת ערכים. כבוי: Ctrl/Cmd בלבד.",
"ui.manufacture": "ייצור",
"ui.match_surface_title": "התאמת משטח",
"ui.material_review.axes": "צירים מקומיים של החומר; לא הוגדרה אוריינטציה לגוף.",
"ui.material_review.claims": "המקורות והרישיונות הם טענות שלא אומתו. ערכים חסרים נשארים לא ידועים.",
"ui.material_review.compressive_strength": "חוזק לחיצה",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "בדיקת נתוני חומר פיזיקליים",
"ui.material_review.unknown": "לא ידוע",
"ui.material_review.yield_strength": "חוזק כניעה",
"ui.mcp_agents": "סוכנים דרך MCP",
"ui.mcp_compact": "פלט מקוצר",
"ui.mcp_compact_note": "לסוכנים שמחוברים דרך שרת ה-MCP ‏(solidcraft-cli mcp): ‏inspect_design מסכם סקיצות ותוצאות הכלים אינן מעוצבות, כך שהן צורכות פחות טוקנים. חל על הפעלות סוכן שמתחילות אחרי השינוי; גם ‎--compact או SOLIDCRAFT_MCP_COMPACT=1 מפעילים אותו.",
"ui.measure": "מדידה",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "3MF עם תגי פאות",
@@ -5326,7 +5252,6 @@
"ui.options": "אפשרויות",
"ui.orbit": "סיבוב מבט",
"ui.orbit_around": "סיבוב מבט סביב",
"ui.organize": "ארגון",
"ui.orientation": "אוריינטציה",
"ui.origin": "ראשית",
"ui.palette_construction_mode": "מצב עזר (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "הוספת מסנן…",
"ui.point_cloud_auto_range": "טווח אוטומטי",
"ui.point_cloud_color_by": "צביעה לפי",
"ui.point_cloud_dots": "נקודות בודדות",
"ui.point_cloud_file_colors": "צבעי הקובץ",
"ui.point_cloud_filter_by": "סינון לפי",
"ui.point_cloud_height_high": "הגובה המרבי",
@@ -5416,7 +5340,6 @@
"ui.quality": "איכות",
"ui.quantity": "כמות",
"ui.quantity_2": "כמות 2",
"ui.quick_access_full": "סרגל הגישה המהירה מכיל {count} פקודות; יש להסיר אחת כדי להוסיף אחרת",
"ui.quit": "יציאה",
"ui.radial_context_menu": "תפריט הקשר מעגלי",
"ui.radius": "רדיוס",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "רכיב זה אינו מקושר לתכן מקור.",
"ui.relink_select_one": "יש לבחור תחילה רכיב מקושר אחד או אחד המופעים שלו.",
"ui.relink_source_all": "קישור מחדש למקור (כל המופעים)…",
"ui.removeFromQuickAccess": "הסרה מהגישה המהירה",
"ui.removeFromToolbar": "הסרה מסרגל הכלים",
"ui.removeSection": "הסרת מקטע",
"ui.render": "הדמיה",
+1 -1
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Čita putanje SVG crteža u skicu, skalirane, zakrenute i postavljene kako zadate. Upotrijebite ga za pretvaranje logotipa ili vektorskog obrisa u krivulje koje možete ekstrudirati.",
"help.sketch.inspect": "Otvara izvješće o otvorenoj skici: koliko je stupnjeva slobode preostalo i je li potpuno ograničena. Upotrijebite ga kako biste saznali što se još pomiče prije dovršetka skice.",
"help.sketch.intersect": "Dodaje krivulje ili točke u kojima tijela, lica, bridovi ili druge skice presijecaju ravninu skice. Ostaju povezane i prate model kad se promijeni.",
"help.sketch.intersection_curve": "Izrađuje 3D krivulje na mjestu gdje se dva tijela, lica ili krivulje drugih skica susreću, povezane s njima. Upotrijebite ih kao putanje ili vodilice koje prate model.",
"help.sketch.intersection_curve": "Izrađuje 3D krivulje na mjestu gdje se dva tijela ili lica susreću, povezane s njima. Upotrijebite ih kao putanje ili vodilice koje prate model.",
"help.sketch.isoparametric_curve": "Izrađuje 3D krivulju u smjeru U ili V lica kroz točku koju odaberete, povezanu s licem. Upotrijebite je kao putanju ili liniju razdvajanja koja prati plohu.",
"help.sketch.line": "Crta povezane linije točku po točku, kao otvoreni lanac ili zatvoreni obris. To je osnovni alat za većinu profila.",
"help.sketch.line.midpoint": "Crta liniju od njezine središnje točke do jednog kraja, a drugi kraj zrcali. Upotrijebite ga za linije centrirane na točku, primjerice simetričan brid.",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Beolvassa egy SVG-rajz útvonalait egy vázlatba, az Ön által megadott léptékkel, elforgatással és helyen. Használja egy logó vagy vektoros körvonal kihúzható görbékké alakítására.",
"help.sketch.inspect": "Jelentést nyit a megnyitott vázlatról: hány szabadságfok maradt, és teljesen kényszerezett-e. Használja annak kiderítésére, mi mozdul még, mielőtt befejezi a vázlatot.",
"help.sketch.intersect": "Hozzáadja azokat a görbéket vagy pontokat, ahol testek, lapok, élek vagy más vázlatok metszik a vázlatsíkot. Kapcsoltak maradnak, és követik a modellt, ha az megváltozik.",
"help.sketch.intersection_curve": "3D görbéket hoz létre ott, ahol két test, lap vagy más vázlatok görbéi találkozik, hozzájuk kapcsolva. Használja őket útvonalként vagy vezérgörbeként, amely követi a modellt.",
"help.sketch.intersection_curve": "3D görbéket hoz létre ott, ahol két test vagy lap találkozik, hozzájuk kapcsolva. Használja őket útvonalként vagy vezérgörbeként, amely követi a modellt.",
"help.sketch.isoparametric_curve": "3D görbét hoz létre egy lap U vagy V iránya mentén egy kiválasztott ponton át, a laphoz kapcsolva. Használja útvonalként vagy osztóvonalként, amely követi a felületet.",
"help.sketch.line": "Összefüggő vonalakat rajzol pontról pontra, nyitott láncként vagy zárt körvonalként. Ez a legtöbb profil alapeszköze.",
"help.sketch.line.midpoint": "Vonalat rajzol a felezőpontjától az egyik végéig, a másik véget tükrözve. Használja egy pontra középen álló vonalakhoz, például szimmetrikus élhez.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Mintalemez",
"sample.vents.about": "Hornyok téglalap mintában: a sorok, oszlopok és osztás paraméterek",
"sample.vents.name": "Szellőzőlemez",
"scale.per_axis": "Tengelyenként",
"scale.uniform": "Egyenletes",
"search.command_keys": "Enter futtatás Shift+Enter futtatás és nyitva tartás Esc bezárás",
"search.commands": "Parancsok",
"search.design": "Ebben a tervben",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Membaca path gambar SVG ke dalam sketsa, diskalakan, diputar, dan ditempatkan sesuai pengaturan Anda. Gunakan untuk mengubah logo atau kontur vektor menjadi kurva yang dapat diekstrusi.",
"help.sketch.inspect": "Membuka laporan tentang sketsa yang terbuka: berapa derajat kebebasan yang tersisa dan apakah sketsa terbatasi penuh. Gunakan untuk mengetahui apa yang masih bergerak sebelum Anda menyelesaikan sketsa.",
"help.sketch.intersect": "Menambahkan kurva atau titik tempat bodi, muka, tepi, atau sketsa lain memotong bidang sketsa. Semuanya tetap tertaut dan mengikuti model saat model berubah.",
"help.sketch.intersection_curve": "Membuat kurva 3D di tempat dua bodi, muka, atau kurva sketsa lain bertemu, tertaut padanya. Gunakan sebagai jalur atau rel pemandu yang mengikuti model.",
"help.sketch.intersection_curve": "Membuat kurva 3D di tempat dua bodi atau muka bertemu, tertaut padanya. Gunakan sebagai jalur atau rel pemandu yang mengikuti model.",
"help.sketch.isoparametric_curve": "Membuat kurva 3D sepanjang arah U atau V sebuah muka melalui titik yang Anda pilih, tertaut ke muka itu. Gunakan sebagai jalur atau garis pisah yang mengikuti permukaan.",
"help.sketch.line": "Menggambar garis-garis tersambung titik demi titik, sebagai rantai terbuka atau kontur tertutup. Ini alat dasar untuk sebagian besar profil.",
"help.sketch.line.midpoint": "Menggambar garis dari titik tengahnya ke satu ujung, dengan ujung lainnya dicerminkan. Gunakan untuk garis yang dipusatkan pada sebuah titik, seperti tepi simetris.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Pelat Contoh",
"sample.vents.about": "Slot dalam pola persegi panjang: baris, kolom, dan pitch adalah parameter",
"sample.vents.name": "Pelat Ventilasi",
"scale.per_axis": "Per sumbu",
"scale.uniform": "Seragam",
"search.command_keys": "Enter jalankan Shift+Enter jalankan dan tetap buka Esc tutup",
"search.commands": "Perintah",
"search.design": "Di desain ini",
+1 -6
View File
@@ -1364,14 +1364,11 @@
"dialog.computing": "Calcolo in corso… {seconds} s",
"dialog.could_not_be_checked": "impossibile verificare",
"dialog.custom_axis": "↖ Asse personalizzato",
"dialog.cylinder_face_tip": "La faccia o il vertice del modello su cui poggia il cilindro: fai clic qui, poi su di esso nella vista. Se resta vuoto, lo posizionano X, Y e Z.",
"dialog.dimension_insert_hint": "Fai doppio clic su un’altra quota di controllo per inserirne il nome",
"dialog.dimension_name": "Quota: {name}",
"dialog.edit_title": "MODIFICA {title}",
"dialog.no_shown_body": "Nessun corpo visibile da modificare: mostrane uno o scegli Nuovo corpo",
"dialog.pattern_sketch_not_object": "Seleziona corpi o lavorazioni: uno schizzo non è nessuno dei due. Ripeti le sue curve con Ripetizione o Specchia dello schizzo stesso, oppure estrudilo prima.",
"dialog.primitive_point_tip": "Un punto che compila X, Y e Z: fai clic qui, poi su un vertice, uno spigolo o una faccia del modello, su un punto di uno schizzo oppure sull'origine.",
"dialog.reference_edge_tip": "Uno spigolo rettilineo della faccia scelta da cui si misura la distanza sotto: fai clic qui, poi sullo spigolo.",
"dialog.select": "↖ Seleziona",
"dialog.selected_count": "↖ Selezionati: {count}",
"dialog.selection_constraint": "Vincolo {id}",
@@ -1625,7 +1622,7 @@
"help.sketch.insert_svg": "Legge i tracciati di un disegno SVG in uno schizzo, scalati, ruotati e posizionati come imposti. Usalo per trasformare un logo o un contorno vettoriale in curve che puoi estrudere.",
"help.sketch.inspect": "Apre un rapporto sullo schizzo aperto: quanti gradi di libertà restano e se è completamente vincolato. Usalo per scoprire cosa si muove ancora prima di terminare lo schizzo.",
"help.sketch.intersect": "Aggiunge le curve o i punti in cui corpi, facce, spigoli o altri schizzi attraversano il piano dello schizzo. Restano collegati e seguono il modello quando cambia.",
"help.sketch.intersection_curve": "Crea curve 3D dove si incontrano due corpi, facce o curve di altri schizzi, collegate a essi. Usale come percorsi o guide che seguono il modello.",
"help.sketch.intersection_curve": "Crea curve 3D dove si incontrano due corpi o facce, collegate a essi. Usale come percorsi o guide che seguono il modello.",
"help.sketch.isoparametric_curve": "Crea una curva 3D lungo la direzione U o V di una faccia passante per un punto che scegli, collegata alla faccia. Usala come percorso o linea di divisione che segue la superficie.",
"help.sketch.line": "Disegna linee collegate punto per punto, come catena aperta o contorno chiuso. È lo strumento di base per la maggior parte dei profili.",
"help.sketch.line.midpoint": "Disegna una linea dal suo punto medio fino a un'estremità, con l'altra estremità speculare. Usalo per linee centrate su un punto, come un bordo simmetrico.",
@@ -3813,8 +3810,6 @@
"sample.plate.name": "Piastra di esempio",
"sample.vents.about": "Asole in ripetizione rettangolare: righe, colonne e passo sono parametri",
"sample.vents.name": "Piastra di ventilazione",
"scale.per_axis": "Per asse",
"scale.uniform": "Uniforme",
"search.command_keys": "Invio esegui Maiusc+Invio esegui e tieni aperto Esc chiudi",
"search.commands": "Comandi",
"search.design": "In questo progetto",
+1 -79
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "選択したフォルダーを抑制",
"Suppressed": "抑制",
"Surface": "サーフェス",
"Surface or face": "サーフェスまたは面",
"Surface or faces": "サーフェスまたは面",
"Surface, or faces to turn over": "サーフェス、または裏返す面",
"Surfaces": "サーフェス",
"Swap Ends": "端点を入れ替え",
@@ -644,7 +642,6 @@
"Target": "ターゲット",
"Target Body": "ターゲットボディ",
"Target Face (optional)": "対象面 (オプション)",
"Target edges": "ターゲットのエッジ",
"Tear": "引き裂き",
"Technical details": "技術情報",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "破線のスケッチは保存された平面ガイドです。新しい面を選択してアタッチメントを修復してください。",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "方向は、軸、またはスケッチ平面上にある直線のスケッチ曲線にしてください",
"The mirror line cannot also be mirrored": "ミラー線自体をミラーすることはできません",
"The mirror line must be a straight curve of this sketch, not an origin axis": "ミラー線は、原点の軸ではなく、このスケッチの直線にしてください",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "原点軸はスケッチ平面に垂直なため、平面内に線がありません",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "保存された作成元のオカレンスが見つかりません。再バインドする前に有効な作成元配置を選択してください。",
"Then": "次を実行 (Then)",
"These features will be deleted:": "以下のフィーチャーが削除されます:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "選択したエッジのボディが存在しなくなりました",
"add a key for a joint first": "先にジョイントのキーを追加してください",
"ai.connected_toast": "SolidCraft が {clients} で使えるようになりました。使うには再起動してください(設定 > アシスタント)。",
"ai.http.allow": "安全でない HTTP を許可",
"ai.http.confirm": "このエンドポイントで許可",
"ai.http.warning": "API キーと会話は暗号化されずに送信されます。ネットワークにアクセスできる人は、内容を読み取ったり改ざんしたりする可能性があります。信頼できるネットワークでのみ使用してください。",
"ai.prefs.allow_control": "AIエージェントの接続を許可",
"ai.prefs.allow_control_note": "ローカルチャネル(MCP)です。このコンピューターから外には何も送信しません。\n\nこのコンピューター内だけのコントロールチャンネル(127.0.0.1、ポート 27878 または次に空いているポート)を開きます。接続するプログラムは、起動のたびに作られ、あなたのユーザーアカウントだけが読める秘密のトークンも提示する必要があります。次に SolidCraft を起動したときから有効です。オフ:--control を付けて起動しない限り、何も待ち受けません。",
"ai.prefs.availability": "利用設定",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "カメラを追従",
"ai.prefs.follow_camera_off": "カメラの自動追従はオフです。",
"ai.prefs.follow_camera_on": "エージェントが作成するスケッチにカメラを向けます。",
"ai.prefs.instructions": "カスタム指示",
"ai.prefs.instructions_note": "各チャットの開始時に、SolidCraft 自身の指示の後に続けてエージェントへ送られます。作業の進め方や守ってほしいルールを書いてください。変更は次のチャット(接続または新しいチャット)から適用されます。",
"ai.prefs.intro": "SolidCraftのAIエージェント。",
"ai.prefs.make_default": "既定にする",
"ai.prefs.no_agents": "エージェントはまだありません。追加するか、更新してインストール済みのエージェントを検索してください。",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "レンダー比較の境界を移動",
"cmd.render.result.discard": "レンダリング結果を破棄",
"cmd.render.result.select": "レンダリング結果を選択",
"cmd.render.surface.import": "サーフェスマップをインポート",
"cmd.render.texture.list": "埋め込みサーフェス画像の一覧",
"cmd.render.texture.remove": "埋め込みサーフェス画像を削除",
"cmd.render_aging_describe": "レイヤー式表面エイジング",
"cmd.render_backends": "レンダリング バックエンド",
"cmd.render_batch": "すべてのショットをレンダリング",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "前のタブ",
"cmd.view_rename": "名前付きビューの名前を変更",
"cmd.view_render_frame": "レンダーフレームガイド",
"cmd.view_ribbon_tabs_only": "リボンのタブのみ",
"cmd.view_right": "右側面ビュー",
"cmd.view_save": "新規名前付きビュー",
"cmd.view_shots_strip": "ショットストリップ",
@@ -1408,7 +1395,6 @@
"dialog.computing": "計算中… {seconds} 秒",
"dialog.could_not_be_checked": "チェックできません",
"dialog.custom_axis": "↖ カスタム軸",
"dialog.cylinder_face_tip": "円柱が立つモデルの面または頂点: ここをクリックしてから、ビューでそれをクリック。空のままなら X、Y、Z で配置します。",
"dialog.dimension_insert_hint": "別の駆動寸法をクリックして名前を挿入",
"dialog.dimension_name": "寸法: {name}",
"dialog.dimension_step_down": "{step} 減らす",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "{title}を編集",
"dialog.no_shown_body": "変更できる表示中のボディがありません。ボディを表示するか、新規ボディを選択してください",
"dialog.pattern_sketch_not_object": "ボディかフィーチャーを選んでください。スケッチはどちらでもありません。曲線はスケッチ内のパターンかミラーで繰り返すか、先に押し出してください。",
"dialog.primitive_point_tip": "X、Y、Z を埋める点: ここをクリックしてから、モデルの頂点、エッジ、面、スケッチの点、または原点をクリック。",
"dialog.reference_edge_tip": "下の距離を測る基準となる、選んだ面の直線エッジ: ここをクリックしてからエッジをクリック。",
"dialog.select": "↖ 選択",
"dialog.selected_count": "↖ {count} 個選択中",
"dialog.selection_constraint": "拘束 {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "開いたファイル選択はデスクトップのものではありません。XWayland ではポータルが親ウィンドウを拒否します。",
"file_load.built": "構築済み: 全{total}フィーチャー中{built}件。",
"file_load.converting": "ソリッドを変換中: {done}/{total}",
"file_load.inserted": "{name} を挿入しました",
"file_load.inserting": "ジオメトリを挿入中",
"file_load.link_item": "{name} ({done}/{total})",
"file_load.opened": "{name} を開きました",
"file_load.opened_in_tab": "{name} を新しいタブで開きました",
"file_load.opening": "デザインを開いています",
"file_load.preparing_thumbnail": "サムネイルを準備中...",
"file_load.preparing_view": "ビューを準備中...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "SVG 図面のパスをスケッチに読み込み、指定した位置に拡大縮小・回転して配置します。ロゴやベクター輪郭を、押し出しできる曲線にするときに使います。",
"help.sketch.inspect": "開いているスケッチのレポートを開きます。残りの自由度と、完全に拘束されているかどうかを表示します。スケッチを終える前に、まだ動く部分を確認するときに使います。",
"help.sketch.intersect": "ボディ、面、エッジ、ほかのスケッチがスケッチ平面と交差する曲線または点を追加します。リンクが保たれ、モデルが変わると追従します。",
"help.sketch.intersection_curve": "2つのボディ、面、またはほかのスケッチの曲線が接する位置に、それらにリンクした 3D 曲線を作成します。モデルに追従するパスやガイドレールとして使います。",
"help.sketch.intersection_curve": "2つのボディまたは面が接する位置に、それらにリンクした 3D 曲線を作成します。モデルに追従するパスやガイドレールとして使います。",
"help.sketch.isoparametric_curve": "選んだ点を通る面の U または V 方向に沿った 3D 曲線を、面にリンクして作成します。表面に追従するパスや分割線として使います。",
"help.sketch.line": "点を順に指定して、つながった直線を開いた連なりまたは閉じた外形として描きます。ほとんどの輪郭に使う基本のツールです。",
"help.sketch.line.midpoint": "中点から一方の端まで直線を描き、もう一方の端は反対側に対称に作られます。対称なエッジなど、点を中心にした直線に使います。",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "左に90度回転するなど、ステップごとにビューを回転、移動、ズームします。ドラッグではなく、カメラを正確に動かすときに使います。",
"help.view.navigation_bar": "ビューポート下部のナビゲーションバーを表示または非表示にします。広く使いたいときは非表示に、マウスでビューツールを使うときは表示にします。",
"help.view.rename": "保存した名前付きビューの名前を変更します。ビュー自体は変わりません。",
"help.view.ribbon_tabs_only": "リボンをタブの行だけに折りたたみ、パネルが使っていた場所をビューに充てます。タブをクリックするとそのパネルがビューの上に表示されます。もう一度選ぶとリボン全体を表示したままにします。",
"help.view.save": "現在のカメラ位置を名前付きビューとしてデザインに保存します。スクリーンショット用など、後で同じ角度に戻るときに使います。",
"help.view.spin": "次のクリックまたはキー操作まで、モデルのまわりでビューを連続して周回させます。モデルをあらゆる方向から見せるときに使います。",
"help.view.tool": "オービット、パン、ズームのカメラツールを固定し、オフにするまで左ボタンのドラッグでビューを動かせるようにします。トラックパッドや、中ボタンのないマウスで使います。",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "材料が接触する対象に応じて結合、新規ボディ、切り取りを選びます。",
"prefs.axes": "軸",
"prefs.axis": "軸",
"prefs.background_choose": "画像を選択…",
"prefs.background_image": "画像",
"prefs.background_unreadable": "背景画像を読み込めませんでした",
"prefs.blur_cost": "相対的な描画負荷です。バーが多いほど、通常は処理量が増えます。",
"prefs.blur_device": "このグラフィックスデバイスまたは描画経路では利用できません",
"prefs.blur_guard": "画面の応答性を保つため、ぼかしの品質を下げました。半径は変更されていません。",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "折りたたみ矢印の隣の目のアイコン",
"prefs.browser_eye_left_note": "ブラウザーの各行の表示切り替えを、行の右端の列ではなく、以前のように折りたたみ矢印の隣に表示します。",
"prefs.browser_reveal_on_hover": "ホバーで表示",
"prefs.browser_rows_start_closed": "ブラウザーの行を閉じた状態で始める",
"prefs.browser_rows_start_closed_note": "ブラウザーの配置とフォルダーを閉じた状態で表示するため、多数のコンポーネントを含むデザインでは最上位の行だけが表示されます。各行は矢印、「すべて展開」または「ブラウザで検索」で開きます。「ブラウザで検索」はボディまでの行だけを開き、前回の検索で開いた行を再び閉じます。3Dビューでボディを選んでもブラウザーはそのままです。オフのときはフォルダーが開いた状態で始まり、配置は「コンポーネントを最初から展開」の設定に従い、3Dビューで選ぶとブラウザーがそのボディまで開きます(以前と同じ)。",
"prefs.browser_show_note": "「表示」はブラウザーを常に画面に表示します。「ホバーで表示」はポインターがその位置か左端の細いタブに来るまで隠し、ポインターが中にある間やそのメニューが開いている間は表示したままにします。",
"prefs.browser_shown": "表示",
"prefs.built_in": "組み込み",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "前へ",
"prefs.choose_font": "フォントファイルを選択…",
"prefs.click": "クリック",
"prefs.command_dialog_values": "コマンドダイアログ",
"prefs.contact_shading": "柔らかな接触陰影",
"prefs.contact_shading_note": "部品が近接する部分に柔らかな陰影を付けます。",
"prefs.context_menu": "コンテキストメニュー",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "サーフェスとエッジ",
"prefs.graphics_page.view_bar": "ビューバーにも表示",
"prefs.graphics_presets_note": "プリセットは以下の設定をまとめて変更します。",
"prefs.ground_shadow_follows_model": "地面の影をモデルに追従させる",
"prefs.ground_shadow_follows_model_help": "表示中のボディの最下部に影を配置します。オフの場合、持ち上げたモデルの影は原点を通る地面上に残ります。",
"prefs.hide_constraint_glyphs_zoomed_out": "ズームアウト時に拘束グリフを隠す",
"prefs.hide_constraint_glyphs_zoomed_out_note": "スケッチを十分にズームアウトすると、拘束グリフは表示されず画面を散らかしません。オフ: ズームに関係なく固定の画面サイズのままです。",
"prefs.history": "履歴",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "キューブの隅にある2つのカーブした矢印は、画面内でビューをロールします。オン: 時計回りの矢印が反時計回りに、反時計回りの矢印が時計回りにロールします。オフ: 各矢印は、そのカーブの向きにビューをロールします。",
"prefs.invert_navigator_arrows": "ビューキューブの回転矢印を反転",
"prefs.invert_navigator_arrows_note": "キューブの周りの矢印が、矢印の指す方向にカメラを回します(Fusion や Inventor と同じ動き):左の矢印は右を指し、カメラを右に振ります。オフ: 矢印は、そのある面の方へキューブを回すため、左の矢印はカメラを左に振ります。カーブしたロール矢印は影響を受けません。",
"prefs.keep_unsaved_also_asks": "タブを閉じるときにも確認する",
"prefs.keep_unsaved_also_asks_tip": "オフにすると、未保存の各デザインのコピーが最新であれば、ブラウザーの確認なしでタブが閉じます。",
"prefs.keep_unsaved_in_browser": "未保存の作業をこのブラウザーに保持する",
"prefs.keep_unsaved_in_browser_tip": "開いている各デザインの未保存の変更を、このブラウザーのプライベートストレージに常に最新の状態で保持します。次回のアクセス時に復元を提案します。",
"prefs.keep_work_on_tab_switch": "デザインを切り替えてもダイアログとツールを開いたままにする",
"prefs.keep_work_on_tab_switch_note": "各デザインのタブが、開いているダイアログまたはツール(選択や入力した内容を含む)とツールバーのタブを保持します。デザインに戻ると元のまま表示されます。オフ: デザインを切り替えるとそれらはキャンセルされ、モデル タブが表示されます。",
"prefs.labels": "ラベル",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "カード",
"prefs.layout_page.column": "列",
"prefs.layout_page.hover": "ホバー時",
"prefs.layout_page.hover_panel_menus": "ポイントしてパネルメニューを切り替える",
"prefs.layout_page.hover_panel_menus_help": "リボンのパネル名をクリックしてメニューを開きます。別のパネル名にポインターを合わせると切り替わります。リボンと開いているメニューの外に移動すると閉じます。",
"prefs.layout_page.icons_labels": "アイコン+ラベル",
"prefs.layout_page.ok_cancel": "OK とキャンセル",
"prefs.layout_page.on_hover": "ホバー時",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "より滑らか",
"prefs.quick_measure": "ビューの隅にクイック測定",
"prefs.quick_measure_note": "選択したものの寸法をビューの右下、履歴の上に表示します: エッジの長さ(円形のものは Ø と R)、面の面積、点の位置、2 つの項目の距離と角度、複数のエッジや面の合計。クリックでコピーします。",
"prefs.remember_dialog_values": "コマンドダイアログの値を記憶",
"prefs.remember_dialog_values.help": "既定ではオフです。オンにすると、コマンドが成功した後、SolidCraft を閉じるまで、同じコマンドを次に開いたときに安全な値とオプションを再利用します。",
"prefs.render_previous_geometry_budget": "レンダープレビューで以前のジオメトリ予算を使用",
"prefs.render_previous_geometry_budget_help": "デバイスに基づく予算の代わりに、以前の固定ジオメトリ上限(64ビットデスクトップでは512 MiB、その他では128 MiB)に戻します。",
"prefs.reports_saved": "{n} 件保存済み",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "使用中のスケッチツールの点灯したリボンボタンをクリックするとツールが終了し、ビューのクリックで再び選択できます。オフ: クリックするとツールが最初から開始されます。",
"prefs.ribbon_reveal": "検索結果をリボンに表示",
"prefs.ribbon_reveal_note": "コマンド検索で結果にポインターを合わせると、そのコマンドがリボンのどこにあるか(タブ、ボタン、またはパネルのドロップダウン内の行)を表示します。検索から開始したコマンドはそこで点滅し、ドロップダウンから実行中のコマンドはそのパネルに印が付きます。",
"prefs.ribbon_tabs_only": "リボンのタブだけを表示",
"prefs.ribbon_tabs_only_note": "リボンをタブの行だけに折りたたみます。タブをクリックすると、コマンドが始まるかポインターが離れるまで、そのパネルがビューの上に表示されます。表示タブの「リボンのタブのみ」またはそのショートカットで切り替えます。",
"prefs.right_click": "右クリック",
"prefs.saving": "起動と保存",
"prefs.scale_note": "ウィンドウ内では Ctrl + / Ctrl − でも変更できます。100% のボタンは 28 px です。",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "たった今",
"recovery.min_ago": "{count}分前",
"recovery.never_saved": "未保存",
"recovery.open_saved": "保存済みのバージョンを開く",
"recovery.restore": "復元",
"recovery.restore_intro": "このページを前回閉じたときに保存されていなかった変更は、このブラウザーに保持されています。",
"recovery.restore_row": "{name}、{when}に変更",
"recovery.restore_title": "未保存のデザインを復元しますか?",
"recovery.restore_title_one": "未保存のデザイン {name}({when}に変更)を復元しますか?",
"refused.change": "{body} を変更できませんでした。",
"refused.cut": "{body} をカットできませんでした。",
"refused.face_curved": "曲面の 1 つがモデリングに使えません。",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · ワイドスクリーン",
"render.gpu_depth": "最大パス深度",
"render.gpu_options_help": "サンプル数、深度、シード、露出をこの設定に保存します。保存するのは選択中の画像方式だけです。",
"render.gpu_path_crashed": "前回このグラフィックアダプターでの準備中に SolidCraft が終了しました。グラフィックドライバー内で終了した可能性が高いため、自動では再度準備しません。代わりに CPU レイトレーシングを使うか、もう一度試してください(ドライバーを更新した場合も再試行されます)。",
"render.gpu_path_failed": "GPUパストレーサーを利用できません",
"render.gpu_path_first_setup": "このGPUでの初回セットアップには数分かかることがあります。その間もSolidCraftは使用できます。以降の起動では、ドライバーが保持していればコンパイル済みのシェーダーを再利用します。",
"render.gpu_path_preparing": "GPUパストレーサー:シェーダーをコンパイル中…",
"render.gpu_path_retry": "もう一度試す",
"render.gpu_seed": "乱数シード",
"render.gpu_unavailable": "このデバイスでは GPU パストレーシングの準備ができていません。",
"render.ground_apply": "床をフィットして保存",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "範囲",
"render.stage_panels.fit_save": "フィットして保存",
"render.stage_panels.gpu_required": "GPUパストレーシングが必要です",
"render.stage_panels.grain_angle": "木目の角度",
"render.stage_panels.keep": "保持",
"render.stage_panels.kept": "保持",
"render.stage_panels.kept_fields": "カメラ、サンプリング、画像寸法、光学設定、CAD形状、工学的特性。",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "内部散乱ランダムウォーク",
"render.subsurface_help": "閉じた誘電体専用。散乱とRGB吸収は別々の毎mm係数です。実際の形状内で散乱し、境界で屈折・反射します。直線透過影、表面ノイズ除去、外部ボリュームを無効にし、フレネル層数を1にします。拡散シェーダー、密度グリッド、実測物性ではありません。高密度ではサンプル数と深度が必要です。",
"render.subsurface_rate": "散乱衝突率",
"render.surface_import.author": "作者",
"render.surface_import.busy": "画像をインポート中…",
"render.surface_import.complete": "画像を選び、作者、出典、ライセンスを入力してください。",
"render.surface_import.embedded": "インポートした画像",
"render.surface_import.failed": "画像のインポートが完了しませんでした。",
"render.surface_import.license": "ライセンス / 所有権",
"render.surface_import.raytrace_required": "画像にはCPUまたはGPUのレイトレーシングが必要です。出力で選択してください。",
"render.surface_import.repeat_u": "U方向の繰り返し",
"render.surface_import.repeat_v": "V方向の繰り返し",
"render.surface_import.save": "ボディに画像を保存",
"render.surface_import.saved_cpu": "CPUレンダリングで使うにはマップを保存してください。",
"render.surface_import.source": "出典",
"render.surface_import.title": "画像をインポート",
"render.tone_aces_fitted": "ACES近似",
"render.tone_reinhard": "Reinhard",
"render.transmission_scope": "GPUガラスは検証された非交差媒体に対応します。無制限の入れ子媒体やノイズのない透過推定器は提供しません。",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "サンプル プレート",
"sample.vents.about": "矩形パターンに並んだスロット: 行数、列数、ピッチはパラメータ",
"sample.vents.name": "通気プレート",
"scale.per_axis": "軸ごと",
"scale.uniform": "均等",
"search.command_keys": "Enter 実行 Shift+Enter 実行して開いたままにする Esc 閉じる",
"search.commands": "コマンド",
"search.design": "このデザイン内",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "3D スケッチ",
"ui.activate": "アクティブ化",
"ui.active_component": "アクティブなコンポーネント",
"ui.addToQuickAccess": "クイックアクセスに追加",
"ui.add_configuration": "構成を追加",
"ui.add_parameter": "パラメーターを追加",
"ui.agent_chat": "エージェントチャット",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "クリックでボディ全体を選択",
"ui.click_then_press_key": "クリックした後、割り当てるキーを押してください",
"ui.close": "閉じる",
"ui.close_tab": "タブを閉じる",
"ui.coil": "コイル",
"ui.coincident": "一致",
"ui.collapse": "折りたたむ",
@@ -5040,11 +4976,6 @@
"ui.factor": "倍率",
"ui.fade": "切り上げ",
"ui.fade_length": "切り上げ長さ",
"ui.fair_iterations": "反復回数",
"ui.fair_keep_edges": "エッジを保持",
"ui.fair_strength": "強度",
"ui.fair_surface_title": "サーフェスフェアリング",
"ui.fair_tolerance_default": "ボディサイズの 0.001 倍",
"ui.feature_history": "フィーチャー履歴",
"ui.feature_options": "フィーチャーオプション",
"ui.features": "フィーチャー",
@@ -5230,7 +5161,6 @@
"ui.inspect": "検査",
"ui.instances": "インスタンス",
"ui.intersect": "交差",
"ui.intersection_curve_second_pick": "交差曲線: 2 つ目の面または曲線をクリックします (右クリックでやり直し)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "分離表示",
"ui.join": "結合",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "マニピュレータのフリードラッグを Alt/Option でも有効",
"ui.manipulator_free_alt_tip": "オン: 押し出し/ギズモ矢印で Alt/Option または Ctrl/Cmd が値スナップを無効にします。オフ: Ctrl/Cmd のみ。",
"ui.manufacture": "製造",
"ui.match_surface_title": "サーフェス一致",
"ui.material_review.axes": "材料ローカル軸。ボディの方向は割り当てません。",
"ui.material_review.claims": "出典とライセンスの申告は未確認です。欠落値は不明のままです。",
"ui.material_review.compressive_strength": "圧縮強度",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "物理材料データを確認",
"ui.material_review.unknown": "不明",
"ui.material_review.yield_strength": "降伏強度",
"ui.mcp_agents": "MCP 経由のエージェント",
"ui.mcp_compact": "コンパクトな出力",
"ui.mcp_compact_note": "MCP サーバー (solidcraft-cli mcp) 経由で接続したエージェント向け: inspect_design はスケッチを要約し、ツールの結果は整形されないため、トークンが少なくて済みます。変更後に開始したエージェントのセッションから適用されます。--compact または SOLIDCRAFT_MCP_COMPACT=1 でも有効になります。",
"ui.measure": "計測",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "面タグ付き 3MF",
@@ -5326,7 +5252,6 @@
"ui.options": "オプション",
"ui.orbit": "回転",
"ui.orbit_around": "回転中心",
"ui.organize": "整理",
"ui.orientation": "向き",
"ui.origin": "原点",
"ui.palette_construction_mode": "補助線モード (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "フィルターを追加…",
"ui.point_cloud_auto_range": "範囲を自動設定",
"ui.point_cloud_color_by": "色の付け方",
"ui.point_cloud_dots": "単独の点",
"ui.point_cloud_file_colors": "ファイルの色",
"ui.point_cloud_filter_by": "フィルター",
"ui.point_cloud_height_high": "最高の高さ",
@@ -5416,7 +5340,6 @@
"ui.quality": "品質",
"ui.quantity": "数量",
"ui.quantity_2": "数量 2",
"ui.quick_access_full": "クイックアクセスバーに置けるコマンドは {count} 個までです。追加するには 1 つ削除してください",
"ui.quit": "終了",
"ui.radial_context_menu": "パイ メニュー",
"ui.radius": "半径",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "このコンポーネントは参照元の設計にリンクされていません。",
"ui.relink_select_one": "リンクされたコンポーネントまたはそのインスタンスを1つ選択してください。",
"ui.relink_source_all": "参照元を再リンク(すべてのインスタンス)…",
"ui.removeFromQuickAccess": "クイックアクセスから削除",
"ui.removeFromToolbar": "ツールバーから削除",
"ui.removeSection": "セクションを解除",
"ui.render": "レンダリング",
+46 -813
View File
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Membaca laluan lukisan SVG ke dalam lakaran, diskalakan, diputar dan diletakkan mengikut tetapan anda. Gunakan untuk menukar logo atau garis luar vektor kepada lengkung yang boleh disemperit.",
"help.sketch.inspect": "Membuka laporan tentang lakaran yang terbuka: berapa banyak darjah kebebasan yang tinggal dan sama ada ia terkekang sepenuhnya. Gunakan untuk mengetahui apa yang masih bergerak sebelum anda menamatkan lakaran.",
"help.sketch.intersect": "Menambah lengkung atau titik tempat jasad, muka, tepi atau lakaran lain melintasi satah lakaran. Ia kekal terpaut dan mengikut model apabila model berubah.",
"help.sketch.intersection_curve": "Mencipta lengkung 3D tempat dua jasad, muka atau lengkung lakaran lain bertemu, terpaut kepadanya. Gunakan sebagai laluan atau rel pemandu yang mengikut model.",
"help.sketch.intersection_curve": "Mencipta lengkung 3D tempat dua jasad atau muka bertemu, terpaut kepadanya. Gunakan sebagai laluan atau rel pemandu yang mengikut model.",
"help.sketch.isoparametric_curve": "Mencipta lengkung 3D di sepanjang arah U atau V muka melalui titik yang anda pilih, terpaut kepada muka itu. Gunakan sebagai laluan atau garis belahan yang mengikut permukaan.",
"help.sketch.line": "Melukis garis bersambung titik demi titik, sebagai rantaian terbuka atau garis luar tertutup. Ia ialah alat asas bagi kebanyakan profil.",
"help.sketch.line.midpoint": "Melukis garis daripada titik tengahnya ke satu hujung, dengan hujung satu lagi dicerminkan. Gunakan untuk garis yang berpusat pada satu titik, seperti tepi simetri.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Plat Contoh",
"sample.vents.about": "Corak slot segi empat tepat: baris, lajur dan pic sebagai parameter",
"sample.vents.name": "Plat Pengudaraan",
"scale.per_axis": "Mengikut paksi",
"scale.uniform": "Seragam",
"search.command_keys": "Enter jalankan Shift+Enter jalankan dan kekalkan terbuka Esc tutup",
"search.commands": "Arahan",
"search.design": "Dalam reka bentuk ini",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Leser banene fra en SVG-tegning inn i en skisse, skalert, dreid og plassert slik du angir. Bruk det til å gjøre en logo eller vektorkontur om til kurver du kan ekstrudere.",
"help.sketch.inspect": "Åpner en rapport om den åpne skissen: hvor mange frihetsgrader som gjenstår og om den er fullstendig bundet. Bruk det til å finne ut hva som fortsatt beveger seg før du fullfører skissen.",
"help.sketch.intersect": "Legger til kurvene eller punktene der kropper, flater, kanter eller andre skisser krysser skisseplanet. De forblir koblet og følger modellen når den endres.",
"help.sketch.intersection_curve": "Oppretter 3D-kurver der to kropper, flater eller kurver fra andre skisser møtes, koblet til dem. Bruk dem som baner eller føringskurver som følger modellen.",
"help.sketch.intersection_curve": "Oppretter 3D-kurver der to kropper eller flater møtes, koblet til dem. Bruk dem som baner eller føringskurver som følger modellen.",
"help.sketch.isoparametric_curve": "Oppretter en 3D-kurve langs U- eller V-retningen til en flate gjennom et punkt du velger, koblet til flaten. Bruk den som en bane eller delelinje som følger flaten.",
"help.sketch.line": "Tegner sammenhengende linjer punkt for punkt, som en åpen kjede eller en lukket kontur. Det er det grunnleggende verktøyet for de fleste profiler.",
"help.sketch.line.midpoint": "Tegner en linje fra midtpunktet og ut til den ene enden, med den andre enden speilet. Bruk det til linjer sentrert på et punkt, for eksempel en symmetrisk kant.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Eksempelplate",
"sample.vents.about": "Spor i et rektangulært mønster: rader, kolonner og stigning er parametere",
"sample.vents.name": "Ventilasjonsplate",
"scale.per_axis": "Per akse",
"scale.uniform": "Jevn",
"search.command_keys": "Enter kjør Shift+Enter kjør og behold åpen Esc lukk",
"search.commands": "Kommandoer",
"search.design": "I dette designet",
+1 -3
View File
@@ -1625,7 +1625,7 @@
"help.sketch.insert_svg": "Leest de paden van een SVG-tekening in een schets, geschaald, gedraaid en geplaatst waar je instelt. Gebruik dit om een logo of vectorcontour om te zetten in curven die je kunt extruderen.",
"help.sketch.inspect": "Opent een rapport over de geopende schets: hoeveel vrijheidsgraden er nog over zijn en of hij volledig beperkt is. Gebruik dit om te zien wat nog beweegt voordat je de schets voltooit.",
"help.sketch.intersect": "Voegt de curven of punten toe waar lichamen, vlakken, randen of andere schetsen het schetsvlak kruisen. Ze blijven gekoppeld en volgen het model wanneer dat verandert.",
"help.sketch.intersection_curve": "Maakt 3D-curven waar twee lichamen, vlakken of curven van andere schetsen samenkomen, eraan gekoppeld. Gebruik ze als paden of geleiders die het model volgen.",
"help.sketch.intersection_curve": "Maakt 3D-curven waar twee lichamen of vlakken samenkomen, eraan gekoppeld. Gebruik ze als paden of geleiders die het model volgen.",
"help.sketch.isoparametric_curve": "Maakt een 3D-curve langs de U- of V-richting van een vlak door een punt dat je kiest, gekoppeld aan het vlak. Gebruik dit als pad of splitslijn die het oppervlak volgt.",
"help.sketch.line": "Tekent verbonden lijnen punt voor punt, als open keten of gesloten contour. Het is het basisgereedschap voor de meeste profielen.",
"help.sketch.line.midpoint": "Tekent een lijn vanuit zijn middelpunt naar één uiteinde, waarbij het andere uiteinde wordt gespiegeld. Gebruik dit voor lijnen die op een punt zijn gecentreerd, zoals een symmetrische rand.",
@@ -3818,8 +3818,6 @@
"sample.plate.name": "Voorbeeldplaat",
"sample.vents.about": "Sleuven in een rechthoekig patroon: rijen, kolommen en spoed zijn parameters",
"sample.vents.name": "Ventilatieplaat",
"scale.per_axis": "Per as",
"scale.uniform": "Uniform",
"search.command_keys": "Enter uitvoeren Shift+Enter uitvoeren en open houden Esc sluiten",
"search.commands": "Opdrachten",
"search.design": "In dit ontwerp",
-2
View File
@@ -1408,8 +1408,6 @@
"sample.plate.name": "Placa de exemplo",
"sample.vents.about": "Rasgos em padrão retangular: linhas, colunas e passo são parâmetros",
"sample.vents.name": "Placa de ventilação",
"scale.per_axis": "Por eixo",
"scale.uniform": "Uniforme",
"search.command_keys": "Enter executar Shift+Enter executar e manter aberto Esc fechar",
"search.commands": "Comandos",
"search.design": "Neste projeto",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Citește traseele unui desen SVG într-o schiță, scalate, rotite și plasate așa cum stabiliți. Folosiți-o pentru a transforma un logo sau un contur vectorial în curbe pe care le puteți extruda.",
"help.sketch.inspect": "Deschide un raport despre schița deschisă: câte grade de libertate au rămas și dacă este complet constrânsă. Folosiți-l pentru a afla ce se mai mișcă înainte de a finaliza schița.",
"help.sketch.intersect": "Adaugă curbele sau punctele în care corpuri, fețe, muchii sau alte schițe taie planul schiței. Rămân legate și urmează modelul când acesta se schimbă.",
"help.sketch.intersection_curve": "Creează curbe 3D acolo unde se întâlnesc două corpuri, fețe sau curbe ale altor schițe, legate de ele. Folosiți-le ca trasee sau ghidaje care urmează modelul.",
"help.sketch.intersection_curve": "Creează curbe 3D acolo unde se întâlnesc două corpuri sau fețe, legate de ele. Folosiți-le ca trasee sau ghidaje care urmează modelul.",
"help.sketch.isoparametric_curve": "Creează o curbă 3D pe direcția U sau V a unei fețe, printr-un punct ales de dumneavoastră, legată de față. Folosiți-o ca traseu sau linie de separare care urmează suprafața.",
"help.sketch.line": "Desenează linii conectate punct cu punct, ca lanț deschis sau contur închis. Este instrumentul de bază pentru majoritatea profilurilor.",
"help.sketch.line.midpoint": "Desenează o linie de la mijlocul ei spre un capăt, celălalt capăt fiind în oglindă. Folosiți-o pentru linii centrate pe un punct, de exemplu o muchie simetrică.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Placă exemplu",
"sample.vents.about": "Canale într-o matrice dreptunghiulară: rândurile, coloanele și pasul sunt parametri",
"sample.vents.name": "Placă de ventilație",
"scale.per_axis": "Pe axe",
"scale.uniform": "Uniform",
"search.command_keys": "Enter execută Shift+Enter execută și păstrează deschis Esc închide",
"search.commands": "Comenzi",
"search.design": "În acest proiect",
+1 -4
View File
@@ -647,7 +647,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "Направление должно быть осью или прямолинейной кривой эскиза, лежащей в плоскости эскиза",
"The mirror line cannot also be mirrored": "Линию зеркала нельзя одновременно отражать",
"The mirror line must be a straight curve of this sketch, not an origin axis": "Линия зеркала должна быть прямолинейной кривой этого эскиза, а не осью начала координат",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "Ось начала координат перпендикулярна плоскости эскиза, поэтому линии в этой плоскости нет",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "Сохранённое исходное вхождение отсутствует. Выберите корректное исходное положение перед перепривязкой.",
"Then": "Затем",
"These features will be deleted:": "Эти операции будут удалены:",
@@ -1611,7 +1610,7 @@
"help.sketch.insert_svg": "Читает контуры рисунка SVG в эскиз, масштабируя, поворачивая и размещая их так, как вы зададите. Используйте, чтобы превратить логотип или векторный контур в кривые, которые можно выдавить.",
"help.sketch.inspect": "Открывает отчёт об открытом эскизе: сколько осталось степеней свободы и определён ли он полностью. Используйте, чтобы выяснить, что ещё двигается, прежде чем завершить эскиз.",
"help.sketch.intersect": "Добавляет кривые или точки, где тела, грани, рёбра или другие эскизы пересекают плоскость эскиза. Они остаются связанными и следуют за моделью при её изменении.",
"help.sketch.intersection_curve": "Создаёт 3D-кривые там, где встречаются два тела, две грани или кривые других эскизов, связанные с ними. Используйте как траектории или направляющие, следующие за моделью.",
"help.sketch.intersection_curve": "Создаёт 3D-кривые там, где встречаются два тела или две грани, связанные с ними. Используйте как траектории или направляющие, следующие за моделью.",
"help.sketch.isoparametric_curve": "Создаёт 3D-кривую вдоль направления U или V грани через выбранную точку, связанную с гранью. Используйте как траекторию или линию разделения, следующую за поверхностью.",
"help.sketch.line": "Рисует соединённые линии точка за точкой, как открытую цепочку или замкнутый контур. Это основной инструмент для большинства профилей.",
"help.sketch.line.midpoint": "Рисует линию от её середины до одного конца, второй конец отражается зеркально. Используйте для линий с центром в точке, например симметричного ребра.",
@@ -3751,8 +3750,6 @@
"sample.plate.name": "Образец пластины",
"sample.vents.about": "Пазы в прямоугольном массиве: число рядов, столбцов и шаг заданы параметрами",
"sample.vents.name": "Вентиляционная пластина",
"scale.per_axis": "По осям",
"scale.uniform": "Равномерно",
"search.command_keys": "Enter выполнить Shift+Enter выполнить и оставить открытым Esc закрыть",
"search.commands": "Команды",
"search.design": "В этом дизайне",
+1 -1
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Учитава путање SVG цртежа у скицу, скалиране, окренуте и постављене како зададете. Користите га да логотип или векторски обрис претворите у криве које можете екструдирати.",
"help.sketch.inspect": "Отвара извештај о отвореној скици: колико је степени слободе остало и да ли је потпуно ограничена. Користите га да сазнате шта се још помера пре него што завршите скицу.",
"help.sketch.intersect": "Додаје криве или тачке у којима тела, лица, ивице или друге скице секу раван скице. Оне остају повезане и прате модел када се он промени.",
"help.sketch.intersection_curve": "Прави 3D криве тамо где се два тела, лица или криве других скица састају, повезане са њима. Користите их као путање или водилице које прате модел.",
"help.sketch.intersection_curve": "Прави 3D криве тамо где се два тела или лица састају, повезане са њима. Користите их као путање или водилице које прате модел.",
"help.sketch.isoparametric_curve": "Прави 3D криву дуж U или V смера лица кроз тачку коју изаберете, повезану са лицем. Користите је као путању или линију поделе која прати површ.",
"help.sketch.line": "Црта повезане линије тачку по тачку, као отворени ланац или затворени обрис. То је основни алат за већину профила.",
"help.sketch.line.midpoint": "Црта линију од њене средишње тачке до једног краја, а други крај се пресликава. Користите је за линије центриране на тачки, на пример за симетричну ивицу.",
+1 -3
View File
@@ -1622,7 +1622,7 @@
"help.sketch.insert_svg": "Läser in banorna från en SVG-ritning i en skiss, skalade, vridna och placerade där du anger. Använd det för att göra en logotyp eller en vektorkontur till kurvor som du kan extrudera.",
"help.sketch.inspect": "Öppnar en rapport om den öppna skissen: hur många frihetsgrader som återstår och om den är fullt definierad. Använd det för att ta reda på vad som fortfarande rör sig innan du avslutar skissen.",
"help.sketch.intersect": "Lägger till de kurvor eller punkter där kroppar, ytor, kanter eller andra skisser korsar skissplanet. De förblir länkade och följer modellen när den ändras.",
"help.sketch.intersection_curve": "Skapar 3D-kurvor där två kroppar, ytor eller kurvor från andra skisser möts, länkade till dem. Använd dem som banor eller styrkurvor som följer modellen.",
"help.sketch.intersection_curve": "Skapar 3D-kurvor där två kroppar eller ytor möts, länkade till dem. Använd dem som banor eller styrkurvor som följer modellen.",
"help.sketch.isoparametric_curve": "Skapar en 3D-kurva längs en ytas U- eller V-riktning genom en punkt som du väljer, länkad till ytan. Använd den som en bana eller delningslinje som följer ytan.",
"help.sketch.line": "Ritar sammanhängande linjer punkt för punkt, som en öppen kedja eller en sluten kontur. Det är det grundläggande verktyget för de flesta profiler.",
"help.sketch.line.midpoint": "Ritar en linje från dess mittpunkt ut till ena änden, med den andra änden speglad. Använd det för linjer centrerade på en punkt, till exempel en symmetrisk kant.",
@@ -3808,8 +3808,6 @@
"sample.plate.name": "Exempelplatta",
"sample.vents.about": "Spår i ett rektangulärt mönster: rader, kolumner och delning är parametrar",
"sample.vents.name": "Ventilationsplatta",
"scale.per_axis": "Per axel",
"scale.uniform": "Likformig",
"search.command_keys": "Enter kör Shift+Enter kör och behåll öppen Esc stäng",
"search.commands": "Kommandon",
"search.design": "I denna konstruktion",
+1 -3
View File
@@ -1621,7 +1621,7 @@
"help.sketch.insert_svg": "Bir SVG çiziminin yollarını, belirlediğiniz ölçekte, açıda ve konumda bir eskize okur. Bir logoyu veya vektör dış hattını ekstrüzyon yapabileceğiniz eğrilere dönüştürmek için kullanın.",
"help.sketch.inspect": "Açık eskiz için bir rapor açar: kaç serbestlik derecesi kaldığını ve tam kısıtlı olup olmadığını. Eskizi bitirmeden önce nelerin hâlâ hareket ettiğini öğrenmek için kullanın.",
"help.sketch.intersect": "Gövdelerin, yüzlerin, kenarların veya diğer eskizlerin eskiz düzlemini kestiği eğrileri ya da noktaları ekler. Bağlı kalır ve model değiştiğinde onu izler.",
"help.sketch.intersection_curve": "İki gövdenin, yüzün veya diğer eskizlerin eğrilerinin buluştuğu yerde, onlara bağlı 3B eğriler oluşturur. Bunları modeli izleyen yollar veya kılavuz raylar olarak kullanın.",
"help.sketch.intersection_curve": "İki gövdenin veya yüzün buluştuğu yerde, onlara bağlı 3B eğriler oluşturur. Bunları modeli izleyen yollar veya kılavuz raylar olarak kullanın.",
"help.sketch.isoparametric_curve": "Bir yüzün U veya V yönü boyunca, seçtiğiniz bir noktadan geçen ve yüze bağlı bir 3B eğri oluşturur. Yüzeyi izleyen bir yol veya bölme çizgisi olarak kullanın.",
"help.sketch.line": "Bağlantılı çizgileri nokta nokta, açık bir zincir veya kapalı bir dış hat olarak çizer. Çoğu profil için temel araçtır.",
"help.sketch.line.midpoint": "Bir çizgiyi orta noktasından bir uca doğru çizer; diğer uç yansıtılır. Bir nokta etrafında ortalanmış çizgiler, örneğin simetrik bir kenar için kullanın.",
@@ -3807,8 +3807,6 @@
"sample.plate.name": "Örnek plaka",
"sample.vents.about": "Dikdörtgen desende yuvalar: satırlar, sütunlar ve aralık parametredir",
"sample.vents.name": "Havalandırma plakası",
"scale.per_axis": "Eksen başına",
"scale.uniform": "Tekdüze",
"search.command_keys": "Enter çalıştır Shift+Enter çalıştır ve açık tut Esc kapat",
"search.commands": "Komutlar",
"search.design": "Bu tasarımda",
+1 -3
View File
@@ -1681,7 +1681,7 @@
"help.sketch.insert_svg": "Зчитує контури малюнка SVG в ескіз, масштабовані, повернуті й розміщені так, як ви задасте. Використовуйте, щоб перетворити логотип або векторний контур на криві, які можна видавити.",
"help.sketch.inspect": "Відкриває звіт про відкритий ескіз: скільки ступенів вільності залишилося і чи він повністю обмежений. Використовуйте його, щоб дізнатися, що ще рухається, перш ніж завершити ескіз.",
"help.sketch.intersect": "Додає криві чи точки, де тіла, грані, ребра або інші ескізи перетинають площину ескізу. Вони залишаються пов'язаними й слідують за моделлю, коли вона змінюється.",
"help.sketch.intersection_curve": "Створює 3D-криві там, де сходяться два тіла, грані чи криві інших ескізів, пов'язані з ними. Використовуйте їх як траєкторії або напрямні, що слідують за моделлю.",
"help.sketch.intersection_curve": "Створює 3D-криві там, де сходяться два тіла чи грані, пов'язані з ними. Використовуйте їх як траєкторії або напрямні, що слідують за моделлю.",
"help.sketch.isoparametric_curve": "Створює 3D-криву, пов'язану з гранню, вздовж напрямку U або V грані через вибрану вами точку. Використовуйте як траєкторію або лінію розділення, що слідує за поверхнею.",
"help.sketch.line": "Малює з'єднані прямі точка за точкою — як розімкнений ланцюг або замкнений контур. Це основний інструмент для більшості профілів.",
"help.sketch.line.midpoint": "Малює пряму від її середини до одного кінця, а другий кінець відображається дзеркально. Використовуйте для прямих, центрованих на точці, наприклад симетричного краю.",
@@ -4074,8 +4074,6 @@
"sample.plate.name": "Зразкова пластина",
"sample.vents.about": "Пази в прямокутному масиві: рядки, стовпці та крок є параметрами",
"sample.vents.name": "Вентиляційна пластина",
"scale.per_axis": "По осях",
"scale.uniform": "Рівномірно",
"search.command_keys": "Enter виконати Shift+Enter виконати й залишити відкритим Esc закрити",
"search.commands": "Команди",
"search.design": "У цьому проєкті",
+1 -79
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "Bỏ kích hoạt các thư mục đã chọn",
"Suppressed": "Bị tạm nén",
"Surface": "Bề mặt",
"Surface or face": "Bề mặt hoặc mặt",
"Surface or faces": "Bề mặt hoặc các mặt",
"Surface, or faces to turn over": "Mặt cong, hoặc các mặt cần lật hướng",
"Surfaces": "Các bề mặt",
"Swap Ends": "Hoán đổi hai đầu",
@@ -644,7 +642,6 @@
"Target": "Mục tiêu",
"Target Body": "Khối mục tiêu",
"Target Face (optional)": "Mặt đích (tùy chọn)",
"Target edges": "Các cạnh đích",
"Tear": "Xé rách mép chấn",
"Technical details": "Chi tiết kỹ thuật",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "Phác thảo nét đứt là đường dẫn mặt phẳng đã lưu. Hãy chọn một bề mặt mới để sửa lại liên kết.",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "Hướng phải là một trục hoặc một đường cong phác thảo thẳng nằm trong mặt phẳng phác thảo",
"The mirror line cannot also be mirrored": "Đường đối xứng không thể đồng thời được lấy đối xứng",
"The mirror line must be a straight curve of this sketch, not an origin axis": "Đường đối xứng phải là một đường cong thẳng của phác thảo này, không phải trục gốc",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "Trục gốc vuông góc với mặt phẳng phác thảo nên không có đường thẳng trong mặt phẳng này",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "Bản thể tác giả đã lưu bị thiếu. Hãy chọn một vị trí tác giả hợp lệ trước khi gán lại.",
"Then": "Thì",
"These features will be deleted:": "Các tính năng sau sẽ bị xóa:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "thân của một cạnh đã chọn không còn nữa",
"add a key for a joint first": "hãy thêm một khóa cho khớp trước",
"ai.connected_toast": "SolidCraft hiện đã sẵn sàng trong {clients}. Khởi động lại ứng dụng để sử dụng (Cài đặt > Trợ lý ảo).",
"ai.http.allow": "Cho phép HTTP không bảo mật",
"ai.http.confirm": "Cho phép với điểm cuối này",
"ai.http.warning": "Khóa API và cuộc trò chuyện sẽ được gửi mà không mã hóa. Bất kỳ ai có quyền truy cập mạng đều có thể đọc hoặc thay đổi chúng. Chỉ sử dụng trên mạng mà bạn tin cậy.",
"ai.prefs.allow_control": "Cho phép tác nhân AI kết nối",
"ai.prefs.allow_control_note": "Kênh cục bộ (MCP). Không có gì rời khỏi máy tính này.\n\nMở kênh điều khiển chỉ trên máy tính này (127.0.0.1, cổng 27878 hoặc cổng trống tiếp theo). Chương trình kết nối phải xuất trình mã token bảo mật chỉ tài khoản người dùng của bạn đọc được, được tạo mới mỗi lần khởi động. Có hiệu lực vào lần khởi động tiếp theo của SolidCraft. Khi tắt: không lắng nghe trừ khi bạn bật.",
"ai.prefs.availability": "Khả dụng",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "Theo camera",
"ai.prefs.follow_camera_off": "Tự động xoay camera theo phác thảo đang tắt.",
"ai.prefs.follow_camera_on": "Camera sẽ tự động xoay vuông góc với phác thảo do agent tạo.",
"ai.prefs.instructions": "Hướng dẫn tùy chỉnh",
"ai.prefs.instructions_note": "Được gửi cho agent khi bắt đầu mỗi cuộc trò chuyện, sau hướng dẫn riêng của SolidCraft: cách bạn muốn làm việc, các quy tắc cần tuân theo. Thay đổi có hiệu lực từ cuộc trò chuyện tiếp theo (Kết nối hoặc Cuộc trò chuyện mới).",
"ai.prefs.intro": "Tác nhân AI trong SolidCraft.",
"ai.prefs.make_default": "Đặt làm mặc định",
"ai.prefs.no_agents": "Chưa có agent nào. Thêm một agent hoặc làm mới để tìm các agent đã cài đặt.",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "Di chuyển vạch so sánh kết xuất",
"cmd.render.result.discard": "Bỏ kết quả kết xuất",
"cmd.render.result.select": "Chọn kết quả kết xuất",
"cmd.render.surface.import": "Nhập bản đồ bề mặt",
"cmd.render.texture.list": "Liệt kê ảnh bề mặt được nhúng",
"cmd.render.texture.remove": "Xóa ảnh bề mặt được nhúng",
"cmd.render_aging_describe": "Lão hóa bề mặt phân lớp",
"cmd.render_backends": "Kết xuất hình ảnh Sauends",
"cmd.render_batch": "Kết xuất mọi cảnh chụp",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "Thẻ trước",
"cmd.view_rename": "Đổi tên góc nhìn đã lưu",
"cmd.view_render_frame": "Đường dẫn khung kết xuất",
"cmd.view_ribbon_tabs_only": "Chỉ các thẻ ribbon",
"cmd.view_right": "Góc nhìn bên phải",
"cmd.view_save": "Tạo góc nhìn đã lưu mới",
"cmd.view_shots_strip": "Dải cảnh chụp",
@@ -1408,7 +1395,6 @@
"dialog.computing": "Đang tính toán… {seconds} s",
"dialog.could_not_be_checked": "không thể kiểm tra",
"dialog.custom_axis": "↖ Trục tùy chỉnh",
"dialog.cylinder_face_tip": "Bề mặt hoặc đỉnh của mô hình mà khối trụ đứng trên đó: nhấp vào đây, sau đó nhấp vào nó trong khung nhìn. Để trống thì X, Y và Z đặt vị trí.",
"dialog.dimension_insert_hint": "Nhấp vào một kích thước điều khiển khác để chèn tên của nó",
"dialog.dimension_name": "Kích thước: {name}",
"dialog.dimension_step_down": "Giảm {step}",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "CHỈNH SỬA {title}",
"dialog.no_shown_body": "Không có thân khối đang hiển thị để thay đổi: hãy hiển thị một thân khối, hoặc chọn “Tạo mới Thân khối”",
"dialog.pattern_sketch_not_object": "Hãy chọn thân khối hoặc tính năng: bản phác thảo không phải là cả hai. Lặp lại các đường cong của nó bằng Mảng hoặc Lấy đối xứng trong chính bản phác thảo, hoặc đùn khối nó trước.",
"dialog.primitive_point_tip": "Một điểm điền vào X, Y và Z: nhấp vào đây, sau đó nhấp vào một đỉnh, cạnh hoặc bề mặt của mô hình, một điểm của bản phác thảo, hoặc gốc tọa độ.",
"dialog.reference_edge_tip": "Một cạnh thẳng của bề mặt đã chọn, từ đó đo khoảng cách bên dưới: nhấp vào đây, sau đó nhấp vào cạnh.",
"dialog.select": "↖ Chọn",
"dialog.selected_count": "↖ {count} đã chọn",
"dialog.selection_constraint": "Ràng buộc {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "Bộ chọn tệp đã mở không phải của riêng desktop: dưới XWayland, portal từ chối cửa sổ cha.",
"file_load.built": "Đã dựng được: {built} trên {total} tính năng.",
"file_load.converting": "Đang chuyển đổi khối đặc {done} trên {total}",
"file_load.inserted": "Đã chèn {name}",
"file_load.inserting": "Đang chèn hình học",
"file_load.link_item": "{name} ({done} trên {total})",
"file_load.opened": "Đã mở {name}",
"file_load.opened_in_tab": "Đã mở {name} trong thẻ mới",
"file_load.opening": "Đang mở thiết kế",
"file_load.preparing_thumbnail": "Đang chuẩn bị ảnh thu nhỏ...",
"file_load.preparing_view": "Đang chuẩn bị góc nhìn...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "Đọc các đường dẫn của bản vẽ SVG vào phác thảo, theo tỉ lệ, góc xoay và vị trí bạn đặt. Dùng để biến logo hoặc đường bao véc tơ thành đường cong có thể đùn.",
"help.sketch.inspect": "Mở báo cáo về bản phác thảo đang mở: còn bao nhiêu bậc tự do và đã ràng buộc hoàn toàn chưa. Dùng nó để biết phần nào vẫn còn di chuyển được trước khi hoàn tất bản phác thảo.",
"help.sketch.intersect": "Thêm các đường cong hoặc điểm nơi khối, mặt, cạnh hoặc phác thảo khác cắt qua mặt phẳng phác thảo. Chúng vẫn được liên kết và thay đổi theo mô hình.",
"help.sketch.intersection_curve": "Tạo đường cong 3D tại nơi hai khối, hai mặt hoặc đường cong của các phác thảo khác gặp nhau, liên kết với chúng. Dùng làm đường dẫn hoặc ray dẫn hướng thay đổi theo mô hình.",
"help.sketch.intersection_curve": "Tạo đường cong 3D tại nơi hai khối hoặc hai mặt gặp nhau, liên kết với chúng. Dùng làm đường dẫn hoặc ray dẫn hướng thay đổi theo mô hình.",
"help.sketch.isoparametric_curve": "Tạo đường cong 3D theo hướng U hoặc V của một mặt qua điểm bạn chọn, liên kết với mặt đó. Dùng làm đường dẫn hoặc đường tách thay đổi theo bề mặt.",
"help.sketch.line": "Vẽ các đường thẳng nối liền từng điểm một, thành chuỗi hở hoặc đường bao khép kín. Đây là công cụ cơ bản cho hầu hết biên dạng.",
"help.sketch.line.midpoint": "Vẽ đường thẳng từ trung điểm ra một đầu, đầu kia đối xứng qua trung điểm. Dùng cho đường thẳng có tâm tại một điểm, như cạnh đối xứng.",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "Xoay, dịch hoặc thu phóng khung nhìn theo từng bước, chẳng hạn xoay một phần tư vòng sang trái. Dùng để điều khiển camera chính xác thay vì kéo chuột.",
"help.view.navigation_bar": "Hiện hoặc ẩn thanh điều hướng ở cuối khung nhìn. Ẩn đi để có thêm chỗ, hiện ra để dùng các công cụ xem bằng chuột.",
"help.view.rename": "Đặt tên mới cho một góc nhìn đã lưu. Bản thân góc nhìn không đổi.",
"help.view.ribbon_tabs_only": "Thu gọn ribbon chỉ còn hàng thẻ, để khung nhìn có thêm chỗ mà các bảng từng chiếm. Bấm một thẻ để hiện các bảng của nó đè lên khung nhìn; chọn lại lệnh này để luôn hiện toàn bộ ribbon.",
"help.view.save": "Lưu vị trí camera hiện tại thành một góc nhìn có tên trong thiết kế. Dùng để quay lại đúng góc đó sau này, chẳng hạn khi chụp ảnh màn hình.",
"help.view.spin": "Quay khung nhìn quanh mô hình liên tục cho đến cú nhấp hoặc phím tiếp theo. Dùng để trình bày mô hình từ mọi phía.",
"help.view.tool": "Giữ cố định một công cụ camera (xoay quanh, dịch hoặc thu phóng) để kéo bằng nút chuột trái sẽ di chuyển khung nhìn cho đến khi bạn tắt nó. Dùng trên bàn di chuột hoặc khi không có nút chuột giữa.",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "Nối, Vật thể mới hoặc Cắt, tùy vào phần vật liệu tiếp xúc.",
"prefs.axes": "Các trục tọa độ",
"prefs.axis": "Trục tọa độ",
"prefs.background_choose": "Chọn ảnh…",
"prefs.background_image": "Ảnh",
"prefs.background_unreadable": "Không đọc được ảnh nền",
"prefs.blur_cost": "Chi phí kết xuất tương đối. Nhiều thanh hơn thường có nghĩa là cần xử lý nhiều hơn.",
"prefs.blur_device": "Không khả dụng trên thiết bị đồ họa hoặc đường kết xuất này",
"prefs.blur_guard": "Chất lượng làm mờ đã giảm để duy trì độ phản hồi của khung hình. Bán kính không thay đổi.",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "Biểu tượng mắt cạnh mũi tên thu gọn",
"prefs.browser_eye_left_note": "Các hàng trong cây thư mục hiển thị biểu tượng mắt bật/tắt cạnh mũi tên thu gọn như trước đây, thay vì trong một cột ở đầu bên phải của các hàng.",
"prefs.browser_reveal_on_hover": "Hiện khi di chuột",
"prefs.browser_rows_start_closed": "Các dòng trong cây thư mục đóng sẵn",
"prefs.browser_rows_start_closed_note": "Vị trí đặt và thư mục trong cây thư mục bắt đầu ở trạng thái đóng, nên thiết kế có nhiều thành phần chỉ hiện các dòng cấp trên cùng. Mỗi dòng mở bằng mũi tên của nó, “Mở rộng tất cả” hoặc “Tìm trong cây đối tượng”, lệnh này chỉ mở các dòng dẫn tới thân khối và đóng lại các dòng mà lần tìm trước đã mở. Chọn một thân khối trong khung nhìn 3D không làm thay đổi cây thư mục. Khi tắt, các thư mục mở sẵn, vị trí đặt theo tùy chọn “Thành phần mở sẵn”, và việc chọn trong khung nhìn 3D mở cây thư mục tới thân khối đó, như trước đây.",
"prefs.browser_show_note": "Hiển thị giữ trình duyệt trên màn hình. Hiện khi di chuột ẩn nó cho đến khi con trỏ đến vị trí của nó hoặc thẻ mảnh ở cạnh trái, và nó vẫn mở khi con trỏ ở bên trong hoặc một menu của nó đang mở.",
"prefs.browser_shown": "Hiển thị",
"prefs.built_in": "Mặc định tích hợp",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "Trước",
"prefs.choose_font": "Chọn tệp phông chữ…",
"prefs.click": "Nhấp chuột",
"prefs.command_dialog_values": "Hộp thoại lệnh",
"prefs.contact_shading": "Đổ bóng tiếp xúc mềm",
"prefs.contact_shading_note": "Tạo bóng đổ mềm tại những vị trí các chi tiết tiếp giáp gần nhau.",
"prefs.context_menu": "Menu ngữ cảnh",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "Bề mặt và cạnh",
"prefs.graphics_page.view_bar": "Cũng có trên thanh khung nhìn",
"prefs.graphics_presets_note": "Các cấu hình định sẵn sẽ thiết lập đồng thời các tùy chọn bên dưới.",
"prefs.ground_shadow_follows_model": "Bóng trên mặt đất di chuyển theo mô hình",
"prefs.ground_shadow_follows_model_help": "Đặt bóng bên dưới khối hiển thị thấp nhất. Khi tắt, bóng của mô hình được nâng lên vẫn nằm trên mặt phẳng đất đi qua gốc tọa độ.",
"prefs.hide_constraint_glyphs_zoomed_out": "Ẩn biểu tượng ràng buộc khi thu nhỏ",
"prefs.hide_constraint_glyphs_zoomed_out_note": "Biểu tượng ràng buộc biến mất khi bản phác được thu nhỏ đủ xa để không làm rối khung nhìn. Tắt: chúng giữ kích thước màn hình cố định ở mọi mức thu phóng.",
"prefs.history": "Lịch sử",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "Hai mũi tên cong ở góc khối cuộn khung nhìn trong mặt phẳng màn hình. Khi bật: mũi tên theo chiều kim đồng hồ cuộn ngược chiều kim đồng hồ và ngược lại. Khi tắt: mỗi mũi tên cuộn khung nhìn theo chiều cong của nó.",
"prefs.invert_navigator_arrows": "Đảo ngược mũi tên xoay của khối điều hướng",
"prefs.invert_navigator_arrows_note": "Các mũi tên quanh khối xoay camera theo hướng mũi tên chỉ, như trong Fusion và Inventor: mũi tên bên trái chỉ sang phải và đưa camera sang phải. Khi tắt: mũi tên xoay khối về phía cạnh chứa nó, nên mũi tên bên trái đưa camera sang trái. Hai mũi tên cuộn cong không bị ảnh hưởng.",
"prefs.keep_unsaved_also_asks": "Vẫn hỏi khi đóng thẻ",
"prefs.keep_unsaved_also_asks_tip": "Khi tắt, thẻ sẽ đóng mà không có hộp thoại của trình duyệt khi bản sao của mọi thiết kế chưa lưu đã được cập nhật.",
"prefs.keep_unsaved_in_browser": "Giữ công việc chưa lưu trong trình duyệt này",
"prefs.keep_unsaved_in_browser_tip": "Các thay đổi chưa lưu của mỗi thiết kế đang mở được cập nhật liên tục trong bộ nhớ riêng của trình duyệt này. Lần truy cập sau sẽ đề nghị khôi phục chúng.",
"prefs.keep_work_on_tab_switch": "Giữ hộp thoại và công cụ mở khi chuyển giữa các thiết kế",
"prefs.keep_work_on_tab_switch_note": "Mỗi thẻ thiết kế giữ hộp thoại hoặc công cụ đang mở, cùng những gì bạn đã chọn và nhập trong đó, và thẻ thanh công cụ của nó. Chúng vẫn còn đó khi bạn quay lại thiết kế. Tắt: chuyển thiết kế sẽ hủy chúng và hiển thị thẻ Mô hình.",
"prefs.labels": "Nhãn chữ",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "Thẻ",
"prefs.layout_page.column": "Cột",
"prefs.layout_page.hover": "Rê chuột",
"prefs.layout_page.hover_panel_menus": "Chuyển menu nhóm khi di chuột",
"prefs.layout_page.hover_panel_menus_help": "Nhấp vào tên nhóm trên dải công cụ để mở menu. Di chuột lên tên nhóm khác để chuyển menu. Di chuyển con trỏ ra ngoài dải công cụ và menu đang mở để đóng menu.",
"prefs.layout_page.icons_labels": "Biểu tượng + nhãn",
"prefs.layout_page.ok_cancel": "Đồng ý và Hủy bỏ",
"prefs.layout_page.on_hover": "Khi rê chuột",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "mượt mà hơn",
"prefs.quick_measure": "Đo nhanh ở góc khung nhìn",
"prefs.quick_measure_note": "Hiển thị kích thước của đối tượng được chọn ở góc dưới bên phải khung nhìn, phía trên Lịch sử: chiều dài của cạnh (hoặc Ø và R với cạnh tròn), diện tích của mặt, vị trí của điểm, khoảng cách và góc giữa hai đối tượng, tổng của nhiều cạnh hoặc mặt. Nhấp để sao chép.",
"prefs.remember_dialog_values": "Ghi nhớ giá trị hộp thoại lệnh",
"prefs.remember_dialog_values.help": "Tắt theo mặc định. Khi bật, sau khi lệnh thành công, các giá trị và tùy chọn an toàn của lệnh sẽ được dùng lại vào lần tiếp theo bạn mở cùng lệnh đó, cho đến khi SolidCraft đóng.",
"prefs.render_previous_geometry_budget": "Dùng ngân sách hình học trước đây cho bản xem trước kết xuất",
"prefs.render_previous_geometry_budget_help": "Khôi phục giới hạn hình học cố định trước đây (512 MiB trên máy tính 64 bit, 128 MiB trên các nền tảng khác) thay cho ngân sách dựa trên thiết bị.",
"prefs.reports_saved": "Đã lưu {n}",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "Nhấp vào nút ruy-băng đang sáng của công cụ phác thảo đang dùng sẽ kết thúc công cụ, để các cú nhấp trong khung nhìn lại chọn đối tượng. Tắt: cú nhấp khởi động lại công cụ.",
"prefs.ribbon_reveal": "Hiện kết quả tìm kiếm trên ribbon",
"prefs.ribbon_reveal_note": "Khi rê chuột lên một kết quả trong Tìm lệnh, ribbon cho biết lệnh nằm ở đâu: tab, nút hoặc dòng của nó trong menu thả xuống của một bảng. Lệnh bắt đầu từ tìm kiếm sẽ nhấp nháy ở đó, và lệnh đang chạy từ menu thả xuống sẽ đánh dấu bảng của nó.",
"prefs.ribbon_tabs_only": "Chỉ hiện các thẻ của ribbon",
"prefs.ribbon_tabs_only_note": "Ribbon thu gọn chỉ còn hàng thẻ. Bấm một thẻ sẽ hiện các bảng của nó đè lên khung nhìn cho đến khi một lệnh bắt đầu hoặc con trỏ rời khỏi chúng. Lệnh Chỉ các thẻ ribbon trong thẻ Xem, hoặc phím tắt của nó, bật tắt tùy chọn này.",
"prefs.right_click": "Nhấp chuột phải",
"prefs.saving": "Khởi động và lưu",
"prefs.scale_note": "Cũng có thể dùng Ctrl + / Ctrl − trong cửa sổ. Các nút có kích thước 28 px ở mức 100%.",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "vừa xong",
"recovery.min_ago": "{count} phút trước",
"recovery.never_saved": "chưa từng lưu",
"recovery.open_saved": "Mở phiên bản đã lưu",
"recovery.restore": "Khôi phục",
"recovery.restore_intro": "Các thay đổi chưa được lưu khi trang này đóng lần trước được giữ trong trình duyệt này.",
"recovery.restore_row": "{name}, thay đổi {when}",
"recovery.restore_title": "Khôi phục các thiết kế chưa lưu?",
"recovery.restore_title_one": "Khôi phục thiết kế chưa lưu: {name}, thay đổi {when}?",
"refused.change": "Không thể thay đổi {body}.",
"refused.cut": "Không thể cắt {body}.",
"refused.face_curved": "Một trong các mặt cong của nó không dùng được để mô hình hóa.",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · Màn ảnh rộng",
"render.gpu_depth": "Độ sâu đường truyền tia tối đa",
"render.gpu_options_help": "Số mẫu, độ sâu, hạt giống và độ phơi sáng được lưu cùng thiết lập này. Chỉ lưu phương thức tạo ảnh đang hoạt động.",
"render.gpu_path_crashed": "Lần trước SolidCraft đã đóng khi đang thiết lập nó trên bộ điều hợp đồ họa này, nhiều khả năng là trong trình điều khiển đồ họa, nên nó sẽ không tự thiết lập lại. Hãy dùng dò tia trên CPU, hoặc thử lại (cập nhật trình điều khiển cũng sẽ thử lại).",
"render.gpu_path_failed": "Bộ dò đường truyền tia GPU không khả dụng",
"render.gpu_path_first_setup": "Lần thiết lập đầu tiên trên GPU này có thể mất vài phút; SolidCraft vẫn sử dụng được bình thường. Các lần khởi động sau sẽ tái sử dụng mã đổ bóng đã biên dịch nếu trình điều khiển lưu giữ chúng.",
"render.gpu_path_preparing": "Bộ dò đường truyền tia GPU: đang biên dịch mã đổ bóng…",
"render.gpu_path_retry": "Thử lại",
"render.gpu_seed": "Hạt giống ngẫu nhiên",
"render.gpu_unavailable": "Dò đường truyền tia GPU chưa sẵn sàng trên thiết bị này.",
"render.ground_apply": "Khớp và lưu mặt sàn",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "Phạm vi",
"render.stage_panels.fit_save": "Khớp và lưu",
"render.stage_panels.gpu_required": "Cần dò đường đi của tia bằng GPU",
"render.stage_panels.grain_angle": "Góc vân gỗ",
"render.stage_panels.keep": "Giữ lại",
"render.stage_panels.kept": "Được giữ lại",
"render.stage_panels.kept_fields": "Camera, lấy mẫu, kích thước, liên kết quang học, hình học CAD và đặc tính kỹ thuật.",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "Bước đi ngẫu nhiên tán xạ bên trong",
"render.subsurface_help": "Chỉ dành cho chất điện môi kín. Hệ số tán xạ và hấp thụ RGB là các hệ số riêng biệt trên mỗi mm. Tia sáng tán xạ bên trong hình học thực tế, sau đó khúc xạ hoặc phản xạ tại ranh giới. Hãy tắt bóng đổ thẳng, khử nhiễu bề mặt và thể tích bên ngoài; dùng một phân tầng Fresnel. Đây không phải bộ đổ bóng khuếch tán, lưới mật độ hay vật liệu đo đạc. Môi trường đậm đặc có thể cần nhiều mẫu và độ sâu tia lớn hơn.",
"render.subsurface_rate": "Tần suất va chạm tán xạ",
"render.surface_import.author": "Tác giả",
"render.surface_import.busy": "Đang nhập ảnh…",
"render.surface_import.complete": "Chọn ảnh rồi nhập tác giả, nguồn và giấy phép.",
"render.surface_import.embedded": "Ảnh đã nhập",
"render.surface_import.failed": "Quá trình nhập ảnh chưa hoàn tất.",
"render.surface_import.license": "Giấy phép / quyền sở hữu",
"render.surface_import.raytrace_required": "Ảnh cần dò tia trên CPU hoặc GPU. Hãy chọn trong phần Đầu ra.",
"render.surface_import.repeat_u": "Chu kỳ U",
"render.surface_import.repeat_v": "Chu kỳ V",
"render.surface_import.save": "Lưu ảnh trên khối",
"render.surface_import.saved_cpu": "Lưu bản đồ để dùng khi kết xuất bằng CPU.",
"render.surface_import.source": "Nguồn",
"render.surface_import.title": "Nhập ảnh",
"render.tone_aces_fitted": "ACES khớp",
"render.tone_reinhard": "Reinhard",
"render.transmission_scope": "Thủy tinh GPU hỗ trợ các môi trường rời rạc đã xác thực. Không cung cấp môi trường lồng nhau không giới hạn hay ước tính truyền dẫn không nhiễu.",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "Tấm mẫu",
"sample.vents.about": "Các rãnh then trong mảng chữ nhật: số hàng, số cột và bước rãnh là các tham số",
"sample.vents.name": "Tấm khe thông gió",
"scale.per_axis": "Theo từng trục",
"scale.uniform": "Đồng đều",
"search.command_keys": "Enter chạy Shift+Enter chạy và giữ mở Esc đóng",
"search.commands": "Lệnh",
"search.design": "Trong thiết kế này",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "3D Phác thảo",
"ui.activate": "Kích hoạt",
"ui.active_component": "Cụm chi tiết đang kích hoạt",
"ui.addToQuickAccess": "Thêm vào Truy cập nhanh",
"ui.add_configuration": "Thêm cấu hình",
"ui.add_parameter": "Thêm tham số",
"ui.agent_chat": "Trò chuyện với AI Agent",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "Nhấp chuột chọn toàn bộ thân khối",
"ui.click_then_press_key": "Nhấp chuột, sau đó nhấn phím mới",
"ui.close": "Đóng",
"ui.close_tab": "Đóng thẻ",
"ui.coil": "Lò xo xoắn",
"ui.coincident": "Trùng điểm",
"ui.collapse": "Thu gọn",
@@ -5040,11 +4976,6 @@
"ui.factor": "Hệ số",
"ui.fade": "Thoát ren",
"ui.fade_length": "Chiều dài thoát ren",
"ui.fair_iterations": "Số lần lặp",
"ui.fair_keep_edges": "Giữ các cạnh",
"ui.fair_strength": "Cường độ",
"ui.fair_surface_title": "LÀM MƯỢT BỀ MẶT",
"ui.fair_tolerance_default": "0,001 lần kích thước thân khối",
"ui.feature_history": "Lịch sử tính năng",
"ui.feature_options": "Tùy chọn tính năng",
"ui.features": "Các tính năng",
@@ -5230,7 +5161,6 @@
"ui.inspect": "Kiểm tra",
"ui.instances": "Số bản",
"ui.intersect": "Giao nhau",
"ui.intersection_curve_second_pick": "Đường cong giao tuyến: nhấp vào bề mặt hoặc đường cong thứ hai (nhấp chuột phải để bắt đầu lại)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "Cô lập đối tượng",
"ui.join": "Nối liền",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "Kéo tự do bộ thao tác cũng bằng Alt/Option",
"ui.manipulator_free_alt_tip": "Bật: Alt/Option hoặc Ctrl/Cmd trên các mũi tên đùn / gizmo sẽ tắt bước nhảy giá trị. Tắt: chỉ Ctrl/Cmd.",
"ui.manufacture": "Gia công chế tạo",
"ui.match_surface_title": "KHỚP BỀ MẶT",
"ui.material_review.axes": "Các trục cục bộ của vật liệu; chưa gán hướng cho thân khối.",
"ui.material_review.claims": "Nguồn gốc và giấy phép là thông tin chưa được kiểm chứng. Các giá trị thiếu vẫn ở dạng chưa biết.",
"ui.material_review.compressive_strength": "Độ bền nén",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "Xem xét dữ liệu thuộc tính vật liệu",
"ui.material_review.unknown": "Chưa biết",
"ui.material_review.yield_strength": "Giới hạn chảy",
"ui.mcp_agents": "Tác tử qua MCP",
"ui.mcp_compact": "Đầu ra gọn",
"ui.mcp_compact_note": "Dành cho các tác tử kết nối qua máy chủ MCP (solidcraft-cli mcp): inspect_design tóm tắt các bản phác thảo và kết quả công cụ không được định dạng đẹp, nên tốn ít token hơn. Áp dụng cho các phiên tác tử bắt đầu sau khi thay đổi; --compact hoặc SOLIDCRAFT_MCP_COMPACT=1 cũng bật nó.",
"ui.measure": "Đo lường",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "3MF kèm thẻ bề mặt",
@@ -5326,7 +5252,6 @@
"ui.options": "Tùy chọn",
"ui.orbit": "Xoay quanh tâm (Orbit)",
"ui.orbit_around": "Xoay quanh",
"ui.organize": "Sắp xếp",
"ui.orientation": "Định hướng",
"ui.origin": "Gốc tọa độ",
"ui.palette_construction_mode": "Chế độ đường dựng (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "Thêm bộ lọc…",
"ui.point_cloud_auto_range": "Phạm vi tự động",
"ui.point_cloud_color_by": "Tô màu theo",
"ui.point_cloud_dots": "Điểm đơn lẻ",
"ui.point_cloud_file_colors": "Màu trong tệp",
"ui.point_cloud_filter_by": "Lọc theo",
"ui.point_cloud_height_high": "Cao nhất",
@@ -5416,7 +5340,6 @@
"ui.quality": "Chất lượng",
"ui.quantity": "Số lượng",
"ui.quantity_2": "Số lượng 2",
"ui.quick_access_full": "Thanh truy cập nhanh chứa tối đa {count} lệnh; hãy gỡ một lệnh để thêm lệnh khác",
"ui.quit": "Thoát ứng dụng",
"ui.radial_context_menu": "Menu ngữ cảnh dạng vòng (Radial)",
"ui.radius": "Bán kính",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "Chi tiết này chưa được liên kết với thiết kế nguồn nào.",
"ui.relink_select_one": "Hãy chọn trước một chi tiết được liên kết hoặc một thể hiện của nó.",
"ui.relink_source_all": "Liên kết lại nguồn (tất cả thể hiện)…",
"ui.removeFromQuickAccess": "Gỡ khỏi Truy cập nhanh",
"ui.removeFromToolbar": "Xóa khỏi thanh công cụ",
"ui.removeSection": "Xóa mặt cắt",
"ui.render": "Kết xuất hình ảnh",
+1 -7
View File
@@ -1364,14 +1364,11 @@
"dialog.computing": "正在計算… {seconds} 秒",
"dialog.could_not_be_checked": "無法檢查",
"dialog.custom_axis": "↖ 自訂軸",
"dialog.cylinder_face_tip": "圓柱體所立的模型面或頂點:先點擊此處,再在視圖中點擊它。留空時由 X、Y、Z 放置。",
"dialog.dimension_insert_hint": "點擊其他驅動尺寸以插入其名稱",
"dialog.dimension_name": "尺寸:{name}",
"dialog.edit_title": "編輯 {title}",
"dialog.no_shown_body": "沒有可變更的已顯示實體:請顯示一個,或選擇「新建實體」",
"dialog.pattern_sketch_not_object": "請選取實體或特徵:草圖兩者皆非。請用草圖自己的「陣列」或「鏡射」重複其曲線,或先將它擠出。",
"dialog.primitive_point_tip": "填入 X、Y、Z 的點:先點擊此處,再點擊模型的頂點、邊或面、草圖中的點,或原點。",
"dialog.reference_edge_tip": "所選面上的一條直邊,下方的距離從它量起:先點擊此處,再點擊該邊。",
"dialog.select": "↖ 選擇",
"dialog.selected_count": "↖ 已選擇 {count} 個",
"dialog.selection_constraint": "拘束 {id}",
@@ -1624,7 +1621,7 @@
"help.sketch.insert_svg": "將 SVG 圖形的路徑讀入草圖,並依您的設定縮放、旋轉和放置。用於把標誌或向量輪廓轉成可擠出的曲線。",
"help.sketch.inspect": "開啟目前草圖的報告:還剩多少個自由度,以及是否已完全拘束。用於在完成草圖之前找出哪些部分仍會移動。",
"help.sketch.intersect": "加入實體、面、邊或其他草圖與草圖平面相交的曲線或點。它們保持連結,並在模型變更時跟隨。",
"help.sketch.intersection_curve": "在兩個實體、面或其他草圖的曲線相接處建立 3D 曲線,並與它們連結。用作跟隨模型的路徑或導軌。",
"help.sketch.intersection_curve": "在兩個實體或面相接處建立 3D 曲線,並與它們連結。用作跟隨模型的路徑或導軌。",
"help.sketch.isoparametric_curve": "通過您選取的點,沿面的 U 或 V 方向建立 3D 曲線,並與該面連結。用作跟隨曲面的路徑或分割線。",
"help.sketch.line": "逐點畫出相連的直線,可為開放的鏈或封閉的輪廓。這是大多數輪廓的基本工具。",
"help.sketch.line.midpoint": "從中點向一端畫直線,另一端對稱映射。用於以一點為中心的直線,例如對稱的邊。",
@@ -3813,8 +3810,6 @@
"sample.plate.name": "範例板",
"sample.vents.about": "依矩形陣列排列的槽:列數、欄數和間距均為參數",
"sample.vents.name": "通風板",
"scale.per_axis": "依軸",
"scale.uniform": "等比",
"search.command_keys": "Enter 執行 Shift+Enter 執行並保持開啟 Esc 關閉",
"search.commands": "命令",
"search.design": "此設計中",
@@ -4445,7 +4440,6 @@
"ui.click_selects_whole_bodies": "點擊選擇整個實體",
"ui.click_then_press_key": "點擊,然後按新按鍵",
"ui.close": "關閉",
"ui.close_tab": "關閉分頁",
"ui.coil": "線圈",
"ui.coincident": "重合",
"ui.collapse": "摺疊",
+1 -79
View File
@@ -629,8 +629,6 @@
"Suppress Selected Folders": "抑制所选文件夹",
"Suppressed": "已抑制",
"Surface": "曲面",
"Surface or face": "曲面或面",
"Surface or faces": "曲面或面",
"Surface, or faces to turn over": "曲面,或要翻转的面",
"Surfaces": "曲面",
"Swap Ends": "交换端点",
@@ -644,7 +642,6 @@
"Target": "目标",
"Target Body": "目标实体",
"Target Face (optional)": "目标面(可选)",
"Target edges": "目标边",
"Tear": "撕裂",
"Technical details": "技术详情",
"The dashed sketch is a saved plane guide. Select a new face to repair the attachment.": "虚线草图是已保存的平面引导。选择一个新面以修复附着。",
@@ -652,7 +649,6 @@
"The direction must be an axis or a straight sketch curve that lies in the sketch plane": "方向必须是轴,或位于草图平面内的直线草图曲线",
"The mirror line cannot also be mirrored": "镜像线本身不能再被镜像",
"The mirror line must be a straight curve of this sketch, not an origin axis": "镜像线必须是此草图中的直线曲线,不能是原点轴",
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "原点轴垂直于草图平面,因此在该平面内没有直线",
"The saved author occurrence is missing. Select a valid author placement before rebinding.": "保存的作者实例缺失。重新绑定前请选择有效的作者放置。",
"Then": "操作",
"These features will be deleted:": "以下特征将被删除:",
@@ -744,9 +740,6 @@
"a picked edge's body is gone": "所选边所属的实体已不存在",
"add a key for a joint first": "请先为接头添加关键帧",
"ai.connected_toast": "SolidCraft 现已可在 {clients} 中使用。请重启它们(设置 > 助手)。",
"ai.http.allow": "允许不安全的 HTTP",
"ai.http.confirm": "允许此端点",
"ai.http.warning": "API 密钥和对话将以未加密的方式发送。任何能够访问该网络的人都可能读取或篡改它们。请仅在可信网络上使用。",
"ai.prefs.allow_control": "允许AI代理连接",
"ai.prefs.allow_control_note": "本地通道(MCP)。任何内容都不会离开此计算机。\n\n仅在本机开放控制通道(127.0.0.1,端口 27878 或下一个空闲端口)。连接的程序还必须出示一个每次启动时新生成、只有你的用户账户能读取的秘密令牌。下次启动 SolidCraft 时生效。关闭:除非用 --control 启动,否则不监听任何端口。",
"ai.prefs.availability": "可用性",
@@ -758,8 +751,6 @@
"ai.prefs.follow_camera": "跟随相机",
"ai.prefs.follow_camera_off": "相机自动跟随已关闭。",
"ai.prefs.follow_camera_on": "相机将转向代理创建的草图。",
"ai.prefs.instructions": "自定义指令",
"ai.prefs.instructions_note": "在每次对话开始时发送给代理,位于 SolidCraft 自身的指令之后:你喜欢的工作方式、需要遵守的规则。更改从下一次对话(连接或新对话)起生效。",
"ai.prefs.intro": "SolidCraft中的AI代理。",
"ai.prefs.make_default": "设为默认",
"ai.prefs.no_agents": "尚无代理。添加代理或刷新以查找已安装的代理。",
@@ -1090,9 +1081,6 @@
"cmd.render.compare.divider": "移动渲染比较分隔线",
"cmd.render.result.discard": "丢弃渲染结果",
"cmd.render.result.select": "选择渲染结果",
"cmd.render.surface.import": "导入表面贴图",
"cmd.render.texture.list": "列出嵌入的表面图像",
"cmd.render.texture.remove": "移除嵌入的表面图像",
"cmd.render_aging_describe": "分层表面老化",
"cmd.render_backends": "渲染后端",
"cmd.render_batch": "渲染所有镜头",
@@ -1336,7 +1324,6 @@
"cmd.view_previous_tab": "上一个标签页",
"cmd.view_rename": "重命名命名视图",
"cmd.view_render_frame": "渲染构图辅助线",
"cmd.view_ribbon_tabs_only": "仅功能区选项卡",
"cmd.view_right": "右视图",
"cmd.view_save": "新建命名视图",
"cmd.view_shots_strip": "镜头条",
@@ -1408,7 +1395,6 @@
"dialog.computing": "正在计算… {seconds} 秒",
"dialog.could_not_be_checked": "无法检查",
"dialog.custom_axis": "↖ 自定义轴",
"dialog.cylinder_face_tip": "圆柱体所立的模型面或顶点:先单击此处,再在视图中单击它。留空时由 X、Y、Z 放置。",
"dialog.dimension_insert_hint": "单击其他驱动尺寸以插入其名称",
"dialog.dimension_name": "尺寸:{name}",
"dialog.dimension_step_down": "减少 {step}",
@@ -1417,8 +1403,6 @@
"dialog.edit_title": "编辑 {title}",
"dialog.no_shown_body": "没有可更改的显示实体:请显示一个实体,或选择新建实体",
"dialog.pattern_sketch_not_object": "请选择实体或特征:草图两者都不是。请用草图自身的阵列或镜像重复其曲线,或先将其拉伸。",
"dialog.primitive_point_tip": "填入 X、Y、Z 的点:先单击此处,再单击模型的顶点、边或面、草图中的点,或原点。",
"dialog.reference_edge_tip": "所选面上的一条直边,下方的距离从它量起:先单击此处,再单击该边。",
"dialog.select": "↖ 选择",
"dialog.selected_count": "↖ 已选择 {count} 个",
"dialog.selection_constraint": "约束 {id}",
@@ -1467,11 +1451,8 @@
"file.open.portal_fallback.xwayland": "打开的文件选择器并非桌面自带:在 XWayland 下,门户会拒绝父窗口。",
"file_load.built": "已构建:{built}/{total} 个特征。",
"file_load.converting": "正在转换实体 {done}/{total}",
"file_load.inserted": "已插入 {name}",
"file_load.inserting": "正在插入几何体",
"file_load.link_item": "{name} ({done}/{total})",
"file_load.opened": "已打开 {name}",
"file_load.opened_in_tab": "已在新标签页中打开 {name}",
"file_load.opening": "正在打开设计",
"file_load.preparing_thumbnail": "正在准备缩略图...",
"file_load.preparing_view": "正在准备视图...",
@@ -1707,7 +1688,7 @@
"help.sketch.insert_svg": "将 SVG 图形中的路径读入草图,并按设定进行缩放、旋转和放置。用于把标志或矢量轮廓变成可拉伸的曲线。",
"help.sketch.inspect": "打开当前草图的报告:显示剩余的自由度以及是否已完全约束。在完成草图之前,用它找出仍然可以移动的部分。",
"help.sketch.intersect": "添加实体、面、边或其他草图与草图平面相交处的曲线或点。它们保持关联,并随模型变化。",
"help.sketch.intersection_curve": "在两个实体、面或其他草图的曲线相交处创建与它们关联的三维曲线。用作跟随模型的路径或导轨。",
"help.sketch.intersection_curve": "在两个实体或面相交处创建与它们关联的三维曲线。用作跟随模型的路径或导轨。",
"help.sketch.isoparametric_curve": "通过你选取的点,沿面的 U 或 V 方向创建与该面关联的三维曲线。用作跟随曲面的路径或分割线。",
"help.sketch.line": "逐点绘制相连的直线,可以是开放链或封闭轮廓。这是绘制大多数轮廓的基本工具。",
"help.sketch.line.midpoint": "从中点向一端绘制直线,另一端随之对称生成。用于以某点为中心的直线,例如对称的边。",
@@ -1813,7 +1794,6 @@
"help.view.navigate": "按步骤旋转、平移或缩放视图,例如向左转四分之一圈。用于精确移动相机,而不是靠拖动。",
"help.view.navigation_bar": "显示或隐藏视口底部的导航栏。隐藏可腾出空间,显示便于用鼠标使用视图工具。",
"help.view.rename": "为已保存的命名视图改名。视图本身保持不变。",
"help.view.ribbon_tabs_only": "将功能区折叠为选项卡行,让视图得到面板原先占用的空间。单击选项卡可在视图上方显示其面板;再次选择此命令则始终显示完整的功能区。",
"help.view.save": "将当前相机位置作为命名视图保存到设计中。用于以后回到同一角度,例如截图。",
"help.view.spin": "让视图持续绕模型环绕,直到下一次点击或按键。用于从各个方向展示模型。",
"help.view.tool": "锁定一个相机工具(环绕、平移或缩放),之后用鼠标左键拖动即可移动视图,直到关闭。用于触控板或没有鼠标中键时。",
@@ -2297,9 +2277,6 @@
"prefs.auto_operation_note": "根据材料接触的对象选择合并、新建实体或切割。",
"prefs.axes": "坐标轴",
"prefs.axis": "轴",
"prefs.background_choose": "选择图片…",
"prefs.background_image": "图片",
"prefs.background_unreadable": "无法读取背景图片",
"prefs.blur_cost": "相对渲染开销。条形越多,通常意味着处理工作越多。",
"prefs.blur_device": "此图形设备或渲染路径不支持此功能",
"prefs.blur_guard": "已降低模糊质量,以保持画面响应。模糊半径未改变。",
@@ -2321,8 +2298,6 @@
"prefs.browser_eye_left": "折叠箭头旁的眼睛图标",
"prefs.browser_eye_left_note": "浏览器各行的显示切换像以前一样位于折叠箭头旁,而不是在行右端的一列中。",
"prefs.browser_reveal_on_hover": "悬停时显示",
"prefs.browser_rows_start_closed": "浏览器中的行默认折叠",
"prefs.browser_rows_start_closed_note": "浏览器中的放置和文件夹默认折叠,因此包含大量组件的设计只显示顶层行。每一行可通过其箭头、“全部展开”或“在浏览器中查找”打开;“在浏览器中查找”只展开通往该实体的行,并重新折叠上次查找展开的行。在 3D 视图中选取实体不会改变浏览器。关闭时文件夹默认展开,放置按“组件初始展开”的设置显示,在 3D 视图中选取会使浏览器展开到该实体,与以前相同。",
"prefs.browser_show_note": "“显示”让浏览器始终留在屏幕上。“悬停时显示”会将其隐藏,直到指针移到它的位置或其左边缘的细标签上;指针在其中或其菜单打开时,它保持打开。",
"prefs.browser_shown": "显示",
"prefs.built_in": "内置",
@@ -2333,7 +2308,6 @@
"prefs.carousel_previous": "上一个",
"prefs.choose_font": "选择字体文件…",
"prefs.click": "单击",
"prefs.command_dialog_values": "命令对话框",
"prefs.contact_shading": "柔和接触阴影",
"prefs.contact_shading_note": "在零件相近处添加柔和阴影。",
"prefs.context_menu": "上下文菜单",
@@ -2429,8 +2403,6 @@
"prefs.graphics_page.surfaces_edges": "曲面与边",
"prefs.graphics_page.view_bar": "也可在视图栏中设置",
"prefs.graphics_presets_note": "预设会同时设置以下选项。",
"prefs.ground_shadow_follows_model": "地面阴影跟随模型",
"prefs.ground_shadow_follows_model_help": "将阴影放在可见实体的最低点下方。关闭时,抬高模型的阴影仍位于经过原点的地面上。",
"prefs.hide_constraint_glyphs_zoomed_out": "缩小时隐藏约束符号",
"prefs.hide_constraint_glyphs_zoomed_out_note": "草图缩小到一定程度时隐藏约束符号,以免遮挡草图。关闭:任意缩放比例下符号仍保持固定屏幕大小。",
"prefs.history": "历史",
@@ -2457,10 +2429,6 @@
"prefs.invert_curved_roll_arrows_note": "立方体角落的两个弯曲箭头在屏幕平面内翻滚视图。开启:顺时针箭头逆时针翻滚,逆时针箭头顺时针翻滚。关闭:每个箭头按其弯曲方向翻滚视图。",
"prefs.invert_navigator_arrows": "反转视图立方体的旋转箭头",
"prefs.invert_navigator_arrows_note": "立方体周围的箭头按箭头所指的方向转动相机,与 Fusion 和 Inventor 相同:左侧箭头指向右,相机向右转动。关闭:箭头把立方体转向它所在的那一面,因此左侧箭头使相机向左转动。弯曲的翻滚箭头不受影响。",
"prefs.keep_unsaved_also_asks": "关闭标签页时仍然询问",
"prefs.keep_unsaved_also_asks_tip": "关闭此项后,只要每个未保存设计的副本都是最新的,标签页就会直接关闭,不显示浏览器的提示框。",
"prefs.keep_unsaved_in_browser": "在此浏览器中保留未保存的工作",
"prefs.keep_unsaved_in_browser_tip": "每个打开的设计的未保存更改都会在此浏览器的私有存储中保持最新。下次访问时会提示恢复。",
"prefs.keep_work_on_tab_switch": "切换设计时保持对话框和工具打开",
"prefs.keep_work_on_tab_switch_note": "每个设计标签页保留其打开的对话框或工具(包括其中已选择和输入的内容)以及工具栏选项卡。回到该设计时它们仍在原处。关闭时:切换设计会取消它们并显示“模型”选项卡。",
"prefs.labels": "标签",
@@ -2472,8 +2440,6 @@
"prefs.layout_page.card": "卡片",
"prefs.layout_page.column": "列",
"prefs.layout_page.hover": "悬停",
"prefs.layout_page.hover_panel_menus": "悬停切换面板菜单",
"prefs.layout_page.hover_panel_menus_help": "点击功能区的面板名称打开菜单。将指针悬停在另一面板名称上即可切换菜单。将指针移到功能区和已打开菜单之外即可关闭菜单。",
"prefs.layout_page.icons_labels": "图标+标签",
"prefs.layout_page.ok_cancel": "确定和取消",
"prefs.layout_page.on_hover": "悬停时",
@@ -2576,8 +2542,6 @@
"prefs.quality_smoother": "更平滑",
"prefs.quick_measure": "在视图角落显示快速测量",
"prefs.quick_measure_note": "在视图右下角、历史记录上方显示所选对象的尺寸:边的长度(圆形边显示 Ø 和 R)、面的面积、点的位置、两个对象之间的距离和角度、多条边或多个面的总和。点击即可复制。",
"prefs.remember_dialog_values": "记住命令对话框的值",
"prefs.remember_dialog_values.help": "默认关闭。开启后,命令成功执行后,在关闭 SolidCraft 前,下次打开同一命令时会重用其安全的值和选项。",
"prefs.render_previous_geometry_budget": "使用先前的渲染预览几何内存预算",
"prefs.render_previous_geometry_budget_help": "恢复先前的固定几何内存上限(64位桌面为512 MiB,其他平台为128 MiB),替代基于设备的预算。",
"prefs.reports_saved": "已保存 {n} 份",
@@ -2586,8 +2550,6 @@
"prefs.ribbon_click_ends_tool_note": "单击正在使用的草图工具的高亮功能区按钮会结束该工具,在视图中单击即可再次选择。关闭:单击会重新启动该工具。",
"prefs.ribbon_reveal": "在功能区中显示搜索结果",
"prefs.ribbon_reveal_note": "将指针悬停在“搜索命令”的结果上时,会显示该命令在功能区中的位置:其选项卡、按钮或面板下拉菜单中的行。从搜索启动的命令会在那里闪烁,从下拉菜单运行的命令会标记其面板。",
"prefs.ribbon_tabs_only": "仅显示功能区的选项卡",
"prefs.ribbon_tabs_only_note": "功能区折叠为选项卡行。单击选项卡会在视图上方显示其面板,直到命令开始或指针离开面板。“视图”选项卡中的“仅功能区选项卡”或其快捷键可切换此项。",
"prefs.right_click": "右键单击",
"prefs.saving": "启动和保存",
"prefs.scale_note": "也可在窗口中使用 Ctrl + / Ctrl −。100% 时按钮高度为 28 像素。",
@@ -2795,12 +2757,6 @@
"recovery.just_now": "刚刚",
"recovery.min_ago": "{count} 分钟前",
"recovery.never_saved": "从未保存",
"recovery.open_saved": "打开已保存的版本",
"recovery.restore": "恢复",
"recovery.restore_intro": "此页面上次关闭时未保存的更改保留在此浏览器中。",
"recovery.restore_row": "{name},更改于{when}",
"recovery.restore_title": "恢复未保存的设计?",
"recovery.restore_title_one": "恢复未保存的设计:{name},更改于{when}?",
"refused.change": "无法更改 {body}。",
"refused.cut": "无法切割 {body}。",
"refused.face_curved": "它的一个曲面无法用于建模。",
@@ -3322,11 +3278,9 @@
"render.frame_wide": "16:9 · 宽屏",
"render.gpu_depth": "最大路径深度",
"render.gpu_options_help": "采样数、深度、种子和曝光会随此配置保存。仅保存当前图像方法。",
"render.gpu_path_crashed": "上次在此图形适配器上设置时 SolidCraft 关闭了,很可能是在图形驱动程序内部,因此不会再自动设置。请改用 CPU 光线追踪,或重试(更新驱动程序后也会重试)。",
"render.gpu_path_failed": "GPU 路径追踪器不可用",
"render.gpu_path_first_setup": "首次在此 GPU 上设置可能需要几分钟,期间 SolidCraft 仍可正常使用。之后启动时,如果驱动程序保留了已编译的着色器,将直接复用。",
"render.gpu_path_preparing": "GPU 路径追踪器:正在编译着色器…",
"render.gpu_path_retry": "重试",
"render.gpu_seed": "随机种子",
"render.gpu_unavailable": "此设备上的 GPU 路径追踪尚未就绪。",
"render.ground_apply": "适配并保存地面",
@@ -3940,7 +3894,6 @@
"render.stage_panels.extent": "范围",
"render.stage_panels.fit_save": "适配并保存",
"render.stage_panels.gpu_required": "需要 GPU 路径追踪",
"render.stage_panels.grain_angle": "木纹角度",
"render.stage_panels.keep": "保留",
"render.stage_panels.kept": "保留",
"render.stage_panels.kept_fields": "相机、采样、图像尺寸、光学绑定、CAD 几何体和工程属性。",
@@ -4059,19 +4012,6 @@
"render.subsurface_enable": "内部散射随机游走",
"render.subsurface_help": "仅适用于封闭介质。散射和RGB吸收使用独立的每毫米系数。路径在实际几何内部散射,并在边界折射或反射。关闭直线透射阴影、表面降噪和外部体积;使用一个菲涅耳分层。这不是扩散着色器、密度网格或实测材料。高密度可能需要更多样本和路径深度。",
"render.subsurface_rate": "散射碰撞率",
"render.surface_import.author": "作者",
"render.surface_import.busy": "正在导入图像…",
"render.surface_import.complete": "请选择图像并填写作者、来源和许可。",
"render.surface_import.embedded": "导入的图像",
"render.surface_import.failed": "图像导入未完成。",
"render.surface_import.license": "许可 / 所有权",
"render.surface_import.raytrace_required": "图像需要 CPU 或 GPU 光线追踪。请在输出中选择。",
"render.surface_import.repeat_u": "U 方向重复",
"render.surface_import.repeat_v": "V 方向重复",
"render.surface_import.save": "将图像保存到实体",
"render.surface_import.saved_cpu": "保存贴图以用于 CPU 渲染。",
"render.surface_import.source": "来源",
"render.surface_import.title": "导入图像",
"render.tone_aces_fitted": "ACES 拟合",
"render.tone_reinhard": "Reinhard",
"render.transmission_scope": "GPU 玻璃支持经过验证且互不相交的介质;不支持任意嵌套介质,也不提供无噪声透射估计器。",
@@ -4148,8 +4088,6 @@
"sample.plate.name": "示例板",
"sample.vents.about": "按矩形阵列排列的槽:行数、列数和间距均为参数",
"sample.vents.name": "通风板",
"scale.per_axis": "按轴",
"scale.uniform": "等比",
"search.command_keys": "Enter 运行 Shift+Enter 运行并保持打开 Esc 关闭",
"search.commands": "命令",
"search.design": "此设计中",
@@ -4487,7 +4425,6 @@
"ui.3d_sketch": "3D 草图",
"ui.activate": "激活",
"ui.active_component": "活动组件",
"ui.addToQuickAccess": "添加到快速访问",
"ui.add_configuration": "添加配置",
"ui.add_parameter": "添加参数",
"ui.agent_chat": "智能体聊天",
@@ -4822,7 +4759,6 @@
"ui.click_selects_whole_bodies": "单击选择整个实体",
"ui.click_then_press_key": "单击,然后按新按键",
"ui.close": "关闭",
"ui.close_tab": "关闭标签页",
"ui.coil": "螺旋",
"ui.coincident": "重合",
"ui.collapse": "折叠",
@@ -5040,11 +4976,6 @@
"ui.factor": "系数",
"ui.fade": "收尾",
"ui.fade_length": "收尾长度",
"ui.fair_iterations": "迭代次数",
"ui.fair_keep_edges": "保持边",
"ui.fair_strength": "强度",
"ui.fair_surface_title": "曲面光顺",
"ui.fair_tolerance_default": "实体尺寸的 0.001 倍",
"ui.feature_history": "特征历史",
"ui.feature_options": "特征选项",
"ui.features": "特征",
@@ -5230,7 +5161,6 @@
"ui.inspect": "检查",
"ui.instances": "实例数",
"ui.intersect": "相交",
"ui.intersection_curve_second_pick": "相交曲线:单击第二个面或曲线(右键单击重新开始)",
"ui.iso_4753": "ISO 4753",
"ui.isolate": "隔离",
"ui.join": "连接",
@@ -5259,7 +5189,6 @@
"ui.manipulator_free_alt": "操纵器自由拖动也适用于 Alt/Option",
"ui.manipulator_free_alt_tip": "开:在拉伸/小控件箭头上按 Alt/Option 或 Ctrl/Cmd 可关闭数值捕捉。关:仅 Ctrl/Cmd。",
"ui.manufacture": "制造",
"ui.match_surface_title": "曲面匹配",
"ui.material_review.axes": "材料局部坐标轴;不指定实体方向。",
"ui.material_review.claims": "来源和许可证声明未经核实。缺失值保持未知。",
"ui.material_review.compressive_strength": "抗压强度",
@@ -5282,9 +5211,6 @@
"ui.material_review.title": "检查物理材料数据",
"ui.material_review.unknown": "未知",
"ui.material_review.yield_strength": "屈服强度",
"ui.mcp_agents": "通过 MCP 连接的代理",
"ui.mcp_compact": "紧凑输出",
"ui.mcp_compact_note": "适用于通过 MCP 服务器 (solidcraft-cli mcp) 连接的代理:inspect_design 汇总草图,工具结果不做美化排版,从而占用更少的 token。更改后新开始的代理会话生效;--compact 或 SOLIDCRAFT_MCP_COMPACT=1 也会开启它。",
"ui.measure": "测量",
"ui.mesh_format_3mf": "3MF",
"ui.mesh_format_3mf_tagged": "带面标签的 3MF",
@@ -5326,7 +5252,6 @@
"ui.options": "选项",
"ui.orbit": "环绕",
"ui.orbit_around": "环绕",
"ui.organize": "整理",
"ui.orientation": "定向",
"ui.origin": "原点",
"ui.palette_construction_mode": "构造模式 (X)",
@@ -5371,7 +5296,6 @@
"ui.point_cloud_add_filter": "添加筛选…",
"ui.point_cloud_auto_range": "自动范围",
"ui.point_cloud_color_by": "着色方式",
"ui.point_cloud_dots": "独立点",
"ui.point_cloud_file_colors": "文件颜色",
"ui.point_cloud_filter_by": "筛选依据",
"ui.point_cloud_height_high": "最高高度",
@@ -5416,7 +5340,6 @@
"ui.quality": "质量",
"ui.quantity": "数量",
"ui.quantity_2": "数量 2",
"ui.quick_access_full": "快速访问栏最多容纳 {count} 个命令;请先移除一个再添加",
"ui.quit": "退出",
"ui.radial_context_menu": "环形上下文菜单",
"ui.radius": "半径",
@@ -5434,7 +5357,6 @@
"ui.relink_not_linked": "此组件未链接到源设计。",
"ui.relink_select_one": "请先选择一个链接组件或其实例。",
"ui.relink_source_all": "重新链接源文件(所有实例)…",
"ui.removeFromQuickAccess": "从快速访问中移除",
"ui.removeFromToolbar": "从工具栏移除",
"ui.removeSection": "移除剖面",
"ui.render": "渲染",
+23 -166
View File
@@ -883,10 +883,10 @@ fn fs_line_all(i: LOut) -> @location(0) vec4<f32> {
return out_color(i.c);
}
// Point clouds and their cells (`view/clouds.rs`): dots, segments as beads (or lines when they
// have no size) and triangles, from one record per element. The cloud's style colours them by
// their own colour, a ramp or a palette, and shows only those whose filtered values lie in its
// ranges or sets; values vary across an element, so a range cuts it where its value crosses an end.
// Point clouds (`view/clouds.rs`): each point is a round dot a few pixels across, facing the
// screen, depth-tested and written like the model's faces, so the model hides the points behind
// it and they hide it. The cloud's style colours them by their own colour, a ramp or a palette,
// and shows only those whose filtered values lie in its ranges or sets.
struct Cloud {
style: vec4<f32>, // x: colour (0 own, 1 ramp, 2 palette), y: dot size (px), z, w: ramp range
@@ -895,88 +895,43 @@ struct Cloud {
@group(1) @binding(3) var<uniform> cloud: Cloud;
struct CIn {
@location(0) a: vec3<f32>,
@location(1) b: vec3<f32>,
@location(2) c: vec3<f32>,
@location(8) before: vec3<f32>,
@location(9) after: vec3<f32>,
@location(3) v: vec3<f32>,
@location(4) f0: vec3<f32>,
@location(5) f1: vec3<f32>,
@location(10) f2: vec3<f32>,
@location(11) f3: vec3<f32>,
@location(6) size: vec2<f32>,
@location(7) rgb: vec4<f32>,
@location(0) p: vec3<f32>,
@location(1) v: f32,
@location(2) f: vec4<f32>,
@location(3) rgb: vec4<f32>,
};
struct COut {
@builtin(position) pos: vec4<f32>,
@location(0) wp: vec3<f32>,
@location(1) n: vec3<f32>, // zero: not lit
@location(2) v: f32,
@location(3) f: vec4<f32>,
@location(4) rgb: vec3<f32>,
@location(5) at: vec2<f32>, // a dot's place on its disc
@location(6) @interpolate(flat) has: u32,
@location(1) v: f32,
@location(2) f: vec4<f32>,
@location(3) rgb: vec3<f32>,
@location(4) at: vec2<f32>, // the place on its disc
@location(5) @interpolate(flat) has: u32,
};
fn cloud_out(i: CIn, w: vec3<f32>, wp: vec3<f32>, pos: vec4<f32>, n: vec3<f32>) -> COut {
var o: COut;
o.pos = pos;
o.wp = wp;
o.n = n;
o.v = dot(w, i.v);
o.f = vec4<f32>(dot(w, i.f0), dot(w, i.f1), dot(w, i.f2), dot(w, i.f3));
o.rgb = i.rgb.rgb;
o.at = vec2<f32>(0.0);
o.has = u32(round(i.rgb.a * 255.0));
return o;
}
fn behind(c: vec4<f32>) -> bool {
return near_z(c) < 0.0;
}
@vertex
fn vs_cloud_dot(@builtin(vertex_index) vi: u32, i: CIn) -> COut {
var xs = array<f32, 6>(-1.0, 1.0, 1.0, -1.0, 1.0, -1.0);
var ys = array<f32, 6>(-1.0, -1.0, 1.0, -1.0, 1.0, 1.0);
let at = vec2<f32>(xs[vi], ys[vi]);
let size = max(cloud.style.y, 1.0);
let centre = u.vp * vec4<f32>(i.a, 1.0);
var pos = vec4<f32>(centre.xy + at * size / u.screen.xy * centre.w, centre.z, centre.w);
if (behind(centre)) { pos = vec4<f32>(0.0, 0.0, 0.0, -1.0); }
var o = cloud_out(i, vec3<f32>(1.0, 0.0, 0.0), i.a, pos, vec3<f32>(0.0));
let centre = u.vp * vec4<f32>(i.p, 1.0);
var o: COut;
o.pos = vec4<f32>(centre.xy + at * size / u.screen.xy * centre.w, centre.z, centre.w);
// Behind the eye: nothing.
if (near_z(centre) < 0.0) { o.pos = vec4<f32>(0.0, 0.0, 0.0, -1.0); }
o.wp = i.p;
o.v = i.v;
o.f = i.f;
o.rgb = i.rgb.rgb;
o.has = u32(round(i.rgb.a * 255.0));
// Dots under two pixels are squares: a disc that small loses its centre pixel.
o.at = at * select(1.0, 0.0, size < 2.0);
return o;
}
/// The least half-width of a segment on screen, in pixels.
const MIN_HALF_PX: f32 = 0.75;
/// The frame of a bead along `d`: along it, across it level, and up, its height axis.
fn bead_frame(d: vec3<f32>) -> mat3x3<f32> {
var t = vec3<f32>(1.0, 0.0, 0.0);
if (length(d) > 1e-9) { t = d / length(d); }
var side = cross(vec3<f32>(0.0, 0.0, 1.0), t);
if (length(side) < 1e-6) { side = vec3<f32>(1.0, 0.0, 0.0); }
side = normalize(side);
return mat3x3<f32>(t, side, cross(t, side));
}
/// Corner `j` (0…9) of a bead's cross-section, a stadium: its place across and up, and its
/// normal. Corners 0…4 go up the right half-disc, 5…9 down the left one, so 4–5 is the flat top
/// and 9–0 the flat bottom.
fn stadium(j: u32, size: vec2<f32>) -> vec4<f32> {
let k = j % 10u;
let right = k < 5u;
let a = -1.5707963 + 0.7853982 * f32(k % 5u) + select(3.1415927, 0.0, right);
let r = 0.5 * size.y;
let flat_half = 0.5 * max(size.x - size.y, 0.0);
return vec4<f32>(select(-flat_half, flat_half, right) + r * cos(a), r * sin(a), cos(a), sin(a));
}
/// Whether filter `f` keeps the value `v`.
fn cloud_keeps(f: vec4<f32>, v: f32) -> bool {
if (f.x < 0.5) { return true; }
@@ -985,101 +940,6 @@ fn cloud_keeps(f: vec4<f32>, v: f32) -> bool {
return k >= 0 && k < 32 && ((bitcast<u32>(f.w) >> u32(k)) & 1u) != 0u;
}
/// Whether filter `f` leaves out a whole element with values `v` at its corners: all on one
/// side of a range, or one value at every corner, not kept. A set of values with corners that
/// differ may keep part of the element: its fragments decide.
fn cloud_drops(f: vec4<f32>, v: vec3<f32>) -> bool {
if (f.x > 1.5) { return all(v == vec3<f32>(v.x)) && !cloud_keeps(f, v.x); }
return f.x > 0.5 && (all(v < vec3<f32>(f.y)) || all(v > vec3<f32>(f.z)));
}
/// Whether a filter leaves out the whole element.
fn filtered_out(i: CIn) -> bool {
let has = u32(round(i.rgb.a * 255.0));
let values = array<vec3<f32>, 4>(i.f0, i.f1, i.f2, i.f3);
for (var k = 0u; k < 4u; k++) {
if (((has >> k) & 1u) != 0u && cloud_drops(cloud.filters[k], values[k])) { return true; }
}
return false;
}
/// The part in front of the near plane of the segment between clip-space `a` and `b`, as
/// fractions of it from `a`; empty (first above second) when all of it is behind. Clip-space
/// coordinates are affine along a line, so the crossing is exact.
fn in_front(a: vec4<f32>, b: vec4<f32>) -> vec2<f32> {
let za = near_z(a);
let zb = near_z(b);
if (za < 0.0 && zb < 0.0) { return vec2<f32>(1.0, 0.0); }
let t = za / (za - zb);
return vec2<f32>(select(0.0, t, za < 0.0), select(1.0, t, zb < 0.0));
}
@vertex
fn vs_cloud_segment(@builtin(vertex_index) vi: u32, i: CIn) -> COut {
// Corner `vi % 10` of the cross-section at the start (`vi < 10`) or the end; the index
// buffer joins them into the bead's sides.
let pa = u.vp * vec4<f32>(i.a, 1.0);
let pb = u.vp * vec4<f32>(i.b, 1.0);
let part = in_front(pa, pb);
if (filtered_out(i) || part.x > part.y) {
return cloud_out(i, vec3<f32>(1.0, 0.0, 0.0), i.a, vec4<f32>(0.0, 0.0, 0.0, -1.0), vec3<f32>(0.0));
}
// Where the near plane cuts it, the bead ends there, square; its numbers are exact at `e`.
let at_end = vi >= 10u;
let e = select(part.x, part.y, at_end);
let cut = e != select(0.0, 1.0, at_end);
let f = bead_frame(i.b - i.a);
let c = stadium(vi % 10u, i.size);
let axis = mix(i.a, i.b, e);
// Where it meets the next or the previous bead, the cross-section lies in the plane halfway
// between their directions, stretched across to keep its width: both beads end on the same
// section. A turn sharper than 120° ends square instead.
let other = select(i.a - i.before, i.after - i.b, at_end);
var across_dir = f[1];
var stretch = 1.0;
if (!cut && length(other) > 1e-9) {
let g = bead_frame(other);
let mid = f[1] + g[1];
if (length(mid) > 1e-6 && dot(normalize(mid), f[1]) > 0.5) {
across_dir = normalize(mid);
stretch = 1.0 / dot(across_dir, f[1]);
}
}
let wp = axis + across_dir * (c.x * stretch) + f[2] * c.y;
let ca = u.vp * vec4<f32>(axis, 1.0);
let cw = u.vp * vec4<f32>(wp, 1.0);
let half = u.screen.xy * 0.5;
var pos = cw;
// At least a pixel and a half across: a bead seen from afar, or a line without size. A corner
// behind the eye has no place on the screen and needs no widening: the rasteriser clips it.
if (cw.w > 0.0) {
let c0 = mix(pa, pb, part.x);
let c1 = mix(pa, pb, part.y);
let along = (c1.xy / c1.w - c0.xy / c0.w) * half;
var across = vec2<f32>(-along.y, along.x);
if (length(across) < 1e-6) { across = vec2<f32>(1.0, 0.0); }
across = normalize(across);
var px = (cw.xy / cw.w - ca.xy / ca.w) * half;
if (length(px) < MIN_HALF_PX * abs(c.z)) {
px = across * c.z * MIN_HALF_PX;
pos = vec4<f32>((ca.xy / ca.w + px / half) * cw.w, cw.z, cw.w);
}
}
let n = select(f[1] * c.z + f[2] * c.w, vec3<f32>(0.0), i.size.y <= 0.0);
return cloud_out(i, vec3<f32>(1.0 - e, e, 0.0), wp, pos, n);
}
@vertex
fn vs_cloud_triangle(@builtin(vertex_index) vi: u32, i: CIn) -> COut {
// Not `w[vi] = 1.0`: the Windows D3D12 shader compiler cannot write through a dynamic vector index.
let w = vec3<f32>(f32(vi == 0u), f32(vi == 1u), f32(vi == 2u));
let wp = i.a * w.x + i.b * w.y + i.c * w.z;
var n = cross(i.b - i.a, i.c - i.a);
if (length(n) > 0.0) { n = normalize(n); }
// The true clip-space corner, even behind the eye: the rasteriser clips a triangle exactly.
return cloud_out(i, w, wp, u.vp * vec4<f32>(wp, 1.0), n);
}
fn cloud_ramp(t: f32) -> vec3<f32> {
var stops = array<vec3<f32>, 5>(
vec3<f32>(40.0, 70.0, 200.0), vec3<f32>(30.0, 170.0, 230.0), vec3<f32>(60.0, 200.0, 90.0),
@@ -1114,8 +974,5 @@ fn fs_cloud(o: COut) -> @location(0) vec4<f32> {
} else if ((o.has & 16u) != 0u && mode > 0.5) {
c = cloud_ramp((o.v - cloud.style.z) / max(cloud.style.w - cloud.style.z, 1e-12));
}
if (length(o.n) > 0.5) {
c = c * (0.45 + 0.55 * abs(dot(normalize(o.n), normalize(u.back.xyz))));
}
return out_color(vec4<f32>(c, 1.0));
}
+3 -12
View File
@@ -452,14 +452,8 @@ pub enum AxisRef {
SketchAxis { axis: String },
/// World X / Y / Z axis through the origin.
World { axis: String },
/// Any line in the sketch plane, in world coordinates. The origin's coordinates are length
/// expressions, so the axis follows parameter changes.
Line {
#[serde(with = "point_expr")]
#[walk(placement)]
origin: PointExpr,
dir: Dir,
},
/// Any line in the sketch plane, in world coordinates.
Line { origin: Position, dir: Dir },
/// An edge or round face of the model (a straight or circular edge, a cylinder, cone or
/// torus face), found again on each evaluation: [`crate::construct::model_axis`].
Model { geo: GeoRef },
@@ -1050,8 +1044,6 @@ pub enum FeatureKind {
Split {
body: BodyName,
plane: PlaneRef,
// The tool face is picked (and named), so the split follows it (#11674).
#[walk(picks_faces)]
#[serde(default, skip_serializing_if = "Option::is_none")]
tool: Option<FaceAt>,
/// A straight line of this sketch as the tool (#1552): the plane through it along the
@@ -1487,7 +1479,7 @@ pub enum FeatureKind {
},
/// Plastic lip (raised band) or groove (recess) along the rim face picked at `face`.
Lip {
face: FacePick,
face: Position,
#[walk(length = "Width")]
width: Expr,
#[walk(length = "Height")]
@@ -3910,7 +3902,6 @@ impl Document {
/// Read a design file's JSON (any format this build knows; older ones are upgraded).
pub fn from_json(s: &str) -> Result<Document> {
crate::render_resources::check_json_budget(s)?;
crate::render_texture_resources::check_json_budget(s)?;
let mut d = crate::format::read(s)?;
if d.features.len() > MAX_FEATURES || d.params.len() > MAX_PARAMS {
return Err(DocError::Invalid("document too large".into()));
+63 -262
View File
@@ -659,7 +659,7 @@ impl ModelState {
}
/// A digest of everything later features can read: bodies (by content identity), sketches,
/// the body counter, threads, sheet bodies and construction geometry.
/// the body counter, threads and sheet bodies.
fn digest(&self) -> u64 {
let mut h = std::collections::hash_map::DefaultHasher::new();
for b in &self.bodies {
@@ -701,19 +701,12 @@ impl ModelState {
}
serde_json::to_string(&self.threads).unwrap_or_default().hash(&mut h);
serde_json::to_string(&self.sheets).unwrap_or_default().hash(&mut h);
// Construction axes, planes and points so far: features find them here by name, and a
// result taken from the cache brings back the ones it was made with, so one moved past
// a feature must change the key (#9544). A state without any hashes as before.
if !self.construct.is_empty() {
serde_json::to_string(&self.construct).unwrap_or_default().hash(&mut h);
}
h.finish()
}
/// After a feature evaluated to this state from `before` with cache key `key`: bodies it
/// made or changed take that key, sketches it made a digest of their solved geometry (see
/// [`quantize`]); the rest keep theirs.
/// `f` must have gone through [`naming_feature`]: face naming reads no parameter values.
fn stamp(&mut self, doc: &Document, before: &Arc<ModelState>, f: &Feature, key: u64, mats: Vec<Mat>) {
let feature = f.id;
let depth = before.bodies.iter().filter_map(|b| b.names.depth()).max().unwrap_or(0) + 1;
@@ -784,7 +777,7 @@ impl ModelState {
let mut h = std::collections::hash_map::DefaultHasher::new();
serde_json::to_string(&s.plane).unwrap_or_default().hash(&mut h);
let mut sketch = s.sketch.clone();
fingerprint_sketch(&mut sketch);
quantize(&mut sketch);
serde_json::to_string(&sketch).unwrap_or_default().hash(&mut h);
s.report.ok().hash(&mut h);
self.sketch_keys.insert(feature, h.finish());
@@ -1091,8 +1084,8 @@ pub struct Model {
pub no_cache: bool,
/// Results kept besides the cache ([`Model::keep`]).
kept: KeptSlot,
/// Embedded imports' content digests from the last evaluation.
import_digests: ImportDigests,
/// The imported texts' digests the last `evaluate` fingerprinted the features with.
step_digests: StepDigests,
/// The address of the shared document whose fingerprints the results were last given in
/// full, with [`fingerprints_digest`] of them then ([`Model::pinned_prefix`]). Only an
/// address: a reference to the document would make every in-place edit of it a copy.
@@ -1131,7 +1124,7 @@ fn param_names(f: &Feature) -> Vec<String> {
names
}
fn fingerprint(doc: &Document, prev: u64, f: &Feature, vals: &BTreeMap<String, Value>, rolled_back: bool, steps: &ImportDigests) -> u64 {
fn fingerprint(doc: &Document, prev: u64, f: &Feature, vals: &BTreeMap<String, Value>, rolled_back: bool, steps: &StepDigests) -> u64 {
let mut h = std::collections::hash_map::DefaultHasher::new();
prev.hash(&mut h);
rolled_back.hash(&mut h);
@@ -1152,73 +1145,34 @@ fn fingerprint(doc: &Document, prev: u64, f: &Feature, vals: &BTreeMap<String, V
h.finish()
}
/// Content digests for embedded imports. Shared, unchanged arrays/text are read once;
/// feature metadata is still fingerprinted on every evaluation. Rebuilding this map prunes
/// removed features and never trusts an address without retaining and checking its Arc.
/// The digests of the Import features' STEP texts, by feature id, with the text each was taken
/// from. Every evaluation fingerprints every feature, and writing out a design's imported files
/// each time made every command as slow as the files are large: a text is shared (`Arc`), so
/// its digest is taken once and kept while the feature holds that same text.
#[derive(Clone, Debug, Default)]
struct ImportDigests {
steps: std::collections::HashMap<u64, (Arc<str>, u64)>,
meshes: std::collections::HashMap<u64, Vec<MeshDigest>>,
}
struct StepDigests(std::collections::HashMap<u64, (Arc<str>, u64)>);
#[derive(Clone, Debug)]
struct MeshDigest {
positions: Arc<[f64]>,
triangles: Arc<[u32]>,
digest: u64,
}
impl MeshDigest {
fn matches(&self, mesh: &crate::MeshData) -> bool {
Arc::ptr_eq(&self.positions, &mesh.positions) && Arc::ptr_eq(&self.triangles, &mesh.triangles)
}
}
impl ImportDigests {
fn of(doc: &Document, known: &ImportDigests) -> ImportDigests {
let mut out = ImportDigests::default();
for f in &doc.features {
match &f.kind {
FeatureKind::Import { step, .. } => {
let digest = known.get(f.id, step).unwrap_or_else(|| step_text_digest(step));
out.steps.insert(f.id, (step.clone(), digest));
}
FeatureKind::MeshImport { meshes, .. } => {
let digests = meshes
.iter()
.enumerate()
.map(|(index, mesh)| {
let digest = known.mesh(f.id, index, mesh).unwrap_or_else(|| mesh_content_digest(mesh));
MeshDigest { positions: mesh.positions.clone(), triangles: mesh.triangles.clone(), digest }
})
.collect();
out.meshes.insert(f.id, digests);
}
_ => {}
}
}
out
impl StepDigests {
/// The digests of `doc`'s imported texts, reusing `known` for texts it has seen.
fn of(doc: &Document, known: &StepDigests) -> StepDigests {
let texts = doc.features.iter().filter_map(|f| match &f.kind {
FeatureKind::Import { step, .. } => Some((f.id, step)),
_ => None,
});
StepDigests(
texts
.map(|(id, step)| {
let digest = known.get(id, step).unwrap_or_else(|| step_text_digest(step));
(id, (step.clone(), digest))
})
.collect(),
)
}
/// The digest of `step`, when it is the text feature `id` was last seen with.
fn get(&self, id: u64, step: &Arc<str>) -> Option<u64> {
self.steps.get(&id).filter(|(text, _)| Arc::ptr_eq(text, step)).map(|(_, digest)| *digest)
self.0.get(&id).filter(|(text, _)| Arc::ptr_eq(text, step)).map(|(_, digest)| *digest)
}
fn mesh(&self, id: u64, index: usize, mesh: &crate::MeshData) -> Option<u64> {
self.meshes.get(&id)?.get(index).filter(|cached| cached.matches(mesh)).map(|cached| cached.digest)
}
}
fn mesh_content_digest(mesh: &crate::MeshData) -> u64 {
#[cfg(test)]
cost_tests::count(|c| c.mesh_digested += 1);
let mut h = std::collections::hash_map::DefaultHasher::new();
mesh.positions.len().hash(&mut h);
for coordinate in mesh.positions.iter() {
coordinate.to_bits().hash(&mut h);
}
mesh.triangles.hash(&mut h);
h.finish()
}
fn step_text_digest(text: &str) -> u64 {
@@ -1253,20 +1207,13 @@ fn quantize(sk: &mut solidcraft_sketch::Sketch) {
}
}
/// The stored solve as a cache key: on the [`QUANTUM`] grid, without the editor state
/// (see [`solidcraft_sketch::Sketch::clear_id_counters`]).
fn fingerprint_sketch(sk: &mut solidcraft_sketch::Sketch) {
quantize(sk);
sk.clear_id_counters();
}
/// A feature as fingerprinted: its definition, a sketch's stored solve quantized, an imported
/// file's text or mesh payload by its content digest.
/// file's text by its digest.
/// Hash [`feature_json`] of `f` into `h`. Every evaluation fingerprints every feature, and in a
/// design built command by command almost all of them are the same as last time: the text of a
/// feature is kept (by id) with the feature it was written from, and written again only when the
/// feature differs. Embedded imports also depend on their content digests, so their small
/// metadata-and-digest representation is written each time without comparing large arrays.
/// feature differs. An Import's text also depends on its STEP digest, so it is written each time
/// as before.
///
/// The texts are shared by every thread: a command evaluated ahead runs on a new worker thread
/// each time (the desktop's deferred commands and delete checks, the control channel's ahead
@@ -1274,10 +1221,10 @@ fn fingerprint_sketch(sk: &mut solidcraft_sketch::Sketch) {
/// feature again. The lock is held only to look up or store an entry, never while a feature is
/// compared or written; an entry is the same whichever thread wrote it, since the text is a
/// function of the feature alone.
fn hash_feature_json(f: &Feature, steps: &ImportDigests, h: &mut impl Hasher) {
fn hash_feature_json(f: &Feature, steps: &StepDigests, h: &mut impl Hasher) {
type Written = std::collections::HashMap<u64, Arc<(Feature, String)>>;
static WRITTEN: std::sync::LazyLock<std::sync::Mutex<Written>> = std::sync::LazyLock::new(Default::default);
if matches!(f.kind, FeatureKind::Import { .. } | FeatureKind::MeshImport { .. }) {
if matches!(f.kind, FeatureKind::Import { .. }) {
feature_json(f, steps).hash(h);
return;
}
@@ -1300,21 +1247,7 @@ fn hash_feature_json(f: &Feature, steps: &ImportDigests, h: &mut impl Hasher) {
written.insert(f.id, entry);
}
fn feature_json(f: &Feature, steps: &ImportDigests) -> String {
if matches!(&f.kind, FeatureKind::MeshImport { .. }) {
let mut g = f.clone();
let mut digests = Vec::new();
if let FeatureKind::MeshImport { meshes, .. } = &mut g.kind {
for (index, mesh) in meshes.iter_mut().enumerate() {
digests.push(steps.mesh(f.id, index, mesh).unwrap_or_else(|| mesh_content_digest(mesh)));
mesh.positions = Arc::from([]);
mesh.triangles = Arc::from([]);
}
}
// Keep the complete definition (including mesh order, names and colors) without
// writing the large numeric arrays out again. Equal content in fresh Arcs hashes alike.
return serde_json::to_string(&(g, digests)).unwrap_or_default();
}
fn feature_json(f: &Feature, steps: &StepDigests) -> String {
if let FeatureKind::Import { step, .. } = &f.kind {
let mut g = f.clone();
if let FeatureKind::Import { step: text, .. } = &mut g.kind {
@@ -1326,7 +1259,7 @@ fn feature_json(f: &Feature, steps: &ImportDigests) -> String {
if let FeatureKind::Sketch { .. } = &f.kind {
let mut g = f.clone();
if let FeatureKind::Sketch { sketch, .. } = &mut g.kind {
fingerprint_sketch(sketch);
quantize(sketch);
}
return serde_json::to_string(&g).unwrap_or_default();
}
@@ -1389,12 +1322,6 @@ impl Document {
pub fn evaluation_values(&self) -> BTreeMap<String, Value> {
evaluation_values(self).0
}
/// A placement point read as the features read it: the parameters, and a bare number
/// beside them in the design's length unit (#9015).
pub fn eval_point(&self, p: &crate::PointExpr) -> Result<Vec3> {
point(&self.evaluation_values(), p)
}
}
/// The values features are evaluated with: the parameters, and the design's length unit.
@@ -1417,7 +1344,7 @@ fn chain_fingerprint(
f: &Feature,
prev: u64,
rolled_back: bool,
steps: &ImportDigests,
steps: &StepDigests,
st: Option<&ModelState>,
) -> u64 {
let mut fp = fingerprint(doc, prev, f, vals, rolled_back, steps) ^ placement_digest(doc, f, st);
@@ -1495,7 +1422,7 @@ fn context_digest(doc: &Document, vals: &BTreeMap<String, Value>) -> u64 {
for f in doc.features.iter().filter(|f| {
matches!(f.kind, FeatureKind::ConstructionPlane { .. } | FeatureKind::ConstructionAxis { .. } | FeatureKind::ConstructionPoint { .. })
}) {
fingerprint(doc, 0, f, vals, false, &ImportDigests::default()).hash(&mut h);
fingerprint(doc, 0, f, vals, false, &StepDigests::default()).hash(&mut h);
}
doc.units.hash(&mut h);
serde_json::to_string(&doc.sheet).unwrap_or_default().hash(&mut h);
@@ -1577,9 +1504,6 @@ fn cache_key(f: &Feature, chain_fp: u64, local: u64, ctx: u64, state: &ModelStat
#[derive(Default)]
struct PlacementReads {
all: bool,
/// A body named that `st` lacks: a further placement's (`Block (Part:2)`), found through
/// its occurrence (#9957), or gone.
unlisted: bool,
components: std::collections::BTreeSet<u64>,
paths: Vec<Vec<u64>>,
bodies: std::collections::BTreeSet<String>,
@@ -1618,17 +1542,14 @@ impl PlacementReads {
}
}
/// The component of body `name` in `st`; every component and every placement when the body
/// is not there (a further placement's body, or the body nearest its point, wherever that is).
/// The component of body `name` in `st`; every component when the body is not there (a
/// projection then takes the body nearest its point, wherever that is).
fn body(&mut self, doc: &Document, st: Option<&ModelState>, name: &str) {
match st.and_then(|st| st.body(name)) {
Some(b) => {
self.components.insert(doc.model_body_component(b));
}
None => {
self.all = true;
self.unlisted = true;
}
None => self.all = true,
}
}
@@ -1864,9 +1785,6 @@ fn placement_digest(doc: &Document, f: &Feature, st: Option<&ModelState>) -> u64
}
}
hash_placed_bodies(doc, st, &reads.bodies, &inverse, &mut h);
if reads.unlisted {
placements_hash(doc).hash(&mut h);
}
// Legacy and component-wide reads still need the conservative offset dependency. Body
// reads above already include just their own offsets, in the frame that evaluates them.
if reads.all || !reads.components.is_empty() || !reads.paths.is_empty() {
@@ -2004,7 +1922,7 @@ impl Model {
}
// The fingerprints from the first stored sketch on.
let vals = evaluation_values(doc).0;
let steps = ImportDigests::of(doc, &self.import_digests);
let steps = StepDigests::of(doc, &self.step_digests);
let marker = doc.marker.unwrap_or(usize::MAX);
let mut prev_fp = first.checked_sub(1).and_then(|i| self.results.get(i)).map_or(0, |r| r.fingerprint);
for (i, f) in doc.features.iter().enumerate().skip(first) {
@@ -2054,7 +1972,7 @@ impl Model {
return false;
}
let vals = evaluation_values(doc).0;
let steps = ImportDigests::of(doc, &self.import_digests);
let steps = StepDigests::of(doc, &self.step_digests);
let marker = doc.marker.unwrap_or(usize::MAX);
let mut prev = 0;
// The model each feature starts from (which components the bodies it names are in).
@@ -2119,7 +2037,7 @@ impl Model {
let previous_context = self.context;
let mut rolled_results = std::mem::take(&mut self.rolled_results);
self.context = ctx;
self.import_digests = ImportDigests::of(doc, &self.import_digests);
self.step_digests = StepDigests::of(doc, &self.step_digests);
let primed = self.primed.as_ref().filter(|(context, _)| !self.no_cache && *context == ctx).map(|(_, results)| results.clone());
// Each feature's component, for `Document::legacy_body_component` on every body after
// every feature without searching the timeline for each (the first feature with an id).
@@ -2154,7 +2072,7 @@ impl Model {
};
// Opening was cancelled: the rest is skipped and the result discarded.
let cancelled = watched.step(i);
let fp = chain_fingerprint(doc, &vals, f, prev_fp, rolled_back, &self.import_digests, Some(&state));
let fp = chain_fingerprint(doc, &vals, f, prev_fp, rolled_back, &self.step_digests, Some(&state));
prev_fp = fp;
let current = |old: &&FeatureResult| old.id == f.id && old.fingerprint == fp && !old.stale;
// A state the saved model did not keep is evaluated again from the one before it; the
@@ -2230,7 +2148,7 @@ impl Model {
}
// The same feature on the same inputs: its earlier result.
let key =
cache_key(f, fp, fingerprint(doc, 0, f, &vals, false, &self.import_digests) ^ placement_digest(doc, f, Some(&state)), ctx, &state);
cache_key(f, fp, fingerprint(doc, 0, f, &vals, false, &self.step_digests) ^ placement_digest(doc, f, Some(&state)), ctx, &state);
let kept = self.kept.0.as_ref().filter(|_| !self.no_cache);
if !self.no_cache
&& let Some(c) = self
@@ -2365,9 +2283,7 @@ impl Model {
}
_ => mats,
};
// A revolve axis origin that follows parameters names its faces from its values.
let named = naming_feature(&vals, f);
next.stamp(doc, &state, &named, key, mats);
next.stamp(doc, &state, f, key, mats);
// Evaluated again only for what came before it (a mirror moved by a drag).
if let Some(old) = self.results.get(i).filter(|old| old.id == f.id) {
let made = old.state.bodies.iter().filter(|b| b.feature == f.id).map(|b| (b.name.as_str(), b));
@@ -2586,7 +2502,7 @@ impl Model {
pub(crate) fn refingerprint_from(&mut self, doc: &Document, start: usize) {
self.placement_inputs = None;
self.fingerprinted = None;
self.import_digests = ImportDigests::of(doc, &self.import_digests);
self.step_digests = StepDigests::of(doc, &self.step_digests);
let start = start.min(self.results.len()).min(doc.features.len());
if start == self.results.len().min(doc.features.len()) {
return;
@@ -2598,7 +2514,7 @@ impl Model {
// Each feature's fingerprint reads the model it starts from, as evaluating does.
let mut before = last.map_or_else(|| Arc::new(ModelState::default()), |r| r.state.clone());
for (i, (r, f)) in self.results.iter_mut().zip(&doc.features).enumerate().skip(start) {
prev = chain_fingerprint(doc, &vals, f, prev, i >= marker, &self.import_digests, Some(&before));
prev = chain_fingerprint(doc, &vals, f, prev, i >= marker, &self.step_digests, Some(&before));
r.fingerprint = prev;
before = r.state.clone();
}
@@ -3684,11 +3600,10 @@ pub fn hole_on_surface(st: &ModelState, p: Vec3, dir: Vec3, scope: &[String]) ->
/// The faces of the model near `p`: for each, how far `p` is from it, the outward normal there
/// (the surface's own normal for planes, cylinders and spheres, turned the way the face looks out
/// of its body; the nearest mesh facet's otherwise) and, for a plane, how far `p` is from the
/// plane itself. Only faces within `reach` of `p`, nearest first, of the bodies in `scope`
/// (every body when it is empty).
fn faces_through(st: &ModelState, p: Vec3, reach: f64, scope: &[String]) -> Vec<(f64, Vec3, Option<f64>)> {
/// plane itself. Only faces within `reach` of `p`, nearest first.
fn faces_through(st: &ModelState, p: Vec3, reach: f64) -> Vec<(f64, Vec3, Option<f64>)> {
let mut out: Vec<(f64, Vec3, Option<f64>)> = Vec::new();
for b in st.bodies.iter().filter(|b| !b.body.is_mesh() && in_hole_scope(scope, b)) {
for b in st.bodies.iter().filter(|b| !b.body.is_mesh()) {
let m = b.mesh();
// The nearest facet of each face of this body.
let mut near: BTreeMap<u32, (f64, Vec3)> = BTreeMap::new();
@@ -3734,29 +3649,13 @@ fn faces_through(st: &ModelState, p: Vec3, reach: f64, scope: &[String]) -> Vec<
out
}
/// The faces near `p` a hole placed there goes by (as [`faces_through`]): those of the bodies in
/// `scope`, the hole's own, when one of them passes within `on` of `p`, else those of every body.
/// Where a plate's face touches another body both faces pass through `p`, and a hole that drills
/// the plate goes by the plate's face, never the other body's (#12066). A hole placed on another
/// body's face, to drill through it into its own body behind, still goes by that face.
fn hole_faces_through(st: &ModelState, p: Vec3, reach: f64, on: f64, scope: &[String]) -> Vec<(f64, Vec3, Option<f64>)> {
if !scope.is_empty() {
let own = faces_through(st, p, reach, scope);
if own.first().is_some_and(|(d, _, _)| *d <= on) {
return own;
}
}
faces_through(st, p, reach, &[])
}
/// The way a hole placed at `p` drills: into the material, against the outward normal of the
/// face `p` lies on. A point on no face (a planar face's centroid outside it, say) takes the
/// nearest planar face whose plane it lies in, else the face nearest it within its body's pick
/// tolerance. None when no face is near. Where the faces of several bodies pass through `p`, those
/// of the bodies in `scope` (the bodies the hole drills; empty for every body) decide.
pub fn hole_direction_at(st: &ModelState, p: Vec3, scope: &[String]) -> Option<Vec3> {
/// tolerance. None when no face is near.
pub fn hole_direction_at(st: &ModelState, p: Vec3) -> Option<Vec3> {
let size = st.bodies.iter().map(|b| b.body.size()).fold(1.0, f64::max);
let faces = hole_faces_through(st, p, f64::INFINITY, size * 1e-4, scope);
let faces = faces_through(st, p, f64::INFINITY);
if let Some((d, n, _)) = faces.first()
&& *d <= size * 1e-4
{
@@ -3773,13 +3672,10 @@ pub fn hole_direction_at(st: &ModelState, p: Vec3, scope: &[String]) -> Option<V
/// starts on (as designs saved before format 18 can say: their direction was taken from any face
/// whose plane passed near the point, such as the other side of a thin plate or a face of another
/// body at the same height), it is mirrored in the face it starts on, so it goes in at the same
/// angle. A direction that enters a face there, or a spot on no face, is kept. Where the faces of
/// the hole's own bodies (`scope`, see [`hole_drill_scope`]) pass through the spot, only they
/// count: a hole that names the plate it drills, saved with the direction into a body touching
/// the plate there, drills the plate (#12066).
fn hole_dir_into_face(st: &ModelState, p: Vec3, dir: Vec3, scope: &[String]) -> Vec3 {
/// angle. A direction that enters a face there, or a spot on no face, is kept.
fn hole_dir_into_face(st: &ModelState, p: Vec3, dir: Vec3) -> Vec3 {
let size = st.bodies.iter().map(|b| b.body.size()).fold(1.0, f64::max);
let faces = hole_faces_through(st, p, size * 1e-5, size * 1e-5, scope);
let faces = faces_through(st, p, size * 1e-5);
if faces.is_empty() || faces.iter().any(|(_, n, _)| n.dot(dir) < -1e-9) {
return dir;
}
@@ -4251,26 +4147,10 @@ fn blend_body(
Ok((Traced::step(nb.with_preserved_planar_sources(&mb.body)?, &[&from]), used, tapered))
}
/// `f` as the naming of its faces reads it: a revolve's explicit axis origin written as the values
/// it has now (the naming has no parameter values to read an expression with).
fn naming_feature<'a>(vals: &BTreeMap<String, Value>, f: &'a Feature) -> std::borrow::Cow<'a, Feature> {
if let FeatureKind::Revolve { axis: AxisRef::Line { origin, .. }, .. } = &f.kind
&& let Ok(o) = point(vals, origin)
{
let mut g = f.clone();
if let FeatureKind::Revolve { axis: AxisRef::Line { origin, .. }, .. } = &mut g.kind {
*origin = [format!("{} mm", o.x).into(), format!("{} mm", o.y).into(), format!("{} mm", o.z).into()];
}
return std::borrow::Cow::Owned(g);
}
std::borrow::Cow::Borrowed(f)
}
/// The revolve axis in the sketch's plane coordinates (a point and a direction). `st` is the model
/// an axis on an edge or face of it is found in; `construct` gives a construction axis, by name, in
/// the sketch's 3D frame; `vals` are the parameter values an explicit axis's origin is read with.
/// the sketch's 3D frame.
pub(crate) fn revolve_axis(
vals: &BTreeMap<String, Value>,
ss: &SolvedSketch,
axis: &AxisRef,
st: &ModelState,
@@ -4305,7 +4185,7 @@ pub(crate) fn revolve_axis(
}
Ok((pl.to_local(Vec3::ZERO), Vec2::new(d.dot(pl.x), d.dot(pl.y))))
}
AxisRef::Line { origin, dir } => line_in_sketch_plane(ss, point(vals, origin)?, dir.0),
AxisRef::Line { origin, dir } => line_in_sketch_plane(ss, origin.0, dir.0),
AxisRef::Model { geo } => {
let (o, d) = crate::construct::model_axis(st, geo)?;
line_in_sketch_plane(ss, o, d)
@@ -4414,13 +4294,6 @@ fn hole_scope(f: &Feature) -> &[String] {
}
}
/// The bodies whose faces decide which way a hole placed at a position drills, where they pass
/// through it: the bodies it cuts when it names them, so a body touching the face there can't
/// turn it round (#12066). Empty (every body) otherwise, and for `["*"]`.
fn hole_drill_scope(f: &Feature) -> &[String] {
if f.participants.iter().any(|b| b == "*") { &[] } else { &f.participants }
}
fn in_hole_scope(scope: &[String], b: &ModelBody) -> bool {
scope.is_empty() || scope.contains(&b.name)
}
@@ -4446,7 +4319,7 @@ fn hole_spots(vals: &BTreeMap<String, Value>, st: &ModelState, f: &Feature) -> R
let dir = direction.normalized().ok_or_else(|| DocError::Invalid("hole direction".into()))?;
let at = hole_on_surface(st, single_hole_position(vals, st, position, at, points)?, dir, &[]);
let at = with_references(vals, st, f, at, dir, true)?;
let dir = hole_dir_into_face(st, at, dir, hole_drill_scope(f));
let dir = hole_dir_into_face(st, at, dir);
return Ok((vec![hole_on_surface(st, at, dir, &[])], dir));
}
};
@@ -4494,7 +4367,7 @@ fn hole_spots_raw(vals: &BTreeMap<String, Value>, st: &ModelState, f: &Feature)
let dir = direction.normalized().ok_or_else(|| DocError::Invalid("hole direction".into()))?;
let p = single_hole_position(vals, st, position, at, points)?;
let p = if hole_references(f).is_empty() { p } else { with_references(vals, st, f, hole_on_surface(st, p, dir, &[]), dir, false)? };
Ok((vec![p], hole_dir_into_face(st, hole_on_surface(st, p, dir, &[]), dir, hole_drill_scope(f))))
Ok((vec![p], hole_dir_into_face(st, hole_on_surface(st, p, dir, &[]), dir)))
}
}
}
@@ -5418,9 +5291,8 @@ fn feature_tools_with_constructor(
f,
)?;
let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);
let (o, d) = revolve_axis(vals, &ss, axis, &*axis_state(doc, st, f.component, axis)?, &|name| {
construction_axis_in(Some(doc), st, name, f.component)
})?;
let (o, d) =
revolve_axis(&ss, axis, &*axis_state(doc, st, f.component, axis)?, &|name| construction_axis_in(Some(doc), st, name, f.component))?;
// To Object is in this feature's component frame: the model as seen from there.
let tst = if to.is_some() { state_in_frame(doc, st, f.component)? } else { std::borrow::Cow::Borrowed(st) };
let angles = if to.is_some() {
@@ -6742,24 +6614,6 @@ fn replay(
}
continue;
}
// A moved copy is copied again as a body: each instance is the copy the Move made,
// placed by the pattern (#5931).
if let FeatureKind::Move { copy: true, .. } = &src.kind {
let made: Vec<ModelBody> = st.bodies.iter().filter(|b| b.feature == src.id).cloned().collect();
if made.is_empty() {
return Err(DocError::Invalid(format!("{} made no copy to repeat", src.name)));
}
let mut output = 0;
for (k, m) in mats.iter().enumerate() {
for mb in &made {
let moved = moved_copy(mb, kernel::transform_matrix(&mb.body, *m)?, first + k + 1);
let name = copy_body_name(st, f, output, &mb.name);
st.bodies.push(ModelBody::traced_new(name, moved, f.id));
output += 1;
}
}
continue;
}
let (op, targets) = feature_op(src);
// A primitive's or a hole's targets are its participants (#1108): the copies change
// those bodies only, like the feature itself (#2755).
@@ -7266,7 +7120,7 @@ fn eval_feature(
| FeatureKind::Rib { .. }
| FeatureKind::ReplaceFace { .. }
| FeatureKind::Align { .. }
| FeatureKind::Remove { .. } => more::eval(doc, vals, f, st, warning),
| FeatureKind::Remove { .. } => more::eval(doc, vals, f, st),
FeatureKind::Sketch { plane, sketch } => {
let anchor = crate::face_anchor::plane_face_anchor(plane);
let fst = match anchor {
@@ -7277,14 +7131,6 @@ fn eval_feature(
None if !plane_reads_geometry(plane) && sketch.links.is_empty() => std::borrow::Cow::Borrowed(st),
None => state_in_frame(doc, st, f.component)?,
};
// A further placement a link reads is placed in its frame too (#9957).
let named: Vec<&str> = sketch.links.iter().flat_map(|l| l.source.bodies()).collect();
let fst = match anchor.map(|anchor| anchor.author_frame(doc, f.component)) {
_ if named.is_empty() => fst,
Some(Ok(frame)) => with_placed_copies(doc, st, fst, &frame, &named),
Some(Err(_)) => fst,
None => with_placed_copies(doc, st, fst, &doc.component_transform(f.component), &named),
};
let (plane, face_warning) = match (anchor, plane) {
(Some(_), plane) => doc.resolve_attached_plane_noted(vals, plane, f.component, st, &fst)?,
// A flat face of a sheet: the panel's exact plane, from its flat region and fold.
@@ -8522,51 +8368,6 @@ pub fn state_in_frame_at<'a>(doc: &Document, st: &'a ModelState, comp: u64, fram
Ok(Cow::Owned(out))
}
/// `framed` (the model `st` in the frame that `frame` places in the world) with the further
/// placements `names` names (`Block (Part:2)`), where they are in the world. A component's model
/// holds its first placement only, so a sketch projecting a copy's face found no body of that
/// name and took the first placement's (#9957). Only the named ones are placed: placing every
/// body of an assembly for each sketch made sketch edits as slow as the design is big.
pub fn with_placed_copies<'a>(
doc: &Document,
st: &ModelState,
framed: std::borrow::Cow<'a, ModelState>,
frame: &Mat,
names: &[&str],
) -> std::borrow::Cow<'a, ModelState> {
let missing: Vec<&str> = names.iter().copied().filter(|n| !n.is_empty() && framed.body(n).is_none()).collect();
if missing.is_empty() || doc.occurrences.is_empty() {
return framed;
}
let Some(inv) = crate::mat_inverse(frame) else { return framed };
let mut by_component: std::collections::HashMap<u64, Vec<&ModelBody>> = std::collections::HashMap::new();
for (b, owner) in st.bodies.iter().zip(doc.model_body_components(st)) {
by_component.entry(owner).or_default().push(b);
}
let world = crate::WorldNames::new(doc, st);
let mut placed: Vec<ModelBody> = Vec::new();
for (comp, path, m) in doc.placements() {
for b in by_component.get(&comp).into_iter().flatten() {
let name = world.name(&b.name, comp, &path);
if !missing.contains(&name.as_str()) || placed.iter().any(|p| p.name == name) {
continue;
}
let bm = doc.model_body_offset(b).map(|o| crate::mat_mul(&m, o)).unwrap_or(m);
if let Ok(mut copy) = st.body_in_frame(b, &crate::mat_mul(&inv, &bm)) {
copy.name = name;
copy.source_name = Some(b.definition_name().to_string());
placed.push(copy);
}
}
}
if placed.is_empty() {
return framed;
}
let mut out = framed.into_owned();
out.bodies.extend(placed);
std::borrow::Cow::Owned(out)
}
/// The model placed in the world: each component's bodies, sketches, threads and construction
/// geometry through every occurrence of it (bodies of the first placement keep their names;
/// further instances get the occurrence path in brackets). Without components this is the model
+1 -150
View File
@@ -16,7 +16,7 @@ use solidcraft_sketch::Sketch;
use crate::eval::{PlacementReads, body_world, hash_placement, placement_digest};
use crate::*;
/// Work counted on this thread: bodies moved, STEP/mesh contents digested, joint faces and bodies
/// Work counted on this thread: bodies moved, STEP texts digested, joint faces and bodies
/// measured, bodies searched for by name, features searched for by id, bodies a cut (or
/// intersect) ran its booleans on, bodies searched for the cylinder a tap marking lies on,
/// bodies whose faces a tapped hole read for its wall, intersects run to find a pattern's copies
@@ -26,7 +26,6 @@ use crate::*;
pub(super) struct Counts {
pub moved: usize,
pub digested: usize,
pub mesh_digested: usize,
pub joint_faces: usize,
pub measures: usize,
pub body_searches: usize,
@@ -43,7 +42,6 @@ thread_local! {
Cell::new(Counts {
moved: 0,
digested: 0,
mesh_digested: 0,
joint_faces: 0,
measures: 0,
body_searches: 0,
@@ -1639,150 +1637,3 @@ fn tools_are_apart_only_when_they_neither_meet_nor_nest() {
// A rod in the tube's bore, clear of its wall, is apart from it.
assert!(super::tools_clearly_apart(&[tube, rod(0.0, 0.0, 3.0)]));
}
fn imported_meshes() -> Document {
let mut doc = Document::new("reference meshes");
let comp = doc.add_component(Some("Part"), 0).unwrap();
let meshes = (0..2)
.map(|i| MeshData {
name: format!("Mesh{i}"),
positions: [0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 4.0].into(),
triangles: [0, 2, 1, 0, 1, 3, 0, 3, 2, 1, 2, 3].into(),
color: Some([0.2, 0.4, 0.6]),
})
.collect();
let id = doc.add_feature(FeatureKind::MeshImport { file: "tetrahedra.stl".into(), meshes }, Some("Meshes")).unwrap();
doc.feature_mut(id).unwrap().component = comp;
doc
}
fn meshes_mut(doc: &mut Document) -> &mut Vec<MeshData> {
let FeatureKind::MeshImport { meshes, .. } = &mut doc.features[0].kind else { panic!("mesh fixture") };
meshes
}
fn same_as_fresh(doc: &Document, model: &Model) {
let mut fresh = Model::new();
fresh.no_cache = true;
fresh.evaluate(doc);
assert_eq!(model.results.iter().map(|r| r.fingerprint).collect::<Vec<_>>(), fresh.results.iter().map(|r| r.fingerprint).collect::<Vec<_>>());
let (actual, expected) = (model.state(), fresh.state());
assert_eq!(actual.bodies.len(), expected.bodies.len());
for (a, b) in actual.bodies.iter().zip(&expected.bodies) {
assert_eq!(a.name, b.name);
assert_eq!(a.mesh().positions, b.mesh().positions);
assert_eq!(a.mesh().triangles, b.mesh().triangles);
assert_eq!(a.body.color(), b.body.color());
}
assert!(model.results.iter().all(|r| r.error.is_none()));
}
#[test]
fn unchanged_mesh_payloads_are_not_read_again_for_rigid_motion() {
let mut doc = imported_meshes();
let mut model = Model::new();
assert_eq!(counted(|| model.evaluate(&doc)).mesh_digested, 2);
for k in 1..5 {
doc = doc.clone(); // Undo/preview copies share the arrays, not the document itself.
doc.occurrences[0].transform = rigid(Vec3::new(f64::from(k), 2.0, 3.0), Vec3::ZERO, Vec3::Z, 0.1 * f64::from(k));
assert_eq!(
counted(|| {
model.evaluate(&doc);
assert!(model.is_current(&doc));
})
.mesh_digested,
0
);
assert_eq!(model.last_recomputed, 0);
same_as_fresh(&doc, &model);
}
let saved = serde_json::to_string(&doc).unwrap();
let reopened: Document = serde_json::from_str(&saved).unwrap();
assert_eq!(counted(|| model.evaluate(&reopened)).mesh_digested, 2, "new array identities must be checked");
assert_eq!(model.last_recomputed, 0, "equal content has equal fingerprints");
same_as_fresh(&reopened, &model);
}
#[test]
fn mesh_payload_edits_invalidate_the_cache_and_undo_restores_the_geometry() {
let mut doc = imported_meshes();
let original = doc.clone();
let mut model = Model::new();
model.evaluate(&doc);
let fingerprint = model.results[0].fingerprint;
Arc::make_mut(&mut meshes_mut(&mut doc)[0].positions)[3] = 5.0;
assert!(!model.is_current(&doc));
assert_eq!(counted(|| model.evaluate(&doc)).mesh_digested, 1);
assert_ne!(model.results[0].fingerprint, fingerprint);
same_as_fresh(&doc, &model);
let edited = doc.clone();
Arc::make_mut(&mut meshes_mut(&mut doc)[0].triangles).swap(0, 1);
assert_eq!(counted(|| model.evaluate(&doc)).mesh_digested, 1);
same_as_fresh(&doc, &model);
for restored in [&original, &edited, &original] {
model.evaluate(restored);
same_as_fresh(restored, &model);
}
assert_eq!(model.results[0].fingerprint, fingerprint);
}
#[test]
fn mesh_metadata_and_order_remain_part_of_the_fingerprint() {
let mut doc = imported_meshes();
let mut model = Model::new();
model.evaluate(&doc);
for edit in 0..7 {
let before = model.results[0].fingerprint;
match edit {
0 => meshes_mut(&mut doc)[0].name = "Renamed".into(),
1 => meshes_mut(&mut doc)[0].color = Some([0.8, 0.1, 0.3]),
2 => doc.features[0].name = "Renamed feature".into(),
3 => meshes_mut(&mut doc).swap(0, 1),
4 => {
meshes_mut(&mut doc).pop();
}
5 => {
let mesh = meshes_mut(&mut doc)[0].clone();
meshes_mut(&mut doc).push(MeshData { name: "Added".into(), ..mesh });
}
_ => {
let FeatureKind::MeshImport { file, .. } = &mut doc.features[0].kind else { panic!("mesh fixture") };
*file = "renamed.stl".into();
}
}
assert!(!model.is_current(&doc));
let work = counted(|| model.evaluate(&doc));
if edit < 3 || edit == 6 {
assert_eq!(work.mesh_digested, 0, "metadata alone: {edit}");
}
assert_ne!(model.results[0].fingerprint, before, "edit {edit}");
same_as_fresh(&doc, &model);
}
}
#[test]
fn an_added_and_deleted_sketch_entity_keeps_its_fingerprint() {
let mut doc = Document::new("sketch fingerprint");
let id = doc.add_feature(line_sketch(PlaneRef::Origin { name: "XY".into() }, Vec2::new(10.0, 0.0)), None).unwrap();
let mut model = Model::new();
model.evaluate(&doc);
let key = model.state().sketch_keys.get(&id).copied();
let json = super::feature_json(doc.feature(id).unwrap(), &super::ImportDigests::default());
// Make and delete an id: the counters advance, but the geometry is the same.
{
let sk = doc.sketch_mut(id).unwrap();
let a = sk.add_point(Vec2::new(2.0, 2.0), None).unwrap();
let b = sk.add_point(Vec2::new(3.0, 2.0), None).unwrap();
let line = sk.add_line_pts(a, b, None).unwrap();
sk.remove_curves(&[line]);
sk.remove_points(&[b]);
sk.remove_points(&[a]);
}
let json_after = super::feature_json(doc.feature(id).unwrap(), &super::ImportDigests::default());
assert_eq!(json, json_after, "deleted ids are not geometry");
model.evaluate(&doc);
assert_eq!(model.state().sketch_keys.get(&id).copied(), key);
assert_eq!((model.last_recomputed, model.last_restored), (0, 0));
}
+2 -15
View File
@@ -8,7 +8,7 @@ use crate::sheet;
use solidcore_record::{Loop2, Seg2};
use solidcraft_geom::{Aabb3, Ring};
pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st: &mut ModelState, warning: &mut Option<String>) -> Result<()> {
pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st: &mut ModelState) -> Result<()> {
match &f.kind {
FeatureKind::Emboss { sketch, profiles, depth, deboss, targets, face } => {
let ss = st.sketch(sketch.0).ok_or_else(|| DocError::Unknown(format!("sketch {sketch}")))?;
@@ -59,20 +59,7 @@ pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature,
if st.bodies.is_empty() {
return Err(DocError::Invalid("there is no body to emboss".into()));
}
// #10940: an emboss or deboss whose tool lies clear of the body (a sketch on the far
// side of the material, a depth that stops short) used to report success and change
// nothing. Say so: the body is compared before and after, as the command's reply does.
let before: Vec<Body> = st.bodies.iter().map(|b| b.body.clone()).collect();
apply_op(doc, st, f, tools, if *deboss { Operation::Cut } else { Operation::Join }, &crate::plain(targets))?;
let unchanged = st.bodies.len() == before.len() && st.bodies.iter().zip(&before).all(|(b, old)| old.same(&b.body));
if unchanged {
let what = if *deboss { "deboss" } else { "emboss" };
append_warning(
warning,
format!("the {what} changed nothing; check where its profile lies, which side of the face the sketch is on, and the depth"),
);
}
Ok(())
apply_op(doc, st, f, tools, if *deboss { Operation::Cut } else { Operation::Join }, &crate::plain(targets))
}
FeatureKind::Rib { .. } => {
let tools = rib_tools(vals, st, f, None)?;
+4 -7
View File
@@ -63,16 +63,13 @@ pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature,
let t = val(vals, thickness, Kind::Length)?;
let mut tools = Vec::new();
for n in bodies {
let b = st.body(n).cloned().ok_or_else(|| DocError::Unknown(format!("body `{n}`")))?;
// Kept face, offset and edge walls. Carry that history so a sketch can attach
// to the solid's faces and follow the thickness (#7641).
let thickened = kernel::thicken(&b.body, t, *symmetric)?;
tools.push(Traced::step(thickened, &[&b.traced()]));
let b = st.body(n).ok_or_else(|| DocError::Unknown(format!("body `{n}`")))?;
tools.push(kernel::thicken(&b.body, t, *symmetric)?);
}
if tools.is_empty() {
return Err(DocError::Invalid("pick the surfaces to thicken".into()));
}
apply_traced(doc, st, f, tools, *operation, &crate::plain(targets))
apply_op(doc, st, f, tools, *operation, &crate::plain(targets))
}
FeatureKind::SurfaceTrim { body, plane, tool, keep, keep_more, curves, with, keep_with, stitch, extend } => {
let i = st.bodies.iter().position(|b| &b.name == body).ok_or_else(|| DocError::Unknown(format!("body `{body}`")))?;
@@ -311,7 +308,7 @@ pub(super) fn eval(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature,
st.sketch(sketch.0).ok_or_else(|| DocError::Unknown(format!("sketch {sketch} (it must come earlier in the timeline)")))?,
f.component,
)?;
let (o, d) = revolve_axis(vals, &ss, axis, &*super::axis_state(doc, st, f.component, axis)?, &|name| {
let (o, d) = revolve_axis(&ss, axis, &*super::axis_state(doc, st, f.component, axis)?, &|name| {
construction_axis_in(Some(doc), st, name, f.component)
})?;
let a = val(vals, angle, Kind::Angle)?;
+2 -4
View File
@@ -55,8 +55,7 @@ impl FeatureKind {
/// The body a feature that works on one body's faces names (shell, draft, split, offset,
/// delete and replace face, surface offset, the placed plastic features, sheet metal
/// conversion, ruled surface, untrim, Split Body's tool face): its face points pick faces of
/// that body.
/// conversion, ruled surface, untrim): its face points pick faces of that body.
pub fn face_body(&self) -> Option<&str> {
match self {
FeatureKind::Shell { body, .. }
@@ -67,11 +66,10 @@ impl FeatureKind {
| FeatureKind::ReplaceFace { body, .. }
| FeatureKind::SurfaceOffset { body, .. }
| FeatureKind::Boss { body, .. }
| FeatureKind::Lip { body, .. }
| FeatureKind::SnapFit { body, .. }
| FeatureKind::Rest { body, .. } => body.as_deref(),
FeatureKind::SheetConvert { body, .. } | FeatureKind::SurfaceRuled { body, .. } => Some(body.as_ref()),
FeatureKind::SurfaceUntrim { face, .. } | FeatureKind::Split { tool: Some(face), .. } => Some(face.body.as_ref()),
FeatureKind::SurfaceUntrim { face, .. } => Some(face.body.as_ref()),
_ => None,
}
}
@@ -12,7 +12,6 @@ revolve
moves: axis.dir[0], axis.dir[1], axis.dir[2], axis.origin[0], axis.origin[1], axis.origin[2], to[0], to[1], to[2]
face points: [3, 3.5, 3.25]
profiles: 1 all
placement: 9, 9.5, 9.25
fillet_constant
moves: edges[0][0], edges[0][1], edges[0][2]
fillet_chord
@@ -87,7 +86,6 @@ construction_plane
moves: plane.axis_dir[0], plane.axis_dir[1], plane.axis_origin[0], plane.axis_origin[1], plane.axis_origin[2]
split
moves: plane.axis_dir[0], plane.axis_dir[1], plane.axis_origin[0], plane.axis_origin[1], plane.axis_origin[2], tool.point[0], tool.point[1], tool.point[2]
face points: [0, 0, 0]
split_line
moves: plane.axis_dir[0], plane.axis_dir[1], plane.axis_origin[0], plane.axis_origin[1], plane.axis_origin[2]
construction_axis
@@ -150,7 +148,6 @@ boss
face points: [0, 0, 0]
lip
moves: face[0], face[1], face[2]
face points: [0, 0, 0]
snap_fit
moves: direction[0], direction[2], hook[0], hook[1], position[0], position[1], position[2]
face points: [0, 0, 0]
@@ -169,7 +166,6 @@ surface_extrude
face points: [1, 1.5, 1.25], [2, 2.5, 2.25]
surface_revolve
moves: axis.dir[0], axis.dir[1], axis.dir[2], axis.origin[0], axis.origin[1], axis.origin[2]
placement: 9, 9.5, 9.25
surface_sweep
surface_sweep_options
surface_loft
@@ -1,3 +0,0 @@
//! Saves exact encoded texture bytes, inert provenance and explicit saved surface roles.
//! Older designs have no embedded textures and retain their built-in surface bindings.
//! The last release asks for an update instead of silently dropping the new resources.
@@ -1,12 +0,0 @@
//! Nothing new is saved for holes, but a hole placed on a face that names the bodies it drills
//! (`participants`: its `targets`, or the body of another component it was picked on) now finds
//! the face it starts on among those bodies' faces, where one of them passes through its position
//! (#12066). Where another body touched that face at the hole, older designs could save a
//! `direction` taken from the other body's face, pointing out of the drilled body; such a hole cut
//! only a shallow pocket. It is now mirrored into the drilled body's face when the design is
//! evaluated, as format 18 does for a direction taken from the far side of a thin plate, and
//! drills through. Holes whose direction enters one of their own bodies' faces there, holes whose
//! own bodies have no face at their position (placed on another body's face to drill through it),
//! holes that name no bodies, and holes at several sketch points (already limited to their bodies,
//! #2882) build as before. No rewrite is needed. The last release refuses a design with this
//! change (the newer format number) instead of building the pocket again.
@@ -1,5 +0,0 @@
//! A sketch's intersection link can save a curve of another sketch as either side (`a` or `b`,
//! `{"type": "sketch_curve", sketch, curve}`), standing in for that curve's extrusion along its
//! sketch's normal (#11048). An older design has only bodies and faces there, and opens as before.
//! The last release refuses a design that has one (it asks for an update) instead of opening the
//! link as lost.
@@ -1,6 +0,0 @@
//! A point cloud keeps the segments and triangles its file draws over its points (#8817):
//! `segments` and `triangles` in its `complex`, the indices of their points, and a column of named
//! numbers may lie on them (`on`: `segment` or `triangle`; a column that does not say is on the
//! points, as every design saved before this has it). Older designs need no transformation: their
//! clouds are points alone. The last release refuses a design saved with this (the newer format
//! number) instead of opening its clouds as loose points without their edges and faces.
@@ -1,5 +0,0 @@
//! A revolve's explicit axis `{origin, dir}` can save its origin's coordinates as length
//! expressions (`["W / 2", 0, "groove_floor"]`) so the axis follows the parameters; a plain number
//! stays a number. An older design has numbers only and reads as before. The last release refuses
//! a design with this change and asks for an update, instead of opening it and reading an
//! expression as the origin.
+2 -3
View File
@@ -77,7 +77,6 @@ pub mod render_optics;
pub mod render_resources;
pub mod render_settings;
pub mod render_surface;
pub mod render_texture_resources;
pub mod sheet;
pub mod sketch_equation;
pub mod text_params;
@@ -93,8 +92,8 @@ pub use eval::{
blend_target, curve_pick_error, draft_corner_options, edge_names_for, edge_refs, face_point_names, face_point_state, hole_direction_at,
hole_on_surface, import_body_names, join_pieces_added, map_wire, metric_thread_sizes, object_height, parse_metric_thread, pattern_matrices,
revolve_extent, revolve_extent_for_handle, revolve_extent_with_convention, select_profiles, sketch_hole_direction, sketch_line_plane,
state_in_frame, state_in_frame_at, suggested_thread, suggested_thread_in, tangent_face_chain, through_all_distance, with_placed_copies,
world_state, world_state_reusing,
state_in_frame, state_in_frame_at, suggested_thread, suggested_thread_in, tangent_face_chain, through_all_distance, world_state,
world_state_reusing,
};
pub use eval::{EvalCache, KeptResults};
pub use expr::Expr;
+4 -4
View File
@@ -760,7 +760,7 @@ impl Model {
return Err(bad("saved model: features"));
}
let (vals, param_errors) = evaluation_values(doc);
let import_digests = ImportDigests::of(doc, &ImportDigests::default());
let step_digests = StepDigests::of(doc, &StepDigests::default());
let marker = doc.marker.unwrap_or(usize::MAX);
// As `evaluate` digests the context under the mode, so the next evaluation reuses these.
let ctx = context_digest(doc, &vals) ^ validation_digest(validation);
@@ -776,7 +776,7 @@ impl Model {
// A fingerprint reads the state before its feature (where the bodies it takes lie).
// After a state the file left out, the saved one is taken: `evaluate` works that state
// out, checks the fingerprints after it, and evaluates again from one that differs.
prev = if exact { chain_fingerprint(doc, &vals, f, prev, i >= marker, &import_digests, Some(&before)) } else { saved };
prev = if exact { chain_fingerprint(doc, &vals, f, prev, i >= marker, &step_digests, Some(&before)) } else { saved };
if r.get("id").and_then(Json::as_u64) != Some(f.id) || saved != prev {
return Err(bad("saved model: the document changed"));
}
@@ -826,7 +826,7 @@ impl Model {
}
results.push(result);
}
let mut model = Model { results, param_errors, import_digests, context: ctx, frame_bodies, validation, ..Model::default() };
let mut model = Model { results, param_errors, step_digests, context: ctx, frame_bodies, validation, ..Model::default() };
let unkept = model.results.iter().filter(|r| r.unkept).count();
if unkept > 0 {
// The features whose state the file did not keep, each evaluated again from the state
@@ -844,7 +844,7 @@ impl Model {
let mut before = Arc::new(ModelState::default());
if let Ok(mut cache) = model.cache.lock() {
for (f, r) in doc.features.iter().zip(&model.results).filter(|(_, r)| !r.skipped && r.error.is_none()) {
let local = fingerprint(doc, 0, f, &vals, false, &model.import_digests) ^ placement_digest(doc, f, Some(&before));
let local = fingerprint(doc, 0, f, &vals, false, &model.step_digests) ^ placement_digest(doc, f, Some(&before));
cache.put(
cache_key(f, r.fingerprint, local, ctx, &before),
CachedEval {
+2 -5
View File
@@ -835,7 +835,7 @@ pub(crate) fn face_centres(b: &ModelBody) -> Vec<Vec3> {
samples(&b.mesh(), face_count(b)).into_iter().map(|ps| ps.iter().fold(Vec3::ZERO, |a, p| a + *p) * (1.0 / ps.len().max(1) as f64)).collect()
}
/// The name of a face new to `f` (a feature that went through `eval::naming_feature`).
/// The name of a face new to `f`.
fn role_name(f: &Feature, before: &ModelState, ps: &[Vec3], ns: &[Vec3], fi: usize, fid: u64, curves: &std::cell::OnceCell<Curves>) -> String {
let c = ps.iter().fold(Vec3::ZERO, |a, p| a + *p) * (1.0 / ps.len().max(1) as f64);
match &f.kind {
@@ -858,10 +858,7 @@ fn role_name(f: &Feature, before: &ModelState, ps: &[Vec3], ns: &[Vec3], fi: usi
}
FeatureKind::Revolve { sketch, axis, .. } => {
let Some(ss) = before.sketch(sketch.0) else { return format!("F{fid}:face:{fi}") };
// The origin was written as its values when the feature was evaluated (`naming_feature`).
let Ok((o2, d2)) =
crate::eval::revolve_axis(&Default::default(), ss, axis, before, &|name| crate::eval::construction_axis_in(None, before, name, 0))
else {
let Ok((o2, d2)) = crate::eval::revolve_axis(ss, axis, before, &|name| crate::eval::construction_axis_in(None, before, name, 0)) else {
return format!("F{fid}:face:{fi}");
};
let (o, d) = (ss.plane.to_world(o2), (ss.plane.to_world(o2 + d2) - ss.plane.to_world(o2)).normalized().unwrap_or(Vec3::Z));
+8 -26
View File
@@ -9,7 +9,6 @@ use std::collections::{BTreeMap, BTreeSet};
use serde::{Deserialize, Serialize};
use crate::expr::{self, Expr, Kind, ParamDef, Value};
use crate::sheet::rule_references;
use crate::walk::Walk;
use crate::{DocError, Document, FeatureKind, MAX_PARAMS, Result};
@@ -798,14 +797,13 @@ impl Document {
}
}
let uses = |e: &str| expr::references(e).iter().any(|r| r == name);
let rule_uses = |field: &str, e: &str| rule_references(field, e).iter().any(|r| r == name);
for r in &self.sheet.rules {
for (field, _, _) in r.fields().into_iter().filter(|(f, e, _)| rule_uses(f, e)) {
for (field, _, _) in r.fields().into_iter().filter(|(_, e, _)| uses(e)) {
out.push(ParamUser::Rule { kind: "sheet metal".into(), name: r.name.clone(), field: field.into() });
}
}
for r in &self.plastic.rules {
for (field, _, _) in r.fields().into_iter().filter(|(f, e, _)| rule_uses(f, e)) {
for (field, _, _) in r.fields().into_iter().filter(|(_, e, _)| uses(e)) {
out.push(ParamUser::Rule { kind: "plastic".into(), name: r.name.clone(), field: field.into() });
}
}
@@ -857,21 +855,6 @@ impl Document {
if self.name_taken(new) {
return Err(DocError::Invalid(format!("there is already a parameter `{new}`")));
}
// Outside a rule's own thickness, `Thickness` is the rule's thickness (#9623): renaming to
// it would turn those references into the rule's thickness and change their values.
if new == "Thickness" {
let uses_old = |field: &str, e: &str| field != "thickness" && expr::references(e).iter().any(|r| r == old);
let sheet = self.sheet.rules.iter().flat_map(|r| r.fields().into_iter().map(move |(f, e, _)| ("sheet metal", &r.name, f, e)));
let plastic = self.plastic.rules.iter().flat_map(|r| r.fields().into_iter().map(move |(f, e, _)| ("plastic", &r.name, f, e)));
let list: Vec<String> =
sheet.chain(plastic).filter(|(_, _, f, e)| uses_old(f, e)).map(|(kind, name, f, _)| format!("{kind} rule {name} ({f})")).collect();
if !list.is_empty() {
return Err(DocError::Invalid(format!(
"`{old}` can't be renamed to `Thickness`: {} would read the rule's thickness instead",
list.join(", ")
)));
}
}
let mut n = 0;
let text = self.text_param(old).is_some();
for p in &mut self.text_params {
@@ -981,8 +964,7 @@ impl Document {
}
// Sheet metal and plastic rules and canvas planes hold expressions too (#4420).
let rules = self.sheet.rules.iter_mut().flat_map(|r| r.fields_mut()).chain(self.plastic.rules.iter_mut().flat_map(|r| r.fields_mut()));
// `Thickness` outside a rule's own thickness is the rule's, not the parameter (#9623).
for (_, e) in rules.filter(|(field, _)| old != "Thickness" || *field == "thickness") {
for (_, e) in rules {
let r = expr::rename_reference(e, old, new);
if r != *e {
*e = r;
@@ -1043,10 +1025,10 @@ impl Document {
}
// Sheet metal and plastic features rebuild when their rules' parameters change (#4420).
if f.kind.is_sheet() {
names.extend(self.sheet.rules.iter().flat_map(|r| r.fields()).flat_map(|(f, e, _)| rule_references(f, e)));
names.extend(self.sheet.rules.iter().flat_map(|r| r.fields()).flat_map(|(_, e, _)| expr::references(e)));
}
if f.kind.is_plastic() {
names.extend(self.plastic.rules.iter().flat_map(|r| r.fields()).flat_map(|(f, e, _)| rule_references(f, e)));
names.extend(self.plastic.rules.iter().flat_map(|r| r.fields()).flat_map(|(_, e, _)| expr::references(e)));
}
out.extend(names.into_iter().map(|n| (format!("Feature:{}", f.name), n)));
}
@@ -1070,9 +1052,9 @@ impl Document {
}
// A rule that uses it changes every sheet metal (or plastic) feature: the evaluation
// hashes the rules into their fingerprint.
let uses = |field: &str, e: &str| rule_references(field, e).iter().any(|r| affected.contains(r));
let sheet = self.sheet.rules.iter().any(|r| r.fields().iter().any(|(f, e, _)| uses(f, e)));
let plastic = self.plastic.rules.iter().any(|r| r.fields().iter().any(|(f, e, _)| uses(f, e)));
let uses = |e: &String| expr::references(e).iter().any(|r| affected.contains(r));
let sheet = self.sheet.rules.iter().any(|r| r.fields().iter().any(|(_, e, _)| uses(e)));
let plastic = self.plastic.rules.iter().any(|r| r.fields().iter().any(|(_, e, _)| uses(e)));
let mut out = Vec::new();
for f in &self.features {
let mut hit = f.param_names.iter().any(|n| affected.contains(n));
+1 -1
View File
@@ -167,7 +167,7 @@ impl Document {
return Err(DocError::Invalid("the plastic thickness must be positive".into()));
}
let with_t = |e: &str, k: Kind| -> Result<f64> {
let f = |n: &str| if n == "Thickness" { Ok(Value::length(t)) } else { look(n) };
let f = |n: &str| if n == "Thickness" && !vals.contains_key("Thickness") { Ok(Value::length(t)) } else { look(n) };
let v = expr::eval_with(e, &f)?.to_kind(k)?;
if !v.is_finite() || v < 0.0 {
return Err(DocError::Invalid(format!("plastic rule `{}`: `{e}` must not be negative", r.name)));
+14 -36
View File
@@ -12,7 +12,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
use solidcore_record::Vec3;
use crate::canvas::{base64_decode, base64_encode};
pub use crate::point_cloud_complex::{Column, Complex, Filter, Floats, Indices, Keep, MAX_CELLS, MAX_COLUMNS, MAX_NAMES, Names, On};
pub use crate::point_cloud_complex::{Column, Complex, Filter, Floats, Keep, MAX_COLUMNS, MAX_NAMES, Names};
use crate::{DocError, IDENTITY, Mat, Result};
/// Most points one cloud may hold.
@@ -71,26 +71,24 @@ pub struct PointCloud {
pub height_range: Option<[f64; 2]>,
#[serde(default = "yes")]
pub visible: bool,
/// Segments and triangles over the points, and the file's other properties.
/// The file's other properties of the points.
#[serde(default, skip_serializing_if = "Complex::is_empty")]
pub complex: Complex,
/// The property `color_by: property` colours by.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub color_property: Option<String>,
/// Only the elements within every filter's range are shown.
/// Only the points every filter keeps are shown.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub filters: Vec<Filter>,
}
/// Where a property's values come from on one kind of element.
/// Where a property's values come from.
#[derive(Clone, Copy, Debug)]
pub enum Source<'a> {
/// A coordinate of each corner in the design.
/// A coordinate of each point in the design.
Coordinate(usize),
/// A column on the points: each corner's.
Corners(&'a [f32]),
/// A column on the element itself.
Element(&'a [f32]),
/// A column of the file: each point's.
Column(&'a [f32]),
}
/// How a cloud's points are coloured.
@@ -241,21 +239,16 @@ impl PointCloud {
ColorBy::File | ColorBy::Single => None,
}
}
/// Where the values of `name` are on elements of kind `on`: a coordinate of each corner, a
/// column on the points (each corner's, varying across the element) or one on the element.
pub fn source(&self, name: &str, on: On) -> Option<Source<'_>> {
/// Where the values of `name` are: a coordinate of each point or a column of the file.
pub fn source(&self, name: &str) -> Option<Source<'_>> {
if let Some(k) = COORDINATES.iter().position(|n| *n == name) {
return Some(Source::Coordinate(k));
}
if let Some(col) = self.complex.column(name, on) {
return Some(Source::Element(&col.values.0));
}
self.complex.column(name, On::Point).map(|col| Source::Corners(&col.values.0))
self.complex.column(name).map(|col| Source::Column(&col.values.0))
}
/// Every property the cloud can be coloured and filtered by: its coordinates, then its columns.
pub fn property_names(&self) -> impl Iterator<Item = &str> {
let mut seen = std::collections::BTreeSet::new();
COORDINATES.into_iter().chain(self.complex.columns.iter().map(|c| c.name.as_str())).filter(move |n| seen.insert(*n))
COORDINATES.into_iter().chain(self.complex.columns.iter().map(|c| c.name.as_str()))
}
/// The smallest and largest value of a property, the coordinates in the design.
pub fn span(&self, property: &str) -> Option<[f64; 2]> {
@@ -280,19 +273,6 @@ impl PointCloud {
self.filters.iter().filter(|f| f.property == property).filter_map(Filter::range).fold(span, |[lo, hi], [a, b]| [lo.max(a), hi.min(b)]);
Some(if shown[0] <= shown[1] { crate::point_cloud_distribution::ramp_range(shown) } else { span })
}
/// Points no segment or triangle ends on: those drawn as dots.
pub fn isolated_points(&self) -> usize {
if self.complex.segments.is_empty() && self.complex.triangles.is_empty() {
return self.len();
}
let mut used = vec![false; self.len()];
for i in self.complex.segments.0.iter().chain(self.complex.triangles.0.iter()) {
if let Some(u) = used.get_mut(*i as usize) {
*u = true;
}
}
used.iter().filter(|u| !**u).count()
}
/// The heights the height ramp runs between now: the cloud's own, else the automatic ones.
pub fn height_range_now(&self) -> Option<[f64; 2]> {
self.height_range.or_else(|| self.auto_height_range())
@@ -301,7 +281,7 @@ impl PointCloud {
pub fn shade(&self, range: Option<[f64; 2]>) -> impl Fn(usize) -> [u8; 3] + '_ {
let single = self.color.unwrap_or(PLAIN).map(byte);
let plain = PLAIN.map(byte);
let column = self.color_property.as_deref().and_then(|n| self.complex.column(n, On::Point));
let column = self.color_property.as_deref().and_then(|n| self.complex.column(n));
move |i| match self.color_by {
ColorBy::File => self.colors.get(i).unwrap_or(plain),
ColorBy::Single => single,
@@ -578,10 +558,9 @@ mod tests {
}
#[test]
fn the_ramp_spans_what_is_shown_unless_set_and_isolated_points_are_counted() {
fn the_ramp_spans_what_is_shown_unless_set() {
let mut c = cloud(vec![0.0; 9], Vec::new());
c.complex.segments = Indices(vec![0, 1].into());
c.complex.columns.push(Column { name: "t".into(), on: On::Point, integer: false, values: Floats(vec![0.0, 10.0, 20.0].into()) });
c.complex.columns.push(Column { name: "t".into(), integer: false, values: Floats(vec![0.0, 10.0, 20.0].into()) });
(c.color_by, c.color_property) = (ColorBy::Property, Some("t".into()));
assert_eq!(c.color_range(), Some([0.0, 20.0]), "the whole span");
c.filters = vec![Filter { property: "t".into(), keep: Keep::Range { range: [5.0, 50.0] } }];
@@ -590,7 +569,6 @@ mod tests {
assert_eq!(c.color_range(), Some([5.0, 20.0]), "another property's filter changes nothing");
c.height_range = Some([1.0, 2.0]);
assert_eq!(c.color_range(), Some([1.0, 2.0]), "a range set is kept");
assert_eq!(c.isolated_points(), 1, "point 2 ends no segment");
}
#[test]
+27 -163
View File
@@ -1,8 +1,5 @@
//! What a point cloud holds besides its points: segments and triangles between them, and named
//! numbers on its points, segments and triangles (a PLY file's properties), to colour the cloud
//! by and to filter it with. A point's numbers vary along the segments and across the triangles
//! that meet there; a segment's or a triangle's are constant on it. A segment with `width` and
//! `height` numbers is drawn as a bead of that cross-section; without them, as a line. Whole
//! What a point cloud holds besides its points' places and colours: named numbers on its points
//! (a PLY file's other vertex properties), to colour the cloud by and to filter it with. Whole
//! numbers may have names (`role: 0 outer wall, 1 inner wall` in a PLY file's comments): they
//! are labels, filtered by a set of values rather than a range.
@@ -14,41 +11,13 @@ use crate::canvas::{base64_decode, base64_encode};
use crate::point_cloud::MAX_POINTS;
use crate::{DocError, Result};
/// Most segments or triangles in one cloud.
pub const MAX_CELLS: usize = 20_000_000;
/// Most named numbers per point, segment and triangle together.
/// Most named numbers per point.
pub const MAX_COLUMNS: usize = 64;
/// The elements a column of numbers is on.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum On {
#[default]
Point,
Segment,
Triangle,
}
impl On {
fn is_point(&self) -> bool {
*self == On::Point
}
pub fn name(self) -> &'static str {
match self {
On::Point => "point",
On::Segment => "segment",
On::Triangle => "triangle",
}
}
}
/// One named number on every element of a kind.
/// One named number on every point.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Column {
pub name: String,
/// Points unless said: a design saved with numbers on points alone says nothing.
#[serde(default, skip_serializing_if = "On::is_point")]
pub on: On,
/// Whole numbers (labels, counts): coloured by a palette rather than a ramp.
#[serde(default)]
pub integer: bool,
@@ -64,16 +33,10 @@ impl Column {
}
}
/// The complex a cloud's points span: segments and triangles over them, and named numbers on
/// all three. Without segments or triangles, the points alone are a complex of dimension 0.
/// The complex a cloud's points form: named numbers on the points, and the names of
/// whole-numbered ones. Points alone are a complex of dimension 0.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Complex {
/// Point indices, two per segment.
#[serde(default, skip_serializing_if = "Indices::is_empty")]
pub segments: Indices,
/// Point indices, three per triangle, counter-clockwise seen from its front.
#[serde(default, skip_serializing_if = "Indices::is_empty")]
pub triangles: Indices,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub columns: Vec<Column>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
@@ -115,95 +78,33 @@ impl Names {
impl Complex {
pub fn is_empty(&self) -> bool {
self.segments.is_empty() && self.triangles.is_empty() && self.columns.is_empty() && self.names.is_empty()
self.columns.is_empty() && self.names.is_empty()
}
/// The subcomplex spanned by the points `kept` marks: those points, numbered in order, with
/// their numbers, and the segments and triangles all of whose corners are among them, with
/// theirs. Also how many segments and triangles it leaves out.
pub fn induced(&self, kept: &[bool]) -> (Complex, u64) {
let mut next = 0u32;
let renumbered: Vec<Option<u32>> = kept
.iter()
.map(|k| {
k.then(|| {
next += 1;
next - 1
})
})
.collect();
let restrict = |indices: &Indices, n: usize| {
let (mut ids, mut whole) = (Vec::new(), Vec::new());
for corners in indices.0.chunks_exact(n) {
let new: Option<Vec<u32>> = corners.iter().map(|i| renumbered.get(*i as usize).copied().flatten()).collect();
whole.push(new.is_some());
ids.extend(new.unwrap_or_default());
}
(Indices(ids.into()), whole)
};
let (segments, on_segments) = restrict(&self.segments, 2);
let (triangles, on_triangles) = restrict(&self.triangles, 3);
let left_out = on_segments.iter().chain(&on_triangles).filter(|whole| !**whole).count() as u64;
let columns = self
.columns
.iter()
.map(|c| {
let mask = match c.on {
On::Point => kept,
On::Segment => &on_segments,
On::Triangle => &on_triangles,
};
let values: Vec<f32> = c.values.0.iter().zip(mask).filter(|(_, k)| **k).map(|(v, _)| *v).collect();
Column { values: Floats(values.into()), ..c.clone() }
})
.collect();
(Complex { segments, triangles, columns, names: self.names.clone() }, left_out)
/// The column named `name`.
pub fn column(&self, name: &str) -> Option<&Column> {
self.columns.iter().find(|c| c.name == name)
}
pub fn segment_count(&self) -> usize {
self.segments.0.len() / 2
}
pub fn triangle_count(&self) -> usize {
self.triangles.0.len() / 3
}
/// The column named `name` on elements of kind `on`: a name may be on several kinds.
pub fn column(&self, name: &str, on: On) -> Option<&Column> {
self.columns.iter().find(|c| c.name == name && c.on == on)
}
/// The smallest and largest value named `name`, on whichever elements carry it.
/// The smallest and largest value named `name`.
pub fn span(&self, name: &str) -> Option<[f64; 2]> {
self.columns.iter().filter(|c| c.name == name).filter_map(Column::span).reduce(|[a, b], [c, d]| [a.min(c), b.max(d)])
self.column(name).and_then(Column::span)
}
/// The names of `property`'s values, when it is a label.
pub fn names(&self, property: &str) -> Option<&Names> {
self.names.iter().find(|n| n.property == property).filter(|_| self.integer(property))
}
/// Whether the values named `name` are whole numbers wherever they are.
/// Whether the values named `name` are whole numbers.
pub fn integer(&self, name: &str) -> bool {
let mut named = self.columns.iter().filter(|c| c.name == name).peekable();
named.peek().is_some() && named.all(|c| c.integer)
self.column(name).is_some_and(|c| c.integer)
}
/// How many elements of a kind there are, the cloud having `points` points.
pub fn count(&self, on: On, points: usize) -> usize {
match on {
On::Point => points,
On::Segment => self.segment_count(),
On::Triangle => self.triangle_count(),
}
}
/// Every index names a point, and every column has one number per element.
/// Every column has one number per point, the cloud having `points` points.
pub fn check(&self, points: usize) -> Result<()> {
let bad = |what: String| Err(DocError::Invalid(format!("point cloud complex: {what}")));
if !self.segments.0.len().is_multiple_of(2) || !self.triangles.0.len().is_multiple_of(3) {
return bad("segments are not pairs or triangles not triples".into());
}
if self.segment_count() > MAX_CELLS || self.triangle_count() > MAX_CELLS || self.columns.len() > MAX_COLUMNS {
return bad("too many segments, triangles or properties".into());
}
if self.segments.0.iter().chain(self.triangles.0.iter()).any(|i| *i as usize >= points) {
return bad("an index names a missing point".into());
let bad = |what: String| Err(DocError::Invalid(format!("point cloud properties: {what}")));
if self.columns.len() > MAX_COLUMNS {
return bad("too many properties".into());
}
for c in &self.columns {
if c.values.0.len() != self.count(c.on, points) {
return bad(format!("property `{}` does not have one number per {}", c.name, c.on.name()));
if c.values.0.len() != points {
return bad(format!("property `{}` does not have one number per point", c.name));
}
}
if self.names.len() > MAX_COLUMNS || self.names.iter().any(|n| n.values.is_empty() || n.values.len() > MAX_NAMES) {
@@ -213,8 +114,8 @@ impl Complex {
}
}
/// Which elements are shown: those whose property lies in a range (both ends included), or, for
/// a label, is one of a set of values.
/// Which points are shown: those whose property lies in a range (both ends included), or, for a
/// label, is one of a set of values.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Filter {
pub property: String,
@@ -239,26 +140,10 @@ impl Filter {
}
}
/// Indices into a cloud's points, shared between copies of the design.
#[derive(Clone, Debug, Default)]
pub struct Indices(pub Arc<[u32]>);
impl Indices {
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
/// Numbers, shared between copies of the design.
#[derive(Clone, Debug, Default)]
pub struct Floats(pub Arc<[f32]>);
impl PartialEq for Indices {
fn eq(&self, other: &Self) -> bool {
Arc::ptr_eq(&self.0, &other.0) || self.0 == other.0
}
}
impl PartialEq for Floats {
fn eq(&self, other: &Self) -> bool {
Arc::ptr_eq(&self.0, &other.0) || self.0.iter().map(|v| v.to_bits()).eq(other.0.iter().map(|v| v.to_bits()))
@@ -282,18 +167,6 @@ fn words<'de, D: Deserializer<'de>>(d: D, max: usize) -> std::result::Result<Vec
Ok(b.as_chunks::<4>().0.to_vec())
}
impl Serialize for Indices {
fn serialize<S: Serializer>(&self, s: S) -> std::result::Result<S::Ok, S::Error> {
s.serialize_str(&base64_encode(&self.0.iter().flat_map(|v| v.to_le_bytes()).collect::<Vec<u8>>()))
}
}
impl<'de> Deserialize<'de> for Indices {
fn deserialize<D: Deserializer<'de>>(d: D) -> std::result::Result<Self, D::Error> {
Ok(Indices(words(d, 3 * MAX_CELLS)?.into_iter().map(u32::from_le_bytes).collect()))
}
}
impl Serialize for Floats {
fn serialize<S: Serializer>(&self, s: S) -> std::result::Result<S::Ok, S::Error> {
s.serialize_str(&base64_encode(&self.0.iter().flat_map(|v| v.to_le_bytes()).collect::<Vec<u8>>()))
@@ -302,7 +175,7 @@ impl Serialize for Floats {
impl<'de> Deserialize<'de> for Floats {
fn deserialize<D: Deserializer<'de>>(d: D) -> std::result::Result<Self, D::Error> {
Ok(Floats(words(d, MAX_POINTS.max(MAX_CELLS))?.into_iter().map(f32::from_le_bytes).collect()))
Ok(Floats(words(d, MAX_POINTS)?.into_iter().map(f32::from_le_bytes).collect()))
}
}
@@ -311,26 +184,20 @@ mod tests {
use super::*;
#[test]
fn a_complex_round_trips_and_is_checked_against_its_points() {
fn properties_round_trip_and_are_checked_against_the_points() {
let complex = Complex {
segments: Indices(vec![0, 1, 1, 2].into()),
triangles: Indices(vec![0, 1, 2].into()),
columns: vec![
Column { name: "t".into(), on: On::Point, integer: false, values: Floats(vec![0.0, 0.5, 1.0].into()) },
Column { name: "role".into(), on: On::Segment, integer: true, values: Floats(vec![0.0, 4.0].into()) },
Column { name: "t".into(), integer: false, values: Floats(vec![0.0, 0.5, 1.0].into()) },
Column { name: "role".into(), integer: true, values: Floats(vec![0.0, 4.0, 4.0].into()) },
],
names: Vec::new(),
};
let back: Complex = serde_json::from_str(&serde_json::to_string(&complex).unwrap()).unwrap();
assert_eq!(back, complex);
let points: Column = serde_json::from_str(r#"{"name": "t", "values": ""}"#).unwrap();
assert!(!serde_json::to_string(&points).unwrap().contains("\"on\""), "a column on the points does not say so");
assert_eq!(points.on, On::Point, "a column without `on` is on the points");
complex.check(3).unwrap();
assert!(complex.check(2).is_err(), "index 2 names a missing point");
assert!(complex.check(2).is_err(), "three numbers for two points");
assert_eq!(complex.span("role"), Some([0.0, 4.0]));
assert!(complex.integer("role") && !complex.integer("t") && !complex.integer("nope"));
assert!(complex.column("role", On::Segment).is_some() && complex.column("role", On::Point).is_none());
// Named values make a label, and a filter keeps a range or a set of them.
let names = Names::parse("role: 0 outer wall, 4 bridge, -1 none").unwrap();
assert_eq!((names.name(4), names.name(-1), names.name(2)), (Some("bridge"), Some("none"), None));
@@ -344,8 +211,5 @@ mod tests {
let range: Filter = serde_json::from_str(r#"{"property": "t", "range": [1, 3]}"#).unwrap();
assert_eq!((set.range(), range.range()), (None, Some([1.0, 3.0])));
assert_eq!(serde_json::to_value(&set).unwrap(), serde_json::json!({"property": "role", "values": [0, 4]}));
let mut short = complex.clone();
short.columns[1].values = Floats(vec![0.0].into());
assert!(short.check(3).is_err(), "one role for two segments");
}
}
+54 -401
View File
@@ -3,79 +3,30 @@
//! colours the view draws, and the values where a label changes along a property, which the
//! tracks snap to.
//!
//! Each element weighs its measure: a dot 1, a segment its length, a triangle its area, each kind
//! divided by its own total so that kinds of different dimension weigh alike. On an element every
//! property is linear (the same everywhere, or its corners' values interpolated), so filters,
//! colours and the histogram all cut it the same way, where a linear function crosses a value. A
//! range filter keeps the part between its ends, as the view does; a filter by values keeps the
//! parts whose rounded value it holds; the colour sorts the parts into the colours they are drawn
//! in. Each part spreads its measure exactly over the values it covers of the histogram's
//! property: a dot's at one value, a segment's evenly, a triangle's as the tent its corners'
//! values make. The values the parts kept take, from the least to the greatest, are the ramp's
//! automatic range: the colours span exactly what is shown.
//! Each point weighs the same, the cloud weighing 1. A range filter keeps the points between its
//! ends, as the view does; a filter by values keeps those whose rounded value it holds; the
//! colour sorts the points kept into the colours they are drawn in. The values the points kept
//! take, from the least to the greatest, are the ramp's automatic range: the colours span exactly
//! what is shown.
use crate::point_cloud::{ColorBy, Filter, Keep, On, PALETTE, PointCloud, Source};
use crate::point_cloud::{ColorBy, Filter, Keep, PALETTE, PointCloud, Source};
/// Most bins of one histogram.
pub const MAX_BINS: usize = 8192;
/// How far past its first band one part of an element is split by one cut. A ramp of [`MAX_BINS`]
/// bands, with the one below it and the one above it, has no more than this to cross, so its
/// measure is whole; only the whole numbers have more (a hostile file's values may cross billions).
const MAX_BANDS: usize = MAX_BINS + 1;
/// Most corners of a part of a triangle: each cut adds at most one to its three.
const MAX_CORNERS: usize = 24;
/// What the histograms need of a cloud's geometry, worked out once for its points and cells.
/// What the histograms need of a cloud's geometry, worked out once for its points.
#[derive(Clone, Debug, Default)]
pub struct Geometry {
/// Each point in the design.
world: Vec<[f64; 3]>,
/// The points drawn as dots: those no segment or triangle ends on.
dots: Vec<u32>,
/// Each segment's share of all segments' length, and each triangle's of their area.
segments: Vec<f64>,
triangles: Vec<f64>,
}
impl Geometry {
pub fn of(c: &PointCloud) -> Geometry {
let world: Vec<[f64; 3]> = (0..c.len()).map(|i| c.world_point(i).map_or([0.0; 3], |p| [p.x, p.y, p.z])).collect();
let mut used = vec![false; world.len()];
for i in c.complex.segments.0.iter().chain(c.complex.triangles.0.iter()) {
if let Some(u) = used.get_mut(*i as usize) {
*u = true;
}
}
let dots = (0..world.len() as u32).filter(|i| !used.get(*i as usize).copied().unwrap_or(true)).collect();
let at = |i: u32| world.get(i as usize).copied().unwrap_or_default();
let sub = |a: [f64; 3], b: [f64; 3]| [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
let norm = |v: [f64; 3]| (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]).sqrt();
let segments = c.complex.segments.0.as_chunks::<2>().0.iter().map(|[a, b]| norm(sub(at(*a), at(*b)))).collect();
let triangles = c
.complex
.triangles
.0
.as_chunks::<3>()
.0
.iter()
.map(|[a, b, d]| {
let (u, v) = (sub(at(*a), at(*b)), sub(at(*a), at(*d)));
0.5 * norm([u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]])
})
.collect();
Geometry { world, dots, segments: shares(segments), triangles: shares(triangles) }
Geometry { world: (0..c.len()).map(|i| c.world_point(i).map_or([0.0; 3], |p| [p.x, p.y, p.z])).collect() }
}
}
/// Each measure over their total (none for a total that is not a positive number).
fn shares(mut m: Vec<f64>) -> Vec<f64> {
let total: f64 = m.iter().filter(|v| v.is_finite()).sum();
for v in &mut m {
*v = if total > 0.0 && v.is_finite() { *v / total } else { 0.0 };
}
m
}
/// How a histogram is split by colour, into slots; the last slot holds what has no value to be
/// coloured by.
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -131,11 +82,11 @@ pub struct Histogram {
pub bins: usize,
/// `slots[s][b]`: the measure of slot `s` in bin `b`.
pub slots: Vec<Vec<f64>>,
/// The least and the greatest value the parts kept take, within the axis or not.
/// The least and the greatest value the points kept take, within the axis or not.
pub extent: Option<[f64; 2]>,
}
/// Where a linear function is cut into bands, by increasing values.
/// Where values are cut into bands, by increasing values.
#[derive(Clone, Copy, Debug)]
enum Cut {
/// Below (band 0), within (1, both ends included) and above (2) a range.
@@ -164,123 +115,6 @@ impl Cut {
}
}
}
/// The values band `k` holds, from and to (`None`: without end).
fn bounds(&self, k: usize) -> (Option<f64>, Option<f64>) {
match *self {
Cut::Range([a, b]) => match k {
0 => (None, Some(a)),
1 => (Some(a), Some(b)),
_ => (Some(b), None),
},
Cut::Grid { start, step, count } => {
((k > 0).then_some(start + k.saturating_sub(1) as f64 * step), (k < count).then_some(start + k as f64 * step))
}
}
}
}
/// A part of an element in its own coordinates: a dot, a stretch `[s₀, s₁]` of a segment (0 at
/// its first point), or a convex polygon in a triangle (each corner the weights of the
/// triangle's second and third points).
// Parts live in two buffers reused element after element: boxing a polygon would allocate per
// triangle.
#[allow(clippy::large_enum_variant)]
#[derive(Clone, Copy, Debug)]
enum Part {
Dot,
Stretch([f64; 2]),
Polygon(Polygon),
}
#[derive(Clone, Copy, Debug)]
struct Polygon {
at: [[f64; 2]; MAX_CORNERS],
len: usize,
}
impl Polygon {
fn triangle() -> Polygon {
let mut at = [[0.0; 2]; MAX_CORNERS];
at[1] = [1.0, 0.0];
at[2] = [0.0, 1.0];
Polygon { at, len: 3 }
}
fn corners(&self) -> &[[f64; 2]] {
self.at.get(..self.len).unwrap_or(&[])
}
/// The part where `g ≥ 0`.
fn clip(&self, g: impl Fn([f64; 2]) -> f64) -> Polygon {
let mut out = Polygon { at: [[0.0; 2]; MAX_CORNERS], len: 0 };
let mut push = |p: [f64; 2]| {
if let Some(slot) = out.at.get_mut(out.len) {
*slot = p;
out.len += 1;
}
};
let c = self.corners();
for (k, p) in c.iter().enumerate() {
let q = c.get((k + 1) % c.len()).copied().unwrap_or(*p);
let (gp, gq) = (g(*p), g(q));
if gp >= 0.0 {
push(*p);
}
if (gp >= 0.0) != (gq >= 0.0) {
let f = gp / (gp - gq);
push([p[0] + (q[0] - p[0]) * f, p[1] + (q[1] - p[1]) * f]);
}
}
out
}
}
/// A linear function on an element: its values at the corners.
fn at(f: [f64; 3], p: [f64; 2]) -> f64 {
f[0] + (f[1] - f[0]) * p[0] + (f[2] - f[0]) * p[1]
}
/// The bands of `cut` that `part` meets where `f` takes its values, each with the part in it.
fn split(part: &Part, f: [f64; 3], cut: Cut, mut visit: impl FnMut(usize, Part)) {
match part {
Part::Dot => visit(cut.band(f[0]), Part::Dot),
Part::Stretch([s0, s1]) => {
let (a, b) = (at(f, [*s0, 0.0]), at(f, [*s1, 0.0]));
let (lo, hi) = (a.min(b), a.max(b));
let (k0, k1) = (cut.band(lo), cut.band(hi));
if k0 == k1 || !(hi > lo) {
return visit(k0, *part);
}
let s = |x: f64| s0 + (x - a) / (b - a) * (s1 - s0);
for k in k0..=k1.min(k0 + MAX_BANDS) {
let (from, to) = cut.bounds(k);
let (x0, x1) = (from.map_or(lo, |v| v.max(lo)), to.map_or(hi, |v| v.min(hi)));
if x1 > x0 {
let (t0, t1) = (s(x0), s(x1));
visit(k, Part::Stretch([t0.min(t1), t0.max(t1)]));
}
}
}
Part::Polygon(p) => {
let values = p.corners().iter().map(|c| at(f, *c));
let (lo, hi) = values.fold((f64::INFINITY, f64::NEG_INFINITY), |(lo, hi), v| (lo.min(v), hi.max(v)));
let (k0, k1) = (cut.band(lo), cut.band(hi));
if k0 == k1 || !(hi > lo) {
return visit(k0, *part);
}
for k in k0..=k1.min(k0 + MAX_BANDS) {
let (from, to) = cut.bounds(k);
let mut q = *p;
if let Some(v) = from {
q = q.clip(|c| at(f, c) - v);
}
if let Some(v) = to {
q = q.clip(|c| v - at(f, c));
}
if q.len >= 3 {
visit(k, Part::Polygon(q));
}
}
}
}
}
/// A filter as a cut and the bands it keeps.
@@ -296,7 +130,8 @@ impl Kept<'_> {
Keep::Values { values } => Kept { cut: INTEGERS, values: Some(values) },
}
}
fn keeps(&self, band: usize) -> bool {
fn keeps(&self, v: f64) -> bool {
let band = self.cut.band(v);
match self.values {
None => band == 1,
Some(values) => integer(band).is_some_and(|v| values.iter().any(|k| i64::from(*k) == v)),
@@ -304,133 +139,14 @@ impl Kept<'_> {
}
}
/// The values of `s` at an element's corners: element `e` of a kind, on points `ids`.
fn corners(s: Source, e: usize, ids: [u32; 3], world: &[[f64; 3]]) -> [f64; 3] {
/// The value of `s` at point `i`.
fn value(s: Source, i: usize, world: &[[f64; 3]]) -> f64 {
match s {
Source::Coordinate(k) => ids.map(|i| world.get(i as usize).and_then(|p| p.get(k)).copied().unwrap_or(f64::NAN)),
Source::Corners(v) => ids.map(|i| v.get(i as usize).map_or(f64::NAN, |x| f64::from(*x))),
Source::Element(v) => [v.get(e).map_or(f64::NAN, |x| f64::from(*x)); 3],
Source::Coordinate(k) => world.get(i).and_then(|p| p.get(k)).copied().unwrap_or(f64::NAN),
Source::Column(v) => v.get(i).map_or(f64::NAN, |x| f64::from(*x)),
}
}
/// Measure spread over bins: what falls in a bin directly, and evenly spread measure as ramps
/// (`k·max(0, x − c)` summed into its distribution function at each bin edge).
struct Bins {
lo: f64,
hi: f64,
width: f64,
n: usize,
direct: Vec<f64>,
slope: Vec<f64>,
offset: Vec<f64>,
}
impl Bins {
fn new([lo, hi]: [f64; 2], n: usize, slots: usize) -> Bins {
Bins {
lo,
hi,
width: (hi - lo) / n as f64,
n,
direct: vec![0.0; slots * n],
slope: vec![0.0; slots * (n + 2)],
offset: vec![0.0; slots * (n + 2)],
}
}
fn edge(&self, j: usize) -> f64 {
if j >= self.n { self.hi } else { self.lo + j as f64 * self.width }
}
/// The bin holding `x`, the last bin holding its upper end too.
fn bin(&self, x: f64) -> Option<usize> {
if !(x >= self.lo && x <= self.hi) {
return None;
}
Some((((x - self.lo) / self.width).floor() as usize).min(self.n - 1))
}
fn add(&mut self, slot: usize, j: usize, m: f64) {
if let Some(d) = self.direct.get_mut(slot * self.n + j) {
*d += m;
}
}
fn point(&mut self, slot: usize, x: f64, m: f64) {
if let Some(j) = self.bin(x) {
self.add(slot, j, m);
}
}
/// A ramp of slope `k` from `c`: it reaches the first edge at or after `c`.
fn ramp(&mut self, slot: usize, c: f64, k: f64) {
let j = ((c - self.lo) / self.width).ceil().clamp(0.0, (self.n + 1) as f64) as usize;
let at = slot * (self.n + 2) + j;
if let (Some(s), Some(o)) = (self.slope.get_mut(at), self.offset.get_mut(at)) {
*s += k;
*o += k * c;
}
}
/// `m` spread evenly over `[a, b]`.
fn even(&mut self, slot: usize, a: f64, b: f64, m: f64) {
if !(b > a) {
return self.point(slot, a, m);
}
let k = m / (b - a);
self.ramp(slot, a, k);
self.ramp(slot, b, -k);
}
/// `m` spread as a triangle's measure over its corners' values `q₀ ≤ q₁ ≤ q₂`: rising to
/// `q₁` and falling to `q₂`.
fn tent(&mut self, slot: usize, [q0, q1, q2]: [f64; 3], m: f64) {
if !(q2 > q0) {
return self.point(slot, q0, m);
}
let below = |x: f64| {
if x <= q0 {
0.0
} else if x >= q2 {
m
} else if x <= q1 {
m * (x - q0) * (x - q0) / ((q2 - q0) * (q1 - q0))
} else {
m * (1.0 - (q2 - x) * (q2 - x) / ((q2 - q0) * (q2 - q1)))
}
};
let (Some(j0), Some(j1)) = (self.bin(q0.max(self.lo)), self.bin(q2.min(self.hi))) else { return };
for j in j0..=j1 {
let (a, b) = (self.edge(j).max(q0), self.edge(j + 1).min(q2));
self.add(slot, j, below(b) - below(a));
}
}
fn finish(self, slots: usize) -> Vec<Vec<f64>> {
(0..slots)
.map(|s| {
let (mut slope, mut offset, mut before) = (0.0, 0.0, 0.0);
(0..=self.n)
.filter_map(|j| {
let at = s * (self.n + 2) + j;
slope += self.slope.get(at).copied().unwrap_or(0.0);
offset += self.offset.get(at).copied().unwrap_or(0.0);
let f = slope * self.edge(j) - offset;
let spread = (j > 0).then_some(f - before);
before = f;
spread.map(|d| d + self.direct.get(s * self.n + j - 1).copied().unwrap_or(0.0))
})
.collect()
})
.collect()
}
}
/// The kinds of element, each with its elements' points and shares of measure.
fn kinds<'a>(c: &'a PointCloud, g: &'a Geometry) -> [(On, Box<dyn Iterator<Item = (usize, [u32; 3], f64)> + 'a>); 3] {
let dot = if g.dots.is_empty() { 0.0 } else { 1.0 / g.dots.len() as f64 };
[
(On::Point, Box::new(g.dots.iter().map(move |i| (*i as usize, [*i; 3], dot)))),
(
On::Segment,
Box::new(c.complex.segments.0.as_chunks::<2>().0.iter().zip(&g.segments).enumerate().map(|(e, ([a, b], m))| (e, [*a, *b, *b], *m))),
),
(On::Triangle, Box::new(c.complex.triangles.0.as_chunks::<3>().0.iter().zip(&g.triangles).enumerate().map(|(e, (ids, m))| (e, *ids, *m)))),
]
}
/// How much of the cloud lies in each of `bins` bins over `axis` of `property`, by `colour`,
/// within every one of `filters`; `None` for an axis or a number of bins it can't have.
pub fn histogram(
@@ -451,68 +167,39 @@ pub fn histogram(
return None;
}
let slots = colour.slots();
let mut out = Bins::new(axis, bins, slots);
let kept: Vec<Kept> = filters.iter().map(Kept::of).collect();
let (colour_cut, plain) = (colour.cut(), slots - 1);
let (mut parts, mut next) = (Vec::new(), Vec::new());
let mut out = vec![vec![0.0; bins]; slots];
let mut extent = None;
for (on, elements) in kinds(c, g) {
let Some(p) = c.source(property, on) else { continue };
let filtered: Vec<Option<Source>> = filters.iter().map(|f| c.source(&f.property, on)).collect();
let coloured = colour.property().and_then(|n| c.source(n, on));
let start = match on {
On::Point => Part::Dot,
On::Segment => Part::Stretch([0.0, 1.0]),
On::Triangle => Part::Polygon(Polygon::triangle()),
let Some(p) = c.source(property) else { return Some(Histogram { bins, slots: out, extent }) };
// A point is not filtered by a property the cloud doesn't have, as in the view.
let kept: Vec<(Kept, Source)> = filters.iter().filter_map(|f| Some((Kept::of(f), c.source(&f.property)?))).collect();
let coloured = colour.property().and_then(|n| c.source(n));
let (colour_cut, plain) = (colour.cut(), slots - 1);
let m = 1.0 / g.world.len().max(1) as f64;
let width = (axis[1] - axis[0]) / bins as f64;
for i in 0..g.world.len() {
if !kept.iter().all(|(k, s)| k.keeps(value(*s, i, &g.world))) {
continue;
}
let v = value(p, i, &g.world);
if !v.is_finite() {
continue;
}
extent = Some(extent.map_or([v, v], |[lo, hi]: [f64; 2]| [lo.min(v), hi.max(v)]));
if !(v >= axis[0] && v <= axis[1]) {
continue;
}
let slot = match (colour_cut, coloured) {
(Some(cut), Some(s)) => colour.slot(cut.band(value(s, i, &g.world))),
(Some(_), None) => plain,
(None, _) => 0,
};
for (e, ids, m) in elements {
if m <= 0.0 {
continue;
}
parts.clear();
parts.push(start);
for (k, s) in kept.iter().zip(&filtered) {
// An element without the filtered property is not filtered by it, as in the view.
let Some(s) = s else { continue };
let f = corners(*s, e, ids, &g.world);
next.clear();
for part in &parts {
split(part, f, k.cut, |band, q| {
if k.keeps(band) {
next.push(q);
}
});
}
std::mem::swap(&mut parts, &mut next);
}
let pv = corners(p, e, ids, &g.world);
let colour_values = coloured.map(|s| corners(s, e, ids, &g.world));
for part in &parts {
// A linear function is least and greatest at a part's corners.
for v in part_values(part, pv) {
if v.is_finite() {
extent = Some(extent.map_or([v, v], |[lo, hi]: [f64; 2]| [lo.min(v), hi.max(v)]));
}
}
match (colour_cut, colour_values) {
(Some(cut), Some(f)) => split(part, f, cut, |band, q| spread(&mut out, colour.slot(band), &q, pv, m)),
(Some(_), None) => spread(&mut out, plain, part, pv, m),
(None, _) => spread(&mut out, 0, part, pv, m),
}
}
// The last bin holds the axis' upper end too.
let bin = (((v - axis[0]) / width).floor() as usize).min(bins - 1);
if let Some(b) = out.get_mut(slot).and_then(|s| s.get_mut(bin)) {
*b += m;
}
}
Some(Histogram { bins, slots: out.finish(slots), extent })
}
/// The values a linear function `f` takes at a part's corners.
fn part_values(part: &Part, f: [f64; 3]) -> impl Iterator<Item = f64> + '_ {
let (ends, corners): (Option<[f64; 2]>, &[[f64; 2]]) = match part {
Part::Dot => (Some([f[0], f[0]]), &[]),
Part::Stretch([s0, s1]) => (Some([at(f, [*s0, 0.0]), at(f, [*s1, 0.0])]), &[]),
Part::Polygon(p) => (None, p.corners()),
};
ends.into_iter().flatten().chain(corners.iter().map(move |c| at(f, *c)))
Some(Histogram { bins, slots: out, extent })
}
/// A range for a ramp from the values it spans: a single value gets one unit around it.
@@ -538,50 +225,16 @@ pub fn color_range_by(c: &PointCloud, extent: impl FnOnce(&str, [f64; 2]) -> Opt
extent(property, axis).map(ramp_range).or_else(|| c.color_range())
}
/// Spread a part's measure (`m`, the whole element's share) over the values `f` takes on it.
fn spread(out: &mut Bins, slot: usize, part: &Part, f: [f64; 3], m: f64) {
match part {
Part::Dot => out.point(slot, f[0], m),
Part::Stretch([s0, s1]) => {
let (a, b) = (at(f, [*s0, 0.0]), at(f, [*s1, 0.0]));
out.even(slot, a.min(b), a.max(b), m * (s1 - s0));
}
Part::Polygon(p) => {
let c = p.corners();
let Some(first) = c.first() else { return };
for w in c.get(1..).unwrap_or(&[]).windows(2) {
let [b, d] = [w[0], w[1]];
// The share of the triangle's area: twice the area in its own coordinates.
let area = ((b[0] - first[0]) * (d[1] - first[1]) - (b[1] - first[1]) * (d[0] - first[0])).abs();
let mut q = [at(f, *first), at(f, b), at(f, d)];
q.sort_by(f64::total_cmp);
out.tent(slot, q, m * area);
}
}
}
}
/// The values of `property` where the whole-numbered `label` changes, element after element in
/// order of `property` (each element at its smallest value, with its label there), lowest first.
/// The values of `property` where the whole-numbered `label` changes, point after point in order
/// of `property`, lowest first.
pub fn label_changes(c: &PointCloud, g: &Geometry, label: &str, property: &str) -> Vec<f64> {
let mut at: Vec<(f64, i64)> = Vec::new();
for (on, elements) in kinds(c, g) {
let (Some(p), Some(l)) = (c.source(property, on), c.source(label, on)) else { continue };
let n = match on {
On::Point => 1,
On::Segment => 2,
On::Triangle => 3,
};
for (e, ids, _) in elements {
let (pv, lv) = (corners(p, e, ids, &g.world), corners(l, e, ids, &g.world));
let lowest = (0..n).min_by(|i, j| pv[*i].total_cmp(&pv[*j])).unwrap_or(0);
let v = pv[lowest];
if v.is_finite() {
let l = lv[lowest];
at.push((v, if l.is_finite() { l.round() as i64 } else { i64::MIN }));
}
}
}
let (Some(p), Some(l)) = (c.source(property), c.source(label)) else { return Vec::new() };
let mut at: Vec<(f64, i64)> = (0..g.world.len())
.filter_map(|i| {
let (v, l) = (value(p, i, &g.world), value(l, i, &g.world));
v.is_finite().then(|| (v, if l.is_finite() { l.round() as i64 } else { i64::MIN }))
})
.collect();
at.sort_by(|a, b| a.0.total_cmp(&b.0));
let mut out: Vec<f64> = at.windows(2).filter(|w| w[0].1 != w[1].1).map(|w| w[1].0).collect();
out.dedup();
@@ -2,10 +2,10 @@ use solidcore_record::Vec3;
use super::*;
use crate::IDENTITY;
use crate::point_cloud::{ColorBy, Colors, Column, Complex, Floats, Indices, Points};
use crate::point_cloud::{ColorBy, Colors, Column, Complex, Floats, Points};
/// A cloud of `points`, with `segments` and `triangles` between them and `columns` on them.
fn cloud(points: &[[f32; 3]], segments: &[u32], triangles: &[u32], columns: Vec<Column>) -> PointCloud {
/// A cloud of `points` with `columns` on them.
fn cloud(points: &[[f32; 3]], columns: Vec<Column>) -> PointCloud {
PointCloud {
id: 1,
name: "c".into(),
@@ -21,14 +21,14 @@ fn cloud(points: &[[f32; 3]], segments: &[u32], triangles: &[u32], columns: Vec<
color: None,
height_range: None,
visible: true,
complex: Complex { segments: Indices(segments.to_vec().into()), triangles: Indices(triangles.to_vec().into()), columns, names: Vec::new() },
complex: Complex { columns, names: Vec::new() },
color_property: None,
filters: Vec::new(),
}
}
fn column(name: &str, on: On, integer: bool, values: &[f32]) -> Column {
Column { name: name.into(), on, integer, values: Floats(values.to_vec().into()) }
fn column(name: &str, integer: bool, values: &[f32]) -> Column {
Column { name: name.into(), integer, values: Floats(values.to_vec().into()) }
}
fn range(property: &str, range: [f64; 2]) -> Filter {
@@ -39,19 +39,27 @@ fn close(a: &[f64], b: &[f64]) -> bool {
a.len() == b.len() && a.iter().zip(b).all(|(x, y)| (x - y).abs() < 1e-9)
}
/// Ten points along x, `t` the same as x.
fn row() -> PointCloud {
let points: Vec<[f32; 3]> = (0..10).map(|i| [i as f32 + 0.5, 0.0, 0.0]).collect();
let t: Vec<f32> = points.iter().map(|p| p[0]).collect();
cloud(&points, vec![column("t", false, &t)])
}
#[test]
fn a_segment_spreads_its_length_evenly_over_what_a_range_keeps() {
// t runs 0 to 10 along a segment 10 long.
let c = cloud(&[[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]], &[0, 1], &[], vec![column("t", On::Point, false, &[0.0, 10.0])]);
fn each_point_weighs_alike_and_a_range_keeps_those_within_it() {
let c = row();
let g = Geometry::of(&c);
let all = histogram(&c, &g, "t", [0.0, 10.0], 10, &Colour::One, &[]).unwrap();
assert!(close(&all.slots[0], &[0.1; 10]));
// Kept from t = 2.5 to 5: the part is cut at the iso-values, as the view cuts it.
let kept = histogram(&c, &g, "t", [0.0, 10.0], 10, &Colour::One, &[range("t", [2.5, 5.0])]).unwrap();
assert!(close(&kept.slots[0], &[0.0, 0.0, 0.05, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0]));
// Filtered by another property along the same segment: x from 0 to 4 keeps t from 0 to 4.
let all = histogram(&c, &g, "t", [0.0, 10.0], 5, &Colour::One, &[]).unwrap();
assert!(close(&all.slots[0], &[0.2; 5]));
// Kept from t = 2 to 5: three points, ends included.
let kept = histogram(&c, &g, "t", [0.0, 10.0], 5, &Colour::One, &[range("t", [2.0, 5.0])]).unwrap();
assert!(close(&kept.slots[0], &[0.0, 0.2, 0.1, 0.0, 0.0]));
// Filtered by another property: x from 0 to 4 keeps t from 0 to 4.
let by_x = histogram(&c, &g, "t", [0.0, 10.0], 5, &Colour::One, &[range("x", [0.0, 4.0])]).unwrap();
assert!(close(&by_x.slots[0], &[0.2, 0.2, 0.0, 0.0, 0.0]));
// A filter on a property the cloud doesn't have keeps everything, as in the view.
assert_eq!(histogram(&c, &g, "t", [0.0, 10.0], 5, &Colour::One, &[range("nope", [0.0, 1.0])]), Some(all));
// An axis or a number of bins it can't have.
for (axis, bins) in [([1.0, 1.0], 4), ([0.0, f64::NAN], 4), ([0.0, 1.0], 0), ([0.0, 1.0], MAX_BINS + 1)] {
assert!(histogram(&c, &g, "t", axis, bins, &Colour::One, &[]).is_none());
@@ -59,82 +67,37 @@ fn a_segment_spreads_its_length_evenly_over_what_a_range_keeps() {
}
#[test]
fn a_triangle_spreads_its_area_as_a_tent_over_its_corners_values() {
// t is 0, 1 and 2 at the corners: the measure rises to t = 1 and falls to 2.
let c = cloud(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], &[], &[0, 1, 2], vec![column("t", On::Point, false, &[0.0, 1.0, 2.0])]);
let g = Geometry::of(&c);
let h = histogram(&c, &g, "t", [0.0, 2.0], 4, &Colour::One, &[]).unwrap();
// The distribution function: x²/2 up to 1, then 1 − (2 − x)²/2.
assert!(close(&h.slots[0], &[0.125, 0.375, 0.375, 0.125]));
// Cut at t ≤ 1: half the area is left, all below 1.
let half = histogram(&c, &g, "t", [0.0, 2.0], 4, &Colour::One, &[range("t", [0.0, 1.0])]).unwrap();
assert!(close(&half.slots[0], &[0.125, 0.375, 0.0, 0.0]));
// Cut by x across t: the part where x ≤ 0.5, its area 3/4 of the triangle's.
let x = histogram(&c, &g, "t", [0.0, 2.0], 1, &Colour::One, &[range("x", [0.0, 0.5])]).unwrap();
assert!(close(&x.slots[0], &[0.75]));
}
#[test]
fn kinds_weigh_alike_and_colours_split_what_is_kept() {
// Two segments, roles 0 and 3, and a dot; t along each segment, the dot at t = 5.
fn colours_split_what_is_kept() {
// Four points, roles 0, 3, 3 and -1, t from 0 to 3.
let c = cloud(
&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 0.0, 0.0], [4.0, 0.0, 0.0], [9.0, 9.0, 9.0]],
&[0, 1, 2, 3],
&[],
vec![
column("t", On::Point, false, &[0.0, 1.0, 1.0, 4.0, 5.0]),
column("role", On::Segment, true, &[0.0, 3.0]),
column("role", On::Point, true, &[0.0, 0.0, 0.0, 0.0, 2.0]),
],
&[[0.0; 3], [1.0, 0.0, 0.0], [2.0, 0.0, 0.0], [3.0, 0.0, 0.0]],
vec![column("t", false, &[0.0, 1.0, 2.0, 3.0]), column("role", true, &[0.0, 3.0, 3.0, -1.0])],
);
let g = Geometry::of(&c);
let colour = Colour::Palette { property: "role" };
let h = histogram(&c, &g, "t", [0.0, 5.0], 5, &colour, &[]).unwrap();
let h = histogram(&c, &g, "t", [0.0, 4.0], 4, &colour, &[]).unwrap();
assert_eq!(h.slots.len(), colour.slots());
// The segments share their kind's 1 by length (1 and 3), the dot has its kind's 1.
assert!(close(&h.slots[0], &[0.25, 0.0, 0.0, 0.0, 0.0]));
assert!(close(&h.slots[3], &[0.0, 0.25, 0.25, 0.25, 0.0]));
assert!(close(&h.slots[2], &[0.0, 0.0, 0.0, 0.0, 1.0]));
// A filter by values keeps role 3 only; the dot has a role too and is left out.
assert!(close(&h.slots[0], &[0.25, 0.0, 0.0, 0.0]));
assert!(close(&h.slots[3], &[0.0, 0.25, 0.25, 0.0]));
assert!(close(&h.slots[PALETTE.len()], &[0.0, 0.0, 0.0, 0.25]), "a negative label");
// A filter by values keeps role 3 only.
let three = Filter { property: "role".into(), keep: Keep::Values { values: vec![3] } };
let kept = histogram(&c, &g, "t", [0.0, 5.0], 5, &colour, &[three]).unwrap();
let kept = histogram(&c, &g, "t", [0.0, 4.0], 4, &colour, &[three]).unwrap();
let total: f64 = kept.slots.iter().flatten().sum();
assert!((total - 0.75).abs() < 1e-9 && close(&kept.slots[3], &h.slots[3]));
// A ramp over t in two bands splits the long segment where t crosses 2.5.
let ramp = Colour::Ramp { property: "t", range: [0.0, 5.0], bands: 2 };
let r = histogram(&c, &g, "t", [0.0, 5.0], 5, &ramp, &[]).unwrap();
assert!(close(&r.slots[0], &[0.25, 0.25, 0.125, 0.0, 0.0]) && close(&r.slots[1], &[0.0, 0.0, 0.125, 0.25, 1.0]));
assert!((total - 0.5).abs() < 1e-9 && close(&kept.slots[3], &h.slots[3]));
// A ramp over t in two bands, and coloured by a property the cloud doesn't have: plain.
let ramp = Colour::Ramp { property: "t", range: [0.0, 4.0], bands: 2 };
let r = histogram(&c, &g, "t", [0.0, 4.0], 4, &ramp, &[]).unwrap();
assert!(close(&r.slots[0], &[0.25, 0.25, 0.0, 0.0]) && close(&r.slots[1], &[0.0, 0.0, 0.25, 0.25]));
let none = histogram(&c, &g, "t", [0.0, 4.0], 4, &Colour::Palette { property: "nope" }, &[]).unwrap();
assert!(close(&none.slots[PALETTE.len() + 1], &[0.25; 4]));
}
#[test]
fn a_ramp_of_the_most_bands_keeps_all_of_an_element() {
// Across every band of the finest ramp the API accepts, nothing is lost: a segment and a
// triangle, within the ramp and running past both its ends.
let t = |values: &[f32]| vec![column("t", On::Point, false, values)];
let ramp = Colour::Ramp { property: "t", range: [0.0, 1.0], bands: MAX_BINS };
for c in [
cloud(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]], &[0, 1], &[], t(&[0.0, 1.0])),
cloud(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], &[], &[0, 1, 2], t(&[0.0, 1.0, 0.5])),
cloud(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]], &[0, 1], &[], t(&[-0.5, 1.5])),
cloud(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], &[], &[0, 1, 2], t(&[-0.5, 1.5, 0.5])),
] {
let g = Geometry::of(&c);
let h = histogram(&c, &g, "t", [-1.0, 2.0], 4, &ramp, &[]).unwrap();
let total: f64 = h.slots.iter().flatten().sum();
assert!((total - 1.0).abs() < 1e-9, "{total}");
}
}
#[test]
fn labels_change_where_the_next_element_has_another() {
// Five segments in order of t, layers 0 0 1 1 2.
fn labels_change_where_the_next_point_has_another() {
// Six points in order of t, layers 0 0 1 1 2 2.
let points: Vec<[f32; 3]> = (0..6).map(|i| [i as f32, 0.0, 0.0]).collect();
let c = cloud(
&points,
&[0, 1, 1, 2, 2, 3, 3, 4, 4, 5],
&[],
vec![column("t", On::Point, false, &[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]), column("layer", On::Segment, true, &[0.0, 0.0, 1.0, 1.0, 2.0])],
);
let c = cloud(&points, vec![column("t", false, &[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]), column("layer", true, &[0.0, 0.0, 1.0, 1.0, 2.0, 2.0])]);
let g = Geometry::of(&c);
assert_eq!(label_changes(&c, &g, "layer", "t"), vec![2.0, 4.0]);
assert!(label_changes(&c, &g, "nope", "t").is_empty());
@@ -142,21 +105,21 @@ fn labels_change_where_the_next_element_has_another() {
#[test]
fn the_automatic_range_is_what_every_filter_keeps() {
// t runs 0 to 10 along x; filtered by x from 2 to 4, coloured by t: the range is 2 to 4,
// though no filter is on t (its span within filters on t would be 0 to 10).
let mut c = cloud(&[[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [20.0, 0.0, 0.0]], &[0, 1], &[], vec![column("t", On::Point, false, &[0.0, 10.0, 7.0])]);
// Filtered by x from 2 to 4, coloured by t: the range is what is kept of t, though no filter
// is on t (its span within filters on t would be all of it).
let mut c = cloud(&[[0.0, 0.0, 0.0], [2.0, 0.0, 0.0], [4.0, 0.0, 0.0], [20.0, 0.0, 0.0]], vec![column("t", false, &[0.0, 3.0, 5.0, 7.0])]);
c.color_by = ColorBy::Property;
c.color_property = Some("t".into());
let g = Geometry::of(&c);
let x = [range("x", [2.0, 4.0])];
assert_eq!(c.color_range(), Some([0.0, 10.0]));
assert_eq!(color_range(&c, &g, &x), Some([2.0, 4.0]));
// The dot at x = 20 is kept by nothing; by itself it would be one value, one unit wide.
assert_eq!(c.color_range(), Some([0.0, 7.0]));
assert_eq!(color_range(&c, &g, &x), Some([3.0, 5.0]));
// The point at x = 20 alone: one value, one unit wide.
assert_eq!(color_range(&c, &g, &[range("x", [19.0, 21.0])]), Some([6.5, 7.5]));
// Nothing kept: the cloud's own bound; a range set is kept as it is.
assert_eq!(color_range(&c, &g, &[range("x", [50.0, 60.0])]), Some([0.0, 10.0]));
assert_eq!(color_range(&c, &g, &[range("x", [50.0, 60.0])]), Some([0.0, 7.0]));
c.height_range = Some([1.0, 2.0]);
assert_eq!(color_range(&c, &g, &x), Some([1.0, 2.0]));
let h = histogram(&c, &g, "t", [0.0, 1.0], 4, &Colour::One, &x).unwrap();
assert_eq!(h.extent, Some([2.0, 4.0]), "the extent reaches past the axis");
assert_eq!(h.extent, Some([3.0, 5.0]), "the extent reaches past the axis");
}
+1 -1
View File
@@ -278,7 +278,7 @@ fn selection_indices(ss: &SolvedSketch, selection: &ProfileSel, mut notes: Optio
.profiles
.iter()
.enumerate()
.filter(|(_, profile)| profile.contains(*point))
.filter(|(_, profile)| profile.region.contains(*point))
.min_by(|(_, a), (_, b)| a.area.total_cmp(&b.area))
.ok_or_else(|| DocError::Unknown(format!("profile at {:?} in {}", [point.x, point.y], ss.name)))?;
indices.push(index);
+13 -42
View File
@@ -55,21 +55,17 @@ pub struct Resolved {
static CACHE: std::sync::Mutex<Vec<(String, Resolved)>> = std::sync::Mutex::new(Vec::new());
const CACHE_SIZE: usize = 64;
fn is_sketch_curve(src: &LinkSource) -> bool {
matches!(src, LinkSource::SketchCurve { .. })
}
fn cache_key(st: &ModelState, plane: &Plane, kind: LinkKind, src: &LinkSource) -> Option<String> {
// An intersection with a sketch curve (#11048) changes with that sketch, not with the meshes.
let body_based = matches!(
src,
LinkSource::Edge { .. }
| LinkSource::Face { .. }
| LinkSource::Body { .. }
| LinkSource::Vertex { .. }
| LinkSource::Intersection { .. }
| LinkSource::Iso { .. }
| LinkSource::Spun { .. }
) || matches!(src, LinkSource::Intersection { a, b } if !is_sketch_curve(a) && !is_sketch_curve(b));
);
if !body_based {
return None;
}
@@ -229,12 +225,16 @@ fn resolve_uncached(
Vec::new()
}
LinkSource::Intersection { a, b } => {
// Where the bodies, faces or other sketches' curves meet, as the edges SMLib's imprint
// of one by the other makes: each its exact record curve, its points at the display
// tolerance.
for (pts, curves) in crate::project3d::meeting(st, a, b)? {
wires.push(pts);
exact.push(curves);
// Where the bodies (or faces) meet, as the edges SMLib's imprint of one by the other
// makes: each its exact record curve, its points at the display tolerance.
let (ba, fa) = crate::project3d::part_of(st, a).ok_or_else(|| lost(&a.describe()))?;
let (bb, fb) = crate::project3d::part_of(st, b).ok_or_else(|| lost(&b.describe()))?;
let chord = (ba.body.size().max(bb.body.size()) * 1e-3).max(1e-3);
for e in
crate::kernel::meeting_edges(&ba.body, fa.as_ref().map(std::slice::from_ref), &bb.body, fb.as_ref().map(std::slice::from_ref), chord)?
{
wires.push(e.points);
exact.push(vec![WireCurve { curve: e.curve, interval: e.interval }]);
}
Vec::new()
}
@@ -1619,36 +1619,7 @@ pub(crate) fn section(plane: &Plane, m: &Mesh, face: Option<u32>) -> Vec<LinkGeo
// where they are) are kept when they take no more curves than the loose fit.
let close = refine(fit_segments(&segs, size, true));
let plain = |v: &[LinkGeom]| v.iter().all(|g| matches!(g, LinkGeom::Line(..) | LinkGeom::Arc { .. } | LinkGeom::Circle(..)));
// A loose fit with fewer curves can still be wrong: short faces beside a small round (2 mm
// walls each side of an R2 corner) fit within its tolerance as one larger arc. The exact
// crossings (on planes and rulings) show it: one of them off every curve of the fit.
// Any other curve counts as near, and past a work limit nothing is checked: the loose fit
// stands, as before.
let tight = size * 1e-4;
let checkable = exact.len().saturating_mul(close.len()) <= 4_000_000;
let strays = |v: &[LinkGeom]| exact.iter().any(|p| !v.iter().any(|g| plain_distance(g, *p).is_none_or(|d| d <= tight)));
if plain(&close) && (close.len() <= lossy.len() || (checkable && strays(&lossy) && !strays(&close))) { close } else { lossy }
}
/// How far `p` lies from a line, arc or circle; None for any other curve.
fn plain_distance(g: &LinkGeom, p: Vec2) -> Option<f64> {
match *g {
LinkGeom::Line(a, b) => {
let d = b - a;
let t = if d.len2() > 0.0 { ((p - a).dot(d) / d.len2()).clamp(0.0, 1.0) } else { 0.0 };
Some(p.dist(a.lerp(b, t)))
}
LinkGeom::Circle(c, r) => Some((p.dist(c) - r).abs()),
LinkGeom::Arc { c, a, b } => {
let (s0, sw) = ((a - c).angle(), ((b - c).angle() - (a - c).angle()).rem_euclid(std::f64::consts::TAU));
if ((p - c).angle() - s0).rem_euclid(std::f64::consts::TAU) <= sw + 1e-9 {
Some((p.dist(c) - c.dist(a)).abs())
} else {
Some(p.dist(a).min(p.dist(b)))
}
}
_ => None,
}
if plain(&close) && close.len() <= lossy.len() { close } else { lossy }
}
/// The segments where the plane crosses the mesh's triangles (in plane coordinates, each with
+7 -233
View File
@@ -1,253 +1,27 @@
//! 3D sketch curves from the model: curves projected onto faces (on their display meshes), the
//! sides an intersection curve is taken on (bodies, faces and other sketches' curves), and spun profiles.
//! bodies and faces an intersection curve is taken on, and spun profiles.
use solidcore_record::{Plane, Seg2, Vec2, Vec3};
use solidcore_record::{Plane, Vec2, Vec3};
use solidcraft_geom::Mesh;
use solidcraft_geom::prelude::*;
use solidcraft_sketch::{LinkSource, WireCurve};
use solidcraft_sketch::LinkSource;
use crate::eval::ModelState;
/// The body of a body or face reference and, for a face reference, the faces (indices in the
/// body's face order) of the freeform surface its face is part of ([`smooth_patch`]), on the named
/// body or else the nearest body, so a spline wall of one face per span meets as a whole (#9009).
fn part_of<'a>(st: &'a ModelState, src: &LinkSource) -> Option<(&'a crate::ModelBody, Option<Vec<usize>>)> {
/// The body of a body or face reference, and the face (its index in the body's face order) for a
/// face reference: the face nearest its point, on the named body or else the nearest body.
pub(crate) fn part_of<'a>(st: &'a ModelState, src: &LinkSource) -> Option<(&'a crate::ModelBody, Option<usize>)> {
match src {
LinkSource::Body { body } => Some((st.body(body)?, None)),
LinkSource::Face { body, at } => {
let b = st.body(body).or_else(|| st.bodies.iter().min_by(|x, y| dist_to(&x.mesh(), *at).total_cmp(&dist_to(&y.mesh(), *at))))?;
let (f, _, _) = crate::project::nearest_face(&b.mesh(), *at)?;
Some((b, Some(smooth_patch(&b.body, usize::try_from(f).ok()?))))
Some((b, usize::try_from(f).ok()))
}
_ => None,
}
}
/// The faces one freeform surface with `face` makes, sorted: `face` and the spline faces joined to
/// it at least tangentially (G1, measured on the exact surfaces), never across a crease. A
/// fit-point spline's wall is one face per span, and a pick on any span means the whole wall; a
/// plane, a fillet or any other analytic face is the face alone, as are faces whose seams cannot
/// be measured.
fn smooth_patch(body: &crate::kernel::Body, face: usize) -> Vec<usize> {
use solidcore_record::brep::Surface;
let r = body.record();
let freeform = |f: usize| r.faces.get(f).is_some_and(|f| matches!(f.surface, Surface::Spline { .. } | Surface::RationalSpline { .. }));
if !freeform(face) {
return vec![face];
}
// The two-sided edges between freeform faces, the only seams worth measuring.
let between: Vec<(usize, [usize; 2])> = r
.edges
.iter()
.enumerate()
.filter_map(|(ei, e)| {
let mut fs: Vec<usize> = e.uses.iter().map(|u| u.face as usize).collect();
fs.sort_unstable();
fs.dedup();
match fs[..] {
[x, y] if freeform(x) && freeform(y) => Some((ei, [x, y])),
_ => None,
}
})
.collect();
let edges: Vec<usize> = between.iter().map(|(ei, _)| *ei).collect();
let tangent: std::collections::BTreeSet<usize> = if edges.is_empty() {
Default::default()
} else {
crate::kernel::seam_diagnostics(body, &edges, crate::kernel::MIN_SAMPLES, crate::kernel::ContinuityTolerances::default())
.map(|rep| {
rep.seams
.iter()
.filter(|s| matches!(s.verdict, crate::kernel::SeamVerdict::Smooth | crate::kernel::SeamVerdict::CurvatureJump))
.map(|s| s.edge)
.collect()
})
.unwrap_or_default()
};
let mut patch = std::collections::BTreeSet::from([face]);
let mut todo = vec![face];
while let Some(f) = todo.pop() {
for (_, pair) in between.iter().filter(|(ei, pair)| tangent.contains(ei) && pair.contains(&f)) {
for next in pair {
if patch.insert(*next) {
todo.push(*next);
}
}
}
}
patch.into_iter().collect()
}
/// One side of an intersection curve: a body (or a face patch of it), or a curve of another sketch.
enum Side<'a> {
Part(&'a crate::ModelBody, Option<Vec<usize>>),
Curve { plane: Plane, segs: Vec<Seg2>, pts: Vec<Vec3> },
}
fn side_of<'a>(st: &'a ModelState, src: &LinkSource) -> Option<Side<'a>> {
if let Some((b, f)) = part_of(st, src) {
return Some(Side::Part(b, f));
}
let LinkSource::SketchCurve { sketch, curve } = src else { return None };
let ss = st.sketch(*sketch)?;
let ci = ss.sketch.curve_index(curve)?;
let segs = ss.sketch.exact_segs(ci).unwrap_or_else(|| ss.sketch.segs(ci));
let pts: Vec<Vec3> = ss.sketch.segs(ci).iter().flat_map(|s| s.polyline(1e-3)).map(|p| ss.plane.to_world(p)).collect();
(!segs.is_empty() && pts.len() >= 2).then_some(Side::Curve { plane: ss.plane, segs, pts })
}
/// Bounds of a point set; `None` when empty or not finite.
fn bounds_of<'a>(pts: impl IntoIterator<Item = &'a Vec3>) -> Option<(Vec3, Vec3)> {
let mut it = pts.into_iter();
let first = *it.next()?;
let (lo, hi) = it.fold((first, first), |(l, h), p| (l.min(*p), h.max(*p)));
(lo.is_finite() && hi.is_finite()).then_some((lo, hi))
}
/// The offsets along `plane`'s unit normal `n` that cover the box `lo`..`hi`, padded.
fn span_over(plane: &Plane, n: Vec3, lo: Vec3, hi: Vec3) -> (f64, f64) {
let corners =
(0..8).map(|i| Vec3::new(if i & 1 == 0 { lo.x } else { hi.x }, if i & 2 == 0 { lo.y } else { hi.y }, if i & 4 == 0 { lo.z } else { hi.z }));
let (s0, s1) = corners.map(|c| (c - plane.origin).dot(n)).fold((f64::INFINITY, f64::NEG_INFINITY), |(l, h), s| (l.min(s), h.max(s)));
let pad = (hi - lo).len() * 0.02 + 1e-3;
(s0 - pad, s1 + pad)
}
/// Where intersection sides `a` and `b` meet, as whole curves ([`join_meeting`]): the edges
/// SMLib's imprint of one by the other makes, each its exact record curve, its points at the
/// display tolerance. A sketch curve stands in for its extrusion along its sketch's normal, both
/// ways and as far as the other side reaches: a sheet made here for this alone and never added to
/// the model (#11048).
pub(crate) fn meeting(st: &ModelState, a: &LinkSource, b: &LinkSource) -> crate::Result<Vec<(Vec<Vec3>, Vec<WireCurve>)>> {
let lost = |s: &LinkSource| crate::DocError::Unknown(format!("{} no longer exists", s.describe()));
let (sa, sb) = (side_of(st, a).ok_or_else(|| lost(a))?, side_of(st, b).ok_or_else(|| lost(b))?);
let unit = |p: &Plane, s: &LinkSource| p.normal().normalized().ok_or_else(|| lost(s));
// How far each curve is swept: across the other side's bounds, or for two curves as far as a
// crossing can lie (a + s·na = b + t·nb with a, b within the curves' bounds, so |s|·sin ≤ |a − b|).
let (ra, rb) = match (&sa, &sb) {
(Side::Curve { plane: pa, pts: qa, .. }, Side::Curve { plane: pb, pts: qb, .. }) => {
let sin = unit(pa, a)?.cross(unit(pb, b)?).len();
if sin < 1e-6 {
return Err(crate::DocError::Invalid("the two curves' sketches are parallel, so their extrusions never cross in a curve".into()));
}
let (lo, hi) = bounds_of(qa.iter().chain(qb)).ok_or_else(|| lost(a))?;
let reach = (hi - lo).len() / sin * 1.05 + 1e-3;
((-reach, reach), (-reach, reach))
}
(Side::Curve { plane, .. }, Side::Part(mb, _)) => {
let m = mb.body.exact_bounds()?;
(span_over(plane, unit(plane, a)?, m.min, m.max), (0.0, 0.0))
}
(Side::Part(mb, _), Side::Curve { plane, .. }) => {
let m = mb.body.exact_bounds()?;
((0.0, 0.0), span_over(plane, unit(plane, b)?, m.min, m.max))
}
(Side::Part(..), Side::Part(..)) => ((0.0, 0.0), (0.0, 0.0)),
};
let sheet = |s: &Side, (s0, s1): (f64, f64)| -> crate::Result<Option<crate::kernel::Body>> {
match s {
Side::Curve { plane, segs, .. } => Ok(Some(crate::kernel::extrude_sheet(plane, std::slice::from_ref(segs), s0, s1)?)),
Side::Part(..) => Ok(None),
}
};
let (ka, kb) = (sheet(&sa, ra)?, sheet(&sb, rb)?);
let (Some((ba, fa)), Some((bb, fb))) = (body_of(&sa, ka.as_ref()), body_of(&sb, kb.as_ref())) else { return Err(lost(a)) };
let chord = (ba.size().max(bb.size()) * 1e-3).max(1e-3);
// The pieces end at the imprint's shared vertices, which the kernel places within its
// intersection tolerance; ten times that, as when it sews sheets, joins them and nothing else.
let tol = 10.0 * ba.record().tolerance.max(bb.record().tolerance).max(1e-9);
Ok(join_meeting(crate::kernel::meeting_edges(ba, fa, bb, fb, chord)?, tol))
}
/// The kernel body a side is intersected as: its model body (and face patch), or the curve's `sheet`.
fn body_of<'b>(side: &'b Side<'b>, sheet: Option<&'b crate::kernel::Body>) -> Option<(&'b crate::kernel::Body, Option<&'b [usize]>)> {
match side {
Side::Part(mb, f) => Some((&mb.body, f.as_deref())),
Side::Curve { .. } => sheet.map(|k| (k, None)),
}
}
/// The meeting edges as whole curves: edges whose ends meet (within `tol`) joined end to end, each
/// curve its points and its exact pieces in order along them. The imprint splits a crossing at
/// every face boundary of either side, so one crossing of two spline walls comes as one edge per
/// span; it is one curve.
fn join_meeting(edges: Vec<crate::kernel::MeetingEdge>, tol: f64) -> Vec<(Vec<Vec3>, Vec<WireCurve>)> {
let mut left: Vec<(Vec<Vec3>, Vec<WireCurve>)> =
edges.into_iter().filter(|e| !e.points.is_empty()).map(|e| (e.points, vec![WireCurve { curve: e.curve, interval: e.interval }])).collect();
let flip = |(mut p, c): (Vec<Vec3>, Vec<WireCurve>)| {
p.reverse();
(p, c.iter().rev().map(reversed).collect::<Vec<_>>())
};
let mut out = Vec::new();
while let Some(mut cur) = left.pop() {
while let (Some(cs), Some(ce)) = (cur.0.first().copied(), cur.0.last().copied()) {
if cur.0.len() > 2 && cs.dist(ce) < tol {
break;
}
let ends = |w: &(Vec<Vec3>, Vec<WireCurve>)| w.0.first().copied().zip(w.0.last().copied());
let Some(i) = left.iter().position(|w| ends(w).is_some_and(|(s, e)| [s, e].iter().any(|q| q.dist(ce) < tol || q.dist(cs) < tol))) else {
break;
};
let next = left.swap_remove(i);
let Some((s, e)) = ends(&next) else { break };
// Append after the end or prepend before the start, turning `next` to run on.
let (mut head, tail) = if s.dist(ce) < tol {
(cur, next)
} else if e.dist(ce) < tol {
(cur, flip(next))
} else if e.dist(cs) < tol {
(next, cur)
} else {
(flip(next), cur)
};
head.0.extend(tail.0.into_iter().skip(1));
head.1.extend(tail.1);
cur = head;
}
out.push(cur);
}
out
}
/// `w` run the other way: the same points, its parameter reversed (record curves have no
/// direction flag, so the curve itself is rewritten).
fn reversed(w: &WireCurve) -> WireCurve {
use solidcore_record::brep::Curve;
let [t0, t1] = w.interval;
let mirror = |knots: &[f64]| {
let (a, b) = (knots.first().copied().unwrap_or(0.0), knots.last().copied().unwrap_or(0.0));
(knots.iter().rev().map(|k| a + b - k).collect::<Vec<_>>(), a + b)
};
let (curve, interval) = match &w.curve {
Curve::Line { start, end } => (Curve::Line { start: *end, end: *start }, [1.0 - t1, 1.0 - t0]),
Curve::Circle { frame, radius } => (Curve::Circle { frame: flipped(frame), radius: *radius }, [-t1, -t0]),
Curve::Ellipse { frame, radii } => (Curve::Ellipse { frame: flipped(frame), radii: *radii }, [-t1, -t0]),
Curve::Polyline { points } => {
let n = points.len().saturating_sub(1) as f64;
(Curve::Polyline { points: points.iter().rev().copied().collect() }, [n - t1, n - t0])
}
Curve::Spline { knots, points } => {
let (k, s) = mirror(knots);
(Curve::Spline { knots: k, points: points.iter().rev().copied().collect() }, [s - t1, s - t0])
}
Curve::RationalSpline { knots, homogeneous } => {
let (k, s) = mirror(knots);
(Curve::RationalSpline { knots: k, homogeneous: homogeneous.iter().rev().copied().collect() }, [s - t1, s - t0])
}
Curve::SurfaceIntersection { surfaces, leader, tolerance } => {
let r = reversed(&WireCurve { curve: (**leader).clone(), interval: w.interval });
(Curve::SurfaceIntersection { surfaces: surfaces.clone(), leader: Box::new(r.curve), tolerance: *tolerance }, r.interval)
}
};
WireCurve { curve, interval }
}
/// `f` with its y axis turned over, so a circle or ellipse on it runs the other way.
fn flipped(f: &solidcore_record::brep::Frame) -> solidcore_record::brep::Frame {
let [x, y, z] = f.y_axis;
solidcore_record::brep::Frame { origin: f.origin, x_axis: f.x_axis, y_axis: [-x, -y, -z] }
}
fn dist_to(m: &Mesh, p: Vec3) -> f64 {
crate::project::nearest_face(m, p).map(|x| x.2).unwrap_or(f64::INFINITY)
}
+2 -2
View File
@@ -280,7 +280,7 @@ pub fn encode_hdr_base64(bytes: &[u8]) -> Result<String> {
Ok(encoded)
}
pub(crate) fn decode_base64(value: &str, maximum: usize) -> Result<Vec<u8>> {
fn decode_base64(value: &str, maximum: usize) -> Result<Vec<u8>> {
let length = base64_length(value, maximum)?;
let padding = if value.ends_with("==") { 2 } else { usize::from(value.ends_with('=')) };
let mut bytes = Vec::new();
@@ -420,7 +420,7 @@ impl<'de> DeserializeSeed<'de> for EncodedBudget {
// RawValue borrows the JSON source without building serde_json's unescaped String scratch.
// Count base64 characters (including legal JSON slash/Unicode escapes) before any payload
// allocation. Full canonical padding, stream, radiance and digest checks still follow.
pub(crate) fn json_base64_length(raw: &str, maximum: usize) -> Result<usize> {
fn json_base64_length(raw: &str, maximum: usize) -> Result<usize> {
let text = raw.strip_prefix('"').and_then(|s| s.strip_suffix('"')).ok_or_else(|| invalid("HDR data must be a base64 string"))?;
let mut bytes = text.as_bytes().iter().copied();
let mut count = 0usize;
+4 -20
View File
@@ -121,10 +121,8 @@ impl RenderSetup {
if !self.stage.is_empty() && matches!(self.job, Some(RenderJob::Raster { .. })) {
return Err(DocError::Invalid("passive stage geometry requires raytracing; raster cannot silently discard it".into()));
}
if !self.surfaces.is_empty() && !matches!(self.job, Some(RenderJob::CpuRaytrace { .. } | RenderJob::GpuPath { .. })) {
return Err(DocError::Invalid(
"saved surfaces require an explicit CPU raytrace or GPU path job; unsupported methods cannot discard bindings".into(),
));
if !self.surfaces.is_empty() && !matches!(self.job, Some(RenderJob::GpuPath { .. })) {
return Err(DocError::Invalid("saved surfaces require an explicit GPU job; unsupported methods cannot discard bindings".into()));
}
let (width, height) = (u64::from(self.width), u64::from(self.height));
if width == 0 || height == 0 {
@@ -187,8 +185,6 @@ pub struct RenderSettings {
pub setups: BTreeMap<String, RenderSetup>,
#[serde(skip_serializing_if = "crate::render_resources::HdrResources::is_empty")]
pub resources: crate::render_resources::HdrResources,
#[serde(skip_serializing_if = "crate::render_texture_resources::TextureResources::is_empty")]
pub texture_resources: crate::render_texture_resources::TextureResources,
}
#[derive(Default, Deserialize)]
@@ -196,13 +192,12 @@ pub struct RenderSettings {
struct UncheckedSettings {
setups: BTreeMap<String, RenderSetup>,
resources: crate::render_resources::HdrResources,
texture_resources: crate::render_texture_resources::TextureResources,
}
impl TryFrom<UncheckedSettings> for RenderSettings {
type Error = DocError;
fn try_from(value: UncheckedSettings) -> Result<Self> {
let settings = Self { setups: value.setups, resources: value.resources, texture_resources: value.texture_resources };
let settings = Self { setups: value.setups, resources: value.resources };
settings.validate()?;
Ok(settings)
}
@@ -210,7 +205,7 @@ impl TryFrom<UncheckedSettings> for RenderSettings {
impl RenderSettings {
pub fn is_empty(&self) -> bool {
self.setups.is_empty() && self.resources.is_empty() && self.texture_resources.is_empty()
self.setups.is_empty() && self.resources.is_empty()
}
pub fn validate_name(name: &str) -> Result<()> {
@@ -233,17 +228,6 @@ impl RenderSettings {
}
pub fn validate_resources(&self, setup: &RenderSetup) -> Result<()> {
for surface in setup.surfaces.iter() {
if let crate::render_surface::SurfaceSource::Embedded(source) = &surface.source {
for (role, id) in source.role_resources() {
let resource = self.texture_resources.required(&id)?;
resource.validate_role(role)?;
if matches!(setup.job, Some(RenderJob::CpuRaytrace { .. })) {
resource.validate_cpu_encoding()?;
}
}
}
}
match &setup.job {
Some(RenderJob::CpuRaytrace { options }) => {
if let Some(hdr) = options.hdr {
+5 -70
View File
@@ -1,6 +1,6 @@
//! Portable opaque surface intent with built-in or design-owned encoded sources.
//! Targets use definition/feature/occurrence identity, never a captured mesh ordinal.
//! Frames are definition-local millimetres; no paths or device objects are saved.
//! Portable built-in surface intent. Targets use definition/feature/occurrence identity,
//! never a captured mesh ordinal. Frames are definition-local millimetres. Encoded map
//! hashes pin the installed built-in resource revision; no paths or device objects are saved.
use crate::{DocError, Result, render_resources::HdrId};
use serde::{Deserialize, Serialize};
use solidcraft_render::job::textures::PlanarFrame;
@@ -72,74 +72,10 @@ impl BuiltinSurfaceSource {
#[serde(deny_unknown_fields)]
pub struct SavedSurface {
pub target: RenderBodyTarget,
pub source: SurfaceSource,
pub source: BuiltinSurfaceSource,
pub local_frame: PlanarFrame,
pub normal_strength: f64,
}
/// Built-in records retain their original wire shape. Embedded records explicitly
/// identify each role; one digest may have several independently prepared uses.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SurfaceSource {
Builtin(BuiltinSurfaceSource),
Embedded(EmbeddedSurfaceSource),
}
impl From<BuiltinSurfaceSource> for SurfaceSource {
fn from(source: BuiltinSurfaceSource) -> Self {
Self::Builtin(source)
}
}
impl SurfaceSource {
pub fn validate(&self) -> Result<()> {
match self {
Self::Builtin(source) => source.validate(),
Self::Embedded(source) => source.validate(),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EmbeddedSurfaceKind {
Embedded,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct EmbeddedSurfaceSource {
pub kind: EmbeddedSurfaceKind,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_color: Option<HdrId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub normal_open_gl: Option<HdrId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub roughness: Option<HdrId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metallic: Option<HdrId>,
#[serde(default)]
pub flip_v: bool,
}
impl EmbeddedSurfaceSource {
pub fn role_resources(&self) -> impl Iterator<Item = (solidcraft_render::texture_input::MapRole, HdrId)> + '_ {
use solidcraft_render::texture_input::MapRole;
[
(MapRole::BaseColor, self.base_color),
(MapRole::NormalOpenGl, self.normal_open_gl),
(MapRole::Roughness, self.roughness),
(MapRole::Metallic, self.metallic),
]
.into_iter()
.filter_map(|(role, id)| id.map(|id| (role, id)))
}
pub fn resources(&self) -> impl Iterator<Item = HdrId> + '_ {
[self.base_color, self.normal_open_gl, self.roughness, self.metallic].into_iter().flatten()
}
pub fn validate(&self) -> Result<()> {
if self.resources().next().is_none() {
return Err(invalid("an embedded surface requires at least one explicit map role"));
}
Ok(())
}
}
impl SavedSurface {
pub fn validate(&self) -> Result<()> {
self.target.validate()?;
@@ -254,8 +190,7 @@ mod tests {
normal_sha256: HdrId::of(b"normal"),
roughness_sha256: HdrId::of(b"rough"),
metallic_sha256: HdrId::of(b"metal"),
}
.into(),
},
local_frame: PlanarFrame { origin: [1., 2., 3.], u: [100., 0., 0.], v: [0., 100., 0.] },
normal_strength: 0.75,
}
-580
View File
@@ -1,580 +0,0 @@
//! Exact, immutable opaque image bytes owned by a design. Interpretation belongs
//! to each saved map role; provenance is bounded inert text, never a permission grant.
use crate::{DocError, Result, render_resources::HdrId};
use serde::{Deserialize, Serialize, de::DeserializeSeed, ser::SerializeStruct};
use solidcraft_render::texture_input::{MapRole, TextureSource};
use std::{collections::BTreeMap, fmt, sync::Arc};
pub const MAX_TEXTURE_RESOURCES: usize = 32;
pub const MAX_TEXTURE_RESOURCE_BYTES: usize = 64 * 1024 * 1024;
pub const MAX_TEXTURE_BYTES: usize = solidcraft_render::texture_input::MAX_TEXTURE_BYTES;
pub const MAX_TEXTURE_EDGE: u32 = 1024;
const MAX_PROVENANCE_JSON: usize = 48 * 1024;
fn invalid(message: impl Into<String>) -> DocError {
DocError::Invalid(message.into())
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default, deny_unknown_fields)]
pub struct TextureProvenance {
#[serde(deserialize_with = "bounded_text")]
pub author: String,
#[serde(deserialize_with = "bounded_text")]
pub source: String,
#[serde(deserialize_with = "bounded_text")]
pub license: String,
}
impl TextureProvenance {
pub fn validate(&self) -> Result<()> {
for (text, maximum) in [(&self.author, 512), (&self.source, 2048), (&self.license, 4096)] {
if text.len() > maximum || text.chars().any(char::is_control) {
return Err(invalid("texture provenance requires bounded inert author, source and license text without control characters"));
}
}
Ok(())
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TextureResource {
id: HdrId,
bytes: Arc<Vec<u8>>,
dimensions: [u32; 2],
provenance: TextureProvenance,
}
impl TextureResource {
/// Import runs on the caller's existing worker. Full decode rejects corrupt streams;
/// the temporary source and pixels are released before immutable publication.
pub fn new(bytes: Vec<u8>, provenance: TextureProvenance) -> Result<Self> {
provenance.validate()?;
if bytes.is_empty() || bytes.len() > MAX_TEXTURE_BYTES || bytes.capacity() > MAX_TEXTURE_BYTES {
return Err(invalid("encoded texture capacity must contain at most 16 MiB"));
}
reject_animation(&bytes)?;
let mut checked = Vec::new();
checked.try_reserve_exact(bytes.len()).map_err(|_| invalid("could not reserve texture validation bytes"))?;
checked.extend_from_slice(&bytes);
let source = TextureSource::new_portable(checked, MapRole::Roughness).map_err(|e| invalid(e.to_string()))?;
let dimensions = [source.info().width, source.info().height];
if dimensions.into_iter().any(|edge| edge == 0 || edge > MAX_TEXTURE_EDGE) {
return Err(invalid("embedded texture dimensions exceed 1024x1024"));
}
source.validate_static_source().map_err(|e| invalid(e.to_string()))?;
source.decode(|| false).map_err(|e| invalid(e.to_string()))?;
Ok(Self { id: HdrId::of(&bytes), bytes: Arc::new(bytes), dimensions, provenance })
}
pub fn id(&self) -> HdrId {
self.id
}
pub fn bytes(&self) -> &[u8] {
&self.bytes
}
pub fn dimensions(&self) -> [u32; 2] {
self.dimensions
}
/// The native cooperative row consumer has a narrower encoding contract
/// than GPU preparation. The complete stream was validated at construction.
pub fn validate_cpu_encoding(&self) -> Result<()> {
if !self.bytes.starts_with(b"\x89PNG\r\n\x1a\n") || self.bytes.get(24).copied() != Some(8) || self.bytes.get(28).copied() != Some(0) {
return Err(invalid(
"CPU surface maps require noninterlaced 8-bit PNG; keep JPEG/interlaced images on the GPU or normalize them before import",
));
}
Ok(())
}
/// Binding roles are explicit; one encoded image may be color or linear data.
pub fn validate_role(&self, role: MapRole) -> Result<()> {
solidcraft_render::texture_input::validate_color_declarations(&self.bytes, role).map_err(|e| invalid(e.to_string()))
}
pub fn provenance(&self) -> &TextureProvenance {
&self.provenance
}
pub fn retained_bytes(&self) -> usize {
self.bytes.capacity()
}
pub fn base64(&self) -> Result<String> {
crate::render_resources::encode_hdr_base64(&self.bytes)
}
}
fn reject_animation(bytes: &[u8]) -> Result<()> {
if !bytes.starts_with(b"\x89PNG\r\n\x1a\n") {
return Ok(());
}
let mut offset = 8usize;
while offset < bytes.len() {
let header = bytes.get(offset..offset.saturating_add(8)).ok_or_else(|| invalid("truncated texture PNG chunk"))?;
let length = header
.get(..4)
.and_then(|v| <[u8; 4]>::try_from(v).ok())
.map(u32::from_be_bytes)
.ok_or_else(|| invalid("invalid texture PNG chunk length"))? as usize;
if header.get(4..8) == Some(b"acTL") {
return Err(invalid("embedded textures require static PNG or JPEG images"));
}
offset = offset
.checked_add(length)
.and_then(|n| n.checked_add(12))
.filter(|n| *n <= bytes.len())
.ok_or_else(|| invalid("texture PNG chunk exceeds encoded bytes"))?;
}
Ok(())
}
impl Serialize for TextureResource {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> {
let mut value = serializer.serialize_struct("TextureResource", 3)?;
value.serialize_field("kind", "opaque_texture")?;
value.serialize_field("data", &self.base64().map_err(serde::ser::Error::custom)?)?;
value.serialize_field("provenance", &self.provenance)?;
value.end()
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)]
#[serde(transparent)]
pub struct TextureResources(BTreeMap<HdrId, TextureResource>);
impl TextureResources {
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
pub fn len(&self) -> usize {
self.0.len()
}
pub fn iter(&self) -> impl Iterator<Item = (&HdrId, &TextureResource)> {
self.0.iter()
}
pub fn get(&self, id: &HdrId) -> Option<&TextureResource> {
self.0.get(id)
}
pub fn required(&self, id: &HdrId) -> Result<&TextureResource> {
self.get(id).ok_or_else(|| invalid(format!("missing embedded texture resource {id}")))
}
pub fn total_bytes(&self) -> usize {
self.0.values().map(TextureResource::retained_bytes).sum()
}
/// Identical bytes retain the first stored provenance; importing labels never
/// changes content identity or another binding's provenance.
pub fn insert(&mut self, resource: TextureResource) -> Result<HdrId> {
let id = resource.id();
if let Some(old) = self.get(&id) {
if old.bytes() != resource.bytes() {
return Err(invalid("texture SHA-256 collision"));
}
return Ok(id);
}
if self.len() >= MAX_TEXTURE_RESOURCES || resource.retained_bytes() > MAX_TEXTURE_RESOURCE_BYTES.saturating_sub(self.total_bytes()) {
return Err(invalid("embedded textures exceed 32 entries or 64 MiB"));
}
self.0.insert(id, resource);
Ok(id)
}
/// The engine checks saved users before removing a resource transactionally.
pub fn remove(&mut self, id: &HdrId) -> Option<TextureResource> {
self.0.remove(id)
}
}
impl<'de> Deserialize<'de> for TextureResources {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> std::result::Result<Self, D::Error> {
struct Resources;
impl<'de> serde::de::Visitor<'de> for Resources {
type Value = TextureResources;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("32 unique opaque texture sources totalling at most 64 MiB")
}
fn visit_map<A: serde::de::MapAccess<'de>>(self, mut map: A) -> std::result::Result<Self::Value, A::Error> {
let mut result = TextureResources::default();
while let Some(id) = map.next_key::<HdrId>()? {
if result.len() >= MAX_TEXTURE_RESOURCES || result.get(&id).is_some() {
return Err(serde::de::Error::custom("too many or duplicate embedded texture resources"));
}
let remaining = MAX_TEXTURE_RESOURCE_BYTES.saturating_sub(result.total_bytes()).min(MAX_TEXTURE_BYTES);
let resource = map.next_value_seed(ResourceSeed(remaining))?;
if resource.id() != id {
return Err(serde::de::Error::custom("embedded texture hash mismatch"));
}
result.insert(resource).map_err(serde::de::Error::custom)?;
}
Ok(result)
}
}
deserializer.deserialize_map(Resources)
}
}
struct ResourceSeed(usize);
impl<'de> DeserializeSeed<'de> for ResourceSeed {
type Value = TextureResource;
fn deserialize<D: serde::Deserializer<'de>>(self, deserializer: D) -> std::result::Result<Self::Value, D::Error> {
struct ResourceVisitor(usize);
impl<'de> serde::de::Visitor<'de> for ResourceVisitor {
type Value = TextureResource;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("opaque_texture kind, bounded base64 data and inert provenance")
}
fn visit_map<A: serde::de::MapAccess<'de>>(self, mut map: A) -> std::result::Result<Self::Value, A::Error> {
let (mut kind, mut data, mut provenance) = (false, None, None);
while let Some(field) = map.next_key::<Field>()? {
match field {
Field::Kind if !kind => {
map.next_value_seed(KindSeed)?;
kind = true;
}
Field::Data if data.is_none() => data = Some(map.next_value_seed(PayloadSeed(self.0))?),
Field::Provenance if provenance.is_none() => provenance = Some(map.next_value_seed(ProvenanceSeed)?),
_ => return Err(serde::de::Error::custom("duplicate embedded texture field")),
}
}
if !kind {
return Err(serde::de::Error::missing_field("kind"));
}
TextureResource::new(
data.ok_or_else(|| serde::de::Error::missing_field("data"))?,
provenance.ok_or_else(|| serde::de::Error::missing_field("provenance"))?,
)
.map_err(serde::de::Error::custom)
}
}
deserializer.deserialize_map(ResourceVisitor(self.0))
}
}
#[derive(Deserialize)]
#[serde(field_identifier, rename_all = "snake_case")]
enum Field {
Kind,
Data,
Provenance,
}
struct KindSeed;
impl<'de> DeserializeSeed<'de> for KindSeed {
type Value = ();
fn deserialize<D: serde::Deserializer<'de>>(self, d: D) -> std::result::Result<(), D::Error> {
struct Kind;
impl serde::de::Visitor<'_> for Kind {
type Value = ();
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("opaque_texture")
}
fn visit_str<E: serde::de::Error>(self, value: &str) -> std::result::Result<(), E> {
if value == "opaque_texture" { Ok(()) } else { Err(E::custom("opaque_texture kind required")) }
}
}
d.deserialize_str(Kind)
}
}
struct ProvenanceSeed;
impl<'de> DeserializeSeed<'de> for ProvenanceSeed {
type Value = TextureProvenance;
fn deserialize<D: serde::Deserializer<'de>>(self, d: D) -> std::result::Result<Self::Value, D::Error> {
let value = TextureProvenance::deserialize(d)?;
value.validate().map_err(serde::de::Error::custom)?;
Ok(value)
}
}
struct PayloadSeed(usize);
impl<'de> DeserializeSeed<'de> for PayloadSeed {
type Value = Vec<u8>;
fn deserialize<D: serde::Deserializer<'de>>(self, d: D) -> std::result::Result<Self::Value, D::Error> {
struct Payload(usize);
impl serde::de::Visitor<'_> for Payload {
type Value = Vec<u8>;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("bounded canonical texture base64")
}
fn visit_str<E: serde::de::Error>(self, value: &str) -> std::result::Result<Self::Value, E> {
crate::render_resources::decode_base64(value, self.0).map_err(E::custom)
}
}
d.deserialize_str(Payload(self.0))
}
}
fn bounded_text<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result<String, D::Error> {
struct Text;
impl serde::de::Visitor<'_> for Text {
type Value = String;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("at most 4096 provenance bytes")
}
fn visit_str<E: serde::de::Error>(self, value: &str) -> std::result::Result<Self::Value, E> {
if value.len() > 4096 {
return Err(E::custom("texture provenance text exceeds its bound"));
}
Ok(value.to_owned())
}
}
d.deserialize_str(Text)
}
/// First pass borrows payload JSON and enforces count/unique/encoded budgets before
/// Document's migration Value can allocate decoded base64 strings or coalesce keys.
pub(crate) fn check_json_budget(text: &str) -> Result<()> {
#[derive(Default, Deserialize)]
struct Render {
#[serde(default, deserialize_with = "budgets")]
texture_resources: (),
}
#[derive(Deserialize)]
struct Design {
#[serde(default)]
render: Render,
}
let Design { render: Render { texture_resources: () } } =
serde_json::from_str(text).map_err(|e| invalid(format!("texture resource admission: {e}")))?;
Ok(())
}
fn budgets<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result<(), D::Error> {
struct Budgets;
impl<'de> serde::de::Visitor<'de> for Budgets {
type Value = ();
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("bounded unique texture resources")
}
fn visit_map<A: serde::de::MapAccess<'de>>(self, mut map: A) -> std::result::Result<(), A::Error> {
let mut keys = std::collections::BTreeSet::new();
let mut total = 0usize;
while let Some(id) = map.next_key::<HdrId>()? {
if keys.len() >= MAX_TEXTURE_RESOURCES || !keys.insert(id) {
return Err(serde::de::Error::custom("too many or duplicate embedded texture resources"));
}
total += map.next_value_seed(ResourceBudget(MAX_TEXTURE_RESOURCE_BYTES.saturating_sub(total).min(MAX_TEXTURE_BYTES)))?;
}
Ok(())
}
}
d.deserialize_map(Budgets)
}
struct ResourceBudget(usize);
impl<'de> DeserializeSeed<'de> for ResourceBudget {
type Value = usize;
fn deserialize<D: serde::Deserializer<'de>>(self, d: D) -> std::result::Result<Self::Value, D::Error> {
struct ResourceVisitor(usize);
impl<'de> serde::de::Visitor<'de> for ResourceVisitor {
type Value = usize;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("bounded texture metadata and base64")
}
fn visit_map<A: serde::de::MapAccess<'de>>(self, mut map: A) -> std::result::Result<Self::Value, A::Error> {
let (mut kind, mut size, mut provenance) = (false, None, false);
while let Some(field) = map.next_key::<Field>()? {
match field {
Field::Kind if !kind => {
let raw = map.next_value::<&serde_json::value::RawValue>()?;
if raw.get().len() > 86 {
return Err(serde::de::Error::custom("texture kind exceeds its budget"));
}
let value: String = serde_json::from_str(raw.get()).map_err(serde::de::Error::custom)?;
if value != "opaque_texture" {
return Err(serde::de::Error::custom("opaque_texture kind required"));
}
kind = true;
}
Field::Data if size.is_none() => {
let raw = map.next_value::<&serde_json::value::RawValue>()?;
size = Some(crate::render_resources::json_base64_length(raw.get(), self.0).map_err(serde::de::Error::custom)?);
}
Field::Provenance if !provenance => {
let raw = map.next_value::<&serde_json::value::RawValue>()?;
if raw.get().len() > MAX_PROVENANCE_JSON {
return Err(serde::de::Error::custom("texture provenance exceeds its budget"));
}
let value: TextureProvenance = serde_json::from_str(raw.get()).map_err(serde::de::Error::custom)?;
value.validate().map_err(serde::de::Error::custom)?;
provenance = true;
}
_ => return Err(serde::de::Error::custom("duplicate embedded texture field")),
}
}
if !kind || !provenance {
return Err(serde::de::Error::custom("complete texture metadata required"));
}
size.ok_or_else(|| serde::de::Error::missing_field("data"))
}
}
d.deserialize_map(ResourceVisitor(self.0))
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::render_settings::{GpuJob, RenderJob, RenderSettings, RenderSetup};
use crate::render_surface::{EmbeddedSurfaceKind, EmbeddedSurfaceSource, RenderBodyTarget, SavedSurface, SurfaceSource};
use serde_json::json;
fn image() -> Vec<u8> {
include_bytes!("../../../assets/render/starter/materials/exports/SURF-027/base_color.png").to_vec()
}
fn provenance() -> TextureProvenance {
TextureProvenance { author: "SolidCraft contributors".into(), source: "original test asset".into(), license: "MIT OR Apache-2.0".into() }
}
fn resource() -> TextureResource {
TextureResource::new(image(), provenance()).unwrap()
}
#[test]
fn exact_encoded_texture_bytes_are_shared_deduplicated_and_portable() {
let first = resource();
let copy = first.clone();
assert!(Arc::ptr_eq(&first.bytes, &copy.bytes));
assert_eq!(first.id(), HdrId::of(&image()));
assert_eq!(first.dimensions(), [512, 512]);
let mut bank = TextureResources::default();
let id = bank.insert(first).unwrap();
let mut different_label = copy.clone();
different_label.provenance.author = "Another declared author".into();
assert_eq!(bank.insert(different_label).unwrap(), id);
assert_eq!(bank.len(), 1);
assert_eq!(bank.total_bytes(), copy.retained_bytes());
assert_eq!(bank.required(&id).unwrap().provenance(), &provenance());
let wire = serde_json::to_value(&bank).unwrap();
let from_value: TextureResources = serde_json::from_value(wire.clone()).unwrap();
let from_json: TextureResources = serde_json::from_str(&wire.to_string()).unwrap();
assert_eq!(from_value, bank);
assert_eq!(from_json, bank);
assert!(bank.required(&HdrId::of(b"missing")).is_err());
assert_eq!(bank.remove(&id).unwrap().bytes(), image());
assert!(bank.is_empty());
}
#[test]
fn embedded_roles_roundtrip_and_missing_references_refuse() {
let resource = resource();
let id = resource.id();
let embedded = EmbeddedSurfaceSource {
kind: EmbeddedSurfaceKind::Embedded,
base_color: Some(id),
normal_open_gl: None,
roughness: Some(id),
metallic: None,
flip_v: true,
};
let mut setup = RenderSetup {
job: Some(RenderJob::GpuPath { transparent_background: false, options: Box::new(GpuJob::default()) }),
..Default::default()
};
setup
.surfaces
.set(
SavedSurface {
target: RenderBodyTarget { definition: "Wood test panel".into(), feature: 7, component: 0, occurrence_path: vec![] },
source: SurfaceSource::Embedded(embedded),
local_frame: solidcraft_render::job::textures::PlanarFrame { origin: [0.; 3], u: [240., 0., 0.], v: [0., 480., 0.] },
normal_strength: 0.5,
},
false,
)
.unwrap();
let mut settings = RenderSettings::default();
settings.setups.insert("Wood".into(), setup);
assert!(settings.validate().unwrap_err().to_string().contains("missing embedded texture"));
settings.texture_resources.insert(resource).unwrap();
settings.validate().unwrap();
let doc = crate::Document { render: Arc::new(settings.clone()), ..Default::default() };
let wire = doc.to_json();
assert_eq!(crate::Document::from_json(&wire).unwrap(), doc);
assert!(wire.contains("embedded-surface-textures"));
assert!(!wire.contains("builtin://"));
assert!(!wire.contains("file://"));
settings.texture_resources.remove(&id);
assert!(settings.validate().is_err());
assert!(serde_json::from_value::<EmbeddedSurfaceSource>(json!({"kind":"embedded","flip_v":false})).unwrap().validate().is_err());
assert!(serde_json::from_value::<SurfaceSource>(json!({"kind":"automatic","base_color":id})).is_err());
}
#[test]
fn corrupt_changed_digest_animated_or_malformed_texture_records_refuse() {
let good = resource();
let id = good.id().to_string();
let entry = serde_json::to_value(&good).unwrap();
let wire = json!({id.clone():entry.clone()});
for (field, value) in [
("kind", json!("exr")),
("data", json!("AAAA")),
("provenance", json!({"author":"x\n","source":"","license":""})),
("path", json!("wood.png")),
] {
let mut changed = wire.clone();
changed[&id][field] = value;
assert!(serde_json::from_value::<TextureResources>(changed).is_err(), "{field}");
}
let wrong_id = HdrId::of(b"wrong").to_string();
assert!(serde_json::from_value::<TextureResources>(json!({wrong_id:entry.clone()})).unwrap_err().to_string().contains("hash mismatch"));
let duplicate = format!("{{\"{id}\":{entry},\"{id}\":{entry}}}");
assert!(serde_json::from_str::<TextureResources>(&duplicate).unwrap_err().to_string().contains("duplicate"));
let mut truncated = image();
truncated.truncate(truncated.len() - 1);
assert!(TextureResource::new(truncated, provenance()).is_err());
// APNG control is rejected before interpreting a potentially moving image.
let mut animated = image();
animated.splice(8..8, [0, 0, 0, 0, b'a', b'c', b'T', b'L', 0, 0, 0, 0]);
assert!(TextureResource::new(animated, provenance()).unwrap_err().to_string().contains("static"));
let mut corrupt_tail = image();
let end = corrupt_tail.len() - 12;
corrupt_tail.splice(end..end, [0, 0, 0, 1, b'v', b'p', b'A', b'g', 17, 0, 0, 0, 0]);
assert!(TextureResource::new(corrupt_tail, provenance()).unwrap_err().to_string().contains("CRC"));
let mut oversized_capacity = Vec::with_capacity(MAX_TEXTURE_BYTES + 1);
oversized_capacity.extend_from_slice(&image());
assert!(TextureResource::new(oversized_capacity, provenance()).is_err());
let mut bad_provenance = provenance();
bad_provenance.source = "x".repeat(2049);
assert!(TextureResource::new(image(), bad_provenance).is_err());
}
#[test]
fn json_texture_admission_preserves_duplicates_and_enforces_count_before_migration() {
let entry = serde_json::to_value(resource()).unwrap();
let mut resources = serde_json::Map::new();
for n in 0..33 {
resources.insert(HdrId::of(&[n]).to_string(), entry.clone());
}
let text = json!({"render":{"texture_resources":resources}}).to_string();
assert!(check_json_budget(&text).unwrap_err().to_string().contains("too many"));
let id = HdrId::of(&image()).to_string();
let text = format!("{{\"render\":{{\"texture_resources\":{{\"{id}\":{entry},\"{id}\":{entry}}}}}}}");
assert!(check_json_budget(&text).unwrap_err().to_string().contains("duplicate"));
let escaped = "\\u0041".repeat(12);
let text = format!("{{\"kind\":\"opaque_texture\",\"data\":\"{escaped}\",\"provenance\":{{}}}}");
let mut d = serde_json::Deserializer::from_str(&text);
assert!(ResourceBudget(1).deserialize(&mut d).is_err());
let text = json!({"render":{"texture_resources":{id:{"kind":"opaque_texture","data":"AAAA","provenance":{"author":"x".repeat(MAX_PROVENANCE_JSON)}}}}}).to_string();
assert!(check_json_budget(&text).unwrap_err().to_string().contains("provenance"));
}
#[test]
fn encoded_resource_is_role_independent_and_conflicting_color_binding_is_rejected() {
let mut bytes = image();
let mut chunk = 4_u32.to_be_bytes().to_vec();
chunk.extend(b"gAMA");
chunk.extend(100_000_u32.to_be_bytes());
let mut crc = u32::MAX;
for byte in &chunk[4..] {
crc ^= u32::from(*byte);
for _ in 0..8 {
crc = (crc >> 1) ^ (0xedb8_8320_u32.wrapping_mul(crc & 1));
}
}
chunk.extend((!crc).to_be_bytes());
bytes.splice(33..33, chunk);
let resource = TextureResource::new(bytes, provenance()).unwrap();
assert!(resource.validate_role(MapRole::BaseColor).unwrap_err().to_string().contains("normalized sRGB"));
resource.validate_role(MapRole::Roughness).unwrap();
let id = resource.id();
let mut setup = RenderSetup {
job: Some(RenderJob::GpuPath { transparent_background: false, options: Box::new(GpuJob::default()) }),
..Default::default()
};
let mut binding = SavedSurface {
target: RenderBodyTarget { definition: "Wood".into(), feature: 7, component: 0, occurrence_path: vec![] },
source: SurfaceSource::Embedded(EmbeddedSurfaceSource {
kind: EmbeddedSurfaceKind::Embedded,
base_color: Some(id),
normal_open_gl: None,
roughness: None,
metallic: None,
flip_v: false,
}),
local_frame: solidcraft_render::job::textures::PlanarFrame { origin: [0.; 3], u: [1., 0., 0.], v: [0., 1., 0.] },
normal_strength: 1.,
};
setup.surfaces.set(binding.clone(), false).unwrap();
let mut settings = RenderSettings::default();
settings.texture_resources.insert(resource).unwrap();
assert!(settings.validate_resources(&setup).is_err());
if let SurfaceSource::Embedded(source) = &mut binding.source {
source.base_color = None;
source.roughness = Some(id);
}
setup.surfaces.set(binding, true).unwrap();
settings.validate_resources(&setup).unwrap();
}
}
+2 -13
View File
@@ -284,16 +284,6 @@ impl SheetRule {
}
}
/// The design parameters a rule's `field` expression `e` reads: outside the rule's own
/// `thickness`, `Thickness` is the rule's thickness (sheet metal and plastic rules alike).
pub fn rule_references(field: &str, e: &str) -> Vec<String> {
let mut names = expr::references(e);
if field != "thickness" {
names.retain(|n| n != "Thickness");
}
names
}
fn rule_gap() -> String {
"Thickness".into()
}
@@ -474,8 +464,7 @@ impl Document {
.unwrap_or_else(SheetRule::steel)
}
/// Evaluate a rule: `Thickness` in its expressions is the rule's thickness, even where the
/// design has a parameter of that name (#9623); only the rule's `thickness` itself reads it.
/// Evaluate a rule: `Thickness` in its expressions is the rule's thickness.
pub fn rule_values(&self, vals: &std::collections::BTreeMap<String, Value>, r: &SheetRule) -> Result<RuleValues> {
self.rule_values_at(vals, r, None)
}
@@ -492,7 +481,7 @@ impl Document {
return Err(DocError::Invalid("the sheet thickness must be more than 0 and less than 10000 mm".into()));
}
let with_t = |e: &str, k: Kind| -> Result<f64> {
let f = |n: &str| if n == "Thickness" { Ok(Value::length(t)) } else { look(n) };
let f = |n: &str| if n == "Thickness" && !vals.contains_key("Thickness") { Ok(Value::length(t)) } else { look(n) };
expr::eval_with(e, &f)?.to_kind(k)
};
let v = RuleValues {
+23 -116
View File
@@ -419,21 +419,6 @@ fn bend_cylinder(b: &Body, mesh: &Mesh, f: usize, tol: f64) -> Option<Chamfer> {
na.cross(nb).normalized().map(|_| Chamfer { strip: f, a, b: bb })
}
/// Every piece of bend cylinder `c`'s cylinder (the same axis line and radius) that is a bend
/// cylinder between the same two faces: the pieces cut-outs across a bend leave of it. `c` too.
fn bend_pieces(b: &Body, mesh: &Mesh, c: Chamfer, tol: f64) -> Vec<Chamfer> {
let Some(FaceSurface::Cylinder { origin, axis, radius }) = face_surface(b, c.strip) else { return vec![c] };
let coaxial = |g: usize| match face_surface(b, g) {
Some(FaceSurface::Cylinder { origin: o, axis: a, radius: r }) => {
(r - radius).abs() <= tol && a.cross(axis).len() <= 1e-6 && ((o - origin) - axis * (o - origin).dot(axis)).len() <= tol
}
_ => false,
};
let same = |o: &Chamfer| (o.a, o.b) == (c.a, c.b) || (o.a, o.b) == (c.b, c.a);
let pieces = (0..b.face_count()).filter(|g| *g != c.strip && coaxial(*g)).filter_map(|g| bend_cylinder(b, mesh, g, tol)).filter(same);
std::iter::once(c).chain(pieces).collect()
}
/// The cylinder of bend `c` on a shell's other skin: the bend cylinder between the faces
/// straight behind `c`'s two sides, so that a bend picked on either skin is that bend on both.
fn other_skin(b: &Body, mesh: &Mesh, c: &Chamfer, tol: f64) -> Option<Chamfer> {
@@ -718,91 +703,33 @@ fn drawn(trimmed: &[Vec2], from: &[Option<usize>], pts: &[Vec2], round: &[Option
if round.iter().all(Option::is_none) {
return Ok(None);
}
let mut segs: Vec<Seg2> = Vec::with_capacity(trimmed.len());
for j in 0..trimmed.len() {
let Some(seg) = drawn_edge(trimmed, from, pts, round, j)? else { continue };
match (segs.last_mut(), seg) {
(Some(Seg2::Arc { center, radius, sweep, .. }), Seg2::Arc { center: c, radius: r, sweep: s, .. })
if center.dist(c) <= 1e-9 && (*radius - r).abs() <= 1e-9 && *sweep * s > 0.0 && (*sweep + s).abs() <= PI + 1e-9 =>
let (m, n) = (trimmed.len(), pts.len());
let mut segs: Vec<Seg2> = Vec::with_capacity(m);
for j in 0..m {
let (Some(&a), Some(&b)) = (trimmed.get(j), trimmed.get((j + 1) % m)) else { continue };
let arc = from.get(j).copied().flatten().and_then(|i| Some((i, round.get(i).copied().flatten()?)));
let Some((i, (c, mid))) = arc else {
segs.push(Seg2::Line { a: snap(a), b: snap(b) });
continue;
};
let (Some(&p), Some(&q)) = (pts.get(i), pts.get((i + 1) % n)) else { continue };
if a.dist(p) > 1e-6 || b.dist(q) > 1e-6 {
return err("not supported yet: a round edge of a face that ends at a bend or a cut edge of the sheet");
}
let (start, r) = ((p - c).angle(), c.dist(p));
let half = ((mid - c).angle() - start + PI).rem_euclid(TAU) - PI;
match segs.last_mut() {
Some(Seg2::Arc { center, radius, sweep, .. })
if center.dist(c) <= 1e-9 && (*radius - r).abs() <= 1e-9 && *sweep * half > 0.0 && (*sweep + 2.0 * half).abs() <= PI + 1e-9 =>
{
*sweep += s;
*sweep += 2.0 * half;
}
_ => segs.push(seg),
_ => segs.push(Seg2::Arc { center: c, radius: r, start, sweep: 2.0 * half }),
}
}
Ok(Some(Loop2 { segs }))
}
/// A panel's trimmed outline where it meets the panel across bend `g` along more than one edge
/// (cut-outs across the bend notch it): the edges must lie in one line, running the same way;
/// they become one edge, from the first one's start to the last one's end, and each notch
/// between two of them a hole of the sheet (the notch's edges, closed along the line). Returns
/// the holes, each with the corners where it leaves the line and comes back to it. Nothing
/// changes where the panel meets `g` along one edge or none.
fn join_runs(
trimmed: &mut Vec<Vec2>,
from: &mut Vec<Option<usize>>,
across: &[Option<usize>],
pts: &[Vec2],
round: &[Option<(Vec2, Vec2)>],
g: usize,
tol: f64,
) -> Result<Vec<(Region2, Vec2, Vec2)>> {
let m = trimmed.len();
let along = |j: usize| from.get(j).copied().flatten().and_then(|i| across.get(i).copied().flatten()) == Some(g);
let runs: Vec<usize> = (0..m).filter(|j| along(*j)).collect();
let (Some(&first), true) = (runs.first(), runs.len() > 1) else { return Ok(Vec::new()) };
let corner = |j: usize| trimmed.get(j % m).copied().unwrap_or_default();
let (o, Some(d)) = (corner(first), (corner(first + 1) - corner(first)).normalized()) else { return err("a bend edge has no length") };
let off = |p: Vec2| (p - o).cross(d).abs();
if runs.iter().any(|j| off(corner(*j)) > tol || off(corner(j + 1)) > tol || (corner(j + 1) - corner(*j)).dot(d) <= 0.0) {
return err("not supported yet: a face of the sheet that meets a bend along edges not in one line");
}
let mut order = runs.clone();
order.sort_by(|x, y| (corner(*x) - o).dot(d).total_cmp(&(corner(*y) - o).dot(d)));
let mut gone = vec![false; m];
let mut holes = Vec::new();
for pair in order.windows(2) {
let &[ja, jb] = pair else { continue };
// The notch: forward round the outline from the end of one edge to the start of the next.
let mut segs = Vec::new();
let mut j = (ja + 1) % m;
while j != jb {
if along(j) || segs.len() > m {
return err("not supported yet: a face of the sheet that meets a bend along edges out of order");
}
segs.extend(drawn_edge(trimmed, from, pts, round, j)?);
gone[j] = true;
j = (j + 1) % m;
}
gone[jb] = true;
let (e, s) = (corner(ja + 1), corner(jb));
segs.push(Seg2::Line { a: snap(s), b: snap(e) });
let lp = Loop2 { segs };
holes.push((Region2 { outer: if lp.signed_area() < 0.0 { lp.reversed() } else { lp }, holes: Vec::new() }, e, s));
}
let keep: Vec<usize> = (0..m).filter(|j| !gone.get(*j).copied().unwrap_or(false)).collect();
let (kept, kept_from): (Vec<Vec2>, Vec<Option<usize>>) = keep.iter().map(|j| (corner(*j), from.get(*j).copied().flatten())).unzip();
(*trimmed, *from) = (kept, kept_from);
Ok(holes)
}
/// Edge `j` of a panel's trimmed outline as [`drawn`] draws it: a line, or an arc where it was a
/// round edge of the face.
fn drawn_edge(trimmed: &[Vec2], from: &[Option<usize>], pts: &[Vec2], round: &[Option<(Vec2, Vec2)>], j: usize) -> Result<Option<Seg2>> {
let (m, n) = (trimmed.len(), pts.len());
let (Some(&a), Some(&b)) = (trimmed.get(j % m), trimmed.get((j + 1) % m)) else { return Ok(None) };
let arc = from.get(j % m).copied().flatten().and_then(|i| Some((i, round.get(i).copied().flatten()?)));
let Some((i, (c, mid))) = arc else { return Ok(Some(Seg2::Line { a: snap(a), b: snap(b) })) };
let (Some(&p), Some(&q)) = (pts.get(i), pts.get((i + 1) % n)) else { return Ok(None) };
if a.dist(p) > 1e-6 || b.dist(q) > 1e-6 {
return err("not supported yet: a round edge of a face that ends at a bend or a cut edge of the sheet");
}
let (start, r) = ((p - c).angle(), c.dist(p));
let half = ((mid - c).angle() - start + PI).rem_euclid(TAU) - PI;
Ok(Some(Seg2::Arc { center: c, radius: r, start, sweep: 2.0 * half }))
}
/// Names of the edges of `body` at the bend points, to find them again after the body changes.
/// A point on no edge gets none: the conversion then says so, instead of bending the edge that
/// happens to be nearest. A point on a chamfer or a bend cylinder gets none either: it stays that
@@ -852,8 +779,7 @@ pub fn convert_body(
for p in bends {
if let Some(c) = chamfer_at(mb, &mesh, *p, tol, near) {
picks.push((*p, (c.a, c.b)));
// Every piece of the bend, on either skin: cut-outs across it split its cylinder.
for c in std::iter::once(c).chain(other_skin(b, &mesh, &c, tol)).flat_map(|c| bend_pieces(b, &mesh, c, tol)) {
for c in std::iter::once(c).chain(other_skin(b, &mesh, &c, tol)) {
if !chamfers.iter().any(|x| x.strip == c.strip) {
chamfers.push(c);
}
@@ -1030,20 +956,7 @@ pub fn convert_body(
}
let first = panel.face.pts.first().copied().unwrap_or_default();
let face_at = |e: DocError| DocError::Invalid(format!("{e} (the face at {})", at(first)));
let (mut trimmed, mut from) = inset(&pts, &by, tol).map_err(face_at)?;
// Where cut-outs across a bend notch the panel, its edges along the bend are one bend
// edge and the notches holes of the sheet, as is the bend zone between them (below).
let mut gaps: BTreeMap<usize, Vec<(Vec2, Vec2)>> = BTreeMap::new();
let mut bent: Vec<usize> =
across.iter().flatten().copied().filter(|g| panel.parent == Some(*g) || panels.get(g).is_some_and(|c| c.parent == Some(pf))).collect();
bent.sort_unstable();
bent.dedup();
for g in bent {
for (hole, e, s) in join_runs(&mut trimmed, &mut from, &across, &pts, &round, g, tol).map_err(face_at)? {
sh.holes.push(hole);
gaps.entry(g).or_default().push((e, s));
}
}
let (trimmed, from) = inset(&pts, &by, tol).map_err(face_at)?;
let exact = drawn(&trimmed, &from, &pts, &round).map_err(face_at)?;
match fl {
None => sh.base.outer = exact.unwrap_or_else(|| Loop2::polygon(&trimmed.iter().map(|q| snap(*q)).collect::<Vec<_>>())),
@@ -1159,13 +1072,7 @@ pub fn convert_body(
tag: String::new(),
tear: (false, false),
});
let i = sh.flanges.len() - 1;
let (ba, n) = sh.flanges.get(i).map_or((0.0, Vec2::new(d.y, -d.x)), |f| (sh.allowance(f), f.n));
for (e, s) in gaps.get(&g).into_iter().flatten() {
let zone = Loop2::polygon(&[snap(*e), snap(*s), snap(*s + n * ba), snap(*e + n * ba)]);
sh.holes.push(Region2 { outer: zone.ccw(), holes: Vec::new() });
}
queue.push((g, Some(i)));
queue.push((g, Some(sh.flanges.len() - 1)));
}
}
// The bends on the fixed face finished as an edge flange feature finishes its own
-29
View File
@@ -105,35 +105,6 @@ fn set_back_reports_restored_features() {
assert_eq!((m.last_recomputed, m.last_restored), (0, 0));
}
/// Adding a line and deleting it again leaves the solved geometry as it was: the extrude and
/// everything after it take their earlier results from the cache.
#[test]
fn a_sketch_line_added_and_deleted_restores_the_extrude() {
let (mut doc, s) = plate_doc();
let mut m = Model::new();
m.evaluate(&doc);
assert_eq!((m.last_recomputed, m.last_restored), (2, 0));
let (a, b, line) = {
let sk = doc.sketch_mut(s).unwrap();
let a = sk.add_point(Vec2::new(5.0, 5.0), None).unwrap();
let b = sk.add_point(Vec2::new(6.0, 5.0), None).unwrap();
(a, b, sk.add_line_pts(a, b, None).unwrap())
};
m.evaluate(&doc);
assert_eq!((m.last_recomputed, m.last_restored), (2, 0));
{
let sk = doc.sketch_mut(s).unwrap();
sk.remove_curves(&[line]);
sk.remove_points(&[b]);
sk.remove_points(&[a]);
}
m.evaluate(&doc);
assert_eq!((m.last_recomputed, m.last_restored), (0, 2));
assert!(rel(measure(&m.state().bodies[0].body).unwrap().volume, 24000.0) < 1e-9);
}
/// Setting a parameter back restores every feature on a design whose states are large next to
/// the cache's budget: each cached state shares the bodies it did not change with the states
/// before it, so it is charged only for what it made, not for the whole model again.
-18
View File
@@ -1,18 +0,0 @@
[package]
name = "solidcraft-dynamics"
description = "SolidCraft multibody dynamics: rigid bodies, joint constraints, gravity and springs, integrated in time"
version.workspace = true
edition.workspace = true
license.workspace = true
[lints]
workspace = true
[dependencies]
solidcore-record = { workspace = true }
solidcraft-geom = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
[dev-dependencies]
serde_json = { workspace = true }
-203
View File
@@ -1,203 +0,0 @@
//! Time stepping: classical Runge–Kutta 4 with a fixed step, or Dormand–Prince 5(4) with an
//! embedded error estimate, each followed by projection onto the joints (positions, then
//! velocities), landing on every output sample.
use crate::model::{Integrator, MAX_MAGNITUDE, MAX_STEPS, Model, Settings};
use crate::system::System;
use crate::{DynamicsError, Result, Sample, Stats, Trajectory};
/// Dormand–Prince 5(4) tableau (the system is autonomous, so the nodes are not needed): stage
/// weights, fifth-order weights and the difference between the fifth- and fourth-order weights
/// (the error estimate).
const DP_A: [[f64; 6]; 7] = [
[0.0; 6],
[1.0 / 5.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[3.0 / 40.0, 9.0 / 40.0, 0.0, 0.0, 0.0, 0.0],
[44.0 / 45.0, -56.0 / 15.0, 32.0 / 9.0, 0.0, 0.0, 0.0],
[19372.0 / 6561.0, -25360.0 / 2187.0, 64448.0 / 6561.0, -212.0 / 729.0, 0.0, 0.0],
[9017.0 / 3168.0, -355.0 / 33.0, 46732.0 / 5247.0, 49.0 / 176.0, -5103.0 / 18656.0, 0.0],
[35.0 / 384.0, 0.0, 500.0 / 1113.0, 125.0 / 192.0, -2187.0 / 6784.0, 11.0 / 84.0],
];
const DP_B: [f64; 7] = [35.0 / 384.0, 0.0, 500.0 / 1113.0, 125.0 / 192.0, -2187.0 / 6784.0, 11.0 / 84.0, 0.0];
const DP_E: [f64; 7] = [
35.0 / 384.0 - 5179.0 / 57600.0,
0.0,
500.0 / 1113.0 - 7571.0 / 16695.0,
125.0 / 192.0 - 393.0 / 640.0,
-2187.0 / 6784.0 + 92097.0 / 339200.0,
11.0 / 84.0 - 187.0 / 2100.0,
-1.0 / 40.0,
];
/// `y + Σ k_i · w_i · h`.
fn combine(y: &[f64], ks: &[Vec<f64>], weights: &[f64], h: f64) -> Vec<f64> {
let mut out = y.to_vec();
for (k, w) in ks.iter().zip(weights) {
if *w == 0.0 {
continue;
}
for (o, d) in out.iter_mut().zip(k) {
*o += h * w * d;
}
}
out
}
fn at_time(e: DynamicsError, t: f64) -> DynamicsError {
match e {
DynamicsError::Singular { .. } => DynamicsError::Singular { time: t },
DynamicsError::Diverged { .. } => DynamicsError::Diverged { time: t },
other => other,
}
}
struct Run<'a> {
sys: &'a System,
settings: &'a Settings,
stats: Stats,
}
impl Run<'_> {
fn deriv(&self, y: &[f64]) -> Result<Vec<f64>> {
self.sys.accelerations(y).map(|a| a.ydot)
}
/// Normalise, project and check a new state.
fn finish_step(&mut self, y: &mut [f64], t: f64) -> Result<()> {
self.sys.normalize(y).map_err(|e| at_time(e, t))?;
if self.settings.projection {
self.sys.project_positions(y, self.settings.projection_tol).map_err(|e| at_time(e, t))?;
self.sys.project_velocities(y).map_err(|e| at_time(e, t))?;
}
if !y.iter().all(|x| x.is_finite() && x.abs() < MAX_MAGNITUDE) {
return Err(DynamicsError::Diverged { time: t });
}
Ok(())
}
fn count_step(&mut self, t: f64) -> Result<()> {
if self.stats.steps + self.stats.rejected >= MAX_STEPS {
return Err(DynamicsError::StepLimit { time: t });
}
Ok(())
}
fn rk4(&mut self, y: &[f64], h: f64) -> Result<Vec<f64>> {
let k1 = self.deriv(y)?;
let k2 = self.deriv(&combine(y, std::slice::from_ref(&k1), &[0.5], h))?;
let k3 = self.deriv(&combine(y, std::slice::from_ref(&k2), &[0.5], h))?;
let k4 = self.deriv(&combine(y, std::slice::from_ref(&k3), &[1.0], h))?;
Ok(combine(y, &[k1, k2, k3, k4], &[1.0 / 6.0, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 6.0], h))
}
/// One Dormand–Prince step: the fifth-order state and the scaled error norm.
fn dopri(&mut self, y: &[f64], h: f64, rel_tol: f64, abs_tol: f64) -> Result<(Vec<f64>, f64)> {
let mut ks: Vec<Vec<f64>> = Vec::with_capacity(7);
for a in DP_A.iter().take(6) {
let stage = combine(y, &ks, a, h);
ks.push(self.deriv(&stage)?);
}
let y5 = combine(y, &ks, &DP_B, h);
ks.push(self.deriv(&y5)?);
let err = combine(&vec![0.0; y.len()], &ks, &DP_E, h);
let n = y.len().max(1) as f64;
let sum: f64 = err
.iter()
.zip(y.iter().zip(&y5))
.map(|(e, (a, b))| {
let scale = abs_tol + rel_tol * a.abs().max(b.abs());
(e / scale).powi(2)
})
.sum();
Ok((y5, (sum / n).sqrt()))
}
/// Advance `y` from `t` to `t_end` exactly.
fn advance(&mut self, y: &mut Vec<f64>, t: &mut f64, t_end: f64, h_next: &mut f64) -> Result<()> {
let span = t_end - *t;
let eps = 1e-12 * t_end.abs().max(1.0);
match self.settings.integrator {
Integrator::Rk4 { step } => {
// Equal steps no longer than `step` that land on t_end.
let n = (span / step).ceil().max(1.0);
let h = span / n;
for _ in 0..n as usize {
self.count_step(*t)?;
let mut next = self.rk4(y, h).map_err(|e| at_time(e, *t))?;
*t += h;
self.finish_step(&mut next, *t)?;
*y = next;
self.stats.steps += 1;
}
*t = t_end;
}
Integrator::Adaptive { rel_tol, abs_tol, min_step, max_step } => {
while t_end - *t > eps {
self.count_step(*t)?;
let remaining = t_end - *t;
let h = h_next.clamp(min_step, max_step).min(remaining);
let (mut next, err) = self.dopri(y, h, rel_tol, abs_tol).map_err(|e| at_time(e, *t))?;
// The usual controller: 0.9·err^(−1/5), within [0.2, 5].
let factor = if err > 0.0 { (0.9 * err.powf(-0.2)).clamp(0.2, 5.0) } else { 5.0 };
if err <= 1.0 {
let landed = h >= remaining;
*t = if landed { t_end } else { *t + h };
self.finish_step(&mut next, *t)?;
*y = next;
self.stats.steps += 1;
// Keep the step chosen before a shortened landing step.
if !landed || factor < 1.0 {
*h_next = h * factor;
}
} else {
self.stats.rejected += 1;
if h <= min_step * (1.0 + 1e-9) {
return Err(DynamicsError::StepTooSmall { time: *t });
}
*h_next = (h * factor).max(min_step);
}
}
*t = t_end;
}
}
Ok(())
}
fn sample(&mut self, y: &[f64], t: f64) -> Result<Sample> {
let acc = self.sys.accelerations(y).map_err(|e| at_time(e, t))?;
let constraint_error = self.sys.constraint_error(y);
self.stats.max_constraint_error = self.stats.max_constraint_error.max(constraint_error);
self.stats.redundant_equations = self.stats.redundant_equations.max(acc.row_count().saturating_sub(acc.rank));
Ok(Sample { time: t, bodies: self.sys.body_states(y), joints: self.sys.joint_results(y, &acc), energy: self.sys.energy(y), constraint_error })
}
}
/// Simulates `model` for `settings.duration`, returning the states at every output interval
/// (the first at t = 0, after the start has been projected onto the joints).
pub fn simulate(model: &Model, settings: &Settings) -> Result<Trajectory> {
settings.validate()?;
let sys = System::new(model, settings.baumgarte)?;
let mut y = System::initial_state(model)?;
// An inconsistent start (frames a little apart, velocities the joints don't allow) is
// brought onto the joints first, whether or not later steps project.
sys.project_positions(&mut y, settings.projection_tol).map_err(|e| at_time(e, 0.0))?;
sys.project_velocities(&mut y).map_err(|e| at_time(e, 0.0))?;
let mut run = Run { sys: &sys, settings, stats: Stats::default() };
let count = (settings.duration / settings.output_interval).ceil() as usize;
let mut samples = Vec::with_capacity(count + 1);
samples.push(run.sample(&y, 0.0)?);
let mut t = 0.0;
let mut h_next = match settings.integrator {
Integrator::Rk4 { step } => step,
Integrator::Adaptive { min_step, max_step, .. } => (settings.output_interval * 0.1).clamp(min_step, max_step),
};
for k in 1..=count {
let t_end = (k as f64 * settings.output_interval).min(settings.duration);
if t_end <= t {
continue;
}
run.advance(&mut y, &mut t, t_end, &mut h_next)?;
samples.push(run.sample(&y, t)?);
}
Ok(Trajectory { samples, stats: run.stats })
}
-136
View File
@@ -1,136 +0,0 @@
//! Multibody dynamics for SolidCraft (RFC #9719): rigid bodies with masses and inertias, held
//! together by joints, moved by gravity, springs, dampers and loads, integrated in time.
//!
//! The crate knows nothing of documents or occurrences: a [`Model`] lists bodies (mass,
//! inertia about the centre of mass, starting pose and velocities), joints between frames on
//! them ([`JointKind`]: rigid, revolute, slider, cylindrical, planar, ball) and force elements;
//! [`simulate`] returns a [`Trajectory`] of poses, joint values and rates, joint reactions and
//! energies at a fixed output interval. The assembly layer maps occurrences and joints to it.
//!
//! The formulation is the textbook one for constrained rigid bodies in maximal coordinates
//! (Lagrange multipliers, index-1 form, see `system.rs`), stepped by Runge–Kutta 4 or
//! Dormand–Prince 5(4) and projected back onto the joints after every step (`integrate.rs`).
//!
//! Units are the design's: mm, kg, s and radians, so forces are in mN (kg·mm/s²), torques in
//! mN·mm, stiffness in N/m (kg/s²) and gravity in mm/s² ([`STANDARD_GRAVITY`]).
//!
//! Every input is checked ([`Model::validate`], [`Settings::validate`]) and every size and loop
//! is capped ([`MAX_BODIES`], [`MAX_STEPS`], …): a bad model is an error, never a panic.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
#![forbid(unsafe_code)]
mod integrate;
mod linalg;
pub mod math;
mod model;
mod system;
use serde::{Deserialize, Serialize};
use solidcore_record::Vec3;
pub use integrate::simulate;
pub use math::{Mat3, Quat};
pub use model::{
Anchor, Body, Force, Integrator, Joint, JointKind, MAX_BODIES, MAX_CONSTRAINT_ROWS, MAX_FORCES, MAX_JOINTS, MAX_MAGNITUDE,
MAX_PROJECTION_ITERATIONS, MAX_SAMPLES, MAX_STEPS, Marker, Model, STANDARD_GRAVITY, Settings,
};
/// Why a simulation could not run or stopped.
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum DynamicsError {
#[error("invalid model: {0}")]
InvalidModel(String),
#[error("invalid settings: {0}")]
InvalidSettings(String),
#[error("too large: {0}")]
TooLarge(String),
#[error("the joint equations could not be solved at t = {time} s")]
Singular { time: f64 },
#[error("the motion diverged at t = {time} s")]
Diverged { time: f64 },
#[error("the step needed at t = {time} s is below the smallest allowed")]
StepTooSmall { time: f64 },
#[error("the run needs more than the step limit (stopped at t = {time} s)")]
StepLimit { time: f64 },
}
pub type Result<T> = std::result::Result<T, DynamicsError>;
/// A body's state at one time (world).
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct BodyState {
/// Centre of mass (mm).
pub position: Vec3,
/// The body's axes (body → world).
pub orientation: Quat,
/// Velocity of the centre of mass (mm/s).
pub velocity: Vec3,
/// Angular velocity (rad/s).
pub angular_velocity: Vec3,
}
/// A joint's state at one time.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct JointResult {
/// The joint's values ([`JointKind::values`]; radians and mm). A ball joint gives B's turn
/// from A as a rotation vector in A's frame.
pub values: Vec<f64>,
/// Their rates (rad/s, mm/s); a ball joint gives the relative angular velocity in A's frame.
pub rates: Vec<f64>,
/// The force the joint puts on `b`'s side (world, mN). Joints whose equations repeat
/// others' (a planar linkage of revolutes) share their reactions in one of many valid ways.
pub force: Vec3,
/// The torque the joint puts on `b`'s side about its frame's origin (world, mN·mm).
pub torque: Vec3,
}
/// Energies at one time (kg·mm²/s² = µJ).
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Energy {
pub kinetic: f64,
/// Potential energy of gravity, zero at the world origin.
pub gravity: f64,
/// Energy stored in springs (preload included).
pub spring: f64,
}
impl Energy {
pub fn total(&self) -> f64 {
self.kinetic + self.gravity + self.spring
}
}
/// The system at one output time.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Sample {
/// Time (s).
pub time: f64,
pub bodies: Vec<BodyState>,
pub joints: Vec<JointResult>,
pub energy: Energy,
/// The largest joint equation error (mm for points; directions are unitless).
pub constraint_error: f64,
}
/// What a run did.
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Stats {
/// Accepted steps.
pub steps: usize,
/// Rejected steps (adaptive integration).
pub rejected: usize,
/// The largest joint equation error at an output sample.
pub max_constraint_error: f64,
/// Joint equations that repeat others (the most at any sample).
pub redundant_equations: usize,
}
/// A run's result: the samples at t = 0, one output interval, two, … up to the duration.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Trajectory {
pub samples: Vec<Sample>,
pub stats: Stats,
}
#[cfg(test)]
mod tests;
-107
View File
@@ -1,107 +0,0 @@
//! Dense symmetric positive semi-definite solves for the constraint equations.
//!
//! The matrix `J M⁻¹ Jᵀ` is singular when joints repeat each other's constraints (every
//! revolute of a planar linkage built in 3D also holds the linkage in its plane), but its
//! right-hand side is then consistent. A Cholesky factorisation with diagonal pivoting stops at
//! the numerical rank and sets the multipliers of the dependent rows to zero, which solves such
//! a system exactly.
/// A square row-major matrix.
#[derive(Clone, Debug)]
pub(crate) struct Sym {
n: usize,
data: Vec<f64>,
}
impl Sym {
pub(crate) fn zeros(n: usize) -> Sym {
Sym { n, data: vec![0.0; n.saturating_mul(n)] }
}
pub(crate) fn get(&self, r: usize, c: usize) -> f64 {
self.data.get(r * self.n + c).copied().unwrap_or(0.0)
}
pub(crate) fn set(&mut self, r: usize, c: usize, v: f64) {
if let Some(x) = self.data.get_mut(r * self.n + c) {
*x = v;
}
}
fn swap(&mut self, a: usize, b: usize) {
if a == b {
return;
}
let n = self.n;
for c in 0..n {
self.data.swap(a * n + c, b * n + c);
}
for r in 0..n {
self.data.swap(r * n + a, r * n + b);
}
}
}
/// Solve `A x = b` for a symmetric positive semi-definite `A`, dropping the directions whose
/// pivot falls below `rel_tol` times the largest diagonal. Returns the solution and the rank;
/// `None` when the input is not finite or the sizes disagree.
pub(crate) fn solve_psd(mut a: Sym, b: &[f64], rel_tol: f64) -> Option<(Vec<f64>, usize)> {
let n = a.n;
if b.len() != n || a.data.len() != n.checked_mul(n)? || !b.iter().chain(&a.data).all(|x| x.is_finite()) {
return None;
}
let mut perm: Vec<usize> = (0..n).collect();
let mut rhs = b.to_vec();
let max_diag = (0..n).map(|i| a.get(i, i)).fold(0.0_f64, f64::max);
let tol = (max_diag * rel_tol).max(f64::MIN_POSITIVE);
let mut rank = 0;
for k in 0..n {
// The largest remaining diagonal becomes the pivot.
let (best, best_val) = (k..n).map(|i| (i, a.get(i, i))).fold((k, f64::NEG_INFINITY), |acc, x| if x.1 > acc.1 { x } else { acc });
if !(best_val > tol) {
break;
}
a.swap(k, best);
perm.swap(k, best);
rhs.swap(k, best);
let l = best_val.sqrt();
a.set(k, k, l);
// Both triangles are kept, so a later pivot swap moves whole rows and columns.
for i in k + 1..n {
let v = a.get(i, k) / l;
a.set(i, k, v);
a.set(k, i, v);
}
for j in k + 1..n {
let ljk = a.get(j, k);
if ljk == 0.0 {
continue;
}
for i in j..n {
let v = a.get(i, j) - a.get(i, k) * ljk;
a.set(i, j, v);
a.set(j, i, v);
}
}
rank = k + 1;
}
// L y = rhs (first `rank` rows), then Lᵀ x = y; the dependent unknowns stay 0.
let mut y = vec![0.0; n];
for i in 0..rank {
let s = (0..i).fold(rhs.get(i).copied().unwrap_or(0.0), |s, j| s - a.get(i, j) * y.get(j).copied().unwrap_or(0.0));
if let Some(v) = y.get_mut(i) {
*v = s / a.get(i, i);
}
}
let mut x = vec![0.0; n];
for i in (0..rank).rev() {
let s = (i + 1..rank).fold(y.get(i).copied().unwrap_or(0.0), |s, j| s - a.get(j, i) * x.get(j).copied().unwrap_or(0.0));
if let Some(v) = x.get_mut(i) {
*v = s / a.get(i, i);
}
}
let mut out = vec![0.0; n];
for (k, p) in perm.iter().enumerate() {
if let (Some(o), Some(v)) = (out.get_mut(*p), x.get(k)) {
*o = *v;
}
}
out.iter().all(|v| v.is_finite()).then_some((out, rank))
}
-203
View File
@@ -1,203 +0,0 @@
//! Rotations for the solver: a 3×3 matrix and a unit quaternion.
use serde::{Deserialize, Serialize};
use solidcore_record::Vec3;
use solidcraft_geom::prelude::*;
/// A 3×3 matrix, row-major (`m[row][col]`); acts on column vectors.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Mat3(pub [[f64; 3]; 3]);
impl Mat3 {
pub const IDENTITY: Mat3 = Mat3([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]);
pub const ZERO: Mat3 = Mat3([[0.0; 3]; 3]);
/// The matrix whose columns are `a`, `b` and `c`.
pub fn from_cols(a: Vec3, b: Vec3, c: Vec3) -> Mat3 {
Mat3([[a.x, b.x, c.x], [a.y, b.y, c.y], [a.z, b.z, c.z]])
}
pub fn diagonal(d: Vec3) -> Mat3 {
Mat3([[d.x, 0.0, 0.0], [0.0, d.y, 0.0], [0.0, 0.0, d.z]])
}
pub fn col(&self, i: usize) -> Vec3 {
let [r0, r1, r2] = self.0;
match i {
0 => Vec3::new(r0[0], r1[0], r2[0]),
1 => Vec3::new(r0[1], r1[1], r2[1]),
_ => Vec3::new(r0[2], r1[2], r2[2]),
}
}
pub fn row(&self, i: usize) -> Vec3 {
let [a, b, c] = match i {
0 => self.0[0],
1 => self.0[1],
_ => self.0[2],
};
Vec3::new(a, b, c)
}
pub fn mul_vec(&self, v: Vec3) -> Vec3 {
Vec3::new(self.row(0).dot(v), self.row(1).dot(v), self.row(2).dot(v))
}
pub fn mul(&self, o: &Mat3) -> Mat3 {
Mat3::from_cols(self.mul_vec(o.col(0)), self.mul_vec(o.col(1)), self.mul_vec(o.col(2)))
}
pub fn transpose(&self) -> Mat3 {
Mat3::from_cols(self.row(0), self.row(1), self.row(2))
}
pub fn is_finite(&self) -> bool {
self.0.iter().flatten().all(|x| x.is_finite())
}
/// The largest difference between `m[i][j]` and `m[j][i]`.
pub fn asymmetry(&self) -> f64 {
let m = &self.0;
(m[0][1] - m[1][0]).abs().max((m[0][2] - m[2][0]).abs()).max((m[1][2] - m[2][1]).abs())
}
pub fn determinant(&self) -> f64 {
self.col(0).dot(self.col(1).cross(self.col(2)))
}
/// The inverse of a symmetric positive definite matrix (an inertia tensor); `None` when it is
/// not one (by its leading principal minors, scaled to its size).
pub fn spd_inverse(&self) -> Option<Mat3> {
let m = &self.0;
let scale = m[0][0].abs().max(m[1][1].abs()).max(m[2][2].abs());
if !(scale > 0.0) || !self.is_finite() || self.asymmetry() > 1e-9 * scale {
return None;
}
let rel = 1e-12;
let m1 = m[0][0];
let m2 = m[0][0] * m[1][1] - m[0][1] * m[1][0];
let det = self.determinant();
if !(m1 > rel * scale) || !(m2 > rel * scale * scale) || !(det > rel * scale * scale * scale) {
return None;
}
// Adjugate over determinant: the cross products of the columns are the adjugate's rows.
let (a, b, c) = (self.col(0), self.col(1), self.col(2));
let inv = Mat3::from_cols(b.cross(c), c.cross(a), a.cross(b)).transpose();
let inv = Mat3(inv.0.map(|r| r.map(|x| x / det)));
inv.is_finite().then_some(inv)
}
}
/// `a × (b × c)`-style helper: the vector `a × (a × v)`.
pub fn cross2(a: Vec3, v: Vec3) -> Vec3 {
a.cross(a.cross(v))
}
/// A rotation as a unit quaternion `w + xi + yj + zk`.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Quat {
pub w: f64,
pub x: f64,
pub y: f64,
pub z: f64,
}
impl Default for Quat {
fn default() -> Self {
Quat::IDENTITY
}
}
impl Quat {
pub const IDENTITY: Quat = Quat { w: 1.0, x: 0.0, y: 0.0, z: 0.0 };
pub fn vec(self) -> Vec3 {
Vec3::new(self.x, self.y, self.z)
}
/// The turn by `angle` (radians) about `axis` (any length; the identity for a zero axis).
pub fn from_axis_angle(axis: Vec3, angle: f64) -> Quat {
match axis.normalized() {
Some(a) => {
let (s, c) = (angle * 0.5).sin_cos();
Quat { w: c, x: a.x * s, y: a.y * s, z: a.z * s }
}
None => Quat::IDENTITY,
}
}
/// The turn by the rotation vector `v` (axis times angle).
pub fn from_rotation_vector(v: Vec3) -> Quat {
// sin(θ/2)/θ by its series for small turns: a projection's corrections are far below
// the length a direction can be normalised from.
let angle = v.len();
let (s, c) = (angle * 0.5).sin_cos();
let k = if angle < 1e-4 { 0.5 - angle * angle / 48.0 } else { s / angle };
if !k.is_finite() || !v.is_finite() {
return Quat::IDENTITY;
}
Quat { w: c, x: v.x * k, y: v.y * k, z: v.z * k }
}
/// The rotation whose matrix has these orthonormal columns (a right-handed frame).
pub fn from_mat3(m: &Mat3) -> Option<Quat> {
let r = &m.0;
let tr = r[0][0] + r[1][1] + r[2][2];
let q = if tr > 0.0 {
let s = (tr + 1.0).sqrt() * 2.0;
Quat { w: 0.25 * s, x: (r[2][1] - r[1][2]) / s, y: (r[0][2] - r[2][0]) / s, z: (r[1][0] - r[0][1]) / s }
} else if r[0][0] > r[1][1] && r[0][0] > r[2][2] {
let s = (1.0 + r[0][0] - r[1][1] - r[2][2]).sqrt() * 2.0;
Quat { w: (r[2][1] - r[1][2]) / s, x: 0.25 * s, y: (r[0][1] + r[1][0]) / s, z: (r[0][2] + r[2][0]) / s }
} else if r[1][1] > r[2][2] {
let s = (1.0 + r[1][1] - r[0][0] - r[2][2]).sqrt() * 2.0;
Quat { w: (r[0][2] - r[2][0]) / s, x: (r[0][1] + r[1][0]) / s, y: 0.25 * s, z: (r[1][2] + r[2][1]) / s }
} else {
let s = (1.0 + r[2][2] - r[0][0] - r[1][1]).sqrt() * 2.0;
Quat { w: (r[1][0] - r[0][1]) / s, x: (r[0][2] + r[2][0]) / s, y: (r[1][2] + r[2][1]) / s, z: 0.25 * s }
};
q.normalized()
}
/// The Hamilton product `self ⊗ o` (turn by `o`, then by `self`).
pub fn compose(self, o: Quat) -> Quat {
Quat {
w: self.w * o.w - self.x * o.x - self.y * o.y - self.z * o.z,
x: self.w * o.x + self.x * o.w + self.y * o.z - self.z * o.y,
y: self.w * o.y - self.x * o.z + self.y * o.w + self.z * o.x,
z: self.w * o.z + self.x * o.y - self.y * o.x + self.z * o.w,
}
}
pub fn conjugate(self) -> Quat {
Quat { w: self.w, x: -self.x, y: -self.y, z: -self.z }
}
pub fn norm(self) -> f64 {
(self.w * self.w + self.x * self.x + self.y * self.y + self.z * self.z).sqrt()
}
pub fn is_finite(self) -> bool {
self.w.is_finite() && self.x.is_finite() && self.y.is_finite() && self.z.is_finite()
}
/// Scaled to length 1; `None` for a zero or non-finite quaternion.
pub fn normalized(self) -> Option<Quat> {
let n = self.norm();
(n > 1e-300 && n.is_finite()).then(|| Quat { w: self.w / n, x: self.x / n, y: self.y / n, z: self.z / n })
}
pub fn to_mat3(self) -> Mat3 {
let Quat { w, x, y, z } = self;
Mat3([
[1.0 - 2.0 * (y * y + z * z), 2.0 * (x * y - w * z), 2.0 * (x * z + w * y)],
[2.0 * (x * y + w * z), 1.0 - 2.0 * (x * x + z * z), 2.0 * (y * z - w * x)],
[2.0 * (x * z - w * y), 2.0 * (y * z + w * x), 1.0 - 2.0 * (x * x + y * y)],
])
}
pub fn rotate(self, v: Vec3) -> Vec3 {
// v + 2 q×(q×v + w v)
let q = self.vec();
v + q.cross(q.cross(v) + v * self.w) * 2.0
}
/// The rate of change of this orientation when the body turns at `omega` (world frame):
/// `q̇ = ½ (0, ω) ⊗ q`.
pub fn rate(self, omega: Vec3) -> Quat {
let o = Quat { w: 0.0, x: omega.x, y: omega.y, z: omega.z }.compose(self);
Quat { w: 0.5 * o.w, x: 0.5 * o.x, y: 0.5 * o.y, z: 0.5 * o.z }
}
/// `self + k·o`, component-wise (an integrator's stage; normalise afterwards).
pub fn add_scaled(self, o: Quat, k: f64) -> Quat {
Quat { w: self.w + k * o.w, x: self.x + k * o.x, y: self.y + k * o.y, z: self.z + k * o.z }
}
/// The rotation vector (axis times angle, angle in [0, π]).
pub fn rotation_vector(self) -> Vec3 {
let q = if self.w < 0.0 { Quat { w: -self.w, x: -self.x, y: -self.y, z: -self.z } } else { self };
let s = q.vec().len();
if s < 1e-12 {
return q.vec() * 2.0;
}
q.vec() * (2.0 * s.atan2(q.w) / s)
}
}
-385
View File
@@ -1,385 +0,0 @@
//! What a simulation is made of: rigid bodies, joints between frames on them, force elements
//! and the solver's settings. Everything is checked by [`Model::validate`] before a run.
use serde::{Deserialize, Serialize};
use solidcore_record::Vec3;
use solidcraft_geom::prelude::*;
use crate::math::{Mat3, Quat};
use crate::{DynamicsError, Result};
/// Bodies one simulation takes at most.
pub const MAX_BODIES: usize = 200;
/// Joints one simulation takes at most.
pub const MAX_JOINTS: usize = 400;
/// Constraint equations one simulation takes at most (the dense solve grows with their cube).
pub const MAX_CONSTRAINT_ROWS: usize = 1200;
/// Force elements one simulation takes at most.
pub const MAX_FORCES: usize = 2000;
/// Integration steps one run takes at most (accepted and rejected together).
pub const MAX_STEPS: usize = 2_000_000;
/// Output samples one run keeps at most.
pub const MAX_SAMPLES: usize = 100_000;
/// Projection iterations per step at most.
pub const MAX_PROJECTION_ITERATIONS: usize = 50;
/// Coordinates are kept within this size (mm, mm/s, rad/s); beyond it the run stops with
/// [`DynamicsError::Diverged`].
pub const MAX_MAGNITUDE: f64 = 1e12;
/// A rigid body. Lengths in mm, mass in kg, time in s, so forces are in kg·mm/s² (mN) and
/// torques in mN·mm.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Body {
/// Mass (kg), > 0.
pub mass: f64,
/// Inertia tensor about the centre of mass in the body's own axes (kg·mm²), symmetric
/// positive definite.
pub inertia: Mat3,
/// Centre of mass at the start (world, mm). The body's own frame has its origin here.
pub position: Vec3,
/// The body's axes at the start (body → world).
#[serde(default)]
pub orientation: Quat,
/// Velocity of the centre of mass at the start (world, mm/s).
#[serde(default)]
pub velocity: Vec3,
/// Angular velocity at the start (world, rad/s).
#[serde(default)]
pub angular_velocity: Vec3,
}
impl Body {
/// A body at rest at `position`, axes along the world's, with a diagonal inertia.
pub fn at_rest(mass: f64, principal_inertia: Vec3, position: Vec3) -> Body {
Body {
mass,
inertia: Mat3::diagonal(principal_inertia),
position,
orientation: Quat::IDENTITY,
velocity: Vec3::ZERO,
angular_velocity: Vec3::ZERO,
}
}
}
/// A frame on a body (in the body's own coordinates: origin at its centre of mass) or, with no
/// body, fixed in the world. `z` and `x` need not be unit or square: `x` is laid square to `z`.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Marker {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<usize>,
pub origin: Vec3,
pub z: Vec3,
pub x: Vec3,
}
impl Marker {
pub fn new(body: Option<usize>, origin: Vec3, z: Vec3, x: Vec3) -> Marker {
Marker { body, origin, z, x }
}
/// A frame fixed in the world.
pub fn ground(origin: Vec3, z: Vec3, x: Vec3) -> Marker {
Marker { body: None, origin, z, x }
}
}
/// A point on a body (body coordinates) or, with no body, in the world.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Anchor {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub body: Option<usize>,
pub point: Vec3,
}
/// The joints the solver knows; each holds `b`'s frame to `a`'s as the matching assembly joint
/// does (z is the joint's axis), with the frames coinciding at zero joint values.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum JointKind {
/// No relative motion (6 equations).
Rigid,
/// Turns about z (5 equations).
Revolute,
/// Slides along z (5 equations).
Slider,
/// Turns about and slides along z (4 equations).
Cylindrical,
/// Slides in the xy plane and turns about z (3 equations).
Planar,
/// Turns any way about the common origin (3 equations).
Ball,
}
impl JointKind {
/// How many constraint equations the joint adds.
pub fn equations(self) -> usize {
match self {
JointKind::Rigid => 6,
JointKind::Revolute | JointKind::Slider => 5,
JointKind::Cylindrical => 4,
JointKind::Planar | JointKind::Ball => 3,
}
}
/// The joint's values, in the order [`crate::JointResult::values`] gives them.
pub fn values(self) -> &'static [&'static str] {
match self {
JointKind::Rigid => &[],
JointKind::Revolute => &["angle"],
JointKind::Slider => &["distance"],
JointKind::Cylindrical => &["angle", "distance"],
JointKind::Planar => &["x", "y", "angle"],
JointKind::Ball => &["rx", "ry", "rz"],
}
}
}
/// A joint: `b`'s frame held to `a`'s.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Joint {
pub kind: JointKind,
pub a: Marker,
pub b: Marker,
}
/// A force element.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum Force {
/// A linear spring and damper between two points: the tension is
/// `stiffness·(length − free_length) + damping·(rate of length) + preload`.
Spring {
a: Anchor,
b: Anchor,
/// kg/s² (= N/m = mN/mm), ≥ 0.
stiffness: f64,
/// kg/s (= N·s/m), ≥ 0.
damping: f64,
/// mm, ≥ 0.
free_length: f64,
/// mN, tension at free length.
#[serde(default)]
preload: f64,
},
/// A constant force (world, mN) at a point of a body, and a constant torque (world, mN·mm).
Load {
body: usize,
#[serde(default)]
point: Vec3,
#[serde(default)]
force: Vec3,
#[serde(default)]
torque: Vec3,
},
}
/// How the equations are stepped in time.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum Integrator {
/// Classical fourth-order Runge–Kutta with a fixed step (s).
Rk4 { step: f64 },
/// Dormand–Prince 5(4) with error control: steps between `min_step` and `max_step` (s)
/// keep the local error under `abs_tol + rel_tol·|y|`.
Adaptive { rel_tol: f64, abs_tol: f64, min_step: f64, max_step: f64 },
}
/// A run's settings.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct Settings {
/// Simulated time (s), > 0.
pub duration: f64,
/// Time between output samples (s), > 0; the integrator lands on every sample.
pub output_interval: f64,
pub integrator: Integrator,
/// Project positions and velocities back onto the joints after every step (on by default).
#[serde(default = "yes")]
pub projection: bool,
/// The constraint error (mm, or radians times mm for directions) projection reaches.
#[serde(default = "default_projection_tol")]
pub projection_tol: f64,
/// Baumgarte stabilisation `(α, β)` (1/s): the constraint accelerations become
/// `Φ̈ + 2αΦ̇ + β²Φ = 0`. Off by default (projection keeps the joints).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub baumgarte: Option<(f64, f64)>,
}
fn yes() -> bool {
true
}
fn default_projection_tol() -> f64 {
1e-10
}
impl Settings {
/// Fixed-step RK4 settings.
pub fn rk4(duration: f64, step: f64, output_interval: f64) -> Settings {
Settings {
duration,
output_interval,
integrator: Integrator::Rk4 { step },
projection: true,
projection_tol: default_projection_tol(),
baumgarte: None,
}
}
/// Adaptive settings with the given relative and absolute tolerances.
pub fn adaptive(duration: f64, output_interval: f64, rel_tol: f64, abs_tol: f64) -> Settings {
Settings {
duration,
output_interval,
integrator: Integrator::Adaptive { rel_tol, abs_tol, min_step: 1e-9, max_step: output_interval },
projection: true,
projection_tol: default_projection_tol(),
baumgarte: None,
}
}
}
/// A multibody system.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Model {
pub bodies: Vec<Body>,
#[serde(default)]
pub joints: Vec<Joint>,
#[serde(default)]
pub forces: Vec<Force>,
/// Gravity (mm/s²), e.g. `(0, 0, −9806.65)`.
#[serde(default)]
pub gravity: Vec3,
}
/// Standard gravity (mm/s²).
pub const STANDARD_GRAVITY: f64 = 9806.65;
fn finite_vec(v: Vec3) -> bool {
v.is_finite() && v.x.abs() < MAX_MAGNITUDE && v.y.abs() < MAX_MAGNITUDE && v.z.abs() < MAX_MAGNITUDE
}
fn bad(what: String) -> DynamicsError {
DynamicsError::InvalidModel(what)
}
/// A marker's axes in its body's coordinates (columns x, y, z), from its `z` and `x`.
pub(crate) fn marker_axes(m: &Marker) -> Option<Mat3> {
let z = m.z.normalized()?;
let x = (m.x - z * m.x.dot(z)).normalized()?;
let y = z.cross(x).normalized()?;
Some(Mat3::from_cols(x, y, z))
}
impl Model {
/// Checks every number and reference, and the caps. Called by [`crate::simulate`].
pub fn validate(&self) -> Result<()> {
if self.bodies.is_empty() {
return Err(bad("no bodies".into()));
}
if self.bodies.len() > MAX_BODIES {
return Err(DynamicsError::TooLarge(format!("{} bodies (at most {MAX_BODIES})", self.bodies.len())));
}
if self.joints.len() > MAX_JOINTS {
return Err(DynamicsError::TooLarge(format!("{} joints (at most {MAX_JOINTS})", self.joints.len())));
}
if self.forces.len() > MAX_FORCES {
return Err(DynamicsError::TooLarge(format!("{} force elements (at most {MAX_FORCES})", self.forces.len())));
}
let rows: usize = self.joints.iter().map(|j| j.kind.equations()).sum();
if rows > MAX_CONSTRAINT_ROWS {
return Err(DynamicsError::TooLarge(format!("{rows} constraint equations (at most {MAX_CONSTRAINT_ROWS})")));
}
if !finite_vec(self.gravity) {
return Err(bad("gravity is not a finite vector".into()));
}
for (i, b) in self.bodies.iter().enumerate() {
if !(b.mass > 0.0) || !(b.mass < MAX_MAGNITUDE) {
return Err(bad(format!("body {i}: mass must be positive and finite")));
}
if b.inertia.spd_inverse().is_none() {
return Err(bad(format!("body {i}: inertia must be symmetric positive definite")));
}
if !finite_vec(b.position) || !finite_vec(b.velocity) || !finite_vec(b.angular_velocity) {
return Err(bad(format!("body {i}: position and velocities must be finite")));
}
if b.orientation.normalized().is_none() {
return Err(bad(format!("body {i}: orientation is not a rotation")));
}
}
let body_ok = |b: Option<usize>| b.is_none_or(|b| b < self.bodies.len());
for (i, j) in self.joints.iter().enumerate() {
for m in [&j.a, &j.b] {
if !body_ok(m.body) {
return Err(bad(format!("joint {i}: no body {}", m.body.unwrap_or(0))));
}
if !finite_vec(m.origin) || marker_axes(m).is_none() {
return Err(bad(format!("joint {i}: a frame's origin or axes are not usable")));
}
}
if j.a.body == j.b.body {
return Err(bad(format!("joint {i}: both frames are on the same body")));
}
}
for (i, f) in self.forces.iter().enumerate() {
match f {
Force::Spring { a, b, stiffness, damping, free_length, preload } => {
if !body_ok(a.body) || !body_ok(b.body) {
return Err(bad(format!("force {i}: no such body")));
}
if !finite_vec(a.point) || !finite_vec(b.point) {
return Err(bad(format!("force {i}: anchor points must be finite")));
}
let ok = |x: f64| (0.0..MAX_MAGNITUDE).contains(&x);
if !ok(*stiffness) || !ok(*damping) || !ok(*free_length) || !preload.is_finite() || preload.abs() >= MAX_MAGNITUDE {
return Err(bad(format!("force {i}: stiffness, damping and free length must be ≥ 0 and finite")));
}
}
Force::Load { body, point, force, torque } => {
if *body >= self.bodies.len() {
return Err(bad(format!("force {i}: no body {body}")));
}
if !finite_vec(*point) || !finite_vec(*force) || !finite_vec(*torque) {
return Err(bad(format!("force {i}: point, force and torque must be finite")));
}
}
}
}
Ok(())
}
}
impl Settings {
/// Checks the times, tolerances and that the run fits the step and sample caps.
pub fn validate(&self) -> Result<()> {
let pos = |x: f64| x > 0.0 && x < MAX_MAGNITUDE;
if !pos(self.duration) || !pos(self.output_interval) {
return Err(DynamicsError::InvalidSettings("duration and output interval must be positive and finite".into()));
}
let samples = (self.duration / self.output_interval).ceil();
if !(samples < MAX_SAMPLES as f64) {
return Err(DynamicsError::TooLarge(format!("{samples} output samples (at most {MAX_SAMPLES})")));
}
if !pos(self.projection_tol) {
return Err(DynamicsError::InvalidSettings("projection tolerance must be positive".into()));
}
if let Some((a, b)) = self.baumgarte
&& (!(0.0..MAX_MAGNITUDE).contains(&a) || !(0.0..MAX_MAGNITUDE).contains(&b))
{
return Err(DynamicsError::InvalidSettings("Baumgarte terms must be ≥ 0 and finite".into()));
}
match self.integrator {
Integrator::Rk4 { step } => {
if !pos(step) {
return Err(DynamicsError::InvalidSettings("step must be positive".into()));
}
let steps = (self.duration / step.min(self.output_interval)).ceil();
if !(steps < MAX_STEPS as f64) {
return Err(DynamicsError::TooLarge(format!("{steps} steps (at most {MAX_STEPS})")));
}
}
Integrator::Adaptive { rel_tol, abs_tol, min_step, max_step } => {
if !pos(rel_tol) || !pos(abs_tol) || !pos(min_step) || !pos(max_step) || min_step > max_step {
return Err(DynamicsError::InvalidSettings("tolerances and step bounds must be positive, min ≤ max".into()));
}
}
}
Ok(())
}
}
-594
View File
@@ -1,594 +0,0 @@
//! The equations of motion: body states, joint constraint equations with their Jacobians,
//! applied forces, the constrained accelerations and the projections back onto the joints.
//!
//! Bodies use maximal coordinates: centre-of-mass position `x`, unit quaternion `q`, velocity
//! `v` and angular velocity `ω` (both world). With `u = (v, ω)` per body, mass matrix
//! `M = diag(m·I₃, I_w)` (`I_w = R I_body Rᵀ`), joint equations `Φ(x, q) = 0`, their Jacobian
//! `J` (`Φ̇ = J u`) and `γ = −J̇ u`, the accelerations solve
//!
//! ```text
//! M u̇ + Jᵀ λ = F − ω × I_w ω, J u̇ = γ
//! ```
//!
//! through the Schur complement `(J M⁻¹ Jᵀ) λ = J M⁻¹ F − γ` (`linalg::solve_psd`, which takes
//! repeated joint equations), and `λ` gives the joints' reactions.
use solidcore_record::Vec3;
use solidcraft_geom::prelude::*;
use crate::linalg::{Sym, solve_psd};
use crate::math::{Mat3, Quat, cross2};
use crate::model::{Force, JointKind, MAX_MAGNITUDE, MAX_PROJECTION_ITERATIONS, Model, marker_axes};
use crate::{BodyState, DynamicsError, Energy, JointResult, Result};
/// Numbers per body in the flat state: x (3), q (4), v (3), ω (3).
pub(crate) const STRIDE: usize = 13;
/// Pivots under this fraction of the largest are taken as repeated equations.
const RANK_TOL: f64 = 1e-10;
fn v3(y: &[f64], at: usize) -> Vec3 {
let g = |i: usize| y.get(at + i).copied().unwrap_or(0.0);
Vec3::new(g(0), g(1), g(2))
}
fn put3(y: &mut [f64], at: usize, v: Vec3) {
for (i, c) in [v.x, v.y, v.z].into_iter().enumerate() {
if let Some(s) = y.get_mut(at + i) {
*s = c;
}
}
}
fn quat(y: &[f64], at: usize) -> Quat {
let g = |i: usize| y.get(at + i).copied().unwrap_or(0.0);
Quat { w: g(0), x: g(1), y: g(2), z: g(3) }
}
fn put_quat(y: &mut [f64], at: usize, q: Quat) {
for (i, c) in [q.w, q.x, q.y, q.z].into_iter().enumerate() {
if let Some(s) = y.get_mut(at + i) {
*s = c;
}
}
}
/// One body's precomputed constants.
struct BodyConst {
mass: f64,
inertia: Mat3,
inertia_inv: Mat3,
}
/// A joint frame: its body, origin and axes in the body's coordinates.
struct MarkerConst {
body: Option<usize>,
origin: Vec3,
axes: Mat3,
}
struct JointConst {
kind: JointKind,
a: MarkerConst,
b: MarkerConst,
}
/// A body's kinematics at one state.
#[derive(Clone, Copy)]
struct Kin {
x: Vec3,
rot: Mat3,
v: Vec3,
w: Vec3,
}
const GROUND: Kin = Kin { x: Vec3::ZERO, rot: Mat3::IDENTITY, v: Vec3::ZERO, w: Vec3::ZERO };
/// A joint frame at one state (world).
struct MarkerWorld {
body: Option<usize>,
/// Origin minus the body's centre of mass.
r: Vec3,
/// Origin.
p: Vec3,
/// Velocity of the origin.
pdot: Vec3,
axes: [Vec3; 3],
w: Vec3,
}
/// A body's part of one Jacobian row: (linear, angular).
type Block = (usize, Vec3, Vec3);
/// One constraint equation at a state.
pub(crate) struct Row {
a: Option<Block>,
b: Option<Block>,
pub(crate) phi: f64,
/// `J̇ u`: the equation's second derivative at zero accelerations.
jdot_u: f64,
}
impl Row {
fn blocks(&self) -> impl Iterator<Item = &Block> {
self.a.iter().chain(self.b.iter())
}
/// `J u`.
fn rate(&self, kin: &[Kin]) -> f64 {
self.blocks().map(|(i, l, a)| kin.get(*i).map_or(0.0, |k| l.dot(k.v) + a.dot(k.w))).sum()
}
}
/// A model ready to integrate.
pub(crate) struct System {
bodies: Vec<BodyConst>,
joints: Vec<JointConst>,
forces: Vec<Force>,
gravity: Vec3,
baumgarte: Option<(f64, f64)>,
}
/// Accelerations and multipliers at one state.
pub(crate) struct Accel {
/// The flat state's derivative.
pub(crate) ydot: Vec<f64>,
/// One multiplier per constraint row, in joint order.
lambda: Vec<f64>,
rows: Vec<Row>,
/// The rank of `J M⁻¹ Jᵀ`.
pub(crate) rank: usize,
}
impl Accel {
/// The number of joint equations.
pub(crate) fn row_count(&self) -> usize {
self.rows.len()
}
}
fn marker_const(m: &crate::Marker) -> Result<MarkerConst> {
let axes = marker_axes(m).ok_or_else(|| DynamicsError::InvalidModel("a joint frame's axes are not usable".into()))?;
Ok(MarkerConst { body: m.body, origin: m.origin, axes })
}
impl System {
pub(crate) fn new(model: &Model, baumgarte: Option<(f64, f64)>) -> Result<System> {
model.validate()?;
let bodies = model
.bodies
.iter()
.map(|b| {
let inertia_inv = b.inertia.spd_inverse().ok_or_else(|| DynamicsError::InvalidModel("inertia is not positive definite".into()))?;
Ok(BodyConst { mass: b.mass, inertia: b.inertia, inertia_inv })
})
.collect::<Result<Vec<_>>>()?;
let joints = model
.joints
.iter()
.map(|j| Ok(JointConst { kind: j.kind, a: marker_const(&j.a)?, b: marker_const(&j.b)? }))
.collect::<Result<Vec<_>>>()?;
Ok(System { bodies, joints, forces: model.forces.clone(), gravity: model.gravity, baumgarte })
}
/// The flat state of the model's starting conditions.
pub(crate) fn initial_state(model: &Model) -> Result<Vec<f64>> {
let mut y = vec![0.0; model.bodies.len() * STRIDE];
for (i, b) in model.bodies.iter().enumerate() {
let at = i * STRIDE;
let q = b.orientation.normalized().ok_or_else(|| DynamicsError::InvalidModel(format!("body {i}: orientation is not a rotation")))?;
put3(&mut y, at, b.position);
put_quat(&mut y, at + 3, q);
put3(&mut y, at + 7, b.velocity);
put3(&mut y, at + 10, b.angular_velocity);
}
Ok(y)
}
/// Unit quaternions again after a step.
pub(crate) fn normalize(&self, y: &mut [f64]) -> Result<()> {
for i in 0..self.bodies.len() {
let q = quat(y, i * STRIDE + 3).normalized().ok_or(DynamicsError::Diverged { time: f64::NAN })?;
put_quat(y, i * STRIDE + 3, q);
}
Ok(())
}
fn kinematics(&self, y: &[f64]) -> Vec<Kin> {
(0..self.bodies.len())
.map(|i| {
let at = i * STRIDE;
Kin { x: v3(y, at), rot: quat(y, at + 3).to_mat3(), v: v3(y, at + 7), w: v3(y, at + 10) }
})
.collect()
}
fn kin_of(kin: &[Kin], body: Option<usize>) -> Kin {
body.and_then(|b| kin.get(b).copied()).unwrap_or(GROUND)
}
fn marker_world(kin: &[Kin], m: &MarkerConst) -> MarkerWorld {
let k = Self::kin_of(kin, m.body);
let r = k.rot.mul_vec(m.origin);
let axes = [k.rot.mul_vec(m.axes.col(0)), k.rot.mul_vec(m.axes.col(1)), k.rot.mul_vec(m.axes.col(2))];
MarkerWorld { body: m.body, r, p: k.x + r, pdot: k.v + k.w.cross(r), axes, w: k.w }
}
/// The constraint equations of every joint at `kin`, in joint order.
fn rows(&self, kin: &[Kin]) -> Vec<Row> {
let mut rows = Vec::new();
for j in &self.joints {
let a = Self::marker_world(kin, &j.a);
let b = Self::marker_world(kin, &j.b);
joint_rows(j.kind, &a, &b, &mut rows);
}
rows
}
/// `M⁻¹` applied to one body's (force, torque).
fn minv(&self, kin: &[Kin], body: usize, f: Vec3, t: Vec3) -> (Vec3, Vec3) {
match (self.bodies.get(body), kin.get(body)) {
(Some(b), Some(k)) => {
let iw_inv = k.rot.mul(&b.inertia_inv).mul(&k.rot.transpose());
(f * (1.0 / b.mass), iw_inv.mul_vec(t))
}
_ => (Vec3::ZERO, Vec3::ZERO),
}
}
/// `J M⁻¹ Jᵀ`, and each row's `M⁻¹ Jᵀ` blocks.
fn schur(&self, kin: &[Kin], rows: &[Row]) -> (Sym, Vec<Vec<Block>>) {
let w: Vec<Vec<Block>> = rows
.iter()
.map(|r| {
r.blocks()
.map(|(i, l, a)| {
let (ml, ma) = self.minv(kin, *i, *l, *a);
(*i, ml, ma)
})
.collect()
})
.collect();
let n = rows.len();
let mut s = Sym::zeros(n);
for (r, row) in rows.iter().enumerate() {
for (c, wc) in w.iter().enumerate().skip(r) {
let mut sum = 0.0;
for (i, l, a) in row.blocks() {
for (k, ml, ma) in wc {
if i == k {
sum += l.dot(*ml) + a.dot(*ma);
}
}
}
s.set(r, c, sum);
s.set(c, r, sum);
}
}
(s, w)
}
/// Applied forces and torques (about each centre of mass, world), gyroscopic terms included.
fn applied(&self, kin: &[Kin]) -> Vec<(Vec3, Vec3)> {
let mut out: Vec<(Vec3, Vec3)> = self
.bodies
.iter()
.zip(kin)
.map(|(b, k)| {
let iw = k.rot.mul(&b.inertia).mul(&k.rot.transpose());
(self.gravity * b.mass, -k.w.cross(iw.mul_vec(k.w)))
})
.collect();
let mut add = |body: Option<usize>, r: Vec3, f: Vec3, t: Vec3| {
if let Some(slot) = body.and_then(|b| out.get_mut(b)) {
slot.0 += f;
slot.1 += r.cross(f) + t;
}
};
for f in &self.forces {
match *f {
Force::Spring { a, b, stiffness, damping, free_length, preload } => {
let (ka, kb) = (Self::kin_of(kin, a.body), Self::kin_of(kin, b.body));
let (ra, rb) = (ka.rot.mul_vec(a.point), kb.rot.mul_vec(b.point));
let d = (kb.x + rb) - (ka.x + ra);
let len = d.len();
let Some(n) = d.normalized().filter(|_| len > 1e-9) else { continue };
let rate = n.dot((kb.v + kb.w.cross(rb)) - (ka.v + ka.w.cross(ra)));
let tension = stiffness * (len - free_length) + damping * rate + preload;
add(a.body, ra, n * tension, Vec3::ZERO);
add(b.body, rb, n * -tension, Vec3::ZERO);
}
Force::Load { body, point, force, torque } => {
let r = kin.get(body).map_or(Vec3::ZERO, |k| k.rot.mul_vec(point));
add(Some(body), r, force, torque);
}
}
}
out
}
/// The state's derivative and the joints' multipliers.
pub(crate) fn accelerations(&self, y: &[f64]) -> Result<Accel> {
let kin = self.kinematics(y);
let applied = self.applied(&kin);
let rows = self.rows(&kin);
let (s, w) = self.schur(&kin, &rows);
// Unconstrained accelerations M⁻¹F.
let free: Vec<(Vec3, Vec3)> = applied.iter().enumerate().map(|(i, (f, t))| self.minv(&kin, i, *f, *t)).collect();
let rhs: Vec<f64> = rows
.iter()
.map(|r| {
let jmf: f64 = r.blocks().map(|(i, l, a)| free.get(*i).map_or(0.0, |(fl, fa)| l.dot(*fl) + a.dot(*fa))).sum();
let stab = self.baumgarte.map_or(0.0, |(alpha, beta)| 2.0 * alpha * r.rate(&kin) + beta * beta * r.phi);
jmf + r.jdot_u + stab
})
.collect();
let (lambda, rank) =
if rows.is_empty() { (Vec::new(), 0) } else { solve_psd(s, &rhs, RANK_TOL).ok_or(DynamicsError::Singular { time: f64::NAN })? };
let mut acc = free;
for (wr, l) in w.iter().zip(&lambda) {
for (i, ml, ma) in wr {
if let Some(a) = acc.get_mut(*i) {
a.0 -= *ml * *l;
a.1 -= *ma * *l;
}
}
}
let mut ydot = vec![0.0; y.len()];
for (i, (k, a)) in kin.iter().zip(&acc).enumerate() {
let at = i * STRIDE;
put3(&mut ydot, at, k.v);
put_quat(&mut ydot, at + 3, quat(y, at + 3).rate(k.w));
put3(&mut ydot, at + 7, a.0);
put3(&mut ydot, at + 10, a.1);
}
if !ydot.iter().all(|x| x.is_finite()) {
return Err(DynamicsError::Diverged { time: f64::NAN });
}
Ok(Accel { ydot, lambda, rows, rank })
}
/// The largest joint equation error at `y`.
pub(crate) fn constraint_error(&self, y: &[f64]) -> f64 {
self.rows(&self.kinematics(y)).iter().map(|r| r.phi.abs()).fold(0.0, f64::max)
}
/// Moves the bodies the least (mass-weighted) onto the joints: Gauss–Newton on `Φ = 0`.
/// Returns the error left.
pub(crate) fn project_positions(&self, y: &mut [f64], tol: f64) -> Result<f64> {
let mut err;
let mut iteration = 0;
loop {
let kin = self.kinematics(y);
let rows = self.rows(&kin);
err = rows.iter().map(|r| r.phi.abs()).fold(0.0, f64::max);
if !(err > tol) || iteration >= MAX_PROJECTION_ITERATIONS {
break;
}
iteration += 1;
let (s, w) = self.schur(&kin, &rows);
let phi: Vec<f64> = rows.iter().map(|r| r.phi).collect();
let (mu, _) = solve_psd(s, &phi, RANK_TOL).ok_or(DynamicsError::Singular { time: f64::NAN })?;
let mut delta = vec![(Vec3::ZERO, Vec3::ZERO); self.bodies.len()];
for (wr, m) in w.iter().zip(&mu) {
for (i, ml, ma) in wr {
if let Some(d) = delta.get_mut(*i) {
d.0 -= *ml * *m;
d.1 -= *ma * *m;
}
}
}
for (i, (dx, dth)) in delta.into_iter().enumerate() {
let at = i * STRIDE;
put3(y, at, v3(y, at) + dx);
let q = Quat::from_rotation_vector(dth).compose(quat(y, at + 3)).normalized().ok_or(DynamicsError::Diverged { time: f64::NAN })?;
put_quat(y, at + 3, q);
}
}
if !err.is_finite() || !y.iter().all(|x| x.is_finite() && x.abs() < MAX_MAGNITUDE) {
return Err(DynamicsError::Diverged { time: f64::NAN });
}
Ok(err)
}
/// Removes the velocities the joints don't allow (mass-weighted): `J u = 0`.
pub(crate) fn project_velocities(&self, y: &mut [f64]) -> Result<()> {
let kin = self.kinematics(y);
let rows = self.rows(&kin);
if rows.is_empty() {
return Ok(());
}
let (s, w) = self.schur(&kin, &rows);
let ju: Vec<f64> = rows.iter().map(|r| r.rate(&kin)).collect();
let (mu, _) = solve_psd(s, &ju, RANK_TOL).ok_or(DynamicsError::Singular { time: f64::NAN })?;
for (wr, m) in w.iter().zip(&mu) {
for (i, ml, ma) in wr {
let at = i * STRIDE;
put3(y, at + 7, v3(y, at + 7) - *ml * *m);
put3(y, at + 10, v3(y, at + 10) - *ma * *m);
}
}
Ok(())
}
/// The bodies' states.
pub(crate) fn body_states(&self, y: &[f64]) -> Vec<BodyState> {
(0..self.bodies.len())
.map(|i| {
let at = i * STRIDE;
BodyState { position: v3(y, at), orientation: quat(y, at + 3), velocity: v3(y, at + 7), angular_velocity: v3(y, at + 10) }
})
.collect()
}
/// Kinetic, gravity and spring energy.
pub(crate) fn energy(&self, y: &[f64]) -> Energy {
let kin = self.kinematics(y);
let mut e = Energy::default();
for (b, k) in self.bodies.iter().zip(&kin) {
let iw = k.rot.mul(&b.inertia).mul(&k.rot.transpose());
e.kinetic += 0.5 * b.mass * k.v.len2() + 0.5 * k.w.dot(iw.mul_vec(k.w));
e.gravity -= b.mass * self.gravity.dot(k.x);
}
for f in &self.forces {
if let Force::Spring { a, b, stiffness, free_length, preload, .. } = *f {
let (ka, kb) = (Self::kin_of(&kin, a.body), Self::kin_of(&kin, b.body));
let stretch = ((kb.x + kb.rot.mul_vec(b.point)) - (ka.x + ka.rot.mul_vec(a.point))).len() - free_length;
e.spring += 0.5 * stiffness * stretch * stretch + preload * stretch;
}
}
e
}
/// Each joint's values, rates and reaction (on `b`'s side, at its frame's origin, world),
/// from the multipliers `acc` found at `y`.
pub(crate) fn joint_results(&self, y: &[f64], acc: &Accel) -> Vec<JointResult> {
let kin = self.kinematics(y);
let mut at = 0;
let mut out = Vec::with_capacity(self.joints.len());
for j in &self.joints {
let a = Self::marker_world(&kin, &j.a);
let b = Self::marker_world(&kin, &j.b);
let (values, rates) = joint_values(j.kind, &a, &b);
let n = j.kind.equations();
// The wrench the joint's equations put on each body: −Jᵀλ.
let (mut fa, mut ta, mut fb, mut tb) = (Vec3::ZERO, Vec3::ZERO, Vec3::ZERO, Vec3::ZERO);
for k in at..at + n {
let (Some(row), Some(l)) = (acc.rows.get(k), acc.lambda.get(k)) else { continue };
if let Some((_, lin, ang)) = row.a {
fa -= lin * *l;
ta -= ang * *l;
}
if let Some((_, lin, ang)) = row.b {
fb -= lin * *l;
tb -= ang * *l;
}
}
at += n;
let (force, torque) = if b.body.is_some() {
(fb, tb - b.r.cross(fb))
} else {
// B is the ground: it takes what A takes, turned round, about B's origin.
let xa = Self::kin_of(&kin, a.body).x;
(-fa, -(ta + (xa - b.p).cross(fa)))
};
out.push(JointResult { values, rates, force, torque });
}
out
}
}
/// `(Φ, J, J̇u)` for one body point's world component along `e`: `e·(p_B − p_A)`.
fn point_row(a: &MarkerWorld, b: &MarkerWorld, e: Vec3) -> Row {
let acc = |m: &MarkerWorld| cross2(m.w, m.r);
Row { a: a.body.map(|i| (i, -e, -a.r.cross(e))), b: b.body.map(|i| (i, e, b.r.cross(e))), phi: e.dot(b.p - a.p), jdot_u: e.dot(acc(b) - acc(a)) }
}
/// `u·v = 0` for a direction `u` of A and `v` of B.
fn dot1_row(a: &MarkerWorld, u: Vec3, b: &MarkerWorld, v: Vec3) -> Row {
let (ud, vd) = (a.w.cross(u), b.w.cross(v));
let (udd, vdd) = (cross2(a.w, u), cross2(b.w, v));
Row {
a: a.body.map(|i| (i, Vec3::ZERO, u.cross(v))),
b: b.body.map(|i| (i, Vec3::ZERO, v.cross(u))),
phi: u.dot(v),
jdot_u: udd.dot(v) + 2.0 * ud.dot(vd) + u.dot(vdd),
}
}
/// `d·u = 0` for `d = p_B − p_A` and a direction `u` of A.
fn dot2_row(a: &MarkerWorld, u: Vec3, b: &MarkerWorld) -> Row {
let d = b.p - a.p;
let dd = b.pdot - a.pdot;
let ddd = cross2(b.w, b.r) - cross2(a.w, a.r);
let (ud, udd) = (a.w.cross(u), cross2(a.w, u));
Row {
a: a.body.map(|i| (i, -u, u.cross(d) - a.r.cross(u))),
b: b.body.map(|i| (i, u, b.r.cross(u))),
phi: d.dot(u),
jdot_u: ddd.dot(u) + 2.0 * dd.dot(ud) + d.dot(udd),
}
}
fn joint_rows(kind: JointKind, a: &MarkerWorld, b: &MarkerWorld, rows: &mut Vec<Row>) {
let [ax, ay, az] = a.axes;
let [bx, by, bz] = b.axes;
let point = |rows: &mut Vec<Row>| rows.extend([Vec3::X, Vec3::Y, Vec3::Z].map(|e| point_row(a, b, e)));
match kind {
JointKind::Rigid => {
point(rows);
rows.extend([dot1_row(a, ay, b, bz), dot1_row(a, az, b, bx), dot1_row(a, ax, b, by)]);
}
JointKind::Revolute => {
point(rows);
rows.extend([dot1_row(a, ax, b, bz), dot1_row(a, ay, b, bz)]);
}
JointKind::Ball => point(rows),
JointKind::Cylindrical => {
rows.extend([dot2_row(a, ax, b), dot2_row(a, ay, b), dot1_row(a, ax, b, bz), dot1_row(a, ay, b, bz)]);
}
JointKind::Slider => {
rows.extend([dot2_row(a, ax, b), dot2_row(a, ay, b), dot1_row(a, ax, b, bz), dot1_row(a, ay, b, bz), dot1_row(a, ax, b, by)]);
}
JointKind::Planar => {
rows.extend([dot2_row(a, az, b), dot1_row(a, az, b, bx), dot1_row(a, az, b, by)]);
}
}
}
/// A joint's values and their rates (see [`JointKind::values`]).
fn joint_values(kind: JointKind, a: &MarkerWorld, b: &MarkerWorld) -> (Vec<f64>, Vec<f64>) {
let [ax, ay, az] = a.axes;
let bx = b.axes[0];
let d = b.p - a.p;
let dd = b.pdot - a.pdot;
let angle = || bx.dot(ay).atan2(bx.dot(ax));
let spin = || (b.w - a.w).dot(az);
let along = |u: Vec3| (d.dot(u), dd.dot(u) + d.dot(a.w.cross(u)));
match kind {
JointKind::Rigid => (vec![], vec![]),
JointKind::Revolute => (vec![angle()], vec![spin()]),
JointKind::Slider => {
let (s, r) = along(az);
(vec![s], vec![r])
}
JointKind::Cylindrical => {
let (s, r) = along(az);
(vec![angle(), s], vec![spin(), r])
}
JointKind::Planar => {
let ((x, xr), (y, yr)) = (along(ax), along(ay));
(vec![x, y, angle()], vec![xr, yr, spin()])
}
JointKind::Ball => {
// B's turn from A as a rotation vector in A's frame, and the relative angular
// velocity in A's frame.
let am = Mat3::from_cols(ax, ay, az);
let rel = am.transpose().mul(&Mat3::from_cols(b.axes[0], b.axes[1], b.axes[2]));
let rv = Quat::from_mat3(&rel).map_or(Vec3::ZERO, Quat::rotation_vector);
let w = am.transpose().mul_vec(b.w - a.w);
(vec![rv.x, rv.y, rv.z], vec![w.x, w.y, w.z])
}
}
}
#[cfg(test)]
pub(crate) mod testing {
//! Finite-difference checks of the Jacobians and `J̇u` (tests only).
use super::*;
/// `(Φ, J u, J̇ u)` of every row at `y`.
pub(crate) fn rows_at(sys: &System, y: &[f64]) -> Vec<(f64, f64, f64)> {
let kin = sys.kinematics(y);
sys.rows(&kin).iter().map(|r| (r.phi, r.rate(&kin), r.jdot_u)).collect()
}
/// The state moved along its velocities for `h` (positions and orientations only).
pub(crate) fn drift(sys: &System, y: &[f64], h: f64) -> Vec<f64> {
let mut out = y.to_vec();
let kin = sys.kinematics(y);
for (i, k) in kin.iter().enumerate() {
let at = i * STRIDE;
put3(&mut out, at, k.x + k.v * h);
let q = Quat::from_rotation_vector(k.w * h).compose(quat(y, at + 3));
put_quat(&mut out, at + 3, q);
}
out
}
}

Some files were not shown because too many files have changed in this diff Show More