mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-05 11:35:55 +00:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b55174743 | |||
| 5821ca2b5e | |||
| 8829c1c3c5 | |||
| a137f2d459 | |||
| f87dd73661 | |||
| af5644aee6 | |||
| abeb232f17 | |||
| 1a27c8399d | |||
| 5ab59e7c1b | |||
| 9a274f91df | |||
| 08fa042039 | |||
| 09bb8aaaf5 | |||
| 46edd8d749 | |||
| c5d3dabd1b | |||
| 92171bd79b | |||
| 2ce55baba1 | |||
| 6870f9539c | |||
| 2998d412b6 | |||
| 2396b6be05 | |||
| 3c1074cfc6 | |||
| c4a63a1d43 | |||
| 2fdcc5ae49 | |||
| 4678a04827 | |||
| 63ffadfebf | |||
| aee947f0f9 | |||
| ad56dd6a93 | |||
| cafe015ef9 | |||
| 155387bac1 | |||
| de1db6fb8c | |||
| c47e848f4a | |||
| 8b4fe10995 | |||
| 8fb046aaa8 | |||
| 7b31c0567b | |||
| 5efdd52854 | |||
| 61ada52984 | |||
| 6578d591ac | |||
| d9421bf2ca | |||
| 774c45a512 | |||
| 315d8cfeb7 | |||
| 4ab1640dc8 | |||
| 3aee35fe01 | |||
| 5562d9c6c8 | |||
| d16496e057 |
@@ -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 goes to solidcore"). The logic is in scripts/kernel-paused/ (tested
|
||||
# answer (CONTRIBUTING.md, "Kernel work is paused"). The logic is in scripts/kernel-paused/ (tested
|
||||
# in ci.yml).
|
||||
name: Kernel paused
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
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`. Act when the code, docs and rules settle a question; ask only when it changes what users see.
|
||||
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. Local `plan/` notes are optional.
|
||||
|
||||
## 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`.
|
||||
@@ -11,7 +11,7 @@ Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelle
|
||||
- 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 (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`.
|
||||
- Kernel ops and math go to solidcore; features call its API: `cargo xtask lists`.
|
||||
- New kernel cases go to solidcore: `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`.
|
||||
@@ -31,7 +31,7 @@ Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelle
|
||||
## Working on X: read the skill first
|
||||
| Working on | Read |
|
||||
|---|---|
|
||||
| A feature, PR, claim, review, CI, evidence | `skills/solidcraft-contributing/SKILL.md` |
|
||||
| A PR, a claim, review, CI or 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` |
|
||||
|
||||
@@ -798,6 +798,7 @@ 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 |
|
||||
|
||||
## Code adapted from sibling projects
|
||||
|
||||
|
||||
+13
-26
@@ -17,27 +17,15 @@ 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 goes to solidcore
|
||||
## Kernel work is paused
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Get it running (about 10 minutes on a fast machine)
|
||||
|
||||
@@ -100,6 +88,8 @@ 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
|
||||
@@ -341,11 +331,8 @@ 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, 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:
|
||||
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:
|
||||
- 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)`.
|
||||
@@ -458,7 +445,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; 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).
|
||||
**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).
|
||||
|
||||
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
+13
@@ -4153,6 +4153,17 @@ 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"
|
||||
@@ -4275,9 +4286,11 @@ dependencies = [
|
||||
name = "solidcraft-render"
|
||||
version = "0.40.0-rc.2"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"image",
|
||||
"moxcms",
|
||||
"png",
|
||||
"robust",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.9",
|
||||
|
||||
@@ -22,6 +22,7 @@ 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" }
|
||||
|
||||
@@ -25,6 +25,7 @@ solidcraft-engine = { workspace = true }
|
||||
solidcraft-ui-egui = { workspace = true }
|
||||
egui = { workspace = true }
|
||||
log = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
url = "2"
|
||||
percent-encoding = "2"
|
||||
|
||||
@@ -33,7 +34,6 @@ 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",
|
||||
|
||||
@@ -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) {
|
||||
pub fn restore(files: &Rc<Files>, path: &str, on_opened: Option<Box<dyn FnOnce()>>) {
|
||||
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,6 +568,9 @@ 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,7 +5,8 @@
|
||||
//! 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.
|
||||
//! 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).
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::rc::Rc;
|
||||
@@ -13,7 +14,7 @@ use std::rc::Rc;
|
||||
use js_sys::{Array, Function, Object, Reflect, Uint8Array};
|
||||
use solidcraft_engine::io::vfs;
|
||||
|
||||
use crate::disk;
|
||||
use crate::{disk, keep};
|
||||
use wasm_bindgen::{JsCast as _, JsValue, closure::Closure};
|
||||
use wasm_bindgen_futures::{JsFuture, spawn_local};
|
||||
use web_sys::{
|
||||
@@ -79,6 +80,16 @@ 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 {
|
||||
@@ -288,6 +299,9 @@ 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 {
|
||||
@@ -300,6 +314,7 @@ 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 {
|
||||
@@ -315,7 +330,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 {
|
||||
if name != RECOVERY && keep::parse_name(&name).is_none() {
|
||||
entries.push(Entry { name: name.clone(), size: bytes.len() as u64, modified });
|
||||
}
|
||||
vfs::insert(&format!("{OPFS}{name}"), bytes);
|
||||
@@ -326,6 +341,7 @@ 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),
|
||||
}
|
||||
@@ -343,7 +359,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 {
|
||||
if name != RECOVERY && name != RECOVERY_META && keep::parse_name(&name).is_none() {
|
||||
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());
|
||||
}
|
||||
@@ -473,7 +489,15 @@ 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> {
|
||||
let path = recovery_path();
|
||||
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 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);
|
||||
@@ -646,3 +670,149 @@ 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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,360 @@
|
||||
//! 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]);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,8 @@ 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))]
|
||||
@@ -184,6 +186,7 @@ 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";
|
||||
@@ -243,7 +246,9 @@ 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).
|
||||
/// 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).
|
||||
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) {
|
||||
@@ -256,6 +261,50 @@ 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.
|
||||
@@ -328,6 +377,10 @@ 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 {
|
||||
@@ -442,8 +495,14 @@ 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() {
|
||||
if self.files.ready.get() && self.files.recovery.borrow().is_none() && !self.app.preferences.keep_unsaved_in_browser {
|
||||
let s = &self.app.session;
|
||||
let changed = s.is_dirty() && self.autosaved != Some(s.revision);
|
||||
let wait = AUTOSAVE_S - (now - self.autosaved_at);
|
||||
@@ -462,6 +521,175 @@ 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(©);
|
||||
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
|
||||
@@ -698,6 +926,13 @@ 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)) {
|
||||
@@ -809,7 +1044,7 @@ mod web {
|
||||
self.api.poll();
|
||||
self.space_mouse.logic(&mut self.app, ctx);
|
||||
self.files_tick(ctx);
|
||||
UNSAVED.with(|u| u.set(solidcraft_ui_egui::documents::any_dirty(&self.app)));
|
||||
UNSAVED.with(|u| u.set(self.asks_before_unload()));
|
||||
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) {
|
||||
@@ -829,7 +1064,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.launch.persists() && solidcraft_ui_egui::documents::any_dirty(&self.app)));
|
||||
UNSAVED.with(|u| u.set(self.asks_before_unload()));
|
||||
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()
|
||||
@@ -844,10 +1079,15 @@ 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()
|
||||
@@ -922,7 +1162,8 @@ mod web {
|
||||
{
|
||||
create.instance_descriptor.backends = eframe::wgpu::Backends::GL;
|
||||
}
|
||||
let result = eframe::WebRunner::new()
|
||||
let runner = eframe::WebRunner::new();
|
||||
let result = runner
|
||||
.start(
|
||||
canvas,
|
||||
options,
|
||||
@@ -966,7 +1207,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))),
|
||||
restore_file: Some(Box::new(move |path: &str| disk::restore(&restorer, path, None))),
|
||||
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))),
|
||||
@@ -1033,10 +1274,18 @@ 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),
|
||||
|
||||
@@ -303,6 +303,8 @@ 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`).
|
||||
|
||||
@@ -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'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.
|
||||
/// 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.
|
||||
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(y)), unit(-i64::from(z))],
|
||||
rotation: [unit(rx), unit(-i64::from(ry)), unit(-i64::from(rz))],
|
||||
translation: [unit(x), unit(-i64::from(z)), unit(-i64::from(y))],
|
||||
rotation: [unit(rx), unit(-i64::from(rz)), unit(-i64::from(ry))],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -149,22 +149,28 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn motion_records_become_axes_in_the_devices_raw_frame() {
|
||||
// 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] }));
|
||||
// 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}");
|
||||
}
|
||||
}
|
||||
// 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() {
|
||||
// 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]));
|
||||
// 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] }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -179,7 +185,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[1]), Some(i16::MAX));
|
||||
assert_eq!(extreme.map(|axes| axes.translation), Some([i16::MIN, i16::MIN, i16::MAX]));
|
||||
assert_eq!(extreme.map(|axes| axes.rotation[0]), Some(i16::MAX));
|
||||
}
|
||||
|
||||
|
||||
@@ -311,13 +311,18 @@ 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 `nvram <key>` and treats exit 0 as present. Any error (missing binary,
|
||||
/// permission denied, key absent) returns `false` — this is a best-effort probe.
|
||||
/// 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.
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn oclp_nvram_present() -> bool {
|
||||
std::process::Command::new("nvram").arg(OCLP_NVRAM_KEY).output().map(|o| o.status.success()).unwrap_or(false)
|
||||
std::process::Command::new(NVRAM_TOOL).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
|
||||
@@ -334,8 +339,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. Re-launching is the only safe approach that
|
||||
/// works without `unsafe` (a true `execve` replacement would require it).
|
||||
/// already queried the OS version by then, so the program starts itself again with the variable
|
||||
/// set and waits for that child.
|
||||
///
|
||||
/// Returns `Ok(false)` immediately when:
|
||||
/// - `SYSTEM_VERSION_COMPAT` is already set (re-launched process, no loop), or
|
||||
|
||||
@@ -79,17 +79,6 @@ 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",
|
||||
|
||||
+64
-41
@@ -1395,6 +1395,7 @@
|
||||
"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}",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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": "خُفّضت جودة التمويه للحفاظ على استجابة الإطارات. لم يتغير نصف القطر.",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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": "مدمج",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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": "التسميات",
|
||||
@@ -2560,8 +2572,8 @@
|
||||
"prefs.section_hatch_by_part": "حسب الجزء",
|
||||
"prefs.section_hatch_one": "نمط واحد",
|
||||
"prefs.select": "تحديد",
|
||||
"prefs.select_hidden_edges": "تحديد الحواف المخفية في العرض المظلل مع الحواف المخفية",
|
||||
"prefs.select_hidden_edges_help": "يتيح تحديد الحواف عبر الأسطح عند تفعيل العرض المظلل مع الحواف المخفية، بما في ذلك استخدام أداة Fillet. يحافظ إيقافه على سلوك التحديد في v0.30.1. تظل الأجسام المخفية غير قابلة للتحديد.",
|
||||
"prefs.select_hidden_edges": "تحديد الحواف المخفية في نمط «مظلل مع الحواف المخفية»",
|
||||
"prefs.select_hidden_edges_help": "يتيح تحديد الحواف عبر الأوجه عند تفعيل نمط «مظلل مع الحواف المخفية»، بما في ذلك عند استخدام التقويس. عند الإيقاف يبقى سلوك التحديد كما في v0.30.1. تظل الأجسام المخفية غير قابلة للتحديد.",
|
||||
"prefs.select_one_item": "تحديد عنصر واحد",
|
||||
"prefs.select_other_hidden": "تحديد العناصر الهندسية المخفية باستخدام «تحديد عنصر آخر»",
|
||||
"prefs.select_other_hidden_help": "عند التفعيل: تضمين الأجسام والمخططات المخفية والحواف المحجوبة قرب المؤشر. عند التعطيل: استخدام القائمة الأصلية للعناصر الهندسية المرئية أسفل المؤشر.",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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": "أحد أوجهه المنحنية لا يمكن استخدامه في النمذجة.",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "الحد الأدنى المطلق لخطأ RGB",
|
||||
"render.adaptive_coverage": "هدف خطأ التغطية",
|
||||
"render.adaptive_enable": "توزيع العيّنات باستخدام عيّنات استكشافية مستقلة",
|
||||
"render.adaptive_help": "على GPU فقط. تُستبعد العيّنات الاستكشافية المستقلة، ثم تُوزَّع 16 عيّنة إنتاجية أو أكثر لكل بكسل حتى قيمة «عيّنات لكل بكسل». يوجّه تباين RGB والتغطية هذا التوزيع؛ قد تفوت المسارات النادرة وقد تبقى البكسلات المحدودة مشوشة. يحصي التقرير النهائي العمل الفعلي. لا ضمان معتمد للتشويش أو للزمن.",
|
||||
"render.adaptive_help": "تُهمل العينات الاستطلاعية المستقلة، ثم يُحدد لكل بكسل 16 عينة إنتاج على الأقل حتى قيمة العينات لكل بكسل. تشمل حدود موارد CPU المرحلتين. يوجه تباين RGB والتغطية التوزيع؛ وقد تبقى ضوضاء في البكسلات التي بلغت الحد. يحصي التقرير النهائي العينات الفعلية.",
|
||||
"render.adaptive_minimum": "الحد الأدنى للعيّنات الإنتاجية",
|
||||
"render.adaptive_pending": "التوزيع التكيّفي على GPU بعيّنات استكشافية مستقلة وطبقات فرينل الشرطية متاحة. التقارب المعتمد وضمانات الأحداث النادرة والنقل التكيّفي على CPU غير متاحة بعد.",
|
||||
"render.adaptive_pending": "يتوفر التوزيع التكيفي بعينات استطلاعية مستقلة على CPU وGPU. تتطلب طبقات فرينل الشرطية GPU. لا يضمن التوزيع الإحصائي التقارب.",
|
||||
"render.adaptive_pilots": "العيّنات الاستكشافية لكل بكسل",
|
||||
"render.adaptive_relative": "هدف خطأ RGB النسبي",
|
||||
"render.add_ground": "إضافة أرضية ملائمة إلى الإعداد",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "استبدال الخصائص البصرية المحفوظة لهذا الجسم",
|
||||
"render.appearance_editor.revalidate": "إعادة التحقق من هذا الجسم",
|
||||
"render.appearance_editor.save": "حفظ هذه الخصائص البصرية",
|
||||
"render.appearance_editor.save_reason": "يتطلب حفظ هذه الخصائص البصرية زجاجًا فيزيائيًا على جسم حالي في بطاقة الرسومات. تبقى الطبقة الشفافة وخرائط الصور المحلية مؤقتة.",
|
||||
"render.appearance_editor.save_reason": "لحفظ الزجاج، فعّله على جسم حالي يستخدم CPU أو GPU. للطلاء الشفاف استخدم حفظ الطلاء مع اللقطة. تبقى ملفات الصور المحلية مؤقتة.",
|
||||
"render.appearance_editor.saved": "محفوظ مع هذه اللقطة",
|
||||
"render.appearance_editor.saved_state": "هذه الخصائص البصرية محفوظة مع هذه اللقطة.",
|
||||
"render.appearance_editor.scatter_reason": "التشتت الداخلي يتطلب حدًّا لجسم مصمت مغلق.",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "نسخ JSON الطلب",
|
||||
"render.children.coverage_error": "خطأ التغطية",
|
||||
"render.children.cpu": "تتبّع الأشعة على المعالج",
|
||||
"render.children.denoise": "تقليل التشويش في الصورة النهائية",
|
||||
"render.children.denoise": "تقليل تشويش الصورة",
|
||||
"render.children.depth": "عمق المسار",
|
||||
"render.children.distortion": "التشويه",
|
||||
"render.children.edge_samples": "عينات الحواف",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "حتى ثمانية أضواء نقطية تُضاف إلى الإضاءة الاتجاهية المختارة. المسافات بالمليمتر؛ ويجب ألا يتجاوز الحد الأدنى المسافة المرجعية.",
|
||||
"render.cpu_primary_samples": "عيّنات الحواف لكل بكسل",
|
||||
"render.cpu_progressive": "CPU تدريجي",
|
||||
"render.cpu_progressive_help": "يُراكم مُكامل CPU الحالي على تمريرات من عيّنة أساسية واحدة. الانعكاسات المختارة تتطلب عيّنة واحدة؛ والأضواء المساحية والعوازل وتباين الخواص تتطلب «صورة واحدة».",
|
||||
"render.cpu_progressive_help": "تُجمع عينات كاميرا CPU الجديدة ويُعرض كل تمرير مكتمل. تستخدم الانعكاسات المحددة محاولة واحدة لكل عينة كاميرا؛ ويحتفظ الزجاج المعتمد والتباين الاتجاهي المستوي بحدودهما الحالية. تتشارك العينات الاستطلاعية التكيفية والإنتاج ميزانية ملف CPU.",
|
||||
"render.cpu_progressive_limits": "بحد أقصى 1,048,576 بكسل و16,777,216 عملية تقييم بكسل × عيّنة. تغيير العيّنات لا يغيّر حجم الصورة تلقائيًا أبدًا.",
|
||||
"render.cpu_progressive_seed": "بذرة عيّنات CPU",
|
||||
"render.cpu_progressive_spp": "عيّنات لكل بكسل",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "تصدير: PNG للعرض",
|
||||
"render.export_image_label": "تصدير الصورة",
|
||||
"render.export_linear": "تصدير: EXR خطي خام",
|
||||
"render.exr_pending": "يستطيع GPU الاحتفاظ بـ EXR خطي خام. الضغط والصور متعددة الطبقات وتمريرات التصيير المساعدة غير متاحة بعد.",
|
||||
"render.exr_pending": "يمكن لتتبع الأشعة على CPU وتتبع المسارات على GPU الاحتفاظ بـ EXR خطي خام. الضغط والصور متعددة الطبقات وتمريرات التصيير المساعدة غير متاحة بعد.",
|
||||
"render.film_grain": "حبيبات فوتوغرافية",
|
||||
"render.fit": "ملاءمة المنتج",
|
||||
"render.fixed_camera": "الكاميرا",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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": "ملاءمة الأرضية وحفظها",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "تتبع الأشعة على CPU",
|
||||
"render.method_gpu": "تتبع المسارات على GPU",
|
||||
"render.method_limit_raster": "التنقيط يستخدم معاينة الاستوديو المعتمة الثابتة. اختر طريقة تتبع أشعة صريحة لعناصر التحكم البصرية المدعومة.",
|
||||
"render.method_raster": "تنقيط على CPU",
|
||||
"render.method_raster": "تصيير نقطي على CPU (تخطيطي)",
|
||||
"render.navigation_help": "تتحرك الكاميرا كما في التصميم (التفضيلات › التنقل). «حفظ الإعداد» يسجّل الكاميرا الحالية.",
|
||||
"render.nested_enable": "عوازل متداخلة معتمدة",
|
||||
"render.nested_help": "حتى 16 طبقة حاوية؛ يجب أن يكون كل أصل محدبًا وكل فرع داخله تمامًا. التقاطعات والأسطح المتلامسة والصفائح الرقيقة ونفاذ الظل المستقيم تُرفض. حالة وجود الكاميرا في الداخل تتبع التسلسل المعتمد. لا يُنشئ سطح سائل ولا يدمج حدود CAD المتلامسة.",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "إعداد مخرجات EXR غير متاح هنا. تصدير EXR الخطي يتطلب صورة GPU مكتملة بنسخة رئيسية خطية محتفظ بها.",
|
||||
"render.output_fit": "ملاءمة",
|
||||
"render.output_format": "الصيغة",
|
||||
"render.output_format_status": "PNG هو صورة العرض المكتملة بالضبط. EXR الاختياري على GPU يحتفظ بالإشعاع الخام الخطي للمشهد بصيغة FLOAT32 قبل مرشحات العرض. التصدير لا يستبدل أبدًا ذاكرة المعاينة المؤقتة أو مهمة أخرى.",
|
||||
"render.output_format_status": "PNG هو صورة العرض المكتملة بالضبط. يحتفظ EXR الاختياري على CPU أو GPU بالإشعاع الخام الخطي للمشهد بصيغة FLOAT32 قبل مرشحات العرض. لا يستبدل التصدير أبدًا الصورة بذاكرة المعاينة المؤقتة أو بمهمة مختلفة.",
|
||||
"render.output_grading": "تدرّج الألوان",
|
||||
"render.output_image": "الصورة",
|
||||
"render.output_largest": "الأقصى {width} × {height}",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "مخصص",
|
||||
"render.quality_draft": "مسودة",
|
||||
"render.quality_high": "عالية",
|
||||
"render.quality_projection_help": "إعدادات Q الجاهزة تتضمن متطلبات مستقبلية. هذا الإجراء يُسقط فقط ميزانية PNG مدعومة بعيّنات ثابتة، ويُغفل صراحةً الإيقاف التكيّفي والإخراج الخطي الخام وحدود النفاذ المستقلة.",
|
||||
"render.quality_projection_help": "تغيّر هذه المراجعة الدقة وميزانية العينات وعمق المسار والبذرة وتقليل التشويش فقط. تُحفظ الإعدادات الأخرى؛ ولا تثبت الميزانية تقارب الصورة.",
|
||||
"render.quality_review": "مراجعة ميزانية العيّنات",
|
||||
"render.queue_pending": "لا توجد في هذه الواجهة قائمة إنتاج تلقائية ولا مُصيّر للرسوم المتحركة. تبقى الصور الثابتة المكتملة قابلة للتصدير كلٌّ على حدة.",
|
||||
"render.radial_assign": "تعيين مظهر",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "الإزاحة والتكبير يتبعان تفضيلات التنقل. Space مع السحب يُزيح العرض.",
|
||||
"render.result_open": "فتح الصورة المكتملة في اللوحة الرئيسية.",
|
||||
"render.result_preview": "المعاينة الحية",
|
||||
"render.result_provisional": "صورة CPU مؤقتة",
|
||||
"render.result_provisional": "صورة مؤقتة",
|
||||
"render.result_provisional_help": "نقطة التحقق هذه غير قابلة للتصدير. يحتفظ التصدير بآخر نتيجة مكتملة؛ والإلغاء يعود إلى تلك النتيجة.",
|
||||
"render.result_reduced_display": "قُلّصت معاينة العرض إلى حد الجهاز أو الذاكرة المؤقتة لمنطقة العرض. يحتفظ PNG المحفوظ والتصدير بالدقة الكاملة؛ والفحص الأصلي بنسبة 100% غير متاح لهذا العرض المقلّص.",
|
||||
"render.result_retained": "تُعرض آخر صورة مكتملة؛ ولم يستبدلها تصيير أحدث.",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "تجهيز خطة الإنشاء",
|
||||
"render.stage_panels.projects": "ما يُسقط",
|
||||
"render.stage_panels.quality_ack": "أقرّ بالميزانية الثابتة وما تُغفله",
|
||||
"render.stage_panels.quality_omissions": "التوقف التكيّفي وأهداف الخطأ، وعمق نفاذ منفصل، وقواعد الروليت الروسية، والإخراج الخطي الخام، ونسخة EXR الأصلية، وشهادة التقارب.",
|
||||
"render.stage_panels.quality_omissions": "لا تضبط هذه الميزانية أهداف الخطأ التكيفي أو حدود النفاذ المستقلة أو قواعد الروليت الروسي أو الاحتفاظ بالأصل الخام، ولا تضمن تقارب الصورة.",
|
||||
"render.stage_panels.reference": "مرجع",
|
||||
"render.stage_panels.references": "مراجع",
|
||||
"render.stage_panels.remove_optics": "إزالة البصريات",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "بيئة HDR أصلية · المشهد بأكمله",
|
||||
"render.stage_panels.subtitle_maps": "خرائط مكانية مُعدّة · معاينة مؤقتة",
|
||||
"render.stage_panels.subtitle_physical": "خطة للقراءة فقط · لا تُنشأ مادة ولا تُعيَّن",
|
||||
"render.stage_panels.subtitle_quality": "ميزانية GPU ثابتة · تُغفل المتطلبات المستقبلية",
|
||||
"render.stage_panels.subtitle_quality": "ميزانية عينات GPU · الحقول المدرجة فقط",
|
||||
"render.stage_panels.subtitle_rig": "طقم إضاءة مُعدّ · باعثات وبطاقات سلبية",
|
||||
"render.stage_panels.subtitle_saved_maps": "خرائط مُعدّة · محفوظة مع هذه اللقطة",
|
||||
"render.stage_panels.subtitle_stage": "أرضية ومنصة فيزيائيتان · ملائمتان للمنتج",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"render.studio_area_help": "حتى أربعة مستطيلات أحادية الجانب. نصفا الضلعين المتعامدين U وV يحددان الحجم؛ وحاصل U × V يواجه الجهة المضاءة. الإحداثيات بمليمترات فضاء العالم.",
|
||||
"render.studio_center": "المركز X, Y, Z (mm)",
|
||||
"render.studio_denoise": "تقليل التشويش في الصورة النهائية",
|
||||
"render.studio_denoise_help": "مرشح نهائي يراعي الحواف؛ وقد تلين التفاصيل الدقيقة. الزجاج والأسطح المرآوية الحادة لا يمر عليها المرشح.",
|
||||
"render.studio_denoise_help": "تستخدم الصور التدريجية والنهائية مرشحًا يحافظ على الحواف؛ وقد تصبح التفاصيل الدقيقة أنعم. لا يُطبّق المرشح على الزجاج والأسطح ذات الانعكاس الحاد.",
|
||||
"render.studio_direction": "الاتجاه نحو الشمس (X, Y, Z)",
|
||||
"render.studio_environment": "البيئة",
|
||||
"render.studio_environment_bounds": "يجب أن يكون دوران البيئة قيمة محدودة ضمن ±1,000,000 راديان والشدة بين 0 و100.",
|
||||
@@ -4178,32 +4198,32 @@
|
||||
"sketch.dof_left": "تبقّت {count} درجات حرية",
|
||||
"sketch.dof_left_one": "تبقّت {count} درجة حرية",
|
||||
"sketch.draw_curves": "الرسم كـ {linetype}",
|
||||
"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.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.make_selection": "تحويل التحديد إلى {linetype}",
|
||||
"sketch.open_ends": "مفتوحة {count}",
|
||||
"sketch.status_conflict": "تعارض القيود",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"ui.3d_sketch": "رسم ثلاثي الأبعاد",
|
||||
"ui.activate": "تنشيط",
|
||||
"ui.active_component": "المكوّن النشط",
|
||||
"ui.addToQuickAccess": "إضافة إلى الوصول السريع",
|
||||
"ui.add_configuration": "إضافة تكوين",
|
||||
"ui.add_parameter": "إضافة معامل",
|
||||
"ui.agent_chat": "محادثة الوكيل",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"ui.quality": "الجودة",
|
||||
"ui.quantity": "الكمية",
|
||||
"ui.quantity_2": "الكمية 2",
|
||||
"ui.quick_access_full": "يتسع شريط الوصول السريع لـ {count} أمرًا؛ أزل أحدها لإضافة آخر",
|
||||
"ui.quit": "خروج",
|
||||
"ui.radial_context_menu": "قائمة سياقية دائرية",
|
||||
"ui.radius": "نصف القطر",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"ui.relink_not_linked": "هذا المكوّن غير مرتبط بتصميم مصدر.",
|
||||
"ui.relink_select_one": "حدد مكوّنًا مرتبطًا واحدًا أو إحدى نسخه أولًا.",
|
||||
"ui.relink_source_all": "إعادة ربط المصدر (كل النسخ)…",
|
||||
"ui.removeFromQuickAccess": "إزالة من الوصول السريع",
|
||||
"ui.removeFromToolbar": "إزالة من شريط الأدوات",
|
||||
"ui.removeSection": "إزالة المقطع",
|
||||
"ui.render": "التصيير",
|
||||
|
||||
+20
-13
@@ -1388,6 +1388,7 @@
|
||||
"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",
|
||||
@@ -1396,6 +1397,8 @@
|
||||
"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}",
|
||||
@@ -2278,6 +2281,8 @@
|
||||
"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",
|
||||
@@ -2746,9 +2751,9 @@
|
||||
"render.adaptive_absolute": "Absolute RGB-Fehleruntergrenze",
|
||||
"render.adaptive_coverage": "Zielwert für den Abdeckungsfehler",
|
||||
"render.adaptive_enable": "Samples mithilfe unabhängiger Pilot-Samples zuteilen",
|
||||
"render.adaptive_help": "Nur GPU. Unabhängige Pilot-Samples werden verworfen. Anschließend werden pro Pixel 16 oder mehr Produktions-Samples zugeteilt, bis zu den Samples pro Pixel. Die Zuteilung richtet sich nach der RGB- und Abdeckungsvarianz; seltene Pfade können übersehen werden, und Pixel, die ihr Limit erreicht haben, können verrauscht bleiben. Der Abschlussbericht zählt den tatsächlichen Aufwand. Keine zertifizierte Garantie für ein bestimmtes Rauschniveau oder eine bestimmte Renderzeit.",
|
||||
"render.adaptive_help": "Unabhängige Pilotsamples werden verworfen und bestimmen dann mindestens 16 Produktionssamples pro Pixel bis zum Wert Samples pro Pixel. CPU-Ressourcengrenzen umfassen beide Phasen. RGB- und Abdeckungsvarianz steuern die Verteilung; Pixel am Limit können verrauscht bleiben. Der Abschlussbericht zählt die tatsächlichen Samples.",
|
||||
"render.adaptive_minimum": "Minimale Produktions-Samples",
|
||||
"render.adaptive_pending": "Die adaptive Zuteilung mit unabhängigen GPU-Pilot-Samples und bedingte Fresnel-Schichten sind verfügbar. Zertifizierte Konvergenz, Garantien für seltene Ereignisse und adaptiver Lichttransport auf der CPU bleiben nicht verfügbar.",
|
||||
"render.adaptive_pending": "Adaptive Verteilung mit unabhängigen Pilotsamples ist für CPU und GPU verfügbar. Bedingte Fresnel-Schichten erfordern die GPU. Die statistische Verteilung bestätigt keine Konvergenz.",
|
||||
"render.adaptive_pilots": "Pilot-Samples pro Pixel",
|
||||
"render.adaptive_relative": "Zielwert für den relativen RGB-Fehler",
|
||||
"render.add_ground": "Add fitted ground to setup",
|
||||
@@ -2809,7 +2814,7 @@
|
||||
"render.appearance_editor.replace": "Gespeicherte Optik dieses Körpers ersetzen",
|
||||
"render.appearance_editor.revalidate": "Diesen Körper erneut prüfen",
|
||||
"render.appearance_editor.save": "Diese Optik speichern",
|
||||
"render.appearance_editor.save_reason": "Zum Speichern wird physikalisches Glas auf einem aktuellen GPU-Körper benötigt. Klarlack und lokale Bildtexturen bleiben vorübergehend.",
|
||||
"render.appearance_editor.save_reason": "Zum Speichern Glas an einem aktuellen CPU- oder GPU-Körper aktivieren. Für Klarlack „Klarlack in Aufnahme speichern“ verwenden. Lokale Bilddateien bleiben temporär.",
|
||||
"render.appearance_editor.saved": "Mit dieser Aufnahme gespeichert",
|
||||
"render.appearance_editor.saved_state": "Diese Optik ist mit dieser Aufnahme gespeichert.",
|
||||
"render.appearance_editor.scatter_reason": "Innere Streuung benötigt einen geschlossenen Körper.",
|
||||
@@ -2905,7 +2910,7 @@
|
||||
"render.children.copy_request": "Anfrage-JSON kopieren",
|
||||
"render.children.coverage_error": "Abdeckungsfehler",
|
||||
"render.children.cpu": "CPU-Raytracing",
|
||||
"render.children.denoise": "Rauschen im fertigen Bild reduzieren",
|
||||
"render.children.denoise": "Bildrauschen reduzieren",
|
||||
"render.children.depth": "Pfadtiefe",
|
||||
"render.children.distortion": "Verzeichnung",
|
||||
"render.children.edge_samples": "Kanten-Samples",
|
||||
@@ -3037,7 +3042,7 @@
|
||||
"render.cpu_point_help": "Bis zu acht Punktlichter, zusätzlich zur gewählten Richtungsbeleuchtung. Abstände in mm; der Mindestabstand darf den Referenzabstand nicht überschreiten.",
|
||||
"render.cpu_primary_samples": "Kanten-Samples pro Pixel",
|
||||
"render.cpu_progressive": "CPU progressiv",
|
||||
"render.cpu_progressive_help": "Den vorhandenen CPU-Integrator in Durchgängen mit je einem Primär-Sample akkumulieren. Ausgewählte Reflexionen erfordern ein Sample; Flächenlichter, Dielektrika und Anisotropie erfordern „Einzelbild“.",
|
||||
"render.cpu_progressive_help": "Neue CPU-Kamerasamples sammeln und jeden vollständigen Durchgang zeigen. Ausgewählte Reflexionen verwenden einen Versuch pro Kamerasample; zertifiziertes Glas und planare Anisotropie behalten ihre bisherigen Grenzen. Adaptive Pilot- und Produktionssamples teilen sich das CPU-Profilbudget.",
|
||||
"render.cpu_progressive_limits": "Höchstens 1.048.576 Pixel und 16.777.216 Auswertungen von Pixel × Sample. Das Ändern der Samples passt die Bildgröße nie automatisch an.",
|
||||
"render.cpu_progressive_seed": "Startwert für das CPU-Sampling",
|
||||
"render.cpu_progressive_spp": "Samples pro Pixel",
|
||||
@@ -3213,7 +3218,7 @@
|
||||
"render.export_display": "Export: Anzeige-PNG",
|
||||
"render.export_image_label": "Bild exportieren",
|
||||
"render.export_linear": "Export: lineares Roh-EXR",
|
||||
"render.exr_pending": "Die GPU kann rohe lineare EXR-Dateien behalten. Kompression, mehrschichtige Bilder und zusätzliche Renderpässe bleiben nicht verfügbar.",
|
||||
"render.exr_pending": "CPU-Raytracing und GPU-Pathtracing können rohe lineare EXR-Dateien behalten. Kompression, mehrschichtige Bilder und zusätzliche Renderpässe bleiben nicht verfügbar.",
|
||||
"render.film_grain": "Fotografisches Korn",
|
||||
"render.fit": "Produkt einpassen",
|
||||
"render.fixed_camera": "Kamera",
|
||||
@@ -3253,9 +3258,11 @@
|
||||
"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",
|
||||
@@ -3574,7 +3581,7 @@
|
||||
"render.method_cpu": "CPU-Raytracing",
|
||||
"render.method_gpu": "GPU-Pathtracing",
|
||||
"render.method_limit_raster": "Die Rasterung verwendet die feste undurchsichtige Studiovorschau. Wählen Sie ausdrücklich eine Raytracing-Methode für die unterstützten optischen Einstellungen.",
|
||||
"render.method_raster": "CPU-Rasterung",
|
||||
"render.method_raster": "CPU-Rasterung (schematisch)",
|
||||
"render.navigation_help": "Die Kamera bewegt sich wie im Konstruieren (Einstellungen › Navigation). Setup speichern übernimmt die aktuelle Kamera.",
|
||||
"render.nested_enable": "Zertifizierte verschachtelte Dielektrika",
|
||||
"render.nested_help": "Bis zu 16 umschließende Schichten; jedes übergeordnete Element muss konvex und jedes untergeordnete strikt darin enthalten sein. Überschneidungen, sich berührende Flächen, dünne Schichten und die Transmission gerader Schattenstrahlen werden abgelehnt. Der Zustand „Kamera im Inneren“ folgt der zertifizierten Hierarchie. Erzeugt keine Flüssigkeitsoberfläche und verschmilzt keine sich berührenden CAD-Grenzflächen.",
|
||||
@@ -3602,7 +3609,7 @@
|
||||
"render.output_exr_unavailable": "EXR-Ausgabeeinstellungen sind hier nicht verfügbar. Linearer EXR-Export erfordert ein fertiges GPU-Bild mit gespeichertem linearem Original.",
|
||||
"render.output_fit": "Einpassen",
|
||||
"render.output_format": "Format",
|
||||
"render.output_format_status": "PNG enthält das exakte fertige Anzeigebild. Optionales GPU-EXR bewahrt rohe lineare FLOAT32-Strahldichte vor Filtern. Export ersetzt nie durch Vorschaucache oder anderen Auftrag.",
|
||||
"render.output_format_status": "PNG enthält das exakte fertige Anzeigebild. Optionales CPU/GPU-EXR bewahrt rohe lineare FLOAT32-Strahldichte vor Anzeigefiltern. Der Export verwendet nie den Vorschaucache oder einen anderen Auftrag.",
|
||||
"render.output_grading": "Farbkorrektur",
|
||||
"render.output_image": "Bild",
|
||||
"render.output_largest": "{width} × {height} max.",
|
||||
@@ -3687,7 +3694,7 @@
|
||||
"render.quality_custom": "Benutzerdefiniert",
|
||||
"render.quality_draft": "Entwurf",
|
||||
"render.quality_high": "Hoch",
|
||||
"render.quality_projection_help": "Q-Vorgaben enthalten künftige Anforderungen. Diese Aktion projiziert nur ein unterstütztes PNG-Budget mit festen Samples und lässt adaptives Stoppen, rohe lineare Ausgabe und unabhängige Transmissionslimits ausdrücklich aus.",
|
||||
"render.quality_projection_help": "Diese Prüfung ändert nur Auflösung, Abtastbudget, Pfadtiefe, Startwert und Rauschreduzierung. Andere Einstellungen bleiben erhalten; das Budget garantiert keine Konvergenz.",
|
||||
"render.quality_review": "Sampling-Budget prüfen",
|
||||
"render.queue_pending": "In dieser Oberfläche gibt es keine automatische Produktionswarteschlange und keinen Animations-Renderer. Fertige Einzelbilder bleiben separat exportierbar.",
|
||||
"render.radial_assign": "Erscheinungsbild zuweisen",
|
||||
@@ -3718,7 +3725,7 @@
|
||||
"render.result_navigation": "Verschieben und Zoomen folgen den Navigationseinstellungen. Leertaste + Ziehen verschiebt.",
|
||||
"render.result_open": "Das fertige Bild in der Hauptansicht öffnen.",
|
||||
"render.result_preview": "Live-Vorschau",
|
||||
"render.result_provisional": "Vorläufiges CPU-Bild",
|
||||
"render.result_provisional": "Vorläufiges Bild",
|
||||
"render.result_provisional_help": "Dieser Zwischenstand ist nicht exportierbar. Der Export behält das letzte fertige Ergebnis; ein Abbruch kehrt zu diesem Ergebnis zurück.",
|
||||
"render.result_reduced_display": "Anzeigevorschau auf die Geräte-/Cachegrenze reduziert. PNG und Export behalten die volle Auflösung; native 100%-Ansicht ist hier nicht verfügbar.",
|
||||
"render.result_retained": "Das zuletzt fertiggestellte Bild wird angezeigt; ein neueres Rendering hat es noch nicht ersetzt.",
|
||||
@@ -3882,7 +3889,7 @@
|
||||
"render.stage_panels.prepare_plan": "Erstellungsplan vorbereiten",
|
||||
"render.stage_panels.projects": "Projiziert",
|
||||
"render.stage_panels.quality_ack": "Ich bestätige das feste Budget und seine Auslassungen",
|
||||
"render.stage_panels.quality_omissions": "Adaptives Stoppen und Fehlerziele, separate Transmissionstiefe, Russian-Roulette-Regeln, lineare Rohausgabe, EXR-Master und Konvergenznachweis.",
|
||||
"render.stage_panels.quality_omissions": "Dieses Budget legt keine adaptiven Fehlerziele, eigenen Transmissionsgrenzen, Russian-Roulette-Regeln oder Speicherung des linearen Masters fest und garantiert keine Konvergenz.",
|
||||
"render.stage_panels.reference": "Referenz",
|
||||
"render.stage_panels.references": "Referenzen",
|
||||
"render.stage_panels.remove_optics": "Optik entfernen",
|
||||
@@ -3926,7 +3933,7 @@
|
||||
"render.stage_panels.subtitle_environment": "Originale HDR-Umgebung · gesamte Szene",
|
||||
"render.stage_panels.subtitle_maps": "Erstellte räumliche Texturen · temporäre Vorschau",
|
||||
"render.stage_panels.subtitle_physical": "Schreibgeschützter Plan · kein Material erstellt oder zugewiesen",
|
||||
"render.stage_panels.subtitle_quality": "Festes GPU-Budget · zukünftige Anforderungen ausgelassen",
|
||||
"render.stage_panels.subtitle_quality": "GPU-Abtastbudget · nur aufgeführte Einstellungen",
|
||||
"render.stage_panels.subtitle_rig": "Erstellter Lichtaufbau · Lichtquellen und passive Flächen",
|
||||
"render.stage_panels.subtitle_saved_maps": "Erstellte Texturen · mit dieser Aufnahme gespeichert",
|
||||
"render.stage_panels.subtitle_stage": "Physischer Boden und Bühne · an das Produkt angepasst",
|
||||
@@ -3951,7 +3958,7 @@
|
||||
"render.studio_area_help": "Bis zu vier einseitige Rechtecke. Orthogonale Halbkanten U und V bestimmen die Größe; U × V zeigt zur beleuchteten Seite. Die Koordinaten sind Weltmillimeter.",
|
||||
"render.studio_center": "Mittelpunkt X, Y, Z (mm)",
|
||||
"render.studio_denoise": "Rauschen im fertigen Bild reduzieren",
|
||||
"render.studio_denoise_help": "Abschließender kantenerhaltender Filter; feine Details können weicher werden. Glas und scharfe spiegelnde Oberflächen umgehen den Filter.",
|
||||
"render.studio_denoise_help": "Kantenerhaltender Filter für progressive und fertige Bilder; feine Details können weicher werden. Glas und scharfe spiegelnde Oberflächen umgehen den Filter.",
|
||||
"render.studio_direction": "Richtung zur Sonne (X, Y, Z)",
|
||||
"render.studio_environment": "Umgebung",
|
||||
"render.studio_environment_bounds": "Die Umgebungsdrehung muss endlich und innerhalb von ±1.000.000 Radiant liegen, die Intensität zwischen 0 und 100.",
|
||||
|
||||
+36
-13
@@ -1395,6 +1395,7 @@
|
||||
"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}",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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.",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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.",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "Absolute RGB error floor",
|
||||
"render.adaptive_coverage": "Coverage error target",
|
||||
"render.adaptive_enable": "Allocate samples with independent pilots",
|
||||
"render.adaptive_help": "GPU only. Independent pilot samples are discarded, then allocate 16 or more production samples per pixel up to Samples per pixel. RGB and coverage variance guide allocation; rare paths may be missed and capped pixels may remain noisy. The final report counts actual work. No certified noise or time guarantee.",
|
||||
"render.adaptive_help": "Independent pilot samples are discarded, then choose 16 or more production samples per pixel up to Samples per pixel. CPU resource limits include both stages. RGB and coverage variance guide allocation; capped pixels can remain noisy. The final report counts actual samples.",
|
||||
"render.adaptive_minimum": "Minimum production samples",
|
||||
"render.adaptive_pending": "GPU independent-pilot adaptive allocation and conditional Fresnel strata are available. Certified convergence, rare-event guarantees and CPU adaptive transport remain unavailable.",
|
||||
"render.adaptive_pending": "Independent-pilot adaptive allocation is available for CPU and GPU. Conditional Fresnel strata require GPU. Statistical allocation does not certify convergence.",
|
||||
"render.adaptive_pilots": "Pilot samples per pixel",
|
||||
"render.adaptive_relative": "Relative RGB error target",
|
||||
"render.add_ground": "Add fitted ground to setup",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "Replace this body's saved optics",
|
||||
"render.appearance_editor.revalidate": "Revalidate this body",
|
||||
"render.appearance_editor.save": "Save these optics",
|
||||
"render.appearance_editor.save_reason": "Saving these optics needs physical glass on a current GPU body. Coat and local image maps remain temporary.",
|
||||
"render.appearance_editor.save_reason": "To save Glass, enable it on a current CPU or GPU body. Use Save coat to shot for clear coat. Local image files remain temporary.",
|
||||
"render.appearance_editor.saved": "Saved with this shot",
|
||||
"render.appearance_editor.saved_state": "These optics are saved with this shot.",
|
||||
"render.appearance_editor.scatter_reason": "Interior scattering needs a closed solid boundary.",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "Copy request JSON",
|
||||
"render.children.coverage_error": "Coverage error",
|
||||
"render.children.cpu": "CPU ray tracing",
|
||||
"render.children.denoise": "Reduce noise in the finished image",
|
||||
"render.children.denoise": "Reduce image noise",
|
||||
"render.children.depth": "Path depth",
|
||||
"render.children.distortion": "Distortion",
|
||||
"render.children.edge_samples": "Edge samples",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "Up to eight point lights, added to the selected directional lighting. Distances are in mm; the minimum must not exceed the reference distance.",
|
||||
"render.cpu_primary_samples": "Edge samples per pixel",
|
||||
"render.cpu_progressive": "CPU progressive",
|
||||
"render.cpu_progressive_help": "Accumulate the existing CPU integrator in passes of one primary sample. Selected reflections require one sample; area lights, dielectrics and anisotropy require Single image.",
|
||||
"render.cpu_progressive_help": "Accumulate fresh CPU camera samples and show every complete pass. Selected reflections use one attempt per camera sample; certified glass and planar anisotropy keep their existing limits. Adaptive pilots and production share the CPU profile budget.",
|
||||
"render.cpu_progressive_limits": "At most 1,048,576 pixels and 16,777,216 pixel × sample evaluations. Changing samples never resizes the image automatically.",
|
||||
"render.cpu_progressive_seed": "CPU sampling seed",
|
||||
"render.cpu_progressive_spp": "samples per pixel",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "Export: display PNG",
|
||||
"render.export_image_label": "Export Image",
|
||||
"render.export_linear": "Export: raw linear EXR",
|
||||
"render.exr_pending": "GPU can retain raw linear EXR. Compression, multilayer images and auxiliary render passes remain unavailable.",
|
||||
"render.exr_pending": "CPU ray tracing and GPU path tracing can retain raw linear EXR. Compression, multilayer images and auxiliary render passes remain unavailable.",
|
||||
"render.film_grain": "Photographic grain",
|
||||
"render.fit": "Fit Product",
|
||||
"render.fixed_camera": "Camera",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "CPU ray tracing",
|
||||
"render.method_gpu": "GPU path tracing",
|
||||
"render.method_limit_raster": "Raster uses the fixed opaque studio preview. Select an explicit raytracing method for supported optical controls.",
|
||||
"render.method_raster": "CPU raster",
|
||||
"render.method_raster": "CPU raster (schematic)",
|
||||
"render.navigation_help": "The camera moves as in Design (Preferences › Navigation). Save Setup records the current camera.",
|
||||
"render.nested_enable": "Certified nested dielectrics",
|
||||
"render.nested_help": "Up to 16 containing layers; every parent must be convex and every child strictly inside it. Intersections, touching surfaces, thin sheets and straight-shadow transmission refuse. Camera-inside state follows the certified hierarchy. Does not create a liquid surface or merge touching CAD boundaries.",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "EXR output setup is unavailable here. Linear EXR export requires a completed GPU image with a retained linear master.",
|
||||
"render.output_fit": "Fit",
|
||||
"render.output_format": "Format",
|
||||
"render.output_format_status": "PNG is the exact completed display image. Optional GPU EXR retains raw scene-linear FLOAT32 radiance before display filters. Export never substitutes the preview cache or a different job.",
|
||||
"render.output_format_status": "PNG is the exact completed display image. Optional CPU/GPU EXR retains raw scene-linear FLOAT32 radiance before display filters. Export never substitutes the preview cache or a different job.",
|
||||
"render.output_grading": "Grading",
|
||||
"render.output_image": "Image",
|
||||
"render.output_largest": "{width} × {height} max",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "Custom",
|
||||
"render.quality_draft": "Draft",
|
||||
"render.quality_high": "High",
|
||||
"render.quality_projection_help": "Q presets include future requirements. This action projects only a supported fixed-sample PNG budget and explicitly omits adaptive stopping, raw linear output and independent transmission limits.",
|
||||
"render.quality_projection_help": "This review changes only resolution, sample budget, path depth, seed and noise reduction. Other settings are kept; the budget does not certify convergence.",
|
||||
"render.quality_review": "Review sampling budget",
|
||||
"render.queue_pending": "There is no automatic production queue or animation renderer in this UI. Completed still images remain separately exportable.",
|
||||
"render.radial_assign": "Assign Appearance",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "Pan and zoom use Navigation preferences. Space + drag pans.",
|
||||
"render.result_open": "Open the completed image in the main canvas.",
|
||||
"render.result_preview": "Live Preview",
|
||||
"render.result_provisional": "Provisional CPU image",
|
||||
"render.result_provisional": "Provisional image",
|
||||
"render.result_provisional_help": "This checkpoint is not exportable. Export keeps the last completed result; cancellation returns to that result.",
|
||||
"render.result_reduced_display": "Display preview reduced to the viewport device/cache limit. The retained PNG and export keep full resolution; native 100% inspection is unavailable for this reduced view.",
|
||||
"render.result_retained": "Showing the last completed image; a newer render has not replaced it.",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "Prepare creation plan",
|
||||
"render.stage_panels.projects": "Projects",
|
||||
"render.stage_panels.quality_ack": "I acknowledge the fixed budget and its omissions",
|
||||
"render.stage_panels.quality_omissions": "Adaptive stopping and error targets, separate transmission depth, Russian roulette rules, raw linear output, EXR master and convergence certification.",
|
||||
"render.stage_panels.quality_omissions": "This budget does not set adaptive error targets, independent transmission limits, Russian roulette rules or raw-master retention, and does not guarantee convergence.",
|
||||
"render.stage_panels.reference": "Reference",
|
||||
"render.stage_panels.references": "References",
|
||||
"render.stage_panels.remove_optics": "Remove optics",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "Original HDR environment · whole scene",
|
||||
"render.stage_panels.subtitle_maps": "Authored spatial maps · temporary preview",
|
||||
"render.stage_panels.subtitle_physical": "Read-only plan · no material created or assigned",
|
||||
"render.stage_panels.subtitle_quality": "Fixed GPU budget · future requirements omitted",
|
||||
"render.stage_panels.subtitle_quality": "GPU sampling budget · listed fields only",
|
||||
"render.stage_panels.subtitle_rig": "Authored light rig · emitters and passive cards",
|
||||
"render.stage_panels.subtitle_saved_maps": "Authored maps · saved with this shot",
|
||||
"render.stage_panels.subtitle_stage": "Physical ground and stage · fitted to the product",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"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 millimeters.",
|
||||
"render.studio_center": "Center X, Y, Z (mm)",
|
||||
"render.studio_denoise": "Reduce noise in the finished image",
|
||||
"render.studio_denoise_help": "Final edge-aware filter; fine detail can soften. Glass and sharp specular surfaces bypass the filter.",
|
||||
"render.studio_denoise_help": "Progressive and final images use an edge-aware filter; fine detail may soften. Glass and sharp specular surfaces bypass it.",
|
||||
"render.studio_direction": "Direction toward sun (X, Y, Z)",
|
||||
"render.studio_environment": "Environment",
|
||||
"render.studio_environment_bounds": "Environment rotation must be finite within ±1,000,000 radians and intensity between 0 and 100.",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"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",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"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",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"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",
|
||||
|
||||
@@ -1392,6 +1392,7 @@
|
||||
"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}",
|
||||
@@ -1400,6 +1401,8 @@
|
||||
"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}",
|
||||
|
||||
@@ -1363,11 +1363,14 @@
|
||||
"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}",
|
||||
@@ -2999,9 +3002,11 @@
|
||||
"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",
|
||||
|
||||
+36
-13
@@ -1395,6 +1395,7 @@
|
||||
"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}",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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": "איכות הטשטוש הופחתה כדי לשמור על תגובתיות הפריימים. הרדיוס לא השתנה.",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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": "מובנה",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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": "תוויות",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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": "אחת הפאות המעוקלות שלו אינה ניתנת לשימוש במידול.",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "רצפת שגיאת RGB מוחלטת",
|
||||
"render.adaptive_coverage": "יעד שגיאת כיסוי",
|
||||
"render.adaptive_enable": "הקצאת דגימות באמצעות דגימות גישוש עצמאיות",
|
||||
"render.adaptive_help": "GPU בלבד. דגימות הגישוש העצמאיות מושלכות, ואז מוקצות 16 דגימות הפקה או יותר לכל פיקסל עד לערך „דגימות לכל פיקסל”. השונות של RGB ושל הכיסוי מכוונת את ההקצאה; מסלולים נדירים עלולים להיות מוחמצים ופיקסלים שהגיעו לתקרה עשויים להישאר רועשים. הדוח הסופי סופר את העבודה בפועל. אין ערובה מאושרת לרמת הרעש או לזמן.",
|
||||
"render.adaptive_help": "דגימות החלוץ העצמאיות נזרקות, ואז נקבעות לכל פיקסל לפחות 16 דגימות הפקה, עד לערך דגימות לפיקסל. מגבלות משאבי CPU כוללות את שני השלבים. השונות ב-RGB ובכיסוי מנחה את ההקצאה; פיקסלים שהגיעו לתקרה עשויים להישאר רועשים. הדוח הסופי מונה את הדגימות בפועל.",
|
||||
"render.adaptive_minimum": "מינימום דגימות הפקה",
|
||||
"render.adaptive_pending": "הקצאה אדפטיבית ב־GPU עם דגימות גישוש עצמאיות ושכבות פרנל מותנות זמינות. התכנסות מאושרת, ערובה לאירועים נדירים והעברה אדפטיבית ב־CPU עדיין אינן זמינות.",
|
||||
"render.adaptive_pending": "הקצאה מסתגלת עם דגימות חלוץ עצמאיות זמינה ב-CPU וב-GPU. שכבות פרנל מותנות דורשות GPU. ההקצאה הסטטיסטית אינה מבטיחה התכנסות.",
|
||||
"render.adaptive_pilots": "דגימות גישוש לכל פיקסל",
|
||||
"render.adaptive_relative": "יעד שגיאת RGB יחסית",
|
||||
"render.add_ground": "הוספת קרקע מותאמת להגדרה",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "החלף את האופטיקה השמורה של גוף זה",
|
||||
"render.appearance_editor.revalidate": "אמת מחדש גוף זה",
|
||||
"render.appearance_editor.save": "שמור אופטיקה זו",
|
||||
"render.appearance_editor.save_reason": "שמירת האופטיקה הזו דורשת זכוכית פיזיקלית בגוף GPU עדכני. הציפוי ומפות התמונה המקומיות נשארים זמניים.",
|
||||
"render.appearance_editor.save_reason": "כדי לשמור זכוכית, יש להפעיל אותה בגוף CPU או GPU עדכני. לציפוי שקוף יש להשתמש בשמירת הציפוי בתצלום. קובצי תמונה מקומיים נשארים זמניים.",
|
||||
"render.appearance_editor.saved": "נשמר עם הצילום הזה",
|
||||
"render.appearance_editor.saved_state": "האופטיקה הזו נשמרת עם הצילום הזה.",
|
||||
"render.appearance_editor.scatter_reason": "פיזור פנימי דורש גבול של גוף מלא סגור.",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "העתק JSON של הבקשה",
|
||||
"render.children.coverage_error": "שגיאת כיסוי",
|
||||
"render.children.cpu": "מעקב קרניים במעבד",
|
||||
"render.children.denoise": "הפחת רעש בתמונה המוגמרת",
|
||||
"render.children.denoise": "הפחתת רעש בתמונה",
|
||||
"render.children.depth": "עומק נתיב",
|
||||
"render.children.distortion": "עיוות",
|
||||
"render.children.edge_samples": "דגימות קצה",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "עד שמונה אורות נקודתיים, המתווספים לתאורה הכיוונית שנבחרה. המרחקים במילימטרים; המינימום אינו יכול לעלות על מרחק הייחוס.",
|
||||
"render.cpu_primary_samples": "דגימות קצה לכל פיקסל",
|
||||
"render.cpu_progressive": "CPU הדרגתי",
|
||||
"render.cpu_progressive_help": "צבירה של אינטגרטור ה־CPU הקיים במעברים של דגימה ראשית אחת. החזרות שנבחרו דורשות דגימה אחת; אורות שטח, דיאלקטריים ואנאיזוטרופיה דורשים תמונה בודדת.",
|
||||
"render.cpu_progressive_help": "נאספות דגימות מצלמת CPU חדשות ומוצג כל מעבר שהושלם. השתקפויות נבחרות משתמשות בניסיון אחד לכל דגימת מצלמה; זכוכית מאושרת ואנאיזוטרופיה מישורית שומרות על מגבלותיהן הקיימות. דגימות החלוץ וההפקה המסתגלות חולקות את תקציב פרופיל CPU.",
|
||||
"render.cpu_progressive_limits": "לכל היותר 1,048,576 פיקסלים ו־16,777,216 הערכות פיקסל × דגימה. שינוי הדגימות לעולם אינו משנה את גודל התמונה אוטומטית.",
|
||||
"render.cpu_progressive_seed": "זרע דגימה ב־CPU",
|
||||
"render.cpu_progressive_spp": "דגימות לכל פיקסל",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "ייצוא: PNG לתצוגה",
|
||||
"render.export_image_label": "ייצוא תמונה",
|
||||
"render.export_linear": "ייצוא: EXR ליניארי גולמי",
|
||||
"render.exr_pending": "GPU יכול לשמור EXR ליניארי גולמי. דחיסה, תמונות רב־שכבתיות ומעברי הדמיה נלווים עדיין אינם זמינים.",
|
||||
"render.exr_pending": "עקיבת קרניים ב־CPU ועקיבת נתיבים ב־GPU יכולות לשמור EXR ליניארי גולמי. דחיסה, תמונות רב־שכבתיות ומעברי הדמיה נלווים עדיין אינם זמינים.",
|
||||
"render.film_grain": "גרעיניות צילומית",
|
||||
"render.fit": "התאמת המוצר לתצוגה",
|
||||
"render.fixed_camera": "מצלמה",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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": "התאמת הקרקע ושמירתה",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "מעקב קרניים ב־CPU",
|
||||
"render.method_gpu": "מעקב מסלולים ב־GPU",
|
||||
"render.method_limit_raster": "רסטר משתמש בתצוגה המקדימה הקבועה של הסטודיו האטום. לפקדים האופטיים הנתמכים יש לבחור שיטת מעקב קרניים מפורשת.",
|
||||
"render.method_raster": "רסטר ב־CPU",
|
||||
"render.method_raster": "רסטר ב־CPU (סכמטי)",
|
||||
"render.navigation_help": "המצלמה נעה כמו בתכן (העדפות › ניווט). שמירת ההגדרה מתעדת את המצלמה הנוכחית.",
|
||||
"render.nested_enable": "דיאלקטריים מקוננים מאושרים",
|
||||
"render.nested_help": "עד 16 שכבות מכילות; כל הורה חייב להיות קמור וכל צאצא חייב להיות בתוכו לגמרי. חיתוכים, משטחים נוגעים, יריעות דקות והעברת צל ישרה נדחים. מצב מצלמה בפנים עוקב אחר ההיררכיה המאושרת. אינו יוצר משטח נוזל ואינו ממזג גבולות CAD נוגעים.",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "הגדרת פלט EXR אינה זמינה כאן. ייצוא EXR לינארי דורש תמונת GPU שהושלמה עם מאסטר לינארי שנשמר.",
|
||||
"render.output_fit": "התאם",
|
||||
"render.output_format": "פורמט",
|
||||
"render.output_format_status": "PNG הוא תמונת התצוגה הגמורה המדויקת. EXR אופציונלי ב־GPU שומר קרינה גולמית ליניארית של הסצנה ב־FLOAT32 לפני מסנני התצוגה. הייצוא לעולם אינו מחליף אותה במטמון התצוגה המקדימה או במשימה אחרת.",
|
||||
"render.output_format_status": "PNG הוא תמונת התצוגה הגמורה המדויקת. EXR אופציונלי ב־CPU או ב־GPU שומר קרינה גולמית ליניארית של הסצנה ב־FLOAT32 לפני מסנני התצוגה. הייצוא לעולם אינו מחליף אותה במטמון התצוגה המקדימה או במשימה אחרת.",
|
||||
"render.output_grading": "גריידינג",
|
||||
"render.output_image": "תמונה",
|
||||
"render.output_largest": "מקס׳ {width} × {height}",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "מותאם",
|
||||
"render.quality_draft": "טיוטה",
|
||||
"render.quality_high": "גבוהה",
|
||||
"render.quality_projection_help": "פרופילי Q מוכנים כוללים דרישות עתידיות. פעולה זו משליכה רק תקציב PNG נתמך בדגימות קבועות, ומשמיטה במפורש עצירה אדפטיבית, פלט ליניארי גולמי ומגבלות העברה עצמאיות.",
|
||||
"render.quality_projection_help": "בדיקה זו משנה רק רזולוציה, תקציב דגימות, עומק נתיב, זרע והפחתת רעש. ההגדרות האחרות נשמרות; התקציב אינו מעיד על התכנסות התמונה.",
|
||||
"render.quality_review": "סקירת תקציב הדגימה",
|
||||
"render.queue_pending": "בממשק זה אין תור הפקה אוטומטי ואין מנוע הדמיה לאנימציה. תמונות סטילס גמורות נשארות ניתנות לייצוא כל אחת בנפרד.",
|
||||
"render.radial_assign": "הקצה מראה",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "הזזה וזום משתמשים בהעדפות הניווט. רווח + גרירה מזיזים.",
|
||||
"render.result_open": "פתיחת התמונה הגמורה בקנבס הראשי.",
|
||||
"render.result_preview": "תצוגה מקדימה חיה",
|
||||
"render.result_provisional": "תמונת CPU זמנית",
|
||||
"render.result_provisional": "תמונה זמנית",
|
||||
"render.result_provisional_help": "נקודת ביקורת זו אינה ניתנת לייצוא. הייצוא שומר את התוצאה הגמורה האחרונה; ביטול חוזר לתוצאה הזאת.",
|
||||
"render.result_reduced_display": "התצוגה המקדימה הוקטנה למגבלת המכשיר או המטמון של אזור התצוגה. ה־PNG השמור והייצוא שומרים על רזולוציה מלאה; בדיקה ברזולוציה המקורית (100%) אינה זמינה בתצוגה המוקטנת הזאת.",
|
||||
"render.result_retained": "מוצגת התמונה הגמורה האחרונה; הדמיה חדשה יותר לא החליפה אותה.",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "הכנת תוכנית יצירה",
|
||||
"render.stage_panels.projects": "מקרין",
|
||||
"render.stage_panels.quality_ack": "ידוע לי על התקציב הקבוע והפרטים המושמטים בו",
|
||||
"render.stage_panels.quality_omissions": "עצירה מסתגלת ויעדי שגיאה, עומק העברה נפרד, כללי רולטה רוסית, פלט ליניארי גולמי, קובץ מקור EXR ואישור התכנסות.",
|
||||
"render.stage_panels.quality_omissions": "תקציב זה אינו קובע יעדי שגיאה אדפטיביים, מגבלות מעבר אור נפרדות, כללי רולטה רוסית או שמירת מקור גולמי, ואינו מבטיח התכנסות של התמונה.",
|
||||
"render.stage_panels.reference": "ייחוס",
|
||||
"render.stage_panels.references": "ייחוסים",
|
||||
"render.stage_panels.remove_optics": "הסרת האופטיקה",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "סביבת HDR מקורית · הסצנה כולה",
|
||||
"render.stage_panels.subtitle_maps": "מפות מרחביות מעוצבות · תצוגה מקדימה זמנית",
|
||||
"render.stage_panels.subtitle_physical": "תוכנית לקריאה בלבד · לא נוצר או משויך חומר",
|
||||
"render.stage_panels.subtitle_quality": "תקציב GPU קבוע · דרישות עתידיות מושמטות",
|
||||
"render.stage_panels.subtitle_quality": "תקציב דגימה ב־GPU · השדות המפורטים בלבד",
|
||||
"render.stage_panels.subtitle_rig": "מערך תאורה מעוצב · פולטי אור וכרטיסים סבילים",
|
||||
"render.stage_panels.subtitle_saved_maps": "מפות מעוצבות · נשמרות עם צילום זה",
|
||||
"render.stage_panels.subtitle_stage": "קרקע ובמה פיזיות · מותאמות למוצר",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"render.studio_area_help": "עד ארבעה מלבנים חד־צדדיים. חצאי הצלעות הניצבים U ו־V קובעים את הגודל; U × V פונה אל הצד המואר. הקואורדינטות במילימטרים של מרחב העולם.",
|
||||
"render.studio_center": "מרכז X, Y, Z (mm)",
|
||||
"render.studio_denoise": "הפחתת רעש בתמונה הסופית",
|
||||
"render.studio_denoise_help": "מסנן סופי שמתחשב בקצוות; פרטים עדינים עלולים להתרכך. זכוכית ומשטחים ספקולריים חדים עוקפים את המסנן.",
|
||||
"render.studio_denoise_help": "תמונות הדרגתיות וסופיות משתמשות במסנן שומר קצוות; פרטים עדינים עלולים להתרכך. זכוכית ומשטחים בעלי החזר חד אינם עוברים סינון.",
|
||||
"render.studio_direction": "כיוון אל השמש (X, Y, Z)",
|
||||
"render.studio_environment": "סביבה",
|
||||
"render.studio_environment_bounds": "סיבוב הסביבה חייב להיות סופי בטווח ±1,000,000 רדיאנים והעוצמה בין 0 ל־100.",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"ui.3d_sketch": "סקיצה תלת־ממדית",
|
||||
"ui.activate": "הפעלה",
|
||||
"ui.active_component": "רכיב פעיל",
|
||||
"ui.addToQuickAccess": "הוספה לגישה מהירה",
|
||||
"ui.add_configuration": "הוספת תצורה",
|
||||
"ui.add_parameter": "הוספת פרמטר",
|
||||
"ui.agent_chat": "צ'אט עם סוכן",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"ui.quality": "איכות",
|
||||
"ui.quantity": "כמות",
|
||||
"ui.quantity_2": "כמות 2",
|
||||
"ui.quick_access_full": "סרגל הגישה המהירה מכיל {count} פקודות; יש להסיר אחת כדי להוסיף אחרת",
|
||||
"ui.quit": "יציאה",
|
||||
"ui.radial_context_menu": "תפריט הקשר מעגלי",
|
||||
"ui.radius": "רדיוס",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"ui.relink_not_linked": "רכיב זה אינו מקושר לתכן מקור.",
|
||||
"ui.relink_select_one": "יש לבחור תחילה רכיב מקושר אחד או אחד המופעים שלו.",
|
||||
"ui.relink_source_all": "קישור מחדש למקור (כל המופעים)…",
|
||||
"ui.removeFromQuickAccess": "הסרה מהגישה המהירה",
|
||||
"ui.removeFromToolbar": "הסרה מסרגל הכלים",
|
||||
"ui.removeSection": "הסרת מקטע",
|
||||
"ui.render": "הדמיה",
|
||||
|
||||
@@ -1364,11 +1364,14 @@
|
||||
"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}",
|
||||
|
||||
+36
-13
@@ -1395,6 +1395,7 @@
|
||||
"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} 減らす",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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": "画面の応答性を保つため、ぼかしの品質を下げました。半径は変更されていません。",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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": "組み込み",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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": "ラベル",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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 つがモデリングに使えません。",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "RGB 絶対誤差の下限",
|
||||
"render.adaptive_coverage": "被覆率の誤差目標",
|
||||
"render.adaptive_enable": "独立した予備サンプルで配分",
|
||||
"render.adaptive_help": "GPU 専用。独立した予備サンプルは破棄され、各ピクセルに最小16から設定上限までの本サンプルを配分します。RGB と被覆率の分散を目安にしますが、まれな経路を見逃したり上限でノイズが残ったりします。最終レポートは実際の処理量を示します。ノイズや時間を保証しません。",
|
||||
"render.adaptive_help": "独立したパイロットサンプルは破棄され、ピクセルごとに16以上、「ピクセルあたりのサンプル数」以下の本番サンプル数を決めます。CPUのリソース上限には両段階が含まれます。RGBとカバレッジの分散から配分し、上限に達したピクセルにはノイズが残ることがあります。最終レポートには実際のサンプル数を記録します。",
|
||||
"render.adaptive_minimum": "最小本サンプル数",
|
||||
"render.adaptive_pending": "GPU の独立予備サンプルによる適応配分と条件付きフレネル層化が利用できます。収束の認証、まれな事象の保証、CPU 適応輸送は未対応です。",
|
||||
"render.adaptive_pending": "独立したパイロットによる適応配分はCPUとGPUで利用できます。条件付きフレネル層にはGPUが必要です。統計的な配分は収束を保証しません。",
|
||||
"render.adaptive_pilots": "ピクセルごとの予備サンプル",
|
||||
"render.adaptive_relative": "RGB 相対誤差の目標",
|
||||
"render.add_ground": "フィットした床をセットアップに追加",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "このボディの保存済み光学設定を置換",
|
||||
"render.appearance_editor.revalidate": "このボディを再検証",
|
||||
"render.appearance_editor.save": "この光学設定を保存",
|
||||
"render.appearance_editor.save_reason": "保存には現在のGPUボディの物理ガラスが必要です。コートとローカル画像マップは一時設定のままです。",
|
||||
"render.appearance_editor.save_reason": "ガラスを保存するには、現在のCPUまたはGPUボディで有効にしてください。クリアコートは「コートをショットに保存」を使用します。ローカル画像ファイルは一時設定のままです。",
|
||||
"render.appearance_editor.saved": "このショットに保存",
|
||||
"render.appearance_editor.saved_state": "この光学設定はこのショットに保存されています。",
|
||||
"render.appearance_editor.scatter_reason": "内部散乱には閉じたソリッド境界が必要です。",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "リクエストJSONをコピー",
|
||||
"render.children.coverage_error": "カバレッジ誤差",
|
||||
"render.children.cpu": "CPUレイトレーシング",
|
||||
"render.children.denoise": "完成画像のノイズを低減",
|
||||
"render.children.denoise": "画像のノイズを低減",
|
||||
"render.children.depth": "パス深度",
|
||||
"render.children.distortion": "歪み",
|
||||
"render.children.edge_samples": "エッジサンプル",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "選択した平行光に最大8個の点光源を追加できます。距離はmmで、最小距離は基準距離以下にしてください。",
|
||||
"render.cpu_primary_samples": "輪郭サンプル数/ピクセル",
|
||||
"render.cpu_progressive": "CPUプログレッシブ",
|
||||
"render.cpu_progressive_help": "既存のCPU積分器を、一次サンプル1個ずつのパスで累積します。選択した反射は1サンプルが必要です。面光源、誘電体、異方性には固定画像を使用してください。",
|
||||
"render.cpu_progressive_help": "新しいCPUカメラサンプルを蓄積し、完了したすべてのパスを表示します。選択した反射はカメラサンプルごとに1回評価します。認証済みガラスと平面異方性には従来の制限が適用されます。適応サンプリングのパイロットと本番は同じCPUプロファイル予算を使います。",
|
||||
"render.cpu_progressive_limits": "最大1,048,576ピクセル、ピクセル×サンプルの合計は16,777,216以下です。サンプル数を変えても画像サイズは自動変更されません。",
|
||||
"render.cpu_progressive_seed": "CPUサンプリングシード",
|
||||
"render.cpu_progressive_spp": "サンプル/ピクセル",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "書き出し:表示PNG",
|
||||
"render.export_image_label": "画像を書き出す",
|
||||
"render.export_linear": "書き出し:生の線形EXR",
|
||||
"render.exr_pending": "GPUでは線形EXRを保持できます。圧縮、複数レイヤー、補助パスは未実装です。",
|
||||
"render.exr_pending": "CPUレイトレーシングとGPUパストレーシングでは生の線形EXRを保持できます。圧縮、複数レイヤー、補助パスは未実装です。",
|
||||
"render.film_grain": "写真粒子",
|
||||
"render.fit": "製品を画面に合わせる",
|
||||
"render.fixed_camera": "カメラ",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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": "床をフィットして保存",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "CPU レイトレーシング",
|
||||
"render.method_gpu": "GPU パストレーシング",
|
||||
"render.method_limit_raster": "ラスターは固定の不透明スタジオプレビューを使用します。対応する光学設定には明示的なレイトレーシング方式を選択してください。",
|
||||
"render.method_raster": "CPU ラスター",
|
||||
"render.method_raster": "CPU ラスター(模式図)",
|
||||
"render.navigation_help": "カメラはデザインと同じように動きます(環境設定 › ナビゲーション)。「セットアップを保存」で現在のカメラを記録します。",
|
||||
"render.nested_enable": "検証済み入れ子誘電体",
|
||||
"render.nested_help": "最大16層。親は凸形状、子は厳密に内部である必要があります。交差・接触・薄膜・直線透過影は拒否します。内部カメラは検証した階層を使います。液面の生成や接触するCAD境界の結合は行いません。",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "ここではEXR出力設定を利用できません。リニアEXR書き出しには、リニアマスターを保持した完成GPU画像が必要です。",
|
||||
"render.output_fit": "全体表示",
|
||||
"render.output_format": "形式",
|
||||
"render.output_format_status": "PNGは完了した表示画像そのものです。GPUの任意EXRは表示フィルター前の生の線形FLOAT32放射輝度を保持します。プレビューキャッシュや別ジョブへの置換はありません。",
|
||||
"render.output_format_status": "PNGは完了した表示画像そのものです。CPU/GPUの任意EXRは表示フィルター前の生の線形FLOAT32放射輝度を保持します。プレビューキャッシュや別ジョブへの置換はありません。",
|
||||
"render.output_grading": "カラーグレーディング",
|
||||
"render.output_image": "画像",
|
||||
"render.output_largest": "{width} × {height} 最大",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "カスタム",
|
||||
"render.quality_draft": "ドラフト",
|
||||
"render.quality_high": "高品質",
|
||||
"render.quality_projection_help": "Qプリセットには将来の要件も含まれます。この操作は対応する固定サンプルPNG予算のみを適用し、適応的停止、生の線形出力、独立した透過制限は含みません。",
|
||||
"render.quality_projection_help": "この確認で変更するのは、解像度、サンプル予算、パス深度、シード、ノイズ低減だけです。他の設定は維持され、収束は保証されません。",
|
||||
"render.quality_review": "サンプリング予算を確認",
|
||||
"render.queue_pending": "このUIには自動の本番キューやアニメーションレンダラーはありません。完了した静止画像は個別に書き出せます。",
|
||||
"render.radial_assign": "外観を割り当て",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "移動とズームはナビゲーション設定に従います。スペースキーを押しながらドラッグすると移動します。",
|
||||
"render.result_open": "完成した画像をメインキャンバスに表示します。",
|
||||
"render.result_preview": "ライブプレビュー",
|
||||
"render.result_provisional": "CPU仮画像",
|
||||
"render.result_provisional": "仮画像",
|
||||
"render.result_provisional_help": "この中間画像はエクスポートできません。最後に完成した結果をエクスポートします。キャンセルするとその結果に戻ります。",
|
||||
"render.result_reduced_display": "表示プレビューをビューポート機器またはキャッシュの上限に縮小しています。保持したPNGと書き出しは元の解像度です。この縮小表示ではネイティブ100%表示はできません。",
|
||||
"render.result_retained": "最後に完成した画像を表示しています。新しいレンダリングにはまだ置き換わっていません。",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "作成計画を準備",
|
||||
"render.stage_panels.projects": "投影",
|
||||
"render.stage_panels.quality_ack": "固定予算と省略事項を確認しました",
|
||||
"render.stage_panels.quality_omissions": "適応停止と誤差目標、個別の透過深度、ロシアンルーレット規則、線形RAW出力、EXRマスター、収束認証。",
|
||||
"render.stage_panels.quality_omissions": "この予算は、適応サンプリングの誤差目標、独立した透過制限、ロシアンルーレット規則、リニアマスターの保持を設定しません。収束も保証しません。",
|
||||
"render.stage_panels.reference": "参照",
|
||||
"render.stage_panels.references": "参照",
|
||||
"render.stage_panels.remove_optics": "光学設定を削除",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "オリジナルHDR環境・シーン全体",
|
||||
"render.stage_panels.subtitle_maps": "作成済み空間マップ・一時プレビュー",
|
||||
"render.stage_panels.subtitle_physical": "読み取り専用計画・マテリアルの作成や割り当てなし",
|
||||
"render.stage_panels.subtitle_quality": "固定GPU予算・将来の要件は省略",
|
||||
"render.stage_panels.subtitle_quality": "GPUサンプリング予算 · 記載された設定のみ",
|
||||
"render.stage_panels.subtitle_rig": "作成済みライトリグ・光源と受動カード",
|
||||
"render.stage_panels.subtitle_saved_maps": "作成済みマップ・このショットに保存",
|
||||
"render.stage_panels.subtitle_stage": "物理的な地面とステージ・製品にフィット",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"render.studio_area_help": "最大 4 個の片面矩形です。直交する半辺 U と V でサイズを定め、U × V が発光方向になります。座標はワールド空間の mm です。",
|
||||
"render.studio_center": "中心 X, Y, Z (mm)",
|
||||
"render.studio_denoise": "完成画像のノイズを低減",
|
||||
"render.studio_denoise_help": "輪郭を保持する最終フィルターです。微細な描写が柔らかくなることがあります。ガラスと鋭い鏡面反射は対象外です。",
|
||||
"render.studio_denoise_help": "プログレッシブ画像と完成画像に輪郭を保持するフィルターを適用します。微細な描写が柔らかくなることがあります。ガラスと鋭い鏡面反射は対象外です。",
|
||||
"render.studio_direction": "太陽に向かう方向 (X, Y, Z)",
|
||||
"render.studio_environment": "環境",
|
||||
"render.studio_environment_bounds": "環境回転は±1,000,000ラジアン以内の有限値、強度は0~100でなければなりません。",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"ui.3d_sketch": "3D スケッチ",
|
||||
"ui.activate": "アクティブ化",
|
||||
"ui.active_component": "アクティブなコンポーネント",
|
||||
"ui.addToQuickAccess": "クイックアクセスに追加",
|
||||
"ui.add_configuration": "構成を追加",
|
||||
"ui.add_parameter": "パラメーターを追加",
|
||||
"ui.agent_chat": "エージェントチャット",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"ui.quality": "品質",
|
||||
"ui.quantity": "数量",
|
||||
"ui.quantity_2": "数量 2",
|
||||
"ui.quick_access_full": "クイックアクセスバーに置けるコマンドは {count} 個までです。追加するには 1 つ削除してください",
|
||||
"ui.quit": "終了",
|
||||
"ui.radial_context_menu": "パイ メニュー",
|
||||
"ui.radius": "半径",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"ui.relink_not_linked": "このコンポーネントは参照元の設計にリンクされていません。",
|
||||
"ui.relink_select_one": "リンクされたコンポーネントまたはそのインスタンスを1つ選択してください。",
|
||||
"ui.relink_source_all": "参照元を再リンク(すべてのインスタンス)…",
|
||||
"ui.removeFromQuickAccess": "クイックアクセスから削除",
|
||||
"ui.removeFromToolbar": "ツールバーから削除",
|
||||
"ui.removeSection": "セクションを解除",
|
||||
"ui.render": "レンダリング",
|
||||
|
||||
+13
-6
@@ -1206,6 +1206,7 @@
|
||||
"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} 줄이기",
|
||||
@@ -1213,6 +1214,8 @@
|
||||
"dialog.dimension_step_up": "{step} 늘리기",
|
||||
"dialog.edit_title": "{title} 편집",
|
||||
"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}",
|
||||
@@ -1687,6 +1690,8 @@
|
||||
"prefs.browser_components_open_note": "브라우저의 모든 구성요소가 이전처럼 펼쳐진 상태로 시작합니다. 끄면 직접 펼칠 때까지 접혀 있습니다.",
|
||||
"prefs.browser_eye_left": "접기 화살표 옆의 눈 아이콘",
|
||||
"prefs.browser_eye_left_note": "브라우저 행의 표시 아이콘을 행 오른쪽 끝의 열이 아니라 이전처럼 접기 화살표 옆에 표시합니다.",
|
||||
"prefs.browser_rows_start_closed": "브라우저 행을 접힌 상태로 시작",
|
||||
"prefs.browser_rows_start_closed_note": "브라우저의 배치와 폴더가 접힌 상태로 시작하므로, 컴포넌트가 많은 디자인은 최상위 행만 보여 줍니다. 각 행은 화살표, '모두 펼치기' 또는 '브라우저에서 찾기'로 엽니다. '브라우저에서 찾기'는 바디까지의 행만 열고, 지난번 찾기로 연 행은 다시 접습니다. 3D 뷰에서 바디를 골라도 브라우저는 그대로입니다. 끄면 폴더가 펼친 상태로 시작하고, 배치는 '구성요소를 펼친 상태로 시작' 설정을 따르며, 3D 뷰에서 고르면 브라우저가 그 바디까지 열립니다(이전과 같음).",
|
||||
"prefs.built_in": "기본 제공",
|
||||
"prefs.button_left": "왼쪽 드래그",
|
||||
"prefs.button_middle": "가운데 드래그",
|
||||
@@ -2115,7 +2120,7 @@
|
||||
"render.appearance_editor.replace": "이 바디의 저장된 광학 설정 교체",
|
||||
"render.appearance_editor.revalidate": "이 바디 다시 검증",
|
||||
"render.appearance_editor.save": "이 광학 설정 저장",
|
||||
"render.appearance_editor.save_reason": "저장하려면 현재 GPU 바디에 물리 유리가 필요합니다. 코트와 로컬 이미지 맵은 임시로 유지됩니다.",
|
||||
"render.appearance_editor.save_reason": "유리를 저장하려면 현재 CPU 또는 GPU 바디에서 활성화하세요. 클리어 코트는 샷에 코트 저장을 사용하세요. 로컬 이미지 파일은 임시 설정으로 유지됩니다.",
|
||||
"render.appearance_editor.saved": "이 샷에 저장됨",
|
||||
"render.appearance_editor.saved_state": "이 광학 설정은 이 샷과 함께 저장되어 있습니다.",
|
||||
"render.appearance_editor.scatter_reason": "내부 산란에는 닫힌 솔리드 경계가 필요합니다.",
|
||||
@@ -2163,7 +2168,7 @@
|
||||
"render.children.copy_request": "요청 JSON 복사",
|
||||
"render.children.coverage_error": "커버리지 오차",
|
||||
"render.children.cpu": "CPU 레이 트레이싱",
|
||||
"render.children.denoise": "완성 이미지의 노이즈 줄이기",
|
||||
"render.children.denoise": "이미지 노이즈 줄이기",
|
||||
"render.children.depth": "경로 깊이",
|
||||
"render.children.distortion": "왜곡",
|
||||
"render.children.edge_samples": "모서리 샘플",
|
||||
@@ -2384,7 +2389,7 @@
|
||||
"render.error_visible_solid": "여기서 미리 보려면 디자인에서 보이는 솔리드를 만드세요.",
|
||||
"render.exit_focus": "집중 보기 종료",
|
||||
"render.export_image_label": "이미지 내보내기",
|
||||
"render.exr_pending": "GPU는 원본 선형 EXR을 보존할 수 있습니다. 압축, 다중 레이어 이미지 및 보조 렌더 패스는 아직 사용할 수 없습니다.",
|
||||
"render.exr_pending": "CPU 레이 트레이싱과 GPU 패스 트레이싱은 원본 선형 EXR을 보존할 수 있습니다. 압축, 다중 레이어 이미지 및 보조 렌더 패스는 아직 사용할 수 없습니다.",
|
||||
"render.fit": "제품에 맞추기",
|
||||
"render.fixed_camera": "카메라",
|
||||
"render.fixed_world": "월드",
|
||||
@@ -2634,7 +2639,7 @@
|
||||
"render.output_exr_unavailable": "여기서는 EXR 출력을 설정할 수 없습니다. 선형 EXR 내보내기에는 선형 원본을 보관한 완료된 GPU 이미지가 필요합니다.",
|
||||
"render.output_fit": "맞춤",
|
||||
"render.output_format": "형식",
|
||||
"render.output_format_status": "PNG는 완료된 표시 이미지 그대로입니다. 선택적 GPU EXR은 표시 필터 전 선형 FLOAT32 방사 휘도를 보존합니다. 미리보기 캐시나 다른 작업으로 바꾸어 내보내지 않습니다.",
|
||||
"render.output_format_status": "PNG는 완료된 표시 이미지 그대로입니다. 선택적 CPU/GPU EXR은 표시 필터 전 선형 FLOAT32 방사 휘도를 보존합니다. 미리보기 캐시나 다른 작업으로 바꾸어 내보내지 않습니다.",
|
||||
"render.output_grading": "색 보정",
|
||||
"render.output_image": "이미지",
|
||||
"render.output_largest": "{width} × {height} 최대",
|
||||
@@ -2684,6 +2689,7 @@
|
||||
"render.quality_custom": "사용자 지정",
|
||||
"render.quality_draft": "초안",
|
||||
"render.quality_high": "높음",
|
||||
"render.quality_projection_help": "이 검토에서는 해상도, 샘플 예산, 경로 깊이, 시드 및 노이즈 제거만 변경합니다. 다른 설정은 유지되며 수렴은 보장되지 않습니다.",
|
||||
"render.radial_assign": "외관 지정",
|
||||
"render.radial_compare": "비교",
|
||||
"render.radial_fit": "제품 맞추기",
|
||||
@@ -2826,7 +2832,7 @@
|
||||
"render.stage_panels.prepare_plan": "생성 계획 준비",
|
||||
"render.stage_panels.projects": "투영",
|
||||
"render.stage_panels.quality_ack": "고정 예산과 생략 사항을 확인했습니다",
|
||||
"render.stage_panels.quality_omissions": "적응형 중지 및 오차 목표, 별도 투과 깊이, 러시안 룰렛 규칙, 원시 선형 출력, EXR 마스터 및 수렴 인증.",
|
||||
"render.stage_panels.quality_omissions": "이 예산은 적응형 오차 목표, 독립적인 투과 한도, 러시안 룰렛 규칙 또는 선형 마스터 보존을 설정하지 않으며 수렴을 보장하지 않습니다.",
|
||||
"render.stage_panels.reference": "참조",
|
||||
"render.stage_panels.references": "참조",
|
||||
"render.stage_panels.remove_optics": "광학 설정 제거",
|
||||
@@ -2870,7 +2876,7 @@
|
||||
"render.stage_panels.subtitle_environment": "원본 HDR 환경 · 전체 장면",
|
||||
"render.stage_panels.subtitle_maps": "제작된 공간 맵 · 임시 미리 보기",
|
||||
"render.stage_panels.subtitle_physical": "읽기 전용 계획 · 재질 생성 또는 할당 없음",
|
||||
"render.stage_panels.subtitle_quality": "고정 GPU 예산 · 향후 요구 사항 생략",
|
||||
"render.stage_panels.subtitle_quality": "GPU 샘플링 예산 · 표시된 설정만 변경",
|
||||
"render.stage_panels.subtitle_rig": "제작된 조명 리그 · 광원 및 수동 카드",
|
||||
"render.stage_panels.subtitle_saved_maps": "제작된 맵 · 이 샷에 저장",
|
||||
"render.stage_panels.subtitle_stage": "물리적 바닥 및 스테이지 · 제품에 맞춤",
|
||||
@@ -2887,6 +2893,7 @@
|
||||
"render.state_in_progress": "이미지 생성 중",
|
||||
"render.state_model": "모델 미리보기",
|
||||
"render.strip_label": "스트립",
|
||||
"render.studio_denoise_help": "프로그레시브 이미지와 완성 이미지에 경계를 보존하는 필터를 적용합니다. 미세한 디테일이 부드러워질 수 있습니다. 유리와 날카로운 정반사 표면은 필터를 거치지 않습니다.",
|
||||
"render.studio_tiles_require_gpu": "스튜디오에는 GPU 경로 추적이 필요합니다. 출력 편집기에서 GPU를 선택하세요.",
|
||||
"render.studios_environments": "스튜디오 및 환경",
|
||||
"render.tone_aces_fitted": "ACES 근사",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"en": {
|
||||
"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)."
|
||||
},
|
||||
"ar": {
|
||||
"ai.prefs.instructions": "تعليمات مخصصة",
|
||||
"ai.prefs.instructions_note": "تُرسَل إلى الوكيل في بداية كل محادثة، بعد تعليمات SolidCraft الخاصة: طريقتك المفضلة في العمل والقواعد التي يجب الالتزام بها. يسري أي تغيير من المحادثة التالية (اتصال أو محادثة جديدة)."
|
||||
},
|
||||
"he": {
|
||||
"ai.prefs.instructions": "הוראות מותאמות אישית",
|
||||
"ai.prefs.instructions_note": "נשלחות לסוכן בתחילת כל צ'אט, אחרי ההוראות של SolidCraft עצמה: דרך העבודה המועדפת עליך וכללים שיש להקפיד עליהם. שינוי חל מהצ'אט הבא (התחברות או צ'אט חדש)."
|
||||
},
|
||||
"ja": {
|
||||
"ai.prefs.instructions": "カスタム指示",
|
||||
"ai.prefs.instructions_note": "各チャットの開始時に、SolidCraft 自身の指示の後に続けてエージェントへ送られます。作業の進め方や守ってほしいルールを書いてください。変更は次のチャット(接続または新しいチャット)から適用されます。"
|
||||
},
|
||||
"vi": {
|
||||
"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)."
|
||||
},
|
||||
"zh": {
|
||||
"ai.prefs.instructions": "自定义指令",
|
||||
"ai.prefs.instructions_note": "在每次对话开始时发送给代理,位于 SolidCraft 自身的指令之后:你喜欢的工作方式、需要遵守的规则。更改从下一次对话(连接或新对话)起生效。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.aging_raytrace_help": "يُطبّق التعتيق في تتبع الأشعة على المعالج وتتبع المسارات على المعالج الرسومي. يبقى التصيير النقطي تخطيطياً."
|
||||
},
|
||||
"de": {
|
||||
"render.aging_raytrace_help": "Alterung wird beim CPU-Raytracing und GPU-Pathtracing angewendet. Raster bleibt eine schematische Darstellung."
|
||||
},
|
||||
"en": {
|
||||
"render.aging_raytrace_help": "Aging is applied by CPU ray tracing and GPU path tracing. Raster keeps schematic rendering."
|
||||
},
|
||||
"en-GB": {
|
||||
"render.aging_raytrace_help": "Ageing is applied by CPU ray tracing and GPU path tracing. Raster keeps schematic rendering."
|
||||
},
|
||||
"he": {
|
||||
"render.aging_raytrace_help": "התיישנות מוחלת במעקב קרניים במעבד ובמעקב מסלולים במעבד הגרפי. רינדור רסטר נשאר סכמטי."
|
||||
},
|
||||
"ja": {
|
||||
"render.aging_raytrace_help": "エイジングはCPUレイトレーシングとGPUパストレーシングで適用されます。ラスタは模式的な描画を維持します。"
|
||||
},
|
||||
"ko": {
|
||||
"render.aging_raytrace_help": "에이징은 CPU 광선 추적과 GPU 경로 추적에 적용됩니다. 래스터는 도식적인 렌더링을 유지합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.aging_raytrace_help": "Hiệu ứng lão hoá được áp dụng khi dò tia bằng CPU và dò đường đi bằng GPU. Kết xuất raster giữ kiểu sơ đồ."
|
||||
},
|
||||
"zh": {
|
||||
"render.aging_raytrace_help": "老化效果适用于CPU光线追踪和GPU路径追踪。光栅保持示意渲染。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_volume_enable_path": "تفعيل الإضاءة غير المباشرة",
|
||||
"render.cpu_volume_enable_path_plan": "تتبع أشعة CPU · عمق المسار {depth} · {spp} عينة/بكسل · بذرة {seed} · ظلال متتبعة. يحتفظ بالغلاف الجوي وميزانية الصورة المحددين.",
|
||||
"render.cpu_volume_help": "يستخدم الغلاف الجوي على CPU الإضاءة غير المباشرة. يحافظ الانطفاء الصفري على الصندوق المحفوظ دون ضباب.",
|
||||
"render.cpu_volume_method_adopt": "تتبع أشعة CPU مع إضاءة غير مباشرة",
|
||||
"render.cpu_volume_method_incompatible": "لا يمكن نقل إعدادات الإضاءة أو أخذ العينات أو الغلاف الجوي هذه إلى هذه الطريقة. تبقى إعداداتك محفوظة.",
|
||||
"render.cpu_volume_path_required": "فعّل الإضاءة غير المباشرة لاستخدام الغلاف الجوي على CPU.",
|
||||
"render.volume_denoise_required": "أوقف تقليل الضوضاء لاستخدام الغلاف الجوي.",
|
||||
"render.volume_glass_required": "لا يمكن الجمع بين الغلاف الجوي والزجاج في هذا الإعداد.",
|
||||
"render.volume_lighting_required": "اختر بيئة أو مجموعة إضاءة محددة لتصيير الغلاف الجوي.",
|
||||
"render.volume_single_stratum_required": "استخدم عينة نفاذ واحدة لتصيير الغلاف الجوي."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_volume_enable_path": "Indirekte Beleuchtung einschalten",
|
||||
"render.cpu_volume_enable_path_plan": "CPU-Raytracing · Pfadtiefe {depth} · {spp} Samples/Pixel · Seed {seed} · Raytracing-Schatten. Atmosphäre und Bildbudget bleiben erhalten.",
|
||||
"render.cpu_volume_help": "CPU-Atmosphäre nutzt indirekte Beleuchtung. Bei Extinktion null bleibt die gespeicherte Box ohne Nebel erhalten.",
|
||||
"render.cpu_volume_method_adopt": "CPU-Raytracing mit indirekter Beleuchtung",
|
||||
"render.cpu_volume_method_incompatible": "Diese Licht-, Sampling- oder Atmosphäreinstellungen lassen sich nicht auf diese Methode übertragen. Die Einstellungen bleiben erhalten.",
|
||||
"render.cpu_volume_path_required": "Indirekte Beleuchtung einschalten, um CPU-Atmosphäre zu nutzen.",
|
||||
"render.volume_denoise_required": "Für Atmosphäre die Rauschreduzierung ausschalten.",
|
||||
"render.volume_glass_required": "Atmosphäre und Glas können in dieser Einstellung nicht kombiniert werden.",
|
||||
"render.volume_lighting_required": "Für Atmosphäre eine Umgebung oder ein eigenes Lichtrig wählen.",
|
||||
"render.volume_single_stratum_required": "Für Atmosphäre ein Transmissionssample verwenden."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_volume_enable_path": "Enable Indirect lighting",
|
||||
"render.cpu_volume_enable_path_plan": "CPU ray tracing · path depth {depth} · {spp} samples/pixel · seed {seed} · traced shadows. Keeps the authored atmosphere and image budget.",
|
||||
"render.cpu_volume_help": "CPU Atmosphere uses Indirect lighting. Zero extinction keeps the saved box without fog.",
|
||||
"render.cpu_volume_method_adopt": "CPU ray tracing with indirect lighting",
|
||||
"render.cpu_volume_method_incompatible": "These light, sampling or atmosphere settings cannot be transferred to this method. Your settings are kept.",
|
||||
"render.cpu_volume_path_required": "Enable Indirect lighting to use CPU Atmosphere.",
|
||||
"render.volume_denoise_required": "Turn off noise reduction to use Atmosphere.",
|
||||
"render.volume_glass_required": "Atmosphere cannot be combined with Glass in this setup.",
|
||||
"render.volume_lighting_required": "Choose an environment or an explicit light rig to render Atmosphere.",
|
||||
"render.volume_single_stratum_required": "Use one transmission sample to render Atmosphere."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_volume_enable_path": "הפעלת תאורה עקיפה",
|
||||
"render.cpu_volume_enable_path_plan": "מעקב קרניים ב־CPU · עומק מסלול {depth} · {spp} דגימות לפיקסל · זרע {seed} · צללים במעקב קרניים. האטמוספרה ותקציב התמונה שנקבעו נשמרים.",
|
||||
"render.cpu_volume_help": "אטמוספרה ב־CPU משתמשת בתאורה עקיפה. הכחדה אפסית שומרת את התיבה ללא ערפל.",
|
||||
"render.cpu_volume_method_adopt": "מעקב קרניים ב־CPU עם תאורה עקיפה",
|
||||
"render.cpu_volume_method_incompatible": "לא ניתן להעביר הגדרות תאורה, דגימה או אטמוספרה אלה לשיטה זו. ההגדרות שלך נשמרות.",
|
||||
"render.cpu_volume_path_required": "יש להפעיל תאורה עקיפה כדי להשתמש באטמוספרה ב־CPU.",
|
||||
"render.volume_denoise_required": "יש לכבות הפחתת רעש כדי להשתמש באטמוספרה.",
|
||||
"render.volume_glass_required": "לא ניתן לשלב אטמוספרה וזכוכית בהגדרה זו.",
|
||||
"render.volume_lighting_required": "יש לבחור סביבה או מערך תאורה מפורש כדי לרנדר אטמוספרה.",
|
||||
"render.volume_single_stratum_required": "יש להשתמש בדגימת מעבר אחת כדי לרנדר אטמוספרה."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_volume_enable_path": "間接照明を有効にする",
|
||||
"render.cpu_volume_enable_path_plan": "CPUレイトレーシング · パス深度{depth} · {spp}サンプル/ピクセル · シード{seed} · レイトレースシャドウ。大気と画像予算の設定を保持します。",
|
||||
"render.cpu_volume_help": "CPUの大気は間接照明を使用します。消散係数がゼロでも、霧のないボックスとして設定は保存されます。",
|
||||
"render.cpu_volume_method_adopt": "間接照明を使うCPUレイトレーシング",
|
||||
"render.cpu_volume_method_incompatible": "この照明、サンプリング、大気の設定はこの方式に引き継げません。設定は保持されます。",
|
||||
"render.cpu_volume_path_required": "CPUの大気を使うには間接照明を有効にしてください。",
|
||||
"render.volume_denoise_required": "大気を使うにはノイズ低減をオフにしてください。",
|
||||
"render.volume_glass_required": "この設定では大気とガラスを併用できません。",
|
||||
"render.volume_lighting_required": "大気を描画するには環境または明示的なライト構成を選んでください。",
|
||||
"render.volume_single_stratum_required": "大気を描画するには透過サンプル数を1にしてください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_volume_enable_path": "간접 조명 켜기",
|
||||
"render.cpu_volume_enable_path_plan": "CPU 레이 트레이싱 · 경로 깊이 {depth} · 픽셀당 {spp}샘플 · 시드 {seed} · 레이 트레이싱 그림자. 작성한 대기와 이미지 예산을 유지합니다.",
|
||||
"render.cpu_volume_help": "CPU 대기는 간접 조명을 사용합니다. 소광 계수가 0이면 저장된 상자는 안개 없이 유지됩니다.",
|
||||
"render.cpu_volume_method_adopt": "간접 조명을 사용하는 CPU 레이 트레이싱",
|
||||
"render.cpu_volume_method_incompatible": "이 조명, 샘플링 또는 대기 설정을 이 방식으로 옮길 수 없습니다. 설정은 유지됩니다.",
|
||||
"render.cpu_volume_path_required": "CPU 대기를 사용하려면 간접 조명을 켜세요.",
|
||||
"render.volume_denoise_required": "대기를 사용하려면 노이즈 감소를 끄세요.",
|
||||
"render.volume_glass_required": "이 설정에서는 대기와 유리를 함께 사용할 수 없습니다.",
|
||||
"render.volume_lighting_required": "대기를 렌더링하려면 환경 또는 명시적인 조명 구성을 선택하세요.",
|
||||
"render.volume_single_stratum_required": "대기를 렌더링하려면 투과 샘플을 1로 설정하세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_volume_enable_path": "Bật chiếu sáng gián tiếp",
|
||||
"render.cpu_volume_enable_path_plan": "Dò tia CPU · độ sâu đường đi {depth} · {spp} mẫu/pixel · hạt giống {seed} · bóng dò tia. Giữ nguyên khí quyển và ngân sách ảnh đã đặt.",
|
||||
"render.cpu_volume_help": "Khí quyển trên CPU dùng chiếu sáng gián tiếp. Hệ số suy giảm bằng không vẫn giữ hộp đã lưu mà không tạo sương.",
|
||||
"render.cpu_volume_method_adopt": "Dò tia CPU với chiếu sáng gián tiếp",
|
||||
"render.cpu_volume_method_incompatible": "Không thể chuyển các thiết lập đèn, lấy mẫu hoặc khí quyển này sang phương pháp này. Thiết lập của bạn được giữ nguyên.",
|
||||
"render.cpu_volume_path_required": "Bật chiếu sáng gián tiếp để dùng Khí quyển trên CPU.",
|
||||
"render.volume_denoise_required": "Tắt giảm nhiễu để dùng Khí quyển.",
|
||||
"render.volume_glass_required": "Không thể kết hợp Khí quyển và Kính trong thiết lập này.",
|
||||
"render.volume_lighting_required": "Chọn môi trường hoặc bộ đèn tường minh để kết xuất Khí quyển.",
|
||||
"render.volume_single_stratum_required": "Dùng một mẫu truyền sáng để kết xuất Khí quyển."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_volume_enable_path": "启用间接照明",
|
||||
"render.cpu_volume_enable_path_plan": "CPU 光线追踪 · 路径深度 {depth} · 每像素 {spp} 个采样 · 种子 {seed} · 追踪阴影。保留已编写的大气和图像预算。",
|
||||
"render.cpu_volume_help": "CPU 大气使用间接照明。消光系数为零时,已保存的包围盒仍会保留,但不会产生雾。",
|
||||
"render.cpu_volume_method_adopt": "使用间接照明的 CPU 光线追踪",
|
||||
"render.cpu_volume_method_incompatible": "这些灯光、采样或大气设置无法转移到此方式。您的设置会保留。",
|
||||
"render.cpu_volume_path_required": "启用间接照明以使用 CPU 大气。",
|
||||
"render.volume_denoise_required": "关闭降噪以使用大气。",
|
||||
"render.volume_glass_required": "此设置无法同时使用大气和玻璃。",
|
||||
"render.volume_lighting_required": "选择环境或显式灯光配置以渲染大气。",
|
||||
"render.volume_single_stratum_required": "将透射采样数设为 1 以渲染大气。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_constant_direct_help": "بدون الإضاءة غير المباشرة، يمكن أن يظهر هذا المصدر الثابت في الانعكاسات وعبر الزجاج. لكنه لا يضيء الأسطح المعتمة. فعّل الإضاءة غير المباشرة لاستخدامه في إضاءة المشهد.",
|
||||
"render.cpu_constant_enable_indirect_plan": "عمق المسار {depth}؛ أخذ عينات تدريجي بمعدل {spp} عينة/بكسل (البذرة {seed})؛ شعاع أولي واحد لكل عينة؛ ظلال متتبعة. يحتفظ بحجم الصورة وميزانية CPU والإعدادات الأخرى.",
|
||||
"render.cpu_indirect_method_required": "اختر تتبع أشعة CPU لتفعيل وضع الإضاءة غير المباشرة هذا."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_constant_direct_help": "Ohne indirekte Beleuchtung kann diese konstante Quelle in Reflexionen und durch Glas sichtbar sein. Sie beleuchtet keine undurchsichtigen Flächen. Schalte indirekte Beleuchtung ein, um sie als Szenenlicht zu nutzen.",
|
||||
"render.cpu_constant_enable_indirect_plan": "Pfadtiefe {depth}; progressives Sampling mit {spp} Samples/Pixel (Seed {seed}); ein Primärstrahl pro Sample; Raytracing-Schatten. Bildgröße, CPU-Budget und andere Einstellungen bleiben erhalten.",
|
||||
"render.cpu_indirect_method_required": "Wähle CPU-Raytracing, um diesen Modus für indirekte Beleuchtung einzuschalten."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_constant_direct_help": "Without Indirect lighting, this constant source can appear in reflections and through Glass. It does not light opaque surfaces. Enable Indirect lighting to use it for scene lighting.",
|
||||
"render.cpu_constant_enable_indirect_plan": "Path depth {depth}; progressive sampling at {spp} samples/pixel (seed {seed}); one primary ray per sample; traced shadows. Keeps your image size, CPU budget and other settings.",
|
||||
"render.cpu_indirect_method_required": "Choose CPU ray tracing to enable this Indirect lighting mode."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_constant_direct_help": "ללא תאורה עקיפה, מקור קבוע זה עשוי להופיע בהשתקפויות ודרך זכוכית. הוא אינו מאיר משטחים אטומים. יש להפעיל תאורה עקיפה כדי להשתמש בו לתאורת הסצנה.",
|
||||
"render.cpu_constant_enable_indirect_plan": "עומק מסלול {depth}; דגימה הדרגתית עם {spp} דגימות לפיקסל (זרע {seed}); קרן ראשית אחת לכל דגימה; צללים במעקב קרניים. גודל התמונה, תקציב ה־CPU וההגדרות האחרות נשמרים.",
|
||||
"render.cpu_indirect_method_required": "יש לבחור מעקב קרניים ב־CPU כדי להפעיל מצב זה של תאורה עקיפה."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_constant_direct_help": "間接照明を使わない場合、この一定の光源は反射やガラス越しに見えることがありますが、不透明な面は照らしません。シーンの照明に使うには、間接照明を有効にしてください。",
|
||||
"render.cpu_constant_enable_indirect_plan": "パスの深さ {depth}、ピクセルあたり {spp} サンプルのプログレッシブサンプリング(シード {seed})、各サンプルに一次レイ1本、レイトレーシングの影を使用します。画像サイズ、CPU予算、その他の設定は保持します。",
|
||||
"render.cpu_indirect_method_required": "この間接照明モードを有効にするには、CPUレイトレーシングを選択してください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_constant_direct_help": "간접 조명이 꺼져 있으면 이 일정한 광원은 반사나 유리를 통해 보일 수 있지만 불투명한 표면을 밝히지는 않습니다. 장면 조명으로 사용하려면 간접 조명을 켜세요.",
|
||||
"render.cpu_constant_enable_indirect_plan": "경로 깊이 {depth}, 픽셀당 {spp}개 샘플의 점진적 샘플링(시드 {seed}), 샘플당 기본 광선 1개, 추적된 그림자를 사용합니다. 이미지 크기, CPU 예산 및 다른 설정을 유지합니다.",
|
||||
"render.cpu_indirect_method_required": "이 간접 조명 모드를 켜려면 CPU 레이 트레이싱을 선택하세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_constant_direct_help": "Khi tắt Chiếu sáng gián tiếp, nguồn sáng đồng nhất này có thể xuất hiện trong phản xạ và qua Kính nhưng không chiếu sáng các bề mặt đục. Bật Chiếu sáng gián tiếp để dùng nguồn này chiếu sáng cảnh.",
|
||||
"render.cpu_constant_enable_indirect_plan": "Độ sâu đường đi {depth}; lấy mẫu tăng dần với {spp} mẫu/pixel (hạt giống {seed}); một tia sơ cấp cho mỗi mẫu; bóng đổ dò tia. Giữ kích thước ảnh, ngân sách CPU và các cài đặt khác.",
|
||||
"render.cpu_indirect_method_required": "Chọn dò tia CPU để bật chế độ Chiếu sáng gián tiếp này."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_constant_direct_help": "未启用间接照明时,此恒定光源可能出现在反射中或透过玻璃可见,但不会照亮不透明表面。要用它照亮场景,请启用间接照明。",
|
||||
"render.cpu_constant_enable_indirect_plan": "路径深度 {depth};每像素 {spp} 个样本的渐进采样(种子 {seed});每个样本一条主光线;光线追踪阴影。保留图像尺寸、CPU预算和其他设置。",
|
||||
"render.cpu_indirect_method_required": "请选择CPU光线追踪以启用此间接照明模式。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_glass_enable_path": "تشغيل الإضاءة غير المباشرة",
|
||||
"render.cpu_path_depth": "عمق المسار",
|
||||
"render.cpu_path_help": "تحسب الضوء المرتد بين الأسطح المعتمة والمار عبر أشكال الزجاج المدعومة. تتطلب التصيير التدريجي وظلال تتبع الأشعة. يحسب عمق المسار الأسطح المضاءة وحدود الزجاج وأحداث التشتت بدءاً من أول تقاطع (1–16). يقتصر العمق 1 على الإضاءة المباشرة للأسطح المعتمة؛ وتسمح القيم الأعلى بمزيد من الارتدادات أو عبور الزجاج وقد تستغرق وقتاً أطول. أوقف الإضاءة غير المباشرة لاستخدام الانعكاسات المخصصة أو التباين الاتجاهي.",
|
||||
"render.cpu_path_lighting": "إضاءة غير مباشرة",
|
||||
"render.cpu_path_optics_reason": "تبقى إعداداتك كما هي. أوقف الإضاءة غير المباشرة لاستخدام الانعكاسات المخصصة أو التباين الاتجاهي."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_glass_enable_path": "Indirekte Beleuchtung einschalten",
|
||||
"render.cpu_path_depth": "Pfadtiefe",
|
||||
"render.cpu_path_help": "Berechnet Licht, das zwischen undurchsichtigen Flächen und durch unterstützte Glasformen läuft. Erfordert progressives Rendern und Raytracing-Schatten. Die Pfadtiefe zählt beleuchtete Flächen, Glasgrenzen und Streuereignisse ab dem ersten Treffer (1–16). Tiefe 1 liefert direkte Beleuchtung auf undurchsichtigen Flächen; höhere Werte erlauben mehr Reflexionen oder Glasdurchgänge und können länger dauern. Für eigene Reflexionen oder Anisotropie die indirekte Beleuchtung ausschalten.",
|
||||
"render.cpu_path_lighting": "Indirekte Beleuchtung",
|
||||
"render.cpu_path_optics_reason": "Die Einstellungen bleiben erhalten. Für eigene Reflexionen oder Anisotropie die indirekte Beleuchtung ausschalten."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_glass_enable_path": "Enable Indirect lighting",
|
||||
"render.cpu_path_depth": "Path depth",
|
||||
"render.cpu_path_help": "Adds light bouncing between opaque surfaces and through supported Glass shapes. Requires progressive rendering and traced shadows. Path depth counts shaded surfaces, Glass boundaries and scattering events, starting with the first hit (1–16). Depth 1 gives direct lighting on opaque surfaces; higher values allow more bounces or Glass crossings and may take longer. Turn off Indirect lighting to use custom reflections or anisotropy.",
|
||||
"render.cpu_path_lighting": "Indirect lighting",
|
||||
"render.cpu_path_optics_reason": "Your settings are kept. Turn off Indirect lighting to use custom reflections or anisotropy."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_glass_enable_path": "הפעלת תאורה עקיפה",
|
||||
"render.cpu_path_depth": "עומק מסלול",
|
||||
"render.cpu_path_help": "מחשבת אור שמוחזר בין משטחים אטומים ועובר דרך צורות זכוכית נתמכות. נדרשים רינדור הדרגתי וצללים במעקב קרניים. עומק המסלול סופר משטחים מוצללים, גבולות זכוכית ואירועי פיזור החל מהמפגש הראשון (1–16). עומק 1 נותן תאורה ישירה למשטחים אטומים; ערכים גבוהים מאפשרים יותר החזרות או מעברים בזכוכית ועשויים לדרוש יותר זמן. יש לכבות תאורה עקיפה כדי להשתמש בהשתקפויות מותאמות או באנאיזוטרופיה.",
|
||||
"render.cpu_path_lighting": "תאורה עקיפה",
|
||||
"render.cpu_path_optics_reason": "ההגדרות שלך נשמרות. יש לכבות תאורה עקיפה כדי להשתמש בהשתקפויות מותאמות או באנאיזוטרופיה."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_glass_enable_path": "間接照明を有効にする",
|
||||
"render.cpu_path_depth": "パス深度",
|
||||
"render.cpu_path_help": "不透明な面の間で反射し、対応するガラス形状を通る光を計算します。プログレッシブ描画とレイトレーシングの影が必要です。パス深度は最初の交点から、照明を計算する面、ガラス境界、散乱イベントを数えます(1~16)。深度1は不透明面の直接照明のみです。値を上げると反射やガラスの通過を増やせますが、時間がかかる場合があります。独自の反射設定や異方性を使うには間接照明をオフにしてください。",
|
||||
"render.cpu_path_lighting": "間接照明",
|
||||
"render.cpu_path_optics_reason": "設定は保持されます。独自の反射設定や異方性を使うには間接照明をオフにしてください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_glass_enable_path": "간접 조명 켜기",
|
||||
"render.cpu_path_depth": "경로 깊이",
|
||||
"render.cpu_path_help": "불투명 표면 사이에서 반사되고 지원되는 유리 형상을 통과하는 빛을 계산합니다. 점진적 렌더링과 레이 추적 그림자가 필요합니다. 경로 깊이는 첫 교점부터 조명이 계산되는 표면, 유리 경계 및 산란 이벤트를 셉니다(1–16). 깊이 1은 불투명 표면의 직접 조명만 계산합니다. 값을 높이면 반사나 유리 통과가 늘어나며 시간이 더 걸릴 수 있습니다. 사용자 반사 설정이나 이방성을 사용하려면 간접 조명을 끄세요.",
|
||||
"render.cpu_path_lighting": "간접 조명",
|
||||
"render.cpu_path_optics_reason": "설정은 유지됩니다. 사용자 반사 설정이나 이방성을 사용하려면 간접 조명을 끄세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_glass_enable_path": "Bật Chiếu sáng gián tiếp",
|
||||
"render.cpu_path_depth": "Độ sâu đường truyền",
|
||||
"render.cpu_path_help": "Tính ánh sáng phản xạ giữa các bề mặt đục và truyền qua các hình kính được hỗ trợ. Cần kết xuất lũy tiến và bóng dò tia. Độ sâu đường đi đếm các bề mặt được chiếu sáng, ranh giới kính và các sự kiện tán xạ từ giao điểm đầu tiên (1–16). Độ sâu 1 chỉ chiếu sáng trực tiếp bề mặt đục; giá trị cao hơn cho phép thêm lần phản xạ hoặc xuyên kính và có thể lâu hơn. Tắt Chiếu sáng gián tiếp để dùng phản xạ tùy chỉnh hoặc dị hướng.",
|
||||
"render.cpu_path_lighting": "Chiếu sáng gián tiếp",
|
||||
"render.cpu_path_optics_reason": "Các thiết lập được giữ nguyên. Tắt Chiếu sáng gián tiếp để dùng phản xạ tùy chỉnh hoặc dị hướng."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_glass_enable_path": "启用间接照明",
|
||||
"render.cpu_path_depth": "路径深度",
|
||||
"render.cpu_path_help": "计算在不透明表面之间反射并穿过受支持玻璃形状的光。需要渐进渲染和光线追踪阴影。路径深度从首次相交开始计算着色表面、玻璃边界和散射事件(1–16)。深度 1 只计算不透明表面的直接照明;更高的值允许更多反射或玻璃穿越,也可能耗时更长。使用自定义反射或各向异性时,请关闭间接照明。",
|
||||
"render.cpu_path_lighting": "间接照明",
|
||||
"render.cpu_path_optics_reason": "设置会保留。使用自定义反射或各向异性时,请关闭间接照明。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"en": {
|
||||
"render.cpu_quality_budget_help": "Changes size, production sample cap, seed and CPU resource profile. Camera, lens, lighting, GI depth and effects are kept.",
|
||||
"render.cpu_quality_progressive_required": "Enable progressive sampling below before choosing a CPU budget.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · {samples} sample cap · seed {seed} · {profile}"
|
||||
},
|
||||
"ar": {
|
||||
"render.cpu_quality_budget_help": "يغير الحجم وحد عينات الإنتاج والبذرة وملف موارد CPU. تُحفظ الكاميرا والعدسة والإضاءة وعمق GI والتأثيرات.",
|
||||
"render.cpu_quality_progressive_required": "فعّل أخذ العينات التدريجي أدناه قبل اختيار ميزانية CPU.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · حد العينات {samples} · البذرة {seed} · {profile}"
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_quality_budget_help": "Ändert Größe, Obergrenze der Produktionssamples, Startwert und CPU-Ressourcenprofil. Kamera, Objektiv, Beleuchtung, GI-Tiefe und Effekte bleiben erhalten.",
|
||||
"render.cpu_quality_progressive_required": "Aktiviere unten progressive Samples, bevor du ein CPU-Budget auswählst.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · Sample-Grenze {samples} · Startwert {seed} · {profile}"
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_quality_budget_help": "משנה גודל, תקרת דגימות הפקה, זרע ופרופיל משאבי CPU. המצלמה, העדשה, התאורה, עומק GI והאפקטים נשמרים.",
|
||||
"render.cpu_quality_progressive_required": "יש להפעיל דגימה מתקדמת למטה לפני בחירת תקציב CPU.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · תקרת דגימות {samples} · זרע {seed} · {profile}"
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_quality_budget_help": "サイズ、本番サンプル数の上限、シード、CPUリソースプロファイルを変更します。カメラ、レンズ、照明、GI深度、エフェクトは維持されます。",
|
||||
"render.cpu_quality_progressive_required": "CPU予算を選ぶ前に、下でプログレッシブサンプリングを有効にしてください。",
|
||||
"render.cpu_quality_summary": "{width} × {height} · サンプル上限 {samples} · シード {seed} · {profile}"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_quality_budget_help": "크기, 제작 샘플 상한, 시드와 CPU 리소스 프로필을 변경합니다. 카메라, 렌즈, 조명, GI 깊이와 효과는 유지됩니다.",
|
||||
"render.cpu_quality_progressive_required": "CPU 예산을 선택하기 전에 아래에서 점진적 샘플링을 활성화하세요.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · 샘플 상한 {samples} · 시드 {seed} · {profile}"
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_quality_budget_help": "Thay đổi kích thước, trần mẫu sản xuất, hạt giống và cấu hình tài nguyên CPU. Giữ nguyên máy ảnh, ống kính, ánh sáng, độ sâu GI và hiệu ứng.",
|
||||
"render.cpu_quality_progressive_required": "Bật lấy mẫu tiến dần bên dưới trước khi chọn ngân sách CPU.",
|
||||
"render.cpu_quality_summary": "{width} × {height} · trần mẫu {samples} · hạt giống {seed} · {profile}"
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_quality_budget_help": "更改尺寸、正式样本上限、种子和CPU资源配置。保留相机、镜头、照明、GI深度和效果。",
|
||||
"render.cpu_quality_progressive_required": "选择CPU预算前,请先在下方启用渐进采样。",
|
||||
"render.cpu_quality_summary": "{width} × {height} · 样本上限 {samples} · 种子 {seed} · {profile}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.appearance_editor.discard_saved_edit": "تجاهل التعديلات البصرية غير المحفوظة",
|
||||
"render.cpu_subsurface_denoise_reason": "يتطلب التشتت داخل الزجاج على CPU إيقاف إزالة الضجيج. تبقى إعداداتك محفوظة.",
|
||||
"render.cpu_subsurface_help": "يغيّر التشتت اتجاه الضوء داخل الزجاج المغلق. تتطلب المعدلات الموجبة إضاءة غير مباشرة مع إيقاف إزالة الضجيج. المعدل هو عدد التصادمات لكل مم؛ لا يضيف الصفر أي تشتت. يفضّل انحياز الاتجاه الموجب الأمام، والسالب الخلف.",
|
||||
"render.material_cpu_glass_only": "تتطلب خرائط ملفات الصور المؤقتة GPU. يمكن لـCPU استخدام خرائط الأسطح المضمنة المحفوظة.",
|
||||
"render.material_cpu_optics_limits": "شغّل الإضاءة غير المباشرة لأشكال الزجاج المغلقة المدعومة والتداخل المتحقق منه والتشتت داخل الزجاج. يمكن للصفائح الرقيقة تمرير الضوء للظلال. وإلا فاستخدم صفيحة مستوية أو صندوقًا محاذيًا للمحاور. تظل الأشكال المتلامسة والظلال النافذة عبر الزجاج المغلق غير مدعومة. تبقى قيمك محفوظة.",
|
||||
"render.material_cpu_saved_runtime_conflict": "لا يمكن الجمع بين البصريات المحفوظة على CPU والارتباطات البصرية المؤقتة السابقة. احفظ البصريات التي راجعتها أو أزل الارتباط المؤقت المتعارض.",
|
||||
"render.material_raytrace_required": "يتطلب الزجاج الفيزيائي تتبع الأشعة على CPU أو تتبع المسارات على GPU.",
|
||||
"render.material_saved_edit_pending": "هذه التعديلات البصرية غير محفوظة. احفظ القيم التي راجعتها، أو أزل التعيين المحفوظ، أو تجاهل التعديلات. لا يمكن للارتباطات المؤقتة السابقة والمؤثرات غير المدعومة تجاوز الهدف المحفوظ."
|
||||
},
|
||||
"de": {
|
||||
"render.appearance_editor.discard_saved_edit": "Ungespeicherte Optikänderungen verwerfen",
|
||||
"render.cpu_subsurface_denoise_reason": "Streuung im Glas auf der CPU benötigt ausgeschaltete Rauschreduzierung. Die Einstellungen bleiben erhalten.",
|
||||
"render.cpu_subsurface_help": "Streuung lenkt Licht im Inneren geschlossenen Glases um. Positive Raten benötigen indirekte Beleuchtung ohne Rauschreduzierung. Die Rate zählt Kollisionen pro mm; 0 fügt keine Streuung hinzu. Positive Richtungswerte bevorzugen vorwärts, negative rückwärts.",
|
||||
"render.material_cpu_glass_only": "Temporäre Bilddatei-Karten benötigen die GPU. Die CPU kann gespeicherte integrierte Oberflächenkarten verwenden.",
|
||||
"render.material_cpu_optics_limits": "Indirekte Beleuchtung für unterstützte geschlossene Glasformen, geprüfte Verschachtelung und Streuung im Inneren einschalten. Dünne Scheiben können Licht für Schatten durchlassen. Sonst eine ebene Scheibe oder achsenparallele Box verwenden. Berührende Formen und durch geschlossenes Glas übertragene Schatten werden weiterhin nicht unterstützt. Die Werte bleiben erhalten.",
|
||||
"render.material_cpu_saved_runtime_conflict": "Gespeicherte CPU-Optik kann nicht mit temporären optischen Bindungen kombiniert werden. Geprüfte Optik speichern oder die temporäre Bindung entfernen.",
|
||||
"render.material_raytrace_required": "Physikalisches Glas benötigt CPU-Raytracing oder GPU-Pathtracing.",
|
||||
"render.material_saved_edit_pending": "Diese Optikänderungen sind ungespeichert. Geprüfte Werte speichern, die gespeicherte Zuordnung entfernen oder Änderungen verwerfen. Temporäre Bindungen und nicht unterstützte Effekte können das gespeicherte Ziel nicht überschreiben."
|
||||
},
|
||||
"en": {
|
||||
"render.appearance_editor.discard_saved_edit": "Discard unsaved optical edits",
|
||||
"render.cpu_subsurface_denoise_reason": "CPU subsurface scattering needs Denoise off. Your settings are kept.",
|
||||
"render.cpu_subsurface_help": "Scattering redirects light inside closed Glass. Positive rates need Indirect lighting with Denoise off. The rate is collisions per mm; 0 adds no scattering. Positive phase bias favors forward directions; negative favors backward.",
|
||||
"render.material_cpu_glass_only": "Temporary image-file maps require GPU. CPU can use saved built-in surface maps.",
|
||||
"render.material_cpu_optics_limits": "Turn on Indirect lighting for supported closed Glass shapes, certified nesting and subsurface scattering. Thin sheets can pass shadows. Otherwise use a planar sheet or axis-aligned box. Touching shapes and transmitted shadows through closed Glass remain unsupported. Your values are kept.",
|
||||
"render.material_cpu_saved_runtime_conflict": "Saved CPU optics cannot combine with legacy temporary optical bindings. Save the reviewed optics or remove the conflicting temporary binding.",
|
||||
"render.material_raytrace_required": "Physical Glass requires CPU ray tracing or GPU path tracing.",
|
||||
"render.material_saved_edit_pending": "These optical edits are unsaved. Save reviewed values, remove the saved assignment, or discard the edits. Legacy temporary bindings and unsupported effects cannot override the saved target."
|
||||
},
|
||||
"he": {
|
||||
"render.appearance_editor.discard_saved_edit": "ביטול שינויים אופטיים שלא נשמרו",
|
||||
"render.cpu_subsurface_denoise_reason": "פיזור בתוך זכוכית ב־CPU דורש הסרת רעש כבויה. ההגדרות נשמרות.",
|
||||
"render.cpu_subsurface_help": "פיזור משנה את כיוון האור בתוך זכוכית סגורה. קצב חיובי דורש תאורה עקיפה והסרת רעש כבויה. הקצב הוא מספר התנגשויות למ״מ; 0 אינו מוסיף פיזור. הטיית כיוון חיובית מעדיפה קדימה, ושלילית אחורה.",
|
||||
"render.material_cpu_glass_only": "מפות זמניות מקובצי תמונה דורשות GPU. ב־CPU אפשר להשתמש במפות משטח מובנות שנשמרו.",
|
||||
"render.material_cpu_optics_limits": "יש להפעיל תאורה עקיפה לצורות זכוכית סגורות נתמכות, לקינון שנבדק ולפיזור בתוך הזכוכית. יריעות דקות יכולות להעביר אור לצללים. אחרת יש להשתמש ביריעה מישורית או בתיבה מקבילה לצירים. צורות נוגעות וצללים העוברים בזכוכית סגורה עדיין אינם נתמכים. הערכים נשמרים.",
|
||||
"render.material_cpu_saved_runtime_conflict": "אי אפשר לשלב הגדרות אופטיות שמורות ב־CPU עם הקישורים האופטיים הזמניים הישנים. יש לשמור את ההגדרות שנבדקו או להסיר את הקישור הזמני המתנגש.",
|
||||
"render.material_raytrace_required": "זכוכית פיזיקלית דורשת עקיבת קרניים ב־CPU או עקיבת נתיבים ב־GPU.",
|
||||
"render.material_saved_edit_pending": "השינויים האופטיים האלה לא נשמרו. יש לשמור את הערכים שנבדקו, להסיר את ההקצאה השמורה או לבטל את השינויים. קישורים זמניים ישנים ואפקטים שאינם נתמכים אינם יכולים לעקוף את היעד השמור."
|
||||
},
|
||||
"ja": {
|
||||
"render.appearance_editor.discard_saved_edit": "未保存の光学設定の変更を破棄",
|
||||
"render.cpu_subsurface_denoise_reason": "CPUの内部散乱ではノイズ除去をオフにしてください。設定値は保持されます。",
|
||||
"render.cpu_subsurface_help": "散乱は閉じたガラスの内部で光の方向を変えます。正の値には間接照明を使い、ノイズ除去をオフにします。率は1mmあたりの衝突回数です。0では散乱を加えません。方向の偏りが正なら前方、負なら後方を優先します。",
|
||||
"render.material_cpu_glass_only": "一時画像ファイルのマップにはGPUが必要です。CPUでは保存済みの組み込み表面マップを使用できます。",
|
||||
"render.material_cpu_optics_limits": "対応する閉じたガラス形状、検証済みの入れ子形状、内部散乱には間接照明をオンにしてください。薄いシートは影に光を透過できます。それ以外は平面シートか軸平行の箱を使います。接触する形状と閉じたガラスを通る透過影には未対応です。値は保持されます。",
|
||||
"render.material_cpu_saved_runtime_conflict": "保存済みCPU光学設定と一時的な光学割り当ては併用できません。確認した設定を保存するか、競合する一時割り当てを削除してください。",
|
||||
"render.material_raytrace_required": "物理ガラスにはCPUレイトレーシングまたはGPUパストレーシングが必要です。",
|
||||
"render.material_saved_edit_pending": "光学設定の変更は未保存です。確認した値を保存するか、保存済み割り当てを削除するか、変更を破棄してください。一時割り当てや未対応の効果で保存済み対象を上書きできません。"
|
||||
},
|
||||
"ko": {
|
||||
"render.appearance_editor.discard_saved_edit": "저장하지 않은 광학 편집 버리기",
|
||||
"render.cpu_subsurface_denoise_reason": "CPU 내부 산란을 사용하려면 노이즈 제거를 끄세요. 설정은 유지됩니다.",
|
||||
"render.cpu_subsurface_help": "산란은 닫힌 유리 내부에서 빛의 방향을 바꿉니다. 양수 비율에는 간접광을 사용하고 노이즈 제거를 끄세요. 비율은 mm당 충돌 횟수이며, 0은 산란을 추가하지 않습니다. 방향 편향이 양수이면 전방, 음수이면 후방을 선호합니다.",
|
||||
"render.material_cpu_glass_only": "임시 이미지 파일 맵에는 GPU가 필요합니다. CPU는 저장된 내장 표면 맵을 사용할 수 있습니다.",
|
||||
"render.material_cpu_optics_limits": "지원되는 닫힌 유리 형상, 검증된 중첩 및 내부 산란에는 간접 조명을 켜세요. 얇은 시트는 그림자에 빛을 통과시킬 수 있습니다. 그 외에는 평면 시트나 축 정렬 상자를 사용하세요. 서로 닿는 형상과 닫힌 유리를 통과하는 투과 그림자는 아직 지원하지 않습니다. 값은 유지됩니다.",
|
||||
"render.material_cpu_saved_runtime_conflict": "저장된 CPU 광학 설정은 임시 광학 바인딩과 함께 사용할 수 없습니다. 검토한 설정을 저장하거나 충돌하는 임시 바인딩을 제거하세요.",
|
||||
"render.material_raytrace_required": "물리 유리에는 CPU 레이 트레이싱이나 GPU 패스 트레이싱이 필요합니다.",
|
||||
"render.material_saved_edit_pending": "광학 편집을 아직 저장하지 않았습니다. 검토한 값을 저장하거나 저장된 할당을 제거하거나 편집을 버리세요. 임시 바인딩과 지원하지 않는 효과는 저장된 대상을 덮어쓸 수 없습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.appearance_editor.discard_saved_edit": "Hủy chỉnh sửa quang học chưa lưu",
|
||||
"render.cpu_subsurface_denoise_reason": "Tán xạ bên trong kính trên CPU cần tắt Khử nhiễu. Các cài đặt được giữ nguyên.",
|
||||
"render.cpu_subsurface_help": "Tán xạ đổi hướng ánh sáng bên trong kính kín. Tốc độ dương cần Chiếu sáng gián tiếp và tắt Khử nhiễu. Tốc độ là số va chạm mỗi mm; 0 không thêm tán xạ. Độ lệch hướng dương ưu tiên phía trước, âm ưu tiên phía sau.",
|
||||
"render.material_cpu_glass_only": "Bản đồ từ tệp ảnh tạm thời yêu cầu GPU. CPU có thể dùng bản đồ bề mặt tích hợp đã lưu.",
|
||||
"render.material_cpu_optics_limits": "Bật Chiếu sáng gián tiếp cho hình kính kín được hỗ trợ, cấu trúc lồng nhau đã kiểm chứng và tán xạ bên trong kính. Tấm mỏng có thể truyền ánh sáng cho bóng. Nếu không, dùng tấm phẳng hoặc hộp thẳng theo trục. Chưa hỗ trợ hình chạm nhau và bóng truyền qua kính kín. Các giá trị được giữ nguyên.",
|
||||
"render.material_cpu_saved_runtime_conflict": "Không thể kết hợp quang học CPU đã lưu với các liên kết quang học tạm thời kiểu cũ. Hãy lưu quang học đã xem xét hoặc xóa liên kết tạm thời xung đột.",
|
||||
"render.material_raytrace_required": "Kính vật lý yêu cầu dò tia trên CPU hoặc dò đường đi trên GPU.",
|
||||
"render.material_saved_edit_pending": "Các chỉnh sửa quang học này chưa được lưu. Hãy lưu các giá trị đã xem xét, xóa phép gán đã lưu hoặc hủy chỉnh sửa. Liên kết tạm thời kiểu cũ và hiệu ứng chưa được hỗ trợ không thể ghi đè đích đã lưu."
|
||||
},
|
||||
"zh": {
|
||||
"render.appearance_editor.discard_saved_edit": "放弃未保存的光学编辑",
|
||||
"render.cpu_subsurface_denoise_reason": "CPU 内部散射需要关闭降噪。设置会保留。",
|
||||
"render.cpu_subsurface_help": "散射会改变闭合玻璃内部的光线方向。正散射率需要开启间接光照并关闭降噪。散射率表示每毫米的碰撞次数;0 不增加散射。方向偏置为正时偏向前方,为负时偏向后方。",
|
||||
"render.material_cpu_glass_only": "临时图像文件贴图需要GPU。CPU可以使用已保存的内置表面贴图。",
|
||||
"render.material_cpu_optics_limits": "启用间接光照可使用受支持的闭合玻璃形状、经验证的嵌套结构及内部散射。薄片可以透射阴影。否则请使用平面薄片或轴对齐盒体。仍不支持相互接触的形状及穿过闭合玻璃的透射阴影。设置值会保留。",
|
||||
"render.material_cpu_saved_runtime_conflict": "已保存的CPU光学设置不能与临时光学绑定组合。请保存已审阅的设置或移除冲突的临时绑定。",
|
||||
"render.material_raytrace_required": "物理玻璃需要CPU光线追踪或GPU路径追踪。",
|
||||
"render.material_saved_edit_pending": "这些光学编辑尚未保存。请保存已审阅的值、移除已保存的分配或放弃编辑。临时绑定和不支持的效果不能覆盖已保存的目标。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_maps_saved_help": "يمكن لتصيير CPU استخدام خرائط الأسطح المعتمة المحفوظة: اختر سطحًا هنا ثم احفظ خرائطه في اللقطة. مع الإضاءة غير المباشرة، يمكن استخدام الزجاج في جسم آخر؛ لا يمكن استخدام الزجاج في الجسم ذي الخرائط. يجب إيقاف الانعكاسات المختارة والتباين الاتجاهي والتأثيرات الإجرائية. تتطلب مسارات ملفات الخرائط المؤقتة GPU."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_maps_saved_help": "CPU-Renderings können gespeicherte Karten undurchsichtiger Flächen verwenden: Oberfläche wählen und die Karten in der Aufnahme speichern. Mit indirekter Beleuchtung darf ein anderer Körper Glas verwenden; der Körper mit Karten darf kein Glas sein. Ausgewählte Reflexionen, Anisotropie und prozedurale Effekte ausschalten. Temporäre Kartendateipfade verwenden die GPU."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_maps_saved_help": "CPU renders can use saved opaque maps: choose a surface here, then Save maps to shot. With Indirect lighting, Glass can be on another body; a mapped body cannot use Glass. Selected reflections, anisotropy and procedural surface effects must be off. Temporary map file paths use GPU."
|
||||
},
|
||||
"es": {
|
||||
"render.cpu_maps_saved_help": "Los renders CPU pueden usar mapas opacos guardados: elige una superficie y guarda sus mapas en la toma. Con Iluminación indirecta, otro cuerpo puede usar Vidrio; el cuerpo con mapas no puede usar Vidrio. Desactiva los reflejos seleccionados, la anisotropía y los efectos procedurales. Las rutas temporales de archivos de mapas usan GPU."
|
||||
},
|
||||
"fr": {
|
||||
"render.cpu_maps_saved_help": "Le rendu CPU accepte les cartes opaques enregistrées : choisissez une surface, puis enregistrez ses cartes dans la vue. Avec l’éclairage indirect, un autre corps peut utiliser Verre ; le corps avec les cartes ne le peut pas. Désactivez les réflexions sélectionnées, l’anisotropie et les effets procéduraux. Les fichiers temporaires de cartes utilisent le GPU."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_maps_saved_help": "רינדור CPU יכול להשתמש במפות אטומות שמורות: בחרו כאן משטח ושמרו את המפות בתצלום. עם תאורה עקיפה, גוף אחר יכול להשתמש בזכוכית; הגוף בעל המפות אינו יכול להשתמש בזכוכית. יש לכבות החזרות שנבחרו, אנאיזוטרופיה ואפקטים פרוצדורליים. נתיבים זמניים לקובצי מפות משתמשים ב־GPU."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_maps_saved_help": "CPUレンダリングは保存された不透明サーフェスマップを使えます。サーフェスを選び、ショットにマップを保存してください。間接光を使う場合、別のボディにはガラスを使えますが、マップを持つボディには使えません。選択した反射、異方性、プロシージャル効果はオフにします。一時的なマップファイルにはGPUを使います。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_maps_saved_help": "CPU 렌더링은 저장한 불투명 표면 맵을 사용할 수 있습니다. 표면을 선택하고 샷에 맵을 저장하세요. 간접광을 사용하면 다른 바디에 유리를 사용할 수 있지만, 맵이 있는 바디에는 유리를 사용할 수 없습니다. 선택 반사, 비등방성 및 절차적 효과는 끄세요. 임시 맵 파일 경로는 GPU를 사용합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_maps_saved_help": "Kết xuất CPU hỗ trợ bản đồ bề mặt đục đã lưu: chọn bề mặt rồi lưu bản đồ vào ảnh chụp. Với chiếu sáng gián tiếp, thân khác có thể dùng kính; thân có bản đồ không thể dùng kính. Tắt phản xạ được chọn, dị hướng và hiệu ứng thủ tục. Đường dẫn tạm tới tệp bản đồ dùng GPU."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_maps_saved_help": "CPU 渲染可使用已保存的不透明表面贴图:在此选择表面,再将贴图保存到镜头。使用间接光照时,其他实体可以使用玻璃;带有贴图的实体不能使用玻璃。请关闭选定的反射、各向异性和程序化表面效果。临时贴图文件路径使用 GPU。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_denoise_help": "يقلل التشويش في كل تحديث للصورة. قد ينعّم التفاصيل الدقيقة وحواف عمق المجال. يبقى EXR الخام دون تغيير. تستخدم تعديلات الصورة المكتملة صورتها الخام ولا تطبّق تقليل التشويش مرة أخرى."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_denoise_help": "Verringert das Rauschen bei jeder Bildaktualisierung. Feine Details und Übergänge der Tiefenschärfe können weicher werden. Die EXR-Rohdaten bleiben unverändert. Nachträgliche Anpassungen eines fertigen Bildes verwenden dessen Rohbild und wenden die Rauschreduzierung nicht erneut an."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_denoise_help": "Reduces noise in every image update. It may soften fine detail and depth-of-field edges. Raw EXR is unchanged. Adjusting a completed image uses its raw image and does not apply noise reduction again."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_denoise_help": "מפחיתה רעש בכל עדכון תמונה. היא עלולה לרכך פרטים עדינים וקצוות של עומק שדה. קובץ EXR הגולמי אינו משתנה. התאמות של תמונה שהושלמה משתמשות בתמונה הגולמית שלה ואינן מחילות שוב הפחתת רעש."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_denoise_help": "画像が更新されるたびにノイズを減らします。細部や被写界深度によるぼけの境界が柔らかくなる場合があります。RAW EXRは変更されません。完成画像の調整にはそのRAW画像を使用し、ノイズ低減は再適用しません。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_denoise_help": "이미지가 갱신될 때마다 노이즈를 줄입니다. 미세한 디테일과 피사계 심도 경계가 부드러워질 수 있습니다. 원본 EXR은 바뀌지 않습니다. 완성된 이미지를 조정할 때는 해당 원본 이미지를 사용하며 노이즈 감소를 다시 적용하지 않습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_denoise_help": "Giảm nhiễu mỗi khi ảnh được cập nhật. Có thể làm mềm chi tiết nhỏ và biên vùng mờ do độ sâu trường ảnh. EXR thô không thay đổi. Khi điều chỉnh ảnh đã hoàn tất, hệ thống dùng ảnh thô của ảnh đó và không áp dụng giảm nhiễu lần nữa."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_denoise_help": "每次图像更新时减少噪点,可能使细节和景深模糊边缘变柔。原始EXR保持不变。调整已完成的图像时使用其原始图像,不会再次降噪。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_studio_enable": "تفعيل الإضاءة غير المباشرة لهذا التوزيع",
|
||||
"render.cpu_studio_enable_apply": "تفعيل الإضاءة غير المباشرة وتطبيقها",
|
||||
"render.cpu_studio_indirect_help": "يحتاج توزيع الشمس هذا إلى إضاءة غير مباشرة بعمق 8 وظلال متتبعة وعينة كاميرا واحدة لكل مرور. إذا كان التصيير التدريجي معطلاً، يبدأ بـ 16 عينة لكل بكسل وبذرة 0. تُحفظ الإعدادات التدريجية الحالية وملف الموارد. تمنع الإعدادات غير المتوافقة التطبيق دون تغييرها.",
|
||||
"render.cpu_studio_radiance_limit": "سطوع المصدر المساحي في هذا التوزيع هو {radiance}، ويتجاوز حد CPU البالغ 64. تُحفظ الإضاءة المؤلَّفة؛ اختر توزيعاً آخر أو GPU."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_studio_enable": "Indirekte Beleuchtung für dieses Lichtset aktivieren",
|
||||
"render.cpu_studio_enable_apply": "Indirekte Beleuchtung aktivieren und anwenden",
|
||||
"render.cpu_studio_indirect_help": "Dieses Sonnen-Lichtset benötigt indirekte Beleuchtung mit Tiefe 8, verfolgte Schatten und eine Kamerastichprobe pro Durchlauf. Ist progressives Rendern ausgeschaltet, beginnt es mit 16 Stichproben pro Pixel und Startwert 0. Vorhandene progressive Einstellungen und das Ressourcenprofil bleiben erhalten. Unvereinbare Einstellungen verhindern die Anwendung, ohne sie zu ändern.",
|
||||
"render.cpu_studio_radiance_limit": "Dieses Lichtset hat eine Flächenstrahldichte von {radiance}, über der CPU-Grenze von 64. Die vorgegebene Beleuchtung bleibt erhalten; wählen Sie ein anderes Lichtset oder GPU."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_studio_enable": "Enable indirect lighting for this rig",
|
||||
"render.cpu_studio_enable_apply": "Enable indirect lighting and apply",
|
||||
"render.cpu_studio_indirect_help": "This Sun rig needs indirect lighting at depth 8, traced shadows and one camera sample per pass. If progressive rendering is off, it starts at 16 samples per pixel with seed 0. Existing progressive settings and the resource profile are kept. Incompatible settings stop the apply without changing them.",
|
||||
"render.cpu_studio_radiance_limit": "This rig has area radiance {radiance}, above the CPU limit of 64. Its authored lighting is kept; choose another rig or GPU."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_studio_enable": "הפעלת תאורה עקיפה עבור מערך זה",
|
||||
"render.cpu_studio_enable_apply": "הפעלת תאורה עקיפה והחלה",
|
||||
"render.cpu_studio_indirect_help": "מערך השמש הזה דורש תאורה עקיפה בעומק 8, צללים מחושבים ודגימת מצלמה אחת בכל מעבר. אם רינדור הדרגתי כבוי, הוא מתחיל ב־16 דגימות לפיקסל עם זרע 0. הגדרות הדרגתיות קיימות ופרופיל המשאבים נשמרים. הגדרות שאינן תואמות עוצרות את ההחלה בלי לשנותן.",
|
||||
"render.cpu_studio_radiance_limit": "עוצמת מקור השטח במערך זה היא {radiance}, מעל מגבלת CPU של 64. התאורה המקורית נשמרת; בחרו מערך אחר או GPU."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_studio_enable": "このリグで間接照明を有効にする",
|
||||
"render.cpu_studio_enable_apply": "間接照明を有効にして適用",
|
||||
"render.cpu_studio_indirect_help": "この太陽リグには深度8の間接照明、追跡した影、パスごとに1つのカメラサンプルが必要です。プログレッシブ描画がオフなら、ピクセルごと16サンプル、シード0で開始します。既存のプログレッシブ設定とリソースプロファイルは維持します。非対応の設定がある場合は変更せず適用を中止します。",
|
||||
"render.cpu_studio_radiance_limit": "このリグの面光源の放射輝度は{radiance}で、CPU上限64を超えます。作成された照明は維持します。別のリグかGPUを選んでください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_studio_enable": "이 리그의 간접 조명 켜기",
|
||||
"render.cpu_studio_enable_apply": "간접 조명을 켜고 적용",
|
||||
"render.cpu_studio_indirect_help": "이 태양 리그에는 깊이 8의 간접 조명, 추적된 그림자, 패스당 카메라 샘플 1개가 필요합니다. 점진적 렌더링이 꺼져 있으면 픽셀당 샘플 16개와 시드 0으로 시작합니다. 기존 점진적 설정과 리소스 프로필은 유지됩니다. 호환되지 않는 설정은 변경하지 않고 적용을 중단합니다.",
|
||||
"render.cpu_studio_radiance_limit": "이 리그의 면 광원 방사 휘도 {radiance}은(는) CPU 한도 64를 넘습니다. 작성된 조명은 유지됩니다. 다른 리그나 GPU를 선택하세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_studio_enable": "Bật chiếu sáng gián tiếp cho bộ đèn này",
|
||||
"render.cpu_studio_enable_apply": "Bật chiếu sáng gián tiếp và áp dụng",
|
||||
"render.cpu_studio_indirect_help": "Bộ đèn Mặt Trời này cần chiếu sáng gián tiếp với độ sâu 8, bóng được truy vết và một mẫu máy ảnh mỗi lượt. Nếu kết xuất tăng dần đang tắt, bắt đầu với 16 mẫu mỗi điểm ảnh và hạt giống 0. Giữ nguyên thiết lập tăng dần và hồ sơ tài nguyên hiện có. Thiết lập không tương thích sẽ ngăn áp dụng mà không thay đổi chúng.",
|
||||
"render.cpu_studio_radiance_limit": "Độ chói bức xạ đèn diện tích của bộ này là {radiance}, vượt giới hạn CPU 64. Giữ nguyên ánh sáng đã tạo; hãy chọn bộ đèn khác hoặc GPU."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_studio_enable": "为此灯组启用间接光照",
|
||||
"render.cpu_studio_enable_apply": "启用间接光照并应用",
|
||||
"render.cpu_studio_indirect_help": "此太阳灯组需要深度为8的间接光照、追踪阴影,以及每轮一个相机采样。如果渐进渲染关闭,则以每像素16个采样和种子0开始。保留现有渐进设置和资源配置。不兼容的设置会阻止应用,且不会被更改。",
|
||||
"render.cpu_studio_radiance_limit": "此灯组的面光源辐射亮度为{radiance},超过CPU上限64。保留原有灯光,请选择其他灯组或GPU。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_celestial_adopt": "تتبع الأشعة على المعالج مع إضاءة غير مباشرة · عمق المسار {depth} · {spp} عينة لكل بكسل · ظلال متتبعة · بذرة {seed} · عينة أولية واحدة",
|
||||
"render.cpu_celestial_adopt_label": "تتبع الأشعة على المعالج مع إضاءة غير مباشرة",
|
||||
"render.cpu_celestial_path_required": "تستخدم الشمس المحدودة والسماء المتدرجة الإضاءة غير المباشرة على المعالج.",
|
||||
"render.cpu_celestial_switch": "اختر تتبع الأشعة على المعالج مع الإضاءة غير المباشرة للاحتفاظ بهذه الشمس أو السماء.",
|
||||
"render.cpu_celestial_unportable": "أبقِ تتبع المسارات على المعالج الرسومي لإعدادات عينات النفاذ الحالية.",
|
||||
"render.cpu_sky_bounds": "يجب أن يكون دوران السماء محدودًا ضمن ±1,000,000 راديان، وأن تكون الشدة بين 0 و100."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_celestial_adopt": "CPU-Raytracing mit indirekter Beleuchtung · Pfadtiefe {depth} · {spp} SPP · verfolgte Schatten · Seed {seed} · 1 Primärsample",
|
||||
"render.cpu_celestial_adopt_label": "CPU-Raytracing mit indirekter Beleuchtung",
|
||||
"render.cpu_celestial_path_required": "Endliche Sonne und Verlaufshimmel verwenden indirekte CPU-Beleuchtung.",
|
||||
"render.cpu_celestial_switch": "Wähle CPU-Raytracing mit indirekter Beleuchtung, um diese Sonne oder diesen Himmel beizubehalten.",
|
||||
"render.cpu_celestial_unportable": "Behalte GPU-Pathtracing für die aktuellen Transmissions-Sample-Einstellungen bei.",
|
||||
"render.cpu_sky_bounds": "Die Himmelsrotation muss endlich innerhalb ±1.000.000 Radiant liegen; die Intensität muss 0–100 sein."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_celestial_adopt": "CPU ray tracing with indirect lighting · path depth {depth} · {spp} SPP · traced shadows · seed {seed} · 1 primary sample",
|
||||
"render.cpu_celestial_adopt_label": "CPU ray tracing with indirect lighting",
|
||||
"render.cpu_celestial_path_required": "Finite Sun and gradient Sky use CPU indirect lighting.",
|
||||
"render.cpu_celestial_switch": "Choose CPU ray tracing with indirect lighting to keep this Sun or Sky.",
|
||||
"render.cpu_celestial_unportable": "Keep GPU path tracing for the current transmission sample settings.",
|
||||
"render.cpu_sky_bounds": "Sky rotation must be finite within ±1,000,000 radians; intensity must be 0–100."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_celestial_adopt": "מעקב קרניים במעבד עם תאורה עקיפה · עומק מסלול {depth} · {spp} דגימות לפיקסל · צללים במעקב · זרע {seed} · דגימה ראשית אחת",
|
||||
"render.cpu_celestial_adopt_label": "מעקב קרניים במעבד עם תאורה עקיפה",
|
||||
"render.cpu_celestial_path_required": "שמש בעלת גודל סופי ושמיים מדורגים משתמשים בתאורה עקיפה במעבד.",
|
||||
"render.cpu_celestial_switch": "כדי לשמור על השמש או השמיים האלה, יש לבחור מעקב קרניים במעבד עם תאורה עקיפה.",
|
||||
"render.cpu_celestial_unportable": "יש לשמור על מעקב מסלולים במעבד הגרפי עבור הגדרות דגימות ההעברה הנוכחיות.",
|
||||
"render.cpu_sky_bounds": "סיבוב השמיים חייב להיות סופי בטווח ±1,000,000 רדיאנים, והעוצמה חייבת להיות בטווח 0–100."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_celestial_adopt": "間接照明付き CPU レイトレーシング · パス深度 {depth} · {spp} SPP · 追跡シャドウ · シード {seed} · プライマリサンプル1個",
|
||||
"render.cpu_celestial_adopt_label": "間接照明付き CPU レイトレーシング",
|
||||
"render.cpu_celestial_path_required": "有限の太陽とグラデーション空は CPU の間接照明を使用します。",
|
||||
"render.cpu_celestial_switch": "この太陽や空を維持するには、間接照明を使用する CPU レイトレーシングを選択してください。",
|
||||
"render.cpu_celestial_unportable": "現在の透過サンプル設定には GPU パストレーシングを使用してください。",
|
||||
"render.cpu_sky_bounds": "空の回転は ±1,000,000 ラジアン以内の有限値、強度は 0~100 にしてください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_celestial_adopt": "간접 조명을 사용하는 CPU 레이 트레이싱 · 경로 깊이 {depth} · {spp} SPP · 추적 그림자 · 시드 {seed} · 기본 샘플1개",
|
||||
"render.cpu_celestial_adopt_label": "간접 조명을 사용하는 CPU 레이 트레이싱",
|
||||
"render.cpu_celestial_path_required": "유한 태양과 그라데이션 하늘은 CPU 간접 조명을 사용합니다.",
|
||||
"render.cpu_celestial_switch": "이 태양 또는 하늘을 유지하려면 간접 조명을 사용하는 CPU 레이 트레이싱을 선택하세요.",
|
||||
"render.cpu_celestial_unportable": "현재 투과 샘플 설정에는 GPU 경로 추적을 유지하세요.",
|
||||
"render.cpu_sky_bounds": "하늘 회전은 ±1,000,000 라디안 이내의 유한 값이어야 하며 강도는 0~100이어야 합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_celestial_adopt": "Dò tia CPU với chiếu sáng gián tiếp · độ sâu đường đi {depth} · {spp} SPP · bóng đổ dò tia · seed {seed} · 1 mẫu chính",
|
||||
"render.cpu_celestial_adopt_label": "Dò tia CPU với chiếu sáng gián tiếp",
|
||||
"render.cpu_celestial_path_required": "Mặt Trời hữu hạn và bầu trời chuyển sắc dùng chiếu sáng gián tiếp CPU.",
|
||||
"render.cpu_celestial_switch": "Chọn dò tia CPU với chiếu sáng gián tiếp để giữ Mặt Trời hoặc bầu trời này.",
|
||||
"render.cpu_celestial_unportable": "Giữ dò đường đi GPU cho cài đặt mẫu truyền sáng hiện tại.",
|
||||
"render.cpu_sky_bounds": "Góc xoay bầu trời phải hữu hạn trong ±1.000.000 radian; cường độ phải từ 0–100."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_celestial_adopt": "CPU 光线追踪与间接照明 · 路径深度 {depth} · {spp} SPP · 追踪阴影 · 种子 {seed} · 1 个主样本",
|
||||
"render.cpu_celestial_adopt_label": "CPU 光线追踪与间接照明",
|
||||
"render.cpu_celestial_path_required": "有限太阳和渐变天空使用 CPU 间接照明。",
|
||||
"render.cpu_celestial_switch": "选择带间接照明的 CPU 光线追踪,以保留此太阳或天空。",
|
||||
"render.cpu_celestial_unportable": "当前透射采样设置请继续使用 GPU 路径追踪。",
|
||||
"render.cpu_sky_bounds": "天空旋转必须为 ±1,000,000 弧度内的有限值;强度必须为 0–100。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.shot_lens_cpu_progressive_reason": "فعّل أخذ العينات التدريجي في قسم «أخذ العينات» قبل تمكين عمق المجال على CPU.",
|
||||
"render.shot_lens_raytrace_reason": "يتوفر عمق المجال مع تتبع الأشعة على CPU وتتبع المسارات على GPU."
|
||||
},
|
||||
"de": {
|
||||
"render.shot_lens_cpu_progressive_reason": "Vor der CPU-Schärfentiefe unter Sampling die progressive Abtastung übernehmen.",
|
||||
"render.shot_lens_raytrace_reason": "Schärfentiefe ist für CPU-Raytracing und GPU-Pathtracing verfügbar."
|
||||
},
|
||||
"en": {
|
||||
"render.shot_lens_cpu_progressive_reason": "Adopt progressive sampling in Sampling before enabling CPU depth of field.",
|
||||
"render.shot_lens_raytrace_reason": "Depth of field is available for CPU ray tracing and GPU path tracing."
|
||||
},
|
||||
"he": {
|
||||
"render.shot_lens_cpu_progressive_reason": "יש להפעיל דגימה הדרגתית בחלונית הדגימה לפני הפעלת עומק שדה ב־CPU.",
|
||||
"render.shot_lens_raytrace_reason": "עומק שדה זמין בעקיבת קרניים ב־CPU ובעקיבת נתיבים ב־GPU."
|
||||
},
|
||||
"ja": {
|
||||
"render.shot_lens_cpu_progressive_reason": "CPUの被写界深度を有効にするには、サンプリングでプログレッシブ方式を適用してください。",
|
||||
"render.shot_lens_raytrace_reason": "被写界深度はCPUレイトレーシングとGPUパストレーシングで利用できます。"
|
||||
},
|
||||
"ko": {
|
||||
"render.shot_lens_cpu_progressive_reason": "CPU 피사계 심도를 켜기 전에 샘플링에서 점진적 샘플링을 적용하세요.",
|
||||
"render.shot_lens_raytrace_reason": "피사계 심도는 CPU 레이 트레이싱과 GPU 패스 트레이싱에서 사용할 수 있습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.shot_lens_cpu_progressive_reason": "Bật lấy mẫu lũy tiến trong mục Lấy mẫu trước khi bật độ sâu trường ảnh trên CPU.",
|
||||
"render.shot_lens_raytrace_reason": "Độ sâu trường ảnh khả dụng với dò tia trên CPU và dò đường đi trên GPU."
|
||||
},
|
||||
"zh": {
|
||||
"render.shot_lens_cpu_progressive_reason": "启用CPU景深前,请在采样中应用渐进式采样。",
|
||||
"render.shot_lens_raytrace_reason": "CPU光线追踪和GPU路径追踪均支持景深。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_transparent_help": "يزيل PNG الشفاف الخلفية ويحافظ على تغطية الحواف. يجب أن تبقى عتامة الأجسام والأوجه عند 100%."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_transparent_help": "Transparentes PNG entfernt den Hintergrund und erhält die Kantenabdeckung. Körper- und Flächendeckkraft müssen 100 % bleiben."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_transparent_help": "Transparent PNG removes the background and keeps edge coverage. Body and face opacity must stay at 100%."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_transparent_help": "PNG שקוף מסיר את הרקע ושומר על כיסוי הקצוות. אטימות הגופים והפאות חייבת להישאר 100%."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_transparent_help": "透明PNGは背景を除き、輪郭の被覆率を保持します。ボディと面の不透明度は100%にしてください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_transparent_help": "투명 PNG는 배경을 제거하고 가장자리 커버리지를 유지합니다. 바디와 면의 불투명도는 100%여야 합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_transparent_help": "PNG trong suốt loại bỏ nền và giữ độ phủ ở biên. Độ đục của thân và mặt phải giữ ở 100%."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_transparent_help": "透明PNG移除背景并保留边缘覆盖率。实体和面的不透明度必须保持100%。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.directional_sun_limit": "تدعم إضاءة GPU ثمانية مصادر ضوء اتجاهية إجمالاً، من بينها شمس واحدة بظلال ناعمة كحد أقصى. انسخ ضوءاً اتجاهياً بظلال حادة لإضافة مصدر بعيد آخر."
|
||||
},
|
||||
"de": {
|
||||
"render.directional_sun_limit": "Die GPU unterstützt insgesamt acht gerichtete Lichtquellen, darunter höchstens eine weiche Sonne. Dupliziere ein hartes gerichtetes Licht für eine weitere entfernte Quelle."
|
||||
},
|
||||
"en": {
|
||||
"render.directional_sun_limit": "GPU lighting supports eight directional sources in total, including at most one soft Sun. Duplicate a hard directional light to add another distant source."
|
||||
},
|
||||
"he": {
|
||||
"render.directional_sun_limit": "תאורת GPU תומכת בשמונה מקורות אור כיווניים בסך הכול, ובהם לכל היותר שמש אחת בעלת צללים רכים. שכפלו אור כיווני בעל צללים חדים כדי להוסיף מקור מרוחק נוסף."
|
||||
},
|
||||
"ja": {
|
||||
"render.directional_sun_limit": "GPUでは指向性光源を合計8個まで使用でき、柔らかい影の太陽は1個までです。遠方の光源を追加するには、硬い影の指向性ライトを複製してください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.directional_sun_limit": "GPU는 부드러운 태양 하나를 포함해 방향성 광원을 총 8개까지 지원합니다. 원거리 광원을 추가하려면 선명한 그림자의 방향성 조명을 복제하세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.directional_sun_limit": "GPU hỗ trợ tổng cộng tám nguồn sáng định hướng, trong đó có tối đa một Mặt trời với bóng mềm. Nhân đôi đèn định hướng có bóng sắc để thêm nguồn sáng ở xa."
|
||||
},
|
||||
"zh": {
|
||||
"render.directional_sun_limit": "GPU 总共支持八个平行光源,其中最多一个为柔和太阳光。复制硬阴影平行光可添加另一个远处光源。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.gpu_path_not_started": "لم يبدأ إعداد متتبع المسارات على المعالج الرسومي بعد."
|
||||
},
|
||||
"de": {
|
||||
"render.gpu_path_not_started": "Die Einrichtung des GPU-Pfadtracers wurde noch nicht gestartet."
|
||||
},
|
||||
"en": {
|
||||
"render.gpu_path_not_started": "GPU path tracer setup has not started."
|
||||
},
|
||||
"he": {
|
||||
"render.gpu_path_not_started": "הגדרת מעקב המסלולים ב-GPU טרם התחילה."
|
||||
},
|
||||
"ja": {
|
||||
"render.gpu_path_not_started": "GPUパストレーサーのセットアップはまだ開始されていません。"
|
||||
},
|
||||
"ko": {
|
||||
"render.gpu_path_not_started": "GPU 경로 추적기 설정이 아직 시작되지 않았습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.gpu_path_not_started": "Quá trình thiết lập bộ dò đường đi GPU chưa bắt đầu."
|
||||
},
|
||||
"zh": {
|
||||
"render.gpu_path_not_started": "GPU路径追踪器的设置尚未开始。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.spot_axis": "اتجاه انبعاث الضوء",
|
||||
"render.spot_gpu_help": "تُقاس الزوايا من اتجاه انبعاث الضوء. يتلاشى الضوء بين الزاويتين الداخلية والخارجية. تتطلب نطاقات التلاشي الضيقة جداً التصيير باستخدام CPU.",
|
||||
"render.spot_help": "تُقاس الزوايا من اتجاه انبعاث الضوء. يتلاشى الضوء بين الزاويتين الداخلية والخارجية.",
|
||||
"render.spot_inner": "نصف الزاوية الداخلية",
|
||||
"render.spot_outer": "نصف الزاوية الخارجية"
|
||||
},
|
||||
"de": {
|
||||
"render.spot_axis": "Abstrahlrichtung",
|
||||
"render.spot_gpu_help": "Die Winkel werden von der Abstrahlrichtung aus gemessen. Zwischen innerem und äußerem Winkel wird das Licht schwächer. Sehr schmale Übergänge erfordern CPU-Rendering.",
|
||||
"render.spot_help": "Die Winkel werden von der Abstrahlrichtung aus gemessen. Zwischen innerem und äußerem Winkel wird das Licht schwächer.",
|
||||
"render.spot_inner": "Innerer Halbwinkel",
|
||||
"render.spot_outer": "Äußerer Halbwinkel"
|
||||
},
|
||||
"en": {
|
||||
"render.spot_axis": "Emission direction",
|
||||
"render.spot_gpu_help": "Angles are measured from the emission direction. Light fades between the inner and outer angles. Very narrow fade ranges require CPU rendering.",
|
||||
"render.spot_help": "Angles are measured from the emission direction. Light fades between the inner and outer angles.",
|
||||
"render.spot_inner": "Inner half-angle",
|
||||
"render.spot_outer": "Outer half-angle"
|
||||
},
|
||||
"he": {
|
||||
"render.spot_axis": "כיוון פליטת האור",
|
||||
"render.spot_gpu_help": "הזוויות נמדדות מכיוון פליטת האור. האור דועך בין הזווית הפנימית לחיצונית. טווחי דעיכה צרים מאוד דורשים רינדור באמצעות CPU.",
|
||||
"render.spot_help": "הזוויות נמדדות מכיוון פליטת האור. האור דועך בין הזווית הפנימית לחיצונית.",
|
||||
"render.spot_inner": "חצי זווית פנימית",
|
||||
"render.spot_outer": "חצי זווית חיצונית"
|
||||
},
|
||||
"ja": {
|
||||
"render.spot_axis": "光の照射方向",
|
||||
"render.spot_gpu_help": "角度は光の照射方向から測ります。内側の角度から外側の角度にかけて光が弱まります。減衰範囲が非常に狭い場合はCPUレンダリングが必要です。",
|
||||
"render.spot_help": "角度は光の照射方向から測ります。内側の角度から外側の角度にかけて光が弱まります。",
|
||||
"render.spot_inner": "内側の半角",
|
||||
"render.spot_outer": "外側の半角"
|
||||
},
|
||||
"ko": {
|
||||
"render.spot_axis": "빛의 방출 방향",
|
||||
"render.spot_gpu_help": "각도는 빛의 방출 방향을 기준으로 측정합니다. 안쪽 각도와 바깥쪽 각도 사이에서 빛이 약해집니다. 감쇠 범위가 매우 좁으면 CPU 렌더링이 필요합니다.",
|
||||
"render.spot_help": "각도는 빛의 방출 방향을 기준으로 측정합니다. 안쪽 각도와 바깥쪽 각도 사이에서 빛이 약해집니다.",
|
||||
"render.spot_inner": "안쪽 반각",
|
||||
"render.spot_outer": "바깥쪽 반각"
|
||||
},
|
||||
"vi": {
|
||||
"render.spot_axis": "Hướng phát sáng",
|
||||
"render.spot_gpu_help": "Các góc được đo từ hướng phát sáng. Ánh sáng yếu dần giữa góc trong và góc ngoài. Dải chuyển tiếp rất hẹp cần kết xuất bằng CPU.",
|
||||
"render.spot_help": "Các góc được đo từ hướng phát sáng. Ánh sáng yếu dần giữa góc trong và góc ngoài.",
|
||||
"render.spot_inner": "Nửa góc trong",
|
||||
"render.spot_outer": "Nửa góc ngoài"
|
||||
},
|
||||
"zh": {
|
||||
"render.spot_axis": "光线发射方向",
|
||||
"render.spot_gpu_help": "角度以光线发射方向为基准测量。光线在内角和外角之间逐渐减弱。极窄的衰减范围需要使用CPU渲染。",
|
||||
"render.spot_help": "角度以光线发射方向为基准测量。光线在内角和外角之间逐渐减弱。",
|
||||
"render.spot_inner": "内半角",
|
||||
"render.spot_outer": "外半角"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.adaptive.pilot_progress": "تمريرات تمهيدية تكيفية · {current}/{target}",
|
||||
"render.adaptive.preview_help": "توجّه الصور التمهيدية توزيع العينات ولا تدخل في الصورة النهائية. تستخدم تكرارات التصيير ميزانية منفصلة لكل بكسل؛ ولا يمثّل عدد التكرارات عددًا موحدًا من العينات لكل بكسل.",
|
||||
"render.adaptive.production_progress": "التصيير التكيفي · {current}/{target} تكرارات",
|
||||
"render.live.adaptive": "مباشر · {width} × {height} · {progress}"
|
||||
},
|
||||
"de": {
|
||||
"render.adaptive.pilot_progress": "Adaptive Pilotphase · {current}/{target} Durchgänge",
|
||||
"render.adaptive.preview_help": "Pilotbilder bestimmen die Verteilung und sind vom Endbild ausgeschlossen. Produktionsiterationen nutzen ein eigenes Budget pro Pixel; die Iterationszahl ist keine einheitliche Samplezahl pro Pixel.",
|
||||
"render.adaptive.production_progress": "Adaptive Produktion · {current}/{target} Iterationen",
|
||||
"render.live.adaptive": "Live · {width} × {height} · {progress}"
|
||||
},
|
||||
"en": {
|
||||
"render.adaptive.pilot_progress": "Adaptive pilots · {current}/{target} passes",
|
||||
"render.adaptive.preview_help": "Pilot images guide allocation and are excluded from the final image. Production iterations use a separate budget for each pixel; the iteration count is not uniform samples per pixel.",
|
||||
"render.adaptive.production_progress": "Adaptive production · {current}/{target} iterations",
|
||||
"render.live.adaptive": "Live · {width} × {height} · {progress}"
|
||||
},
|
||||
"he": {
|
||||
"render.adaptive.pilot_progress": "מעברים מקדימים אדפטיביים · {current}/{target}",
|
||||
"render.adaptive.preview_help": "התמונות המקדימות מנחות את הקצאת הדגימות ואינן נכללות בתמונה הסופית. איטרציות ההדמיה משתמשות בתקציב נפרד לכל פיקסל; מספר האיטרציות אינו מספר דגימות אחיד לכל פיקסל.",
|
||||
"render.adaptive.production_progress": "הדמיה אדפטיבית · {current}/{target} איטרציות",
|
||||
"render.live.adaptive": "חי · {width} × {height} · {progress}"
|
||||
},
|
||||
"ja": {
|
||||
"render.adaptive.pilot_progress": "適応パイロット · {current}/{target} パス",
|
||||
"render.adaptive.preview_help": "パイロット画像は配分の決定に使われ、最終画像には含まれません。本処理はピクセルごとに別の予算を使うため、反復回数は全ピクセル共通のサンプル数ではありません。",
|
||||
"render.adaptive.production_progress": "適応本処理 · {current}/{target} 回",
|
||||
"render.live.adaptive": "ライブ · {width} × {height} · {progress}"
|
||||
},
|
||||
"ko": {
|
||||
"render.adaptive.pilot_progress": "적응형 파일럿 · {current}/{target} 패스",
|
||||
"render.adaptive.preview_help": "파일럿 이미지는 예산 배분에 사용되며 최종 이미지에서 제외됩니다. 본 처리는 픽셀마다 별도의 예산을 사용하므로 반복 횟수는 모든 픽셀의 동일한 샘플 수를 뜻하지 않습니다.",
|
||||
"render.adaptive.production_progress": "적응형 본 처리 · {current}/{target} 회",
|
||||
"render.live.adaptive": "라이브 · {width} × {height} · {progress}"
|
||||
},
|
||||
"vi": {
|
||||
"render.adaptive.pilot_progress": "Các lượt thăm dò thích ứng · {current}/{target}",
|
||||
"render.adaptive.preview_help": "Ảnh thăm dò định hướng việc phân bổ mẫu và không được đưa vào ảnh cuối cùng. Các vòng kết xuất sử dụng ngân sách riêng cho từng pixel; số vòng không phải số mẫu đồng đều trên mỗi pixel.",
|
||||
"render.adaptive.production_progress": "Kết xuất thích ứng · {current}/{target} vòng lặp",
|
||||
"render.live.adaptive": "Trực tiếp · {width} × {height} · {progress}"
|
||||
},
|
||||
"zh": {
|
||||
"render.adaptive.pilot_progress": "自适应预采样 · {current}/{target} 轮",
|
||||
"render.adaptive.preview_help": "预采样图像用于分配预算,不计入最终图像。正式采样为每个像素使用独立预算;迭代次数不表示所有像素具有相同的采样数。",
|
||||
"render.adaptive.production_progress": "自适应正式采样 · {current}/{target} 轮迭代",
|
||||
"render.live.adaptive": "实时 · {width} × {height} · {progress}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.batch_current_settings_help": "يستخدم إعدادات الصورة الحالية مع كاميرا كل لقطة محفوظة، لقطة واحدة في كل مرة."
|
||||
},
|
||||
"de": {
|
||||
"render.batch_current_settings_help": "Verwendet die aktuellen Bildeinstellungen mit jeder gespeicherten Aufnahmekamera, eine Aufnahme nach der anderen."
|
||||
},
|
||||
"en": {
|
||||
"render.batch_current_settings_help": "Uses the current image settings with each saved shot camera, one shot at a time."
|
||||
},
|
||||
"he": {
|
||||
"render.batch_current_settings_help": "משתמש בהגדרות התמונה הנוכחיות עם המצלמה של כל שוט שמור, שוט אחד בכל פעם."
|
||||
},
|
||||
"ja": {
|
||||
"render.batch_current_settings_help": "現在の画像設定と各保存済みショットのカメラで、1ショットずつレンダリングします。"
|
||||
},
|
||||
"ko": {
|
||||
"render.batch_current_settings_help": "현재 이미지 설정과 저장된 각 샷의 카메라를 사용해 한 번에 한 샷씩 렌더링합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.batch_current_settings_help": "Dùng thiết lập ảnh hiện tại với máy ảnh của từng góc chụp đã lưu, lần lượt từng góc chụp."
|
||||
},
|
||||
"zh": {
|
||||
"render.batch_current_settings_help": "使用当前图像设置和各个已保存镜头的相机,逐个渲染镜头。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"ar": {
|
||||
"cmd.render.coat.bind": "حفظ الطلاء الشفاف",
|
||||
"cmd.render.coat.unbind": "إزالة الطلاء الشفاف",
|
||||
"render.coat_discard": "تجاهل تعديل الطلاء",
|
||||
"render.coat_pending_edit": "لم يُحفظ تعديل الطلاء هذا. احفظه مع اللقطة أو تجاهل التعديل.",
|
||||
"render.coat_remove": "إزالة الطلاء المحفوظ",
|
||||
"render.coat_remove_note": "يزيل طلاء هذا الهدف من اللقطة. تبقى الهندسة والمظاهر والمواد الفيزيائية دون تغيير.",
|
||||
"render.coat_remove_title": "إزالة الطلاء الشفاف المحفوظ؟",
|
||||
"render.coat_revalidate_saved": "تغيّر الطلاء المحفوظ. تجاهل هذا التعديل وأعد فتح الهدف قبل تعديله مجددًا.",
|
||||
"render.coat_save": "حفظ الطلاء مع اللقطة",
|
||||
"render.coat_saved_help": "يضيف الطلاء الشفاف طبقة لامعة إلى الأسطح المعتمة. احفظه مع اللقطة. لا يمكن استخدام الزجاج على الهدف نفسه، ولا تجاوزات الانعكاس المخصص والتباين الاتجاهي على CPU."
|
||||
},
|
||||
"de": {
|
||||
"cmd.render.coat.bind": "Klarlack speichern",
|
||||
"cmd.render.coat.unbind": "Klarlack entfernen",
|
||||
"render.coat_discard": "Klarlackänderung verwerfen",
|
||||
"render.coat_pending_edit": "Diese Klarlackänderung ist ungespeichert. Mit der Aufnahme speichern oder verwerfen.",
|
||||
"render.coat_remove": "Gespeicherten Klarlack entfernen",
|
||||
"render.coat_remove_note": "Entfernt den Klarlack dieses Ziels aus der Aufnahme. Geometrie, Aussehen und physikalische Materialien bleiben unverändert.",
|
||||
"render.coat_remove_title": "Gespeicherten Klarlack entfernen?",
|
||||
"render.coat_revalidate_saved": "Der gespeicherte Klarlack wurde geändert. Diese Änderung verwerfen und das Ziel vor der nächsten Bearbeitung erneut öffnen.",
|
||||
"render.coat_save": "Klarlack in Aufnahme speichern",
|
||||
"render.coat_saved_help": "Klarlack fügt undurchsichtigen Flächen eine glänzende Schicht hinzu. Mit der Aufnahme speichern. Glas kann nicht dasselbe Ziel verwenden. Auf der CPU dürfen auch benutzerdefinierte Reflexions- und Anisotropieüberschreibungen dieses Ziel nicht verwenden."
|
||||
},
|
||||
"en": {
|
||||
"cmd.render.coat.bind": "Save Clear Coat",
|
||||
"cmd.render.coat.unbind": "Remove Clear Coat",
|
||||
"render.coat_discard": "Discard coat edit",
|
||||
"render.coat_pending_edit": "This coat edit is unsaved. Save it with the shot or discard it.",
|
||||
"render.coat_remove": "Remove saved coat",
|
||||
"render.coat_remove_note": "Removes this target’s coat from the shot. Geometry, appearances and physical materials stay unchanged.",
|
||||
"render.coat_remove_title": "Remove saved clear coat?",
|
||||
"render.coat_revalidate_saved": "The saved coat changed. Discard this edit and reopen the target before editing it again.",
|
||||
"render.coat_save": "Save coat to shot",
|
||||
"render.coat_saved_help": "Clear coat adds a glossy layer to opaque surfaces. Save it with the shot. Glass cannot share this target. CPU custom reflection and anisotropy overrides cannot share it either."
|
||||
},
|
||||
"he": {
|
||||
"cmd.render.coat.bind": "שמירת ציפוי שקוף",
|
||||
"cmd.render.coat.unbind": "הסרת ציפוי שקוף",
|
||||
"render.coat_discard": "ביטול עריכת הציפוי",
|
||||
"render.coat_pending_edit": "שינוי הציפוי הזה לא נשמר. יש לשמור אותו עם התצלום או לבטל את השינוי.",
|
||||
"render.coat_remove": "הסרת ציפוי שמור",
|
||||
"render.coat_remove_note": "מסיר את הציפוי של היעד הזה מהתצלום. הגאומטריה, המראה והחומרים הפיזיקליים אינם משתנים.",
|
||||
"render.coat_remove_title": "להסיר את הציפוי השקוף השמור?",
|
||||
"render.coat_revalidate_saved": "הציפוי השמור השתנה. יש לבטל את העריכה הזו ולפתוח מחדש את היעד לפני עריכה נוספת.",
|
||||
"render.coat_save": "שמירת הציפוי בתצלום",
|
||||
"render.coat_saved_help": "ציפוי שקוף מוסיף שכבה מבריקה למשטחים אטומים. יש לשמור אותו עם התצלום. זכוכית אינה יכולה להשתמש באותו יעד, וגם לא דריסות של השתקפות מותאמת אישית ואנאיזוטרופיה ב־CPU."
|
||||
},
|
||||
"ja": {
|
||||
"cmd.render.coat.bind": "クリアコートを保存",
|
||||
"cmd.render.coat.unbind": "クリアコートを削除",
|
||||
"render.coat_discard": "コートの編集を破棄",
|
||||
"render.coat_pending_edit": "クリアコートの変更は未保存です。ショットに保存するか破棄してください。",
|
||||
"render.coat_remove": "保存済みコートを削除",
|
||||
"render.coat_remove_note": "この対象のコートをショットから削除します。形状、外観、物理材料は変更されません。",
|
||||
"render.coat_remove_title": "保存済みクリアコートを削除しますか?",
|
||||
"render.coat_revalidate_saved": "保存済みコートが変更されています。この編集を破棄し、対象を開き直してから編集してください。",
|
||||
"render.coat_save": "コートをショットに保存",
|
||||
"render.coat_saved_help": "クリアコートは不透明な表面に光沢のある層を追加します。ショットに保存してください。同じ対象にガラスは使用できません。CPUのカスタム反射や異方性の上書きも、この対象と併用できません。"
|
||||
},
|
||||
"ko": {
|
||||
"cmd.render.coat.bind": "클리어 코트 저장",
|
||||
"cmd.render.coat.unbind": "클리어 코트 제거",
|
||||
"render.coat_discard": "코트 편집 버리기",
|
||||
"render.coat_pending_edit": "이 코트 편집은 저장되지 않았습니다. 샷에 저장하거나 편집을 버리세요.",
|
||||
"render.coat_remove": "저장된 코트 제거",
|
||||
"render.coat_remove_note": "이 대상의 코트를 샷에서 제거합니다. 형상, 외관 및 물리 재료는 변경되지 않습니다.",
|
||||
"render.coat_remove_title": "저장된 클리어 코트를 제거할까요?",
|
||||
"render.coat_revalidate_saved": "저장된 코트가 변경되었습니다. 이 편집을 버리고 대상을 다시 연 뒤 편집하세요.",
|
||||
"render.coat_save": "샷에 코트 저장",
|
||||
"render.coat_saved_help": "클리어 코트는 불투명 표면에 광택 층을 추가합니다. 샷에 저장하세요. 같은 대상에 유리를 사용할 수 없습니다. CPU 사용자 지정 반사 또는 이방성 재정의도 이 대상을 함께 사용할 수 없습니다."
|
||||
},
|
||||
"vi": {
|
||||
"cmd.render.coat.bind": "Lưu lớp phủ bóng",
|
||||
"cmd.render.coat.unbind": "Xóa lớp phủ bóng",
|
||||
"render.coat_discard": "Hủy chỉnh sửa lớp phủ",
|
||||
"render.coat_pending_edit": "Chỉnh sửa lớp phủ này chưa được lưu. Hãy lưu cùng cảnh chụp hoặc hủy chỉnh sửa.",
|
||||
"render.coat_remove": "Xóa lớp phủ đã lưu",
|
||||
"render.coat_remove_note": "Xóa lớp phủ của đích này khỏi cảnh chụp. Hình học, diện mạo và vật liệu vật lý không thay đổi.",
|
||||
"render.coat_remove_title": "Xóa lớp phủ bóng đã lưu?",
|
||||
"render.coat_revalidate_saved": "Lớp phủ đã lưu đã thay đổi. Hãy hủy chỉnh sửa này và mở lại đích trước khi sửa tiếp.",
|
||||
"render.coat_save": "Lưu lớp phủ vào cảnh chụp",
|
||||
"render.coat_saved_help": "Lớp phủ bóng thêm một lớp sáng bóng lên bề mặt đục. Hãy lưu cùng cảnh chụp. Kính không thể dùng chung đích này. Ghi đè phản xạ tùy chỉnh và tính dị hướng CPU cũng không thể dùng chung đích."
|
||||
},
|
||||
"zh": {
|
||||
"cmd.render.coat.bind": "保存清漆",
|
||||
"cmd.render.coat.unbind": "移除清漆",
|
||||
"render.coat_discard": "放弃清漆编辑",
|
||||
"render.coat_pending_edit": "清漆编辑尚未保存。请保存到镜头或放弃编辑。",
|
||||
"render.coat_remove": "移除已保存清漆",
|
||||
"render.coat_remove_note": "从镜头中移除此目标的清漆。几何、外观和物理材料保持不变。",
|
||||
"render.coat_remove_title": "移除已保存的清漆?",
|
||||
"render.coat_revalidate_saved": "已保存的清漆发生了变化。请放弃此编辑,重新打开目标后再编辑。",
|
||||
"render.coat_save": "将清漆保存到镜头",
|
||||
"render.coat_saved_help": "清漆为不透明表面添加光泽层。请随镜头保存。同一目标不能使用玻璃,也不能使用CPU自定义反射或各向异性覆盖。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.check_glass_cpu": "يدعم CPU صفائح زجاج مستوية وصناديق محاذية للمحاور بعد التحقق منها. تتطلب الشبكات المغلقة العامة والتعشيق والتشتت الداخلي إضاءة غير مباشرة. لا تزال الظلال النافذة عبر الزجاج المغلق غير مدعومة.",
|
||||
"render.check_glass_gpu": "يدعم GPU أوساط زجاج منفصلة متحققًا منها، أو تعشيقًا متحققًا منه عند تفعيله صراحةً. يتطلب التعشيق أغلفة خارجية محدبة وأجسامًا داخلية محتواة بالكامل وحدودًا غير متلامسة.",
|
||||
"render.check_media_remaining": "لا تزال تأثيرات الزجاج الخشن وشبكات الكثافة والإزاحة والنقل الطيفي غير متاحة.",
|
||||
"render.check_media_scope": "يتطلب التشتت الداخلي النشط وسطًا زجاجيًا مغلقًا مع إيقاف نفاذ أشعة الظل المستقيمة وإزالة الضجيج. ويتطلب GPU أيضًا طبقة عينات فرينل واحدة. لا يمكن جمع الغلاف الجوي الخارجي النشط مع الزجاج أو إزالة ضجيج الأسطح.",
|
||||
"render.cpu_material_certification": "يتحقق فحص CPU من هندسة الزجاج المدعومة قبل التصيير. يستخدم الزجاج المغلق المسافة الهندسية."
|
||||
},
|
||||
"de": {
|
||||
"render.check_glass_cpu": "Die CPU unterstützt geprüfte ebene Glasscheiben und achsenparallele Boxen. Allgemeine geschlossene Netze, Verschachtelung und innere Streuung erfordern indirekte Beleuchtung. Durch geschlossenes Glas übertragene Schatten bleiben nicht unterstützt.",
|
||||
"render.check_glass_gpu": "Die GPU unterstützt geprüfte getrennte Glasmedien oder ausdrücklich aktivierte geprüfte Verschachtelung. Dafür müssen die äußeren Körper konvex und die inneren streng enthalten sein; Grenzen dürfen sich nicht berühren.",
|
||||
"render.check_media_remaining": "Raues Glas, Dichtegitter, Displacement und spektraler Lichttransport bleiben nicht verfügbar.",
|
||||
"render.check_media_scope": "Aktive innere Streuung benötigt ein geschlossenes Glasmedium ohne gerade Schattenübertragung und ohne Rauschreduzierung. Die GPU benötigt außerdem eine Fresnel-Schicht. Aktive äußere Atmosphäre kann nicht mit Glas oder Oberflächen-Rauschreduzierung kombiniert werden.",
|
||||
"render.cpu_material_certification": "Die CPU-Prüfung validiert unterstützte Glasgeometrie vor dem Rendern. Geschlossenes Glas verwendet geometrische Abstände."
|
||||
},
|
||||
"en": {
|
||||
"render.check_glass_cpu": "CPU supports certified planar Glass sheets and axis-aligned boxes. General closed meshes, nesting and interior scattering require Indirect lighting. Closed transmitted shadows remain unsupported.",
|
||||
"render.check_glass_gpu": "GPU supports certified disjoint Glass or explicit certified nesting. Nesting requires convex parents, strictly contained children and no touching boundaries.",
|
||||
"render.check_media_remaining": "Rough Glass, density grids, displacement and spectral transport remain unavailable.",
|
||||
"render.check_media_scope": "Active interior scattering needs a closed Glass medium, straight shadow transmission off and Denoise off. GPU also needs one Fresnel stratum. Active exterior Atmosphere cannot combine with Glass or surface Denoise.",
|
||||
"render.cpu_material_certification": "CPU Check validates supported Glass geometry before rendering. Closed Glass uses geometric distance."
|
||||
},
|
||||
"es": {
|
||||
"render.cpu_material_certification": "La comprobación de CPU valida la geometría de vidrio admitida antes de renderizar. El vidrio cerrado usa la distancia geométrica."
|
||||
},
|
||||
"fr": {
|
||||
"render.cpu_material_certification": "La vérification CPU valide la géométrie de verre prise en charge avant le rendu. Le verre fermé utilise la distance géométrique."
|
||||
},
|
||||
"he": {
|
||||
"render.check_glass_cpu": "ה־CPU תומך בלוחות זכוכית מישוריים ובתיבות מקבילות לצירים שעברו אימות. רשתות סגורות כלליות, קינון ופיזור פנימי דורשים תאורה עקיפה. העברת צל דרך זכוכית סגורה עדיין אינה נתמכת.",
|
||||
"render.check_glass_gpu": "ה־GPU תומך בנפחי זכוכית נפרדים שעברו אימות או בקינון מאומת שמופעל במפורש. קינון דורש גופים חיצוניים קמורים, גופים פנימיים המוכלים בתוכם ממש וגבולות שאינם נוגעים זה בזה.",
|
||||
"render.check_media_remaining": "זכוכית מחוספסת, רשתות צפיפות, הסטת משטח והעברת אור ספקטרלית עדיין אינן זמינות.",
|
||||
"render.check_media_scope": "פיזור פנימי פעיל דורש נפח זכוכית סגור, העברת קרני צל ישרות כבויה והסרת רעש כבויה. ה־GPU דורש גם שכבת פרנל אחת. אי אפשר לשלב אטמוספירה חיצונית פעילה עם זכוכית או עם הסרת רעש משטחית.",
|
||||
"render.cpu_material_certification": "בדיקת CPU מאמתת את גאומטריית הזכוכית הנתמכת לפני הרינדור. זכוכית סגורה משתמשת במרחק גאומטרי."
|
||||
},
|
||||
"ja": {
|
||||
"render.check_glass_cpu": "CPUは検証済みの平面ガラス薄板と軸に平行な箱に対応します。一般の閉じたメッシュ、入れ子、内部散乱には間接照明が必要です。閉じたガラスを通る透過影には未対応です。",
|
||||
"render.check_glass_gpu": "GPUは検証済みの分離したガラス、または明示的に有効にした検証済みの入れ子に対応します。入れ子には凸形状の親、厳密に内包された子、接触しない境界が必要です。",
|
||||
"render.check_media_remaining": "粗いガラス、密度グリッド、ディスプレイスメント、分光輸送には未対応です。",
|
||||
"render.check_media_scope": "有効な内部散乱には閉じたガラス媒質を使い、直線の影透過とノイズ除去をオフにします。GPUではフレネル層を1つにします。有効な外部の大気はガラスや表面ノイズ除去と併用できません。",
|
||||
"render.cpu_material_certification": "CPUの確認では、レンダリング前に対応するガラス形状を検証します。閉じたガラスには形状から得られる距離を使います。"
|
||||
},
|
||||
"ko": {
|
||||
"render.check_glass_cpu": "CPU는 검증된 평면 유리판과 축 정렬 상자를 지원합니다. 일반적인 닫힌 메시, 중첩 및 내부 산란에는 간접광이 필요합니다. 닫힌 유리를 통과하는 투과 그림자는 아직 지원하지 않습니다.",
|
||||
"render.check_glass_gpu": "GPU는 검증된 분리 유리 또는 명시적으로 활성화한 검증된 중첩을 지원합니다. 중첩에는 볼록한 바깥 형상, 완전히 내부에 포함된 안쪽 형상 및 서로 닿지 않는 경계가 필요합니다.",
|
||||
"render.check_media_remaining": "거친 유리, 밀도 격자, 디스플레이스먼트 및 분광 광전달은 아직 지원하지 않습니다.",
|
||||
"render.check_media_scope": "활성 내부 산란에는 닫힌 유리 매질이 필요하며 직선 그림자 투과와 노이즈 제거를 꺼야 합니다. GPU에는 프레넬 계층도 하나만 필요합니다. 활성 외부 대기는 유리 또는 표면 노이즈 제거와 함께 사용할 수 없습니다.",
|
||||
"render.cpu_material_certification": "CPU 검사는 렌더링 전에 지원되는 유리 형상을 검증합니다. 닫힌 유리는 기하학적 거리를 사용합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.check_glass_cpu": "CPU hỗ trợ các tấm kính phẳng và hộp thẳng theo trục đã được kiểm chứng. Lưới kín tổng quát, cấu trúc lồng nhau và tán xạ bên trong cần Chiếu sáng gián tiếp. Chưa hỗ trợ bóng truyền qua kính kín.",
|
||||
"render.check_glass_gpu": "GPU hỗ trợ các khối kính tách rời đã được kiểm chứng hoặc cấu trúc lồng nhau được kiểm chứng và bật rõ ràng. Cấu trúc lồng nhau cần lớp bao lồi, vật thể con nằm hoàn toàn bên trong và các ranh giới không chạm nhau.",
|
||||
"render.check_media_remaining": "Chưa hỗ trợ kính nhám, lưới mật độ, dịch chuyển bề mặt và truyền sáng quang phổ.",
|
||||
"render.check_media_scope": "Tán xạ bên trong đang hoạt động cần môi trường kính kín, tắt truyền tia bóng thẳng và tắt Khử nhiễu. GPU cũng cần một tầng Fresnel. Không thể kết hợp Khí quyển bên ngoài đang hoạt động với kính hoặc Khử nhiễu bề mặt.",
|
||||
"render.cpu_material_certification": "Kiểm tra trên CPU xác thực hình học thủy tinh được hỗ trợ trước khi kết xuất. Thủy tinh kín sử dụng khoảng cách hình học."
|
||||
},
|
||||
"zh": {
|
||||
"render.check_glass_cpu": "CPU 支持经验证的平面玻璃薄片和轴对齐盒体。一般闭合网格、嵌套和内部散射需要间接光照。仍不支持穿过闭合玻璃的透射阴影。",
|
||||
"render.check_glass_gpu": "GPU 支持经验证的互不相交玻璃介质,或明确启用的经验证嵌套。嵌套要求外层物体为凸体、内层物体严格包含于其中,且边界互不接触。",
|
||||
"render.check_media_remaining": "仍不支持粗糙玻璃、密度网格、位移和光谱传输。",
|
||||
"render.check_media_scope": "启用内部散射需要闭合玻璃介质,并关闭直线阴影透射和降噪。GPU 还需要只使用一个菲涅耳分层。启用的外部大气不能与玻璃或表面降噪同时使用。",
|
||||
"render.cpu_material_certification": "CPU 检查会在渲染前验证所支持的玻璃几何体。封闭玻璃使用几何距离。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_opaque_hint": "يستخدم تتبع الأشعة على CPU خلفية معتمة.",
|
||||
"render.output_master_unavailable": "لتصدير EXR، اختر صورة مكتملة تحتوي على بيانات EXR خام. فعّل EXR الخام قبل تصيير صور جديدة.",
|
||||
"render.output_presentation_limits": "تدعم مؤثرات الصور على CPU وإخراج EXR صوراً بعرض وارتفاع لا يتجاوزان 8192 بكسل، وبإجمالي لا يتجاوز 16,777,216 بكسل.",
|
||||
"render.output_raytrace_only": "تتطلب مؤثرات الصور تتبع الأشعة على CPU أو تتبع المسارات على GPU.",
|
||||
"render.presentation_banner": "تعمل مؤثرات إخراج الصورة مع تتبع الأشعة على CPU وGPU. فتح هذه الصفحة لا يغيّر الطريقة مطلقًا."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_opaque_hint": "CPU-Raytracing verwendet einen undurchsichtigen Hintergrund.",
|
||||
"render.output_master_unavailable": "Zum EXR-Export ein fertiges Bild mit EXR-Rohdaten auswählen. EXR-Rohdaten vor dem Rendern neuer Bilder aktivieren.",
|
||||
"render.output_presentation_limits": "CPU-Bildeffekte und EXR-Ausgabe unterstützen Bilder mit bis zu 8192 Pixeln Breite oder Höhe und insgesamt höchstens 16.777.216 Pixeln.",
|
||||
"render.output_raytrace_only": "Bildeffekte erfordern CPU-Raytracing oder GPU-Pathtracing.",
|
||||
"render.presentation_banner": "Bildeffekte funktionieren mit CPU- und GPU-Raytracing. Das Öffnen dieser Seite ändert die Methode nicht."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_opaque_hint": "CPU ray tracing uses an opaque background.",
|
||||
"render.output_master_unavailable": "Select a completed image with raw EXR data to export EXR. Enable raw EXR before rendering new images.",
|
||||
"render.output_presentation_limits": "CPU image effects and EXR output support images up to 8192 pixels wide or high, with at most 16,777,216 pixels in total.",
|
||||
"render.output_raytrace_only": "Image effects require CPU ray tracing or GPU path tracing.",
|
||||
"render.presentation_banner": "Presentation effects work with CPU and GPU ray tracing. Opening this page never changes the method."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_opaque_hint": "עקיבת קרניים ב־CPU משתמשת ברקע אטום.",
|
||||
"render.output_master_unavailable": "כדי לייצא EXR, יש לבחור תמונה שהושלמה ומכילה נתוני EXR גולמיים. יש להפעיל EXR גולמי לפני רינדור תמונות חדשות.",
|
||||
"render.output_presentation_limits": "אפקטים של תמונה ב־CPU ופלט EXR תומכים בתמונות ברוחב ובגובה של עד 8192 פיקסלים, ועד 16,777,216 פיקסלים בסך הכול.",
|
||||
"render.output_raytrace_only": "אפקטים של תמונה דורשים עקיבת קרניים ב־CPU או עקיבת נתיבים ב־GPU.",
|
||||
"render.presentation_banner": "אפקטים של תצוגת התמונה פועלים בעקיבת קרניים ב־CPU וב־GPU. פתיחת דף זה לעולם אינה משנה את השיטה."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_opaque_hint": "CPUレイトレーシングでは不透明な背景を使用します。",
|
||||
"render.output_master_unavailable": "EXRを書き出すには、RAW EXRデータを持つ完成画像を選択してください。新しい画像は、レンダリング前にRAW EXRを有効にしてください。",
|
||||
"render.output_presentation_limits": "CPUの画像効果とEXR出力は、幅・高さとも8192ピクセル以下、合計16,777,216ピクセル以下の画像に対応します。",
|
||||
"render.output_raytrace_only": "画像効果にはCPUレイトレーシングまたはGPUパストレーシングが必要です。",
|
||||
"render.presentation_banner": "画像効果はCPUとGPUのレイトレーシングで使用できます。このページを開いても方式は変わりません。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_opaque_hint": "CPU 레이 트레이싱은 불투명한 배경을 사용합니다.",
|
||||
"render.output_master_unavailable": "EXR을 내보내려면 원본 EXR 데이터가 있는 완성 이미지를 선택하세요. 새 이미지를 렌더링하기 전에 원본 EXR을 활성화하세요.",
|
||||
"render.output_presentation_limits": "CPU 이미지 효과와 EXR 출력은 너비와 높이가 각각 최대 8192픽셀이고 총 16,777,216픽셀 이하인 이미지를 지원합니다.",
|
||||
"render.output_raytrace_only": "이미지 효과에는 CPU 레이 트레이싱 또는 GPU 패스 트레이싱이 필요합니다.",
|
||||
"render.presentation_banner": "이미지 효과는 CPU 및 GPU 레이 트레이싱에서 사용할 수 있습니다. 이 페이지를 열어도 방식이 바뀌지 않습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_opaque_hint": "Dò tia trên CPU sử dụng nền không trong suốt.",
|
||||
"render.output_master_unavailable": "Để xuất EXR, hãy chọn ảnh đã hoàn tất có dữ liệu EXR thô. Bật EXR thô trước khi kết xuất ảnh mới.",
|
||||
"render.output_presentation_limits": "Hiệu ứng ảnh trên CPU và đầu ra EXR hỗ trợ ảnh có chiều rộng và chiều cao tối đa 8192 pixel, với tổng cộng không quá 16.777.216 pixel.",
|
||||
"render.output_raytrace_only": "Hiệu ứng ảnh yêu cầu dò tia trên CPU hoặc dò đường đi trên GPU.",
|
||||
"render.presentation_banner": "Các hiệu ứng hình ảnh hoạt động với dò tia trên CPU và GPU. Mở trang này không bao giờ thay đổi phương pháp."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_opaque_hint": "CPU光线追踪使用不透明背景。",
|
||||
"render.output_master_unavailable": "要导出EXR,请选择包含原始EXR数据的已完成图像。渲染新图像前请先启用原始EXR。",
|
||||
"render.output_presentation_limits": "CPU图像效果和EXR输出支持宽度、高度均不超过8192像素且总像素数不超过16,777,216的图像。",
|
||||
"render.output_raytrace_only": "图像效果需要CPU光线追踪或GPU路径追踪。",
|
||||
"render.presentation_banner": "图像效果支持CPU和GPU光线追踪。打开此页面不会更改渲染方式。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"ar": {
|
||||
"prefs.render_legacy_image_defaults": "استخدام الإعدادات الافتراضية السابقة لصور التصيير",
|
||||
"prefs.render_legacy_image_defaults_help": "الاحتفاظ بسير العمل اليدوي السابق: إعدادات جديدة بالتصيير النقطي على CPU، وأخذ العينات الثابت لتتبع الأشعة على CPU، وفتح النتائج يدويًا. إعادة ملاءمة العرض عند دخول التصيير، وتبديل اللقطات دون استعادة كاميراتها، واستخدام التأطير والتنقل السابقين. تعطيل التحديث التلقائي للصورة المباشرة. لا تتغير الإعدادات المحفوظة."
|
||||
},
|
||||
"de": {
|
||||
"prefs.render_legacy_image_defaults": "Bisherige Render-Bildvorgaben verwenden",
|
||||
"prefs.render_legacy_image_defaults_help": "Den bisherigen manuellen Ablauf beibehalten: neue Setups mit CPU-Raster, feste Abtastung beim CPU-Raytracing und manuell geöffnete Ergebnisse. Beim Wechsel zu Render die Ansicht neu einpassen, Aufnahmen ohne Wiederherstellung ihrer Kamera wechseln und die bisherige Bildausrichtung und Navigation verwenden. Automatische Live-Bildrückmeldungen deaktivieren. Gespeicherte Setups bleiben unverändert."
|
||||
},
|
||||
"en": {
|
||||
"prefs.render_legacy_image_defaults": "Use previous Render image defaults",
|
||||
"prefs.render_legacy_image_defaults_help": "Keep the previous manual workflow: new setups use CPU raster, CPU ray tracing keeps fixed sampling, and you open rendered results manually. Refit on Render entry, switch shots without restoring their cameras, and use the previous framing and navigation. Disable automatic live image feedback. Saved setups are unchanged."
|
||||
},
|
||||
"he": {
|
||||
"prefs.render_legacy_image_defaults": "שימוש בברירות המחדל הקודמות לתמונות הדמיה",
|
||||
"prefs.render_legacy_image_defaults_help": "שמירה על תהליך העבודה הידני הקודם: הגדרות חדשות ברסטר CPU, דגימה קבועה בעקיבת קרניים ב־CPU ופתיחת התוצאות ידנית. התאמת התצוגה מחדש בכניסה להדמיה, מעבר בין צילומים בלי לשחזר את המצלמות שלהם ושימוש במסגור ובניווט הקודמים. עדכון אוטומטי של התמונה החיה מושבת. הגדרות שמורות אינן משתנות."
|
||||
},
|
||||
"ja": {
|
||||
"prefs.render_legacy_image_defaults": "以前のレンダー画像の既定値を使用",
|
||||
"prefs.render_legacy_image_defaults_help": "以前の手動の画像ワークフローを使用します。新しいセットアップはCPUラスタ、CPUレイトレーシングは固定サンプリングとし、結果は手動で開きます。レンダーに入るたびにビューをフィットし、ショットを切り替えても保存カメラを復元せず、以前のフレーミングとナビゲーションを使用します。自動のライブ画像更新は無効にします。保存済みのセットアップは変更しません。"
|
||||
},
|
||||
"ko": {
|
||||
"prefs.render_legacy_image_defaults": "이전 렌더 이미지 기본값 사용",
|
||||
"prefs.render_legacy_image_defaults_help": "이전의 수동 이미지 작업 방식을 유지합니다. 새 설정은 CPU 래스터를 사용하고 CPU 광선 추적은 고정 샘플링을 사용하며 결과는 직접 엽니다. 렌더에 들어갈 때 뷰를 다시 맞추고, 샷을 전환해도 저장된 카메라를 복원하지 않으며, 이전의 프레이밍과 탐색 방식을 사용합니다. 자동 실시간 이미지 피드백을 끕니다. 저장된 설정은 변경하지 않습니다.",
|
||||
"render.method_raster": "CPU 래스터 (도식)",
|
||||
"render.result_provisional": "임시 이미지"
|
||||
},
|
||||
"vi": {
|
||||
"prefs.render_legacy_image_defaults": "Dùng mặc định ảnh Kết xuất trước đây",
|
||||
"prefs.render_legacy_image_defaults_help": "Giữ quy trình hình ảnh thủ công trước đây: thiết lập mới dùng raster CPU, dò tia CPU dùng lấy mẫu cố định và mở kết quả thủ công. Căn vừa lại khung nhìn khi vào Kết xuất, chuyển góc chụp mà không khôi phục camera đã lưu, đồng thời dùng cách lấy khung hình và điều hướng trước đây. Tắt phản hồi ảnh trực tiếp tự động. Các thiết lập đã lưu không thay đổi."
|
||||
},
|
||||
"zh": {
|
||||
"prefs.render_legacy_image_defaults": "使用以前的渲染图像默认值",
|
||||
"prefs.render_legacy_image_defaults_help": "保留以前的手动图像流程:新设置使用 CPU 光栅渲染,CPU 光线追踪使用固定采样,并手动打开结果。进入渲染时重新适配视图,切换镜头时不恢复其保存的相机,并使用以前的取景和导航方式。禁用自动实时图像反馈。已保存的设置保持不变。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.light_space_world": "أضواء بإحداثيات العالم",
|
||||
"render.light_space_world_help": "تستخدم مواضع الأضواء واتجاهاتها إحداثيات العالم. لا يؤدي تدوير الكاميرا حول النموذج إلى تحريك الأضواء."
|
||||
},
|
||||
"de": {
|
||||
"render.light_space_world": "Lichter in Weltkoordinaten",
|
||||
"render.light_space_world_help": "Lichtpositionen und -richtungen verwenden Weltkoordinaten. Beim Umkreisen mit der Kamera bleiben die Lichter an ihrer Position."
|
||||
},
|
||||
"en": {
|
||||
"render.light_space_world": "World-space lights",
|
||||
"render.light_space_world_help": "Light positions and directions use world coordinates. Orbiting the camera does not move them."
|
||||
},
|
||||
"he": {
|
||||
"render.light_space_world": "אורות בקואורדינטות העולם",
|
||||
"render.light_space_world_help": "מיקומי האורות וכיווניהם משתמשים בקואורדינטות העולם. סיבוב המצלמה סביב המודל אינו מזיז את האורות."
|
||||
},
|
||||
"ja": {
|
||||
"render.light_space_world": "ワールド座標のライト",
|
||||
"render.light_space_world_help": "ライトの位置と方向はワールド座標を使用します。カメラを周回させてもライトは移動しません。"
|
||||
},
|
||||
"ko": {
|
||||
"render.light_space_world": "월드 좌표의 조명",
|
||||
"render.light_space_world_help": "조명의 위치와 방향은 월드 좌표를 사용합니다. 카메라를 회전해도 조명은 움직이지 않습니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.light_space_world": "Đèn trong hệ tọa độ thế giới",
|
||||
"render.light_space_world_help": "Vị trí và hướng của đèn dùng hệ tọa độ thế giới. Xoay camera quanh mô hình không làm đèn di chuyển."
|
||||
},
|
||||
"zh": {
|
||||
"render.light_space_world": "世界坐标光源",
|
||||
"render.light_space_world_help": "光源的位置和方向使用世界坐标。环绕旋转相机不会移动光源。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"cmd.view.render_live": "إيقاف التصيير المباشر مؤقتًا أو استئنافه"
|
||||
},
|
||||
"de": {
|
||||
"cmd.view.render_live": "Live-Rendering pausieren oder fortsetzen"
|
||||
},
|
||||
"en": {
|
||||
"cmd.view.render_live": "Pause or Resume Live Render"
|
||||
},
|
||||
"he": {
|
||||
"cmd.view.render_live": "השהיה או חידוש של הדמיה חיה"
|
||||
},
|
||||
"ja": {
|
||||
"cmd.view.render_live": "ライブレンダーを一時停止・再開"
|
||||
},
|
||||
"ko": {
|
||||
"cmd.view.render_live": "실시간 렌더링 일시 중지 또는 재개"
|
||||
},
|
||||
"vi": {
|
||||
"cmd.view.render_live": "Tạm dừng hoặc tiếp tục kết xuất trực tiếp"
|
||||
},
|
||||
"zh": {
|
||||
"cmd.view.render_live": "暂停或继续实时渲染"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.live.final_changed": "تغيّر طلب التصيير أثناء إيقاف التصيير المباشر. ابدأ الصورة النهائية من جديد.",
|
||||
"render.live.final_waiting": "جارٍ تحضير الصورة النهائية · تحرير موارد التصيير المباشر",
|
||||
"render.live.invalid_size": "يتطلب التصيير المباشر عرضًا وارتفاعًا موجبين للإخراج.",
|
||||
"render.live.pause": "إيقاف المباشر مؤقتًا",
|
||||
"render.live.paused": "مباشر · متوقف مؤقتًا",
|
||||
"render.live.paused_outdated": "مباشر · متوقف مؤقتًا · غير محدّث",
|
||||
"render.live.quality_help": "جودة تفاعلية: بحد أقصى 512 بكسل للضلع الأطول. تستخدم المصيّر المحدد ومؤثراته المدعومة. تبقى دقة الصورة النهائية وإعداداتها وتصديرها مستقلة.",
|
||||
"render.live.refused": "التصيير المباشر غير متاح: {reason}",
|
||||
"render.live.resume": "استئناف المباشر",
|
||||
"render.live.samples": "مباشر · {width} × {height} · {current}/{target} عينة",
|
||||
"render.live.stopped": "توقف التصيير المباشر",
|
||||
"render.live.updating": "مباشر · جودة تفاعلية (حتى 512 بكسل) · جارٍ التحديث",
|
||||
"render.live.waiting_canvas": "في انتظار لوحة التصيير",
|
||||
"render.live.worker_stopped": "توقفت مهمة التقاط التصيير المباشر قبل إرجاع نتيجة"
|
||||
},
|
||||
"de": {
|
||||
"render.live.final_changed": "Die Render-Anfrage hat sich beim Anhalten des Live-Renderings geändert. Starten Sie das finale Bild erneut.",
|
||||
"render.live.final_waiting": "Finales Bild vorbereiten · Live-Render-Ressourcen freigeben",
|
||||
"render.live.invalid_size": "Live-Rendering benötigt eine positive Ausgabebreite und -höhe.",
|
||||
"render.live.pause": "Live pausieren",
|
||||
"render.live.paused": "Live · Pausiert",
|
||||
"render.live.paused_outdated": "Live · Pausiert · Veraltet",
|
||||
"render.live.quality_help": "Interaktive Qualität: höchstens 512 Pixel an der längsten Kante. Verwendet den gewählten Renderer und seine unterstützten Effekte. Endauflösung, Einstellungen und Export bleiben getrennt.",
|
||||
"render.live.refused": "Live nicht verfügbar: {reason}",
|
||||
"render.live.resume": "Live fortsetzen",
|
||||
"render.live.samples": "Live · {width} × {height} · {current}/{target} Samples",
|
||||
"render.live.stopped": "Live-Rendering angehalten",
|
||||
"render.live.updating": "Live · Interaktive Qualität (bis 512 px) · Aktualisierung",
|
||||
"render.live.waiting_canvas": "Warten auf die Render-Ansicht",
|
||||
"render.live.worker_stopped": "Der Aufnahmeprozess für das Live-Rendering wurde vor der Rückgabe eines Ergebnisses beendet"
|
||||
},
|
||||
"en": {
|
||||
"render.live.final_changed": "The render request changed while live rendering was stopping. Start the final image again.",
|
||||
"render.live.final_waiting": "Preparing final image · releasing live-render resources",
|
||||
"render.live.invalid_size": "Live rendering needs a positive output width and height.",
|
||||
"render.live.pause": "Pause live",
|
||||
"render.live.paused": "Live · Paused",
|
||||
"render.live.paused_outdated": "Live · Paused · Out of date",
|
||||
"render.live.quality_help": "Interactive quality: at most 512 pixels on the longest edge. Uses the selected renderer and its supported effects. Final resolution, settings and export remain separate.",
|
||||
"render.live.refused": "Live unavailable: {reason}",
|
||||
"render.live.resume": "Resume live",
|
||||
"render.live.samples": "Live · {width} × {height} · {current}/{target} samples",
|
||||
"render.live.stopped": "Live rendering stopped",
|
||||
"render.live.updating": "Live · Interactive quality (up to 512 px) · Updating",
|
||||
"render.live.waiting_canvas": "Waiting for the Render canvas",
|
||||
"render.live.worker_stopped": "The live-render capture worker stopped before returning a result"
|
||||
},
|
||||
"he": {
|
||||
"render.live.final_changed": "בקשת ההדמיה השתנתה בזמן עצירת ההדמיה החיה. יש להתחיל את התמונה הסופית מחדש.",
|
||||
"render.live.final_waiting": "מכין תמונה סופית · משחרר משאבי הדמיה חיה",
|
||||
"render.live.invalid_size": "הדמיה חיה דורשת רוחב וגובה פלט גדולים מאפס.",
|
||||
"render.live.pause": "השהיית הדמיה חיה",
|
||||
"render.live.paused": "חי · מושהה",
|
||||
"render.live.paused_outdated": "חי · מושהה · לא מעודכן",
|
||||
"render.live.quality_help": "איכות אינטראקטיבית: לכל היותר 512 פיקסלים בצד הארוך. משתמשת במנוע ההדמיה שנבחר ובאפקטים הנתמכים בו. רזולוציית התמונה הסופית, ההגדרות והייצוא נשארים נפרדים.",
|
||||
"render.live.refused": "הדמיה חיה אינה זמינה: {reason}",
|
||||
"render.live.resume": "חידוש הדמיה חיה",
|
||||
"render.live.samples": "חי · {width} × {height} · {current}/{target} דגימות",
|
||||
"render.live.stopped": "ההדמיה החיה נעצרה",
|
||||
"render.live.updating": "חי · איכות אינטראקטיבית (עד 512 פיקסלים) · מתעדכן",
|
||||
"render.live.waiting_canvas": "ממתין למשטח ההדמיה",
|
||||
"render.live.worker_stopped": "תהליך הלכידה של ההדמיה החיה נעצר לפני שהחזיר תוצאה"
|
||||
},
|
||||
"ja": {
|
||||
"render.live.final_changed": "ライブレンダリングの停止中にリクエストが変更されました。最終画像をもう一度開始してください。",
|
||||
"render.live.final_waiting": "最終画像を準備中 · ライブレンダーのリソースを解放中",
|
||||
"render.live.invalid_size": "ライブレンダリングには正の出力幅と高さが必要です。",
|
||||
"render.live.pause": "ライブを一時停止",
|
||||
"render.live.paused": "ライブ · 一時停止中",
|
||||
"render.live.paused_outdated": "ライブ · 一時停止中 · 更新が必要",
|
||||
"render.live.quality_help": "インタラクティブ品質: 長辺は最大512ピクセルです。選択したレンダラーと対応する効果を使用します。最終解像度、設定、書き出しは別に保持します。",
|
||||
"render.live.refused": "ライブを利用できません: {reason}",
|
||||
"render.live.resume": "ライブを再開",
|
||||
"render.live.samples": "ライブ · {width} × {height} · {current}/{target} サンプル",
|
||||
"render.live.stopped": "ライブレンダリングを停止しました",
|
||||
"render.live.updating": "ライブ · インタラクティブ品質(最大512 px)· 更新中",
|
||||
"render.live.waiting_canvas": "レンダーキャンバスを待機中",
|
||||
"render.live.worker_stopped": "ライブレンダリングのキャプチャーワーカーが結果を返す前に停止しました"
|
||||
},
|
||||
"ko": {
|
||||
"render.live.final_changed": "라이브 렌더링을 중지하는 동안 렌더 요청이 변경되었습니다. 최종 이미지를 다시 시작하세요.",
|
||||
"render.live.final_waiting": "최종 이미지 준비 중 · 라이브 렌더 리소스 해제 중",
|
||||
"render.live.invalid_size": "라이브 렌더링에는 양수의 출력 너비와 높이가 필요합니다.",
|
||||
"render.live.pause": "라이브 일시 중지",
|
||||
"render.live.paused": "라이브 · 일시 중지됨",
|
||||
"render.live.paused_outdated": "라이브 · 일시 중지됨 · 업데이트 필요",
|
||||
"render.live.quality_help": "대화형 품질: 가장 긴 변은 최대 512픽셀입니다. 선택한 렌더러와 지원하는 효과를 사용합니다. 최종 해상도, 설정 및 내보내기는 별도로 유지됩니다.",
|
||||
"render.live.refused": "라이브 사용 불가: {reason}",
|
||||
"render.live.resume": "라이브 재개",
|
||||
"render.live.samples": "라이브 · {width} × {height} · {current}/{target} 샘플",
|
||||
"render.live.stopped": "라이브 렌더링 중지됨",
|
||||
"render.live.updating": "라이브 · 대화형 품질(최대 512 px) · 업데이트 중",
|
||||
"render.live.waiting_canvas": "렌더 캔버스 대기 중",
|
||||
"render.live.worker_stopped": "라이브 렌더 캡처 작업이 결과를 반환하기 전에 중지되었습니다"
|
||||
},
|
||||
"vi": {
|
||||
"render.live.final_changed": "Yêu cầu kết xuất đã thay đổi trong lúc dừng kết xuất trực tiếp. Hãy bắt đầu lại ảnh cuối cùng.",
|
||||
"render.live.final_waiting": "Đang chuẩn bị ảnh cuối · Giải phóng tài nguyên kết xuất trực tiếp",
|
||||
"render.live.invalid_size": "Kết xuất trực tiếp yêu cầu chiều rộng và chiều cao đầu ra lớn hơn không.",
|
||||
"render.live.pause": "Tạm dừng trực tiếp",
|
||||
"render.live.paused": "Trực tiếp · Tạm dừng",
|
||||
"render.live.paused_outdated": "Trực tiếp · Tạm dừng · Chưa cập nhật",
|
||||
"render.live.quality_help": "Chất lượng tương tác: tối đa 512 pixel ở cạnh dài nhất. Sử dụng bộ kết xuất đã chọn và các hiệu ứng được bộ đó hỗ trợ. Độ phân giải cuối, thiết lập và thao tác xuất vẫn độc lập.",
|
||||
"render.live.refused": "Kết xuất trực tiếp không khả dụng: {reason}",
|
||||
"render.live.resume": "Tiếp tục trực tiếp",
|
||||
"render.live.samples": "Trực tiếp · {width} × {height} · {current}/{target} mẫu",
|
||||
"render.live.stopped": "Kết xuất trực tiếp đã dừng",
|
||||
"render.live.updating": "Trực tiếp · Chất lượng tương tác (tối đa 512 px) · Đang cập nhật",
|
||||
"render.live.waiting_canvas": "Đang chờ khung vẽ Kết xuất",
|
||||
"render.live.worker_stopped": "Luồng thu nhận dữ liệu cho kết xuất trực tiếp đã dừng trước khi trả về kết quả"
|
||||
},
|
||||
"zh": {
|
||||
"render.live.final_changed": "停止实时渲染时渲染请求已更改。请重新开始最终图像渲染。",
|
||||
"render.live.final_waiting": "正在准备最终图像 · 释放实时渲染资源",
|
||||
"render.live.invalid_size": "实时渲染需要正的输出宽度和高度。",
|
||||
"render.live.pause": "暂停实时渲染",
|
||||
"render.live.paused": "实时 · 已暂停",
|
||||
"render.live.paused_outdated": "实时 · 已暂停 · 已过时",
|
||||
"render.live.quality_help": "交互质量:最长边最多为 512 像素。使用所选渲染器及其支持的效果。最终分辨率、设置和导出保持独立。",
|
||||
"render.live.refused": "实时渲染不可用:{reason}",
|
||||
"render.live.resume": "恢复实时渲染",
|
||||
"render.live.samples": "实时 · {width} × {height} · {current}/{target} 次采样",
|
||||
"render.live.stopped": "实时渲染已停止",
|
||||
"render.live.updating": "实时 · 交互质量(最多 512 px)· 正在更新",
|
||||
"render.live.waiting_canvas": "正在等待渲染画布",
|
||||
"render.live.worker_stopped": "实时渲染捕获工作线程在返回结果之前已停止"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"en": {
|
||||
"render.batch_owner_limit": "At most 32 document shot queues can be retained. Finish or cancel an existing queue first.",
|
||||
"render.batch_preparing": "Preparing next shot",
|
||||
"render.batch_waiting_worker": "Waiting for render preparation",
|
||||
"render.preparation_cancelled": "Render preparation cancelled",
|
||||
"render.preparation_checking": "Checking render",
|
||||
"render.preparation_retirement_failed": "Render preparation cleanup failed. This window cannot prepare another image.",
|
||||
"render.preparation_retiring": "Finishing render preparation",
|
||||
"render.preparation_unavailable": "Render preparation unavailable"
|
||||
},
|
||||
"de": {
|
||||
"render.batch_owner_limit": "Es können höchstens 32 Dokument-Bildfolgen vorgehalten werden. Schließen Sie zuerst eine vorhandene Folge ab oder brechen Sie sie ab.",
|
||||
"render.batch_preparing": "Nächste Aufnahme wird vorbereitet",
|
||||
"render.batch_waiting_worker": "Warten auf die Rendering-Vorbereitung",
|
||||
"render.preparation_cancelled": "Rendering-Vorbereitung abgebrochen",
|
||||
"render.preparation_checking": "Rendering wird geprüft",
|
||||
"render.preparation_retirement_failed": "Die Bereinigung der Rendering-Vorbereitung ist fehlgeschlagen. Dieses Fenster kann kein weiteres Bild vorbereiten.",
|
||||
"render.preparation_retiring": "Rendering-Vorbereitung wird abgeschlossen",
|
||||
"render.preparation_unavailable": "Rendering-Vorbereitung nicht verfügbar"
|
||||
},
|
||||
"ja": {
|
||||
"render.batch_owner_limit": "保持できるドキュメントのショットキューは最大32個です。既存のキューを完了するかキャンセルしてください。",
|
||||
"render.batch_preparing": "次のショットを準備中",
|
||||
"render.batch_waiting_worker": "レンダリングの準備待ち",
|
||||
"render.preparation_cancelled": "レンダリングの準備をキャンセルしました",
|
||||
"render.preparation_checking": "レンダリングを確認中",
|
||||
"render.preparation_retirement_failed": "レンダリング準備の後処理に失敗しました。このウィンドウでは別の画像を準備できません。",
|
||||
"render.preparation_retiring": "レンダリングの準備を終了中",
|
||||
"render.preparation_unavailable": "レンダリングの準備を利用できません"
|
||||
},
|
||||
"ko": {
|
||||
"render.batch_owner_limit": "문서 샷 대기열은 최대 32개까지 유지할 수 있습니다. 기존 대기열을 완료하거나 취소하세요.",
|
||||
"render.batch_preparing": "다음 샷 준비 중",
|
||||
"render.batch_waiting_worker": "렌더링 준비 대기 중",
|
||||
"render.preparation_cancelled": "렌더링 준비가 취소되었습니다",
|
||||
"render.preparation_checking": "렌더링 확인 중",
|
||||
"render.preparation_retirement_failed": "렌더링 준비 정리에 실패했습니다. 이 창에서는 다른 이미지를 준비할 수 없습니다.",
|
||||
"render.preparation_retiring": "렌더링 준비 마무리 중",
|
||||
"render.preparation_unavailable": "렌더링 준비를 사용할 수 없음"
|
||||
},
|
||||
"zh": {
|
||||
"render.batch_owner_limit": "最多可保留32个文档的镜头队列。请先完成或取消现有队列。",
|
||||
"render.batch_preparing": "正在准备下一个镜头",
|
||||
"render.batch_waiting_worker": "等待渲染准备",
|
||||
"render.preparation_cancelled": "渲染准备已取消",
|
||||
"render.preparation_checking": "正在检查渲染",
|
||||
"render.preparation_retirement_failed": "渲染准备清理失败。此窗口无法再准备其他图像。",
|
||||
"render.preparation_retiring": "正在完成渲染准备",
|
||||
"render.preparation_unavailable": "渲染准备不可用"
|
||||
},
|
||||
"ar": {
|
||||
"render.batch_owner_limit": "يمكن الاحتفاظ بقوائم لقطات 32 مستندًا كحد أقصى. أكمل قائمة موجودة أو ألغها أولًا.",
|
||||
"render.batch_preparing": "جارٍ إعداد اللقطة التالية",
|
||||
"render.batch_waiting_worker": "في انتظار إعداد التصيير",
|
||||
"render.preparation_cancelled": "أُلغي إعداد التصيير",
|
||||
"render.preparation_checking": "جارٍ التحقق من التصيير",
|
||||
"render.preparation_retirement_failed": "تعذّر تنظيف موارد إعداد التصيير. لا يمكن لهذه النافذة إعداد صورة أخرى.",
|
||||
"render.preparation_retiring": "جارٍ إنهاء إعداد التصيير",
|
||||
"render.preparation_unavailable": "إعداد التصيير غير متاح"
|
||||
},
|
||||
"he": {
|
||||
"render.batch_owner_limit": "ניתן לשמור תורי צילומים של 32 מסמכים לכל היותר. יש להשלים או לבטל תור קיים תחילה.",
|
||||
"render.batch_preparing": "מכין את הצילום הבא",
|
||||
"render.batch_waiting_worker": "ממתין להכנת הרינדור",
|
||||
"render.preparation_cancelled": "הכנת הרינדור בוטלה",
|
||||
"render.preparation_checking": "בודק רינדור",
|
||||
"render.preparation_retirement_failed": "ניקוי משאבי הכנת הרינדור נכשל. לא ניתן להכין תמונה נוספת בחלון זה.",
|
||||
"render.preparation_retiring": "מסיים את הכנת הרינדור",
|
||||
"render.preparation_unavailable": "הכנת הרינדור אינה זמינה"
|
||||
},
|
||||
"vi": {
|
||||
"render.batch_owner_limit": "Chỉ có thể giữ hàng đợi cảnh của tối đa 32 tài liệu. Hãy hoàn tất hoặc hủy một hàng đợi hiện có trước.",
|
||||
"render.batch_preparing": "Đang chuẩn bị cảnh tiếp theo",
|
||||
"render.batch_waiting_worker": "Đang chờ chuẩn bị kết xuất",
|
||||
"render.preparation_cancelled": "Đã hủy chuẩn bị kết xuất",
|
||||
"render.preparation_checking": "Đang kiểm tra kết xuất",
|
||||
"render.preparation_retirement_failed": "Không thể giải phóng tài nguyên chuẩn bị kết xuất. Cửa sổ này không thể chuẩn bị ảnh khác.",
|
||||
"render.preparation_retiring": "Đang hoàn tất chuẩn bị kết xuất",
|
||||
"render.preparation_unavailable": "Không thể chuẩn bị kết xuất"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.cpu_fixed_retained": "تم الاحتفاظ بأخذ العينات الثابت",
|
||||
"render.cpu_progressive_adopt": "استخدام أخذ العينات التدريجي",
|
||||
"render.cpu_progressive_adopt_help": "يستخدم أخذ العينات التدريجي عينة كاميرا واحدة لكل تمريرة. يبقى حجم الصورة والأضواء وإعدادات الانعكاس دون تغيير.",
|
||||
"render.cpu_progressive_always": "أخذ العينات التدريجي مفعّل دائمًا",
|
||||
"render.cpu_progressive_reflection_adopt": "اضبط محاولات الانعكاس المحددة على 1 قبل تفعيل أخذ العينات التدريجي."
|
||||
},
|
||||
"de": {
|
||||
"render.cpu_fixed_retained": "Feste Abtastung beibehalten",
|
||||
"render.cpu_progressive_adopt": "Progressive Abtastung verwenden",
|
||||
"render.cpu_progressive_adopt_help": "Die progressive Abtastung verwendet ein Kamerasample pro Durchlauf. Bildgröße, Lichtquellen und Reflexionseinstellungen bleiben unverändert.",
|
||||
"render.cpu_progressive_always": "Progressive Abtastung ist immer aktiv",
|
||||
"render.cpu_progressive_reflection_adopt": "Setzen Sie die Reflexionsversuche ausgewählter Körper auf 1, bevor Sie die progressive Abtastung übernehmen."
|
||||
},
|
||||
"en": {
|
||||
"render.cpu_fixed_retained": "Fixed sampling retained",
|
||||
"render.cpu_progressive_adopt": "Use progressive sampling",
|
||||
"render.cpu_progressive_adopt_help": "Adopting progressive uses one camera sample per pass. Image size, lights and reflection settings stay unchanged.",
|
||||
"render.cpu_progressive_always": "Progressive sampling is always on",
|
||||
"render.cpu_progressive_reflection_adopt": "Set selected reflection attempts to 1 before adopting progressive sampling."
|
||||
},
|
||||
"he": {
|
||||
"render.cpu_fixed_retained": "הדגימה הקבועה נשמרה",
|
||||
"render.cpu_progressive_adopt": "שימוש בדגימה הדרגתית",
|
||||
"render.cpu_progressive_adopt_help": "מעבר לדגימה הדרגתית משתמש בדגימת מצלמה אחת לכל מעבר. גודל התמונה, האורות והגדרות ההחזר נשארים ללא שינוי.",
|
||||
"render.cpu_progressive_always": "דגימה הדרגתית פעילה תמיד",
|
||||
"render.cpu_progressive_reflection_adopt": "יש לקבוע את מספר ניסיונות ההחזר שנבחרו ל־1 לפני המעבר לדגימה הדרגתית."
|
||||
},
|
||||
"ja": {
|
||||
"render.cpu_fixed_retained": "固定サンプリングを維持",
|
||||
"render.cpu_progressive_adopt": "プログレッシブサンプリングを使用",
|
||||
"render.cpu_progressive_adopt_help": "切り替えると各パスで1つのカメラサンプルを使用します。画像サイズ、照明、反射設定は変わりません。",
|
||||
"render.cpu_progressive_always": "プログレッシブサンプリングは常に有効です",
|
||||
"render.cpu_progressive_reflection_adopt": "切り替える前に、選択した反射の試行回数を1に設定してください。"
|
||||
},
|
||||
"ko": {
|
||||
"render.cpu_fixed_retained": "고정 샘플링 유지",
|
||||
"render.cpu_progressive_adopt": "점진적 샘플링 사용",
|
||||
"render.cpu_progressive_adopt_help": "전환하면 패스마다 카메라 샘플 하나를 사용합니다. 이미지 크기, 조명 및 반사 설정은 유지됩니다.",
|
||||
"render.cpu_progressive_always": "점진적 샘플링은 항상 켜져 있습니다",
|
||||
"render.cpu_progressive_reflection_adopt": "전환하기 전에 선택한 반사의 시도 횟수를 1로 설정하세요."
|
||||
},
|
||||
"vi": {
|
||||
"render.cpu_fixed_retained": "Đã giữ lấy mẫu cố định",
|
||||
"render.cpu_progressive_adopt": "Dùng lấy mẫu lũy tiến",
|
||||
"render.cpu_progressive_adopt_help": "Lấy mẫu lũy tiến sử dụng một mẫu máy ảnh cho mỗi lượt. Kích thước ảnh, nguồn sáng và thiết lập phản xạ không thay đổi.",
|
||||
"render.cpu_progressive_always": "Lấy mẫu lũy tiến luôn bật",
|
||||
"render.cpu_progressive_reflection_adopt": "Đặt số lần thử phản xạ đã chọn thành 1 trước khi chuyển sang lấy mẫu lũy tiến."
|
||||
},
|
||||
"zh": {
|
||||
"render.cpu_fixed_retained": "保留固定采样",
|
||||
"render.cpu_progressive_adopt": "使用渐进采样",
|
||||
"render.cpu_progressive_adopt_help": "启用后每轮使用一个相机样本。图像大小、灯光和反射设置保持不变。",
|
||||
"render.cpu_progressive_always": "渐进采样始终开启",
|
||||
"render.cpu_progressive_reflection_adopt": "启用渐进采样前,请将所选反射的尝试次数设为1。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.quality_budget_help": "يضبط الحجم والعينات والعمق والبذرة وتقليل التشويش. تُحفظ إعدادات الصورة الأخرى.",
|
||||
"render.quality_denoise_off": "تقليل التشويش: متوقف",
|
||||
"render.quality_denoise_on": "تقليل التشويش: مفعّل"
|
||||
},
|
||||
"de": {
|
||||
"render.quality_budget_help": "Legt Größe, Samples, Tiefe, Startwert und Rauschreduzierung fest. Andere Bildeinstellungen bleiben erhalten.",
|
||||
"render.quality_denoise_off": "Rauschreduzierung: Aus",
|
||||
"render.quality_denoise_on": "Rauschreduzierung: Ein"
|
||||
},
|
||||
"en": {
|
||||
"render.quality_budget_help": "Sets size, samples, depth, seed and noise reduction. Other image settings are kept.",
|
||||
"render.quality_denoise_off": "Noise reduction: Off",
|
||||
"render.quality_denoise_on": "Noise reduction: On"
|
||||
},
|
||||
"he": {
|
||||
"render.quality_budget_help": "קובע גודל, דגימות, עומק, זרע והפחתת רעש. הגדרות התמונה האחרות נשמרות.",
|
||||
"render.quality_denoise_off": "הפחתת רעש: כבויה",
|
||||
"render.quality_denoise_on": "הפחתת רעש: פעילה"
|
||||
},
|
||||
"ja": {
|
||||
"render.quality_budget_help": "サイズ、サンプル数、深度、シード、ノイズ低減を設定します。他の画像設定は維持されます。",
|
||||
"render.quality_denoise_off": "ノイズ低減:オフ",
|
||||
"render.quality_denoise_on": "ノイズ低減:オン"
|
||||
},
|
||||
"ko": {
|
||||
"render.quality_budget_help": "크기, 샘플 수, 깊이, 시드 및 노이즈 제거를 설정합니다. 다른 이미지 설정은 유지됩니다.",
|
||||
"render.quality_denoise_off": "노이즈 제거: 꺼짐",
|
||||
"render.quality_denoise_on": "노이즈 제거: 켜짐"
|
||||
},
|
||||
"vi": {
|
||||
"render.quality_budget_help": "Đặt kích thước, số mẫu, độ sâu, hạt giống và giảm nhiễu. Giữ nguyên các thiết lập ảnh khác.",
|
||||
"render.quality_denoise_off": "Giảm nhiễu: Tắt",
|
||||
"render.quality_denoise_on": "Giảm nhiễu: Bật"
|
||||
},
|
||||
"zh": {
|
||||
"render.quality_budget_help": "设置尺寸、采样数、深度、种子和降噪。其他图像设置保持不变。",
|
||||
"render.quality_denoise_off": "降噪:关闭",
|
||||
"render.quality_denoise_on": "降噪:开启"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} عينة · العمق {depth} · البذرة {seed} · {denoise}"
|
||||
},
|
||||
"de": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} Samples · Tiefe {depth} · Startwert {seed} · {denoise}"
|
||||
},
|
||||
"en": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} samples · depth {depth} · seed {seed} · {denoise}"
|
||||
},
|
||||
"he": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} דגימות · עומק {depth} · זרע {seed} · {denoise}"
|
||||
},
|
||||
"ja": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} サンプル · 深度 {depth} · シード {seed} · {denoise}"
|
||||
},
|
||||
"ko": {
|
||||
"render.quality_summary": "{width} × {height} · 샘플 {samples}개 · 깊이 {depth} · 시드 {seed} · {denoise}"
|
||||
},
|
||||
"vi": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} mẫu · độ sâu {depth} · hạt giống {seed} · {denoise}"
|
||||
},
|
||||
"zh": {
|
||||
"render.quality_summary": "{width} × {height} · {samples} 次采样 · 深度 {depth} · 种子 {seed} · {denoise}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"ar": {
|
||||
"render.live.source_current": "{method} · مباشر",
|
||||
"render.live.source_outdated": "{method} · الصورة السابقة",
|
||||
"render.live.source_outdated_help": "يعرض آخر صورة ملتقطة أثناء تحديث التصيير المباشر أو عند عدم توفره. قد تختلف عن المشهد أو إعدادات الصورة الحالية.",
|
||||
"render.live.source_settings_help": "افتح «الإخراج» لتعديل المصيّر وإعدادات الصورة."
|
||||
},
|
||||
"de": {
|
||||
"render.live.source_current": "{method} · Live",
|
||||
"render.live.source_outdated": "{method} · Vorheriges Bild",
|
||||
"render.live.source_outdated_help": "Zeigt das zuletzt aufgenommene Bild, während das Live-Rendering aktualisiert wird oder nicht verfügbar ist. Es kann von der aktuellen Szene oder den Bildeinstellungen abweichen.",
|
||||
"render.live.source_settings_help": "Ausgabe öffnen, um Renderer und Bildeinstellungen zu bearbeiten."
|
||||
},
|
||||
"en": {
|
||||
"render.live.source_current": "{method} · Live",
|
||||
"render.live.source_outdated": "{method} · Previous image",
|
||||
"render.live.source_outdated_help": "Shows the last captured image while live rendering updates or is unavailable. It may differ from the current scene or image settings.",
|
||||
"render.live.source_settings_help": "Open Output to edit the renderer and image settings."
|
||||
},
|
||||
"he": {
|
||||
"render.live.source_current": "{method} · חי",
|
||||
"render.live.source_outdated": "{method} · תמונה קודמת",
|
||||
"render.live.source_outdated_help": "מציג את התמונה האחרונה שנלכדה בזמן שההדמיה החיה מתעדכנת או אינה זמינה. היא עשויה להיות שונה מהסצנה או מהגדרות התמונה הנוכחיות.",
|
||||
"render.live.source_settings_help": "יש לפתוח את חלונית הפלט כדי לערוך את מנוע ההדמיה ואת הגדרות התמונה."
|
||||
},
|
||||
"ja": {
|
||||
"render.live.source_current": "{method} · ライブ",
|
||||
"render.live.source_outdated": "{method} · 前の画像",
|
||||
"render.live.source_outdated_help": "ライブレンダリングの更新中や利用できない間は、最後に取得した画像を表示します。現在のシーンや画像設定とは異なる場合があります。",
|
||||
"render.live.source_settings_help": "出力を開いてレンダラーと画像設定を編集します。"
|
||||
},
|
||||
"ko": {
|
||||
"render.live.source_current": "{method} · 라이브",
|
||||
"render.live.source_outdated": "{method} · 이전 이미지",
|
||||
"render.live.source_outdated_help": "라이브 렌더링이 업데이트 중이거나 사용할 수 없는 동안 마지막으로 캡처한 이미지를 표시합니다. 현재 장면 또는 이미지 설정과 다를 수 있습니다.",
|
||||
"render.live.source_settings_help": "출력을 열어 렌더러와 이미지 설정을 편집합니다."
|
||||
},
|
||||
"vi": {
|
||||
"render.live.source_current": "{method} · Trực tiếp",
|
||||
"render.live.source_outdated": "{method} · Ảnh trước",
|
||||
"render.live.source_outdated_help": "Hiển thị ảnh đã chụp gần nhất trong khi kết xuất trực tiếp đang cập nhật hoặc không khả dụng. Ảnh có thể khác cảnh hoặc thiết lập ảnh hiện tại.",
|
||||
"render.live.source_settings_help": "Mở mục Đầu ra để sửa bộ kết xuất và thiết lập ảnh."
|
||||
},
|
||||
"zh": {
|
||||
"render.live.source_current": "{method} · 实时",
|
||||
"render.live.source_outdated": "{method} · 上一幅图像",
|
||||
"render.live.source_outdated_help": "实时渲染更新或不可用时显示上次捕获的图像。它可能与当前场景或图像设置不同。",
|
||||
"render.live.source_settings_help": "打开输出以编辑渲染器和图像设置。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"ar": {
|
||||
"prefs.layout_page.hover_panel_menus": "تبديل قوائم اللوحات عند مرور المؤشر",
|
||||
"prefs.layout_page.hover_panel_menus_help": "انقر على اسم لوحة في الشريط لفتح قائمتها. مرّر المؤشر فوق اسم لوحة أخرى للتبديل. حرّك المؤشر خارج الشريط والقائمة المفتوحة لإغلاقها."
|
||||
},
|
||||
"de": {
|
||||
"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."
|
||||
},
|
||||
"en": {
|
||||
"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."
|
||||
},
|
||||
"he": {
|
||||
"prefs.layout_page.hover_panel_menus": "מעבר בין תפריטי לוחות בריחוף",
|
||||
"prefs.layout_page.hover_panel_menus_help": "לחצו על שם לוח ברצועת הכלים כדי לפתוח את התפריט שלו. העבירו את הסמן מעל שם של לוח אחר כדי לעבור לתפריט שלו. הזיזו את הסמן אל מחוץ לרצועת הכלים ולתפריט הפתוח כדי לסגור אותו."
|
||||
},
|
||||
"ja": {
|
||||
"prefs.layout_page.hover_panel_menus": "ポイントしてパネルメニューを切り替える",
|
||||
"prefs.layout_page.hover_panel_menus_help": "リボンのパネル名をクリックしてメニューを開きます。別のパネル名にポインターを合わせると切り替わります。リボンと開いているメニューの外に移動すると閉じます。"
|
||||
},
|
||||
"ko": {
|
||||
"prefs.layout_page.hover_panel_menus": "포인터를 올려 패널 메뉴 전환",
|
||||
"prefs.layout_page.hover_panel_menus_help": "리본의 패널 이름을 클릭하여 메뉴를 엽니다. 다른 패널 이름에 포인터를 올리면 메뉴가 전환됩니다. 리본과 열린 메뉴 밖으로 포인터를 이동하면 메뉴가 닫힙니다."
|
||||
},
|
||||
"vi": {
|
||||
"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."
|
||||
},
|
||||
"zh": {
|
||||
"prefs.layout_page.hover_panel_menus": "悬停切换面板菜单",
|
||||
"prefs.layout_page.hover_panel_menus_help": "点击功能区的面板名称打开菜单。将指针悬停在另一面板名称上即可切换菜单。将指针移到功能区和已打开菜单之外即可关闭菜单。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"en": {
|
||||
"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"
|
||||
},
|
||||
"ar": {
|
||||
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "محور الأصل عمودي على مستوى الرسم، لذا ليس له خط في المستوى"
|
||||
},
|
||||
"de": {
|
||||
"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"
|
||||
},
|
||||
"he": {
|
||||
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "ציר הראשית ניצב למישור הסקיצה, ולכן אין לו קו במישור"
|
||||
},
|
||||
"ja": {
|
||||
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "原点軸はスケッチ平面に垂直なため、平面内に線がありません"
|
||||
},
|
||||
"ru": {
|
||||
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "Ось начала координат перпендикулярна плоскости эскиза, поэтому линии в этой плоскости нет"
|
||||
},
|
||||
"vi": {
|
||||
"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"
|
||||
},
|
||||
"zh": {
|
||||
"The origin axis is perpendicular to the sketch plane, so it has no line in the plane": "原点轴垂直于草图平面,因此在该平面内没有直线"
|
||||
}
|
||||
}
|
||||
+36
-13
@@ -1395,6 +1395,7 @@
|
||||
"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}",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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.",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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ữ",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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.",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "Ngưỡng lỗi RGB tuyệt đối",
|
||||
"render.adaptive_coverage": "Mục tiêu lỗi độ phủ (Coverage error)",
|
||||
"render.adaptive_enable": "Phân bổ mẫu bằng các mẫu thử độc lập",
|
||||
"render.adaptive_help": "Chỉ dành cho GPU. Các mẫu thử độc lập sẽ bị loại bỏ, sau đó phân bổ tối thiểu 16 mẫu chính thức trên mỗi pixel cho đến khi đạt giới hạn mẫu. Phương sai RGB và độ phủ chỉ dùng để định hướng phân bổ; các đường truyền tia hiếm có thể bị bỏ sót và pixel đạt giới hạn vẫn có thể còn nhiễu. Báo cáo cuối cùng ghi nhận khối lượng tính toán thực tế. Không đảm bảo tuyệt đối về độ nhiễu hay thời gian.",
|
||||
"render.adaptive_help": "Các mẫu thăm dò độc lập được loại bỏ, sau đó chọn ít nhất 16 mẫu sản xuất cho mỗi điểm ảnh, tối đa bằng Số mẫu mỗi điểm ảnh. Giới hạn tài nguyên CPU bao gồm cả hai giai đoạn. Phương sai RGB và độ phủ hướng dẫn phân bổ; điểm ảnh đạt trần vẫn có thể nhiễu. Báo cáo cuối đếm số mẫu thực tế.",
|
||||
"render.adaptive_minimum": "Số mẫu chính thức tối thiểu",
|
||||
"render.adaptive_pending": "GPU hỗ trợ phân bổ thích ứng qua mẫu thử độc lập và phân tầng Fresnel có điều kiện. Chưa hỗ trợ kiểm định hội tụ, đảm bảo sự kiện hiếm và truyền dẫn thích ứng trên CPU.",
|
||||
"render.adaptive_pending": "Phân bổ thích ứng bằng mẫu thăm dò độc lập có trên CPU và GPU. Các tầng Fresnel có điều kiện cần GPU. Phân bổ thống kê không chứng nhận sự hội tụ.",
|
||||
"render.adaptive_pilots": "Số mẫu thử trên mỗi pixel",
|
||||
"render.adaptive_relative": "Mục tiêu lỗi RGB tương đối",
|
||||
"render.add_ground": "Thêm mặt sàn khớp vào thiết lập",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "Thay thuộc tính quang học đã lưu của thân này",
|
||||
"render.appearance_editor.revalidate": "Kiểm tra lại thân này",
|
||||
"render.appearance_editor.save": "Lưu các thuộc tính quang học này",
|
||||
"render.appearance_editor.save_reason": "Lưu các thuộc tính quang học này cần kính vật lý trên một thân GPU hiện hành. Lớp phủ và bản đồ ảnh cục bộ vẫn tạm thời.",
|
||||
"render.appearance_editor.save_reason": "Để lưu Kính, hãy bật nó trên thân CPU hoặc GPU hiện hành. Với lớp phủ bóng, dùng Lưu lớp phủ vào cảnh chụp. Các tệp ảnh cục bộ vẫn tạm thời.",
|
||||
"render.appearance_editor.saved": "Lưu cùng cảnh chụp này",
|
||||
"render.appearance_editor.saved_state": "Các thuộc tính quang học này được lưu cùng cảnh chụp này.",
|
||||
"render.appearance_editor.scatter_reason": "Tán xạ bên trong cần biên là khối đặc kín.",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "Sao chép JSON yêu cầu",
|
||||
"render.children.coverage_error": "Sai số độ phủ",
|
||||
"render.children.cpu": "Dò tia bằng CPU",
|
||||
"render.children.denoise": "Giảm nhiễu trong ảnh hoàn chỉnh",
|
||||
"render.children.denoise": "Giảm nhiễu ảnh",
|
||||
"render.children.depth": "Độ sâu đường đi",
|
||||
"render.children.distortion": "Méo",
|
||||
"render.children.edge_samples": "Mẫu cạnh",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "Tối đa tám nguồn sáng điểm, được bổ sung vào ánh sáng định hướng đã chọn. Khoảng cách tính bằng mm; khoảng cách tối thiểu không được vượt quá khoảng cách tham chiếu.",
|
||||
"render.cpu_primary_samples": "Số mẫu cạnh trên mỗi pixel",
|
||||
"render.cpu_progressive": "Kết xuất lũy tiến trên CPU",
|
||||
"render.cpu_progressive_help": "Tích lũy bộ tích phân CPU hiện có theo từng lượt một mẫu chính. Các phản xạ đã chọn yêu cầu một mẫu; nguồn sáng vùng, chất điện môi và bất đẳng hướng yêu cầu chế độ 'Hình ảnh đơn'.",
|
||||
"render.cpu_progressive_help": "Tích lũy các mẫu máy ảnh CPU mới và hiển thị từng lượt hoàn chỉnh. Phản xạ được chọn dùng một lần thử cho mỗi mẫu máy ảnh; kính được chứng nhận và dị hướng phẳng giữ các giới hạn hiện có. Mẫu thăm dò và mẫu sản xuất thích ứng dùng chung ngân sách cấu hình CPU.",
|
||||
"render.cpu_progressive_limits": "Tối đa 1.048.576 pixel và tổng số tính toán (pixel × mẫu) không quá 16.777.216. Thay đổi số mẫu không bao giờ tự động đổi kích thước ảnh.",
|
||||
"render.cpu_progressive_seed": "Hạt giống lấy mẫu CPU",
|
||||
"render.cpu_progressive_spp": "Mẫu trên mỗi pixel",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "Xuất: ảnh PNG hiển thị",
|
||||
"render.export_image_label": "Xuất ảnh",
|
||||
"render.export_linear": "Xuất: ảnh EXR tuyến tính thô",
|
||||
"render.exr_pending": "GPU có thể giữ lại tệp EXR tuyến tính thô. Tính năng nén, ảnh nhiều lớp và các kênh kết xuất phụ trợ vẫn chưa được triển khai.",
|
||||
"render.exr_pending": "Dò tia trên CPU và dò đường đi trên GPU có thể giữ lại EXR tuyến tính thô. Tính năng nén, ảnh nhiều lớp và các lượt kết xuất phụ trợ vẫn chưa khả dụng.",
|
||||
"render.film_grain": "Hạt nhiễu nhiếp ảnh (Film Grain)",
|
||||
"render.fit": "Thu phóng vừa sản phẩm",
|
||||
"render.fixed_camera": "Máy ảnh",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "Dò tia trên CPU",
|
||||
"render.method_gpu": "Dò đường truyền tia trên GPU (Path Tracing)",
|
||||
"render.method_limit_raster": "Quét mảng (Raster) dùng bản xem trước studio đục cố định. Chọn phương thức dò tia rõ ràng để dùng các điều khiển quang học được hỗ trợ.",
|
||||
"render.method_raster": "Quét mảng CPU (Raster)",
|
||||
"render.method_raster": "Raster trên CPU (dạng sơ đồ)",
|
||||
"render.navigation_help": "Camera di chuyển tương tự như trong Thiết kế (Tùy chọn cài đặt › Điều hướng). Lưu thiết lập sẽ ghi lại camera hiện tại.",
|
||||
"render.nested_enable": "Chất điện môi lồng nhau đã xác thực",
|
||||
"render.nested_help": "Tối đa 16 lớp chứa nhau; mỗi khối cha phải là khối lồi và mọi khối con phải nằm hoàn toàn bên trong. Từ chối giao cắt, bề mặt tiếp xúc, tấm mỏng và bóng đổ thẳng. Trạng thái camera bên trong tuân theo hệ thống phân cấp đã xác thực. Không tạo bề mặt chất lỏng hoặc hợp nhất các ranh giới CAD tiếp xúc.",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "Thiết lập đầu ra EXR không khả dụng ở đây. Xuất EXR tuyến tính cần ảnh GPU đã hoàn tất với bản gốc tuyến tính được giữ lại.",
|
||||
"render.output_fit": "Vừa khít",
|
||||
"render.output_format": "Định dạng",
|
||||
"render.output_format_status": "PNG là hình ảnh hiển thị hoàn chỉnh chính xác. EXR tùy chọn trên GPU giữ lại suất bức xạ FLOAT32 tuyến tính cảnh thô trước các bộ lọc hiển thị. Xuất không bao giờ thay thế bằng bộ nhớ đệm xem trước hoặc tác vụ khác.",
|
||||
"render.output_format_status": "PNG là ảnh hiển thị hoàn chỉnh chính xác. EXR tùy chọn trên CPU hoặc GPU giữ lại suất bức xạ FLOAT32 thô trong không gian tuyến tính của cảnh trước các bộ lọc hiển thị. Xuất không bao giờ thay thế ảnh bằng bộ nhớ đệm xem trước hoặc tác vụ khác.",
|
||||
"render.output_grading": "Chỉnh màu",
|
||||
"render.output_image": "Ảnh",
|
||||
"render.output_largest": "Tối đa {width} × {height}",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "Tùy chỉnh",
|
||||
"render.quality_draft": "Bản nháp",
|
||||
"render.quality_high": "Cao",
|
||||
"render.quality_projection_help": "Các thiết lập sẵn Q bao gồm các yêu cầu tương lai. Hành động này chỉ chiếu định mức mẫu PNG cố định được hỗ trợ và lược bỏ rõ ràng việc dừng thích ứng, đầu ra tuyến tính thô và các giới hạn truyền dẫn độc lập.",
|
||||
"render.quality_projection_help": "Bản xem xét này chỉ thay đổi độ phân giải, ngân sách mẫu, độ sâu đường đi, hạt giống và giảm nhiễu. Các thiết lập khác được giữ nguyên; ngân sách không chứng nhận ảnh đã hội tụ.",
|
||||
"render.quality_review": "Xem xét định mức lấy mẫu",
|
||||
"render.queue_pending": "Không có hàng đợi sản xuất tự động hay bộ kết xuất hoạt hình trong giao diện này. Ảnh tĩnh đã hoàn thành vẫn có thể xuất riêng lẻ.",
|
||||
"render.radial_assign": "Gán diện mạo",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "Thu phóng và lia theo tùy chọn Điều hướng. Nhấn phím cách + kéo rê để lia.",
|
||||
"render.result_open": "Mở hình ảnh đã hoàn thành trong khung vẽ chính.",
|
||||
"render.result_preview": "Xem trước trực tiếp",
|
||||
"render.result_provisional": "Hình ảnh CPU tạm thời",
|
||||
"render.result_provisional": "Ảnh tạm",
|
||||
"render.result_provisional_help": "Điểm kiểm tra trung gian này không thể xuất. Lệnh xuất giữ lại kết quả hoàn thành gần nhất; hủy bỏ sẽ quay lại kết quả đó.",
|
||||
"render.result_reduced_display": "Bản xem trước hiển thị bị thu nhỏ theo giới hạn bộ nhớ đệm/thiết bị của khung nhìn. Tệp PNG được giữ lại và tệp xuất vẫn giữ nguyên độ phân giải đầy đủ; chế độ kiểm tra gốc 100% không khả dụng cho chế độ xem thu nhỏ này.",
|
||||
"render.result_retained": "Đang hiển thị hình ảnh hoàn thành gần nhất; kết xuất mới hơn chưa thay thế nó.",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "Chuẩn bị kế hoạch tạo",
|
||||
"render.stage_panels.projects": "Chiếu",
|
||||
"render.stage_panels.quality_ack": "Tôi xác nhận ngân sách cố định và các mục bị lược bỏ",
|
||||
"render.stage_panels.quality_omissions": "Dừng thích ứng và mục tiêu sai số, độ sâu truyền dẫn riêng, quy tắc roulette Nga, đầu ra tuyến tính thô, bản gốc EXR và chứng nhận hội tụ.",
|
||||
"render.stage_panels.quality_omissions": "Ngân sách này không đặt mục tiêu sai số thích ứng, giới hạn truyền sáng độc lập, quy tắc roulette Nga hay việc lưu giữ bản gốc thô, và không bảo đảm ảnh hội tụ.",
|
||||
"render.stage_panels.reference": "Tham chiếu",
|
||||
"render.stage_panels.references": "Các tham chiếu",
|
||||
"render.stage_panels.remove_optics": "Xóa cài đặt quang học",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "Môi trường HDR nguyên bản · toàn bộ cảnh",
|
||||
"render.stage_panels.subtitle_maps": "Bản đồ không gian đã tạo · xem trước tạm thời",
|
||||
"render.stage_panels.subtitle_physical": "Kế hoạch chỉ đọc · không tạo hay gán vật liệu",
|
||||
"render.stage_panels.subtitle_quality": "Ngân sách GPU cố định · lược bỏ các yêu cầu tương lai",
|
||||
"render.stage_panels.subtitle_quality": "Ngân sách lấy mẫu GPU · chỉ các trường được liệt kê",
|
||||
"render.stage_panels.subtitle_rig": "Bộ đèn chiếu sáng đã thiết kế · bộ phát sáng và tấm thụ động",
|
||||
"render.stage_panels.subtitle_saved_maps": "Bản đồ đã tạo · lưu cùng khung hình này",
|
||||
"render.stage_panels.subtitle_stage": "Mặt sàn và sân khấu vật lý · khớp với sản phẩm",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"render.studio_area_help": "Tối đa bốn hình chữ nhật một mặt. Nửa cạnh trực giao U và V xác định kích thước; U × V hướng về phía chiếu sáng. Tọa độ tính theo milimét không gian thế giới.",
|
||||
"render.studio_center": "Tâm X, Y, Z (mm)",
|
||||
"render.studio_denoise": "Giảm nhiễu trong ảnh thành phẩm",
|
||||
"render.studio_denoise_help": "Bộ lọc cuối cùng bảo toàn cạnh; chi tiết tinh xảo có thể bị làm mềm. Thủy tinh và bề mặt phản xạ gương sắc nét bỏ qua bộ lọc này.",
|
||||
"render.studio_denoise_help": "Ảnh lũy tiến và ảnh cuối sử dụng bộ lọc bảo toàn biên; chi tiết nhỏ có thể bị làm mềm. Kính và bề mặt phản xạ sắc nét không qua bộ lọc này.",
|
||||
"render.studio_direction": "Hướng về phía mặt trời (X, Y, Z)",
|
||||
"render.studio_environment": "Môi trường",
|
||||
"render.studio_environment_bounds": "Góc xoay môi trường phải hữu hạn trong khoảng ±1.000.000 radian và cường độ từ 0 đến 100.",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"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",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"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",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"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",
|
||||
|
||||
@@ -1364,11 +1364,14 @@
|
||||
"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}",
|
||||
|
||||
+36
-13
@@ -1395,6 +1395,7 @@
|
||||
"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}",
|
||||
@@ -1403,6 +1404,8 @@
|
||||
"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}",
|
||||
@@ -2277,6 +2280,9 @@
|
||||
"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": "已降低模糊质量,以保持画面响应。模糊半径未改变。",
|
||||
@@ -2298,6 +2304,8 @@
|
||||
"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": "内置",
|
||||
@@ -2429,6 +2437,10 @@
|
||||
"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": "标签",
|
||||
@@ -2757,6 +2769,12 @@
|
||||
"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": "它的一个曲面无法用于建模。",
|
||||
@@ -2771,9 +2789,9 @@
|
||||
"render.adaptive_absolute": "RGB 绝对误差下限",
|
||||
"render.adaptive_coverage": "覆盖率误差目标",
|
||||
"render.adaptive_enable": "使用独立预采样分配样本",
|
||||
"render.adaptive_help": "仅限 GPU。丢弃独立预采样后,每像素分配至少16个正式样本,最多达到每像素样本数上限。RGB 和覆盖率方差仅用于指导分配;可能遗漏罕见路径,达到上限后仍可能有噪声。最终报告记录实际工作量,不保证噪声或耗时。",
|
||||
"render.adaptive_help": "独立的先导样本会被丢弃,随后为每个像素分配至少16个、不超过“每像素样本数”的正式样本。CPU资源限制包含两个阶段。RGB与覆盖率方差决定分配,达到上限的像素仍可能有噪点。最终报告记录实际样本数。",
|
||||
"render.adaptive_minimum": "最少正式样本数",
|
||||
"render.adaptive_pending": "GPU 支持独立预采样自适应分配和条件菲涅耳分层。尚不支持认证收敛、罕见事件保证及 CPU 自适应光传输。",
|
||||
"render.adaptive_pending": "CPU和GPU均支持独立先导样本的自适应分配。条件菲涅耳分层需要GPU。统计分配不保证收敛。",
|
||||
"render.adaptive_pilots": "每像素预采样数",
|
||||
"render.adaptive_relative": "RGB 相对误差目标",
|
||||
"render.add_ground": "向设置添加适配地面",
|
||||
@@ -2834,7 +2852,7 @@
|
||||
"render.appearance_editor.replace": "替换此实体已保存的光学设置",
|
||||
"render.appearance_editor.revalidate": "重新验证此实体",
|
||||
"render.appearance_editor.save": "保存这些光学设置",
|
||||
"render.appearance_editor.save_reason": "保存需要当前 GPU 实体上的物理玻璃。清漆和本地图像贴图仍为临时设置。",
|
||||
"render.appearance_editor.save_reason": "要保存玻璃,请在当前CPU或GPU实体上启用它。清漆请使用“将清漆保存到镜头”。本地图像文件仍为临时设置。",
|
||||
"render.appearance_editor.saved": "随此镜头保存",
|
||||
"render.appearance_editor.saved_state": "这些光学设置已随此镜头保存。",
|
||||
"render.appearance_editor.scatter_reason": "内部散射需要封闭实体边界。",
|
||||
@@ -2930,7 +2948,7 @@
|
||||
"render.children.copy_request": "复制请求JSON",
|
||||
"render.children.coverage_error": "覆盖误差",
|
||||
"render.children.cpu": "CPU光线追踪",
|
||||
"render.children.denoise": "降低成品图像噪点",
|
||||
"render.children.denoise": "降低图像噪点",
|
||||
"render.children.depth": "路径深度",
|
||||
"render.children.distortion": "畸变",
|
||||
"render.children.edge_samples": "边缘采样",
|
||||
@@ -3062,7 +3080,7 @@
|
||||
"render.cpu_point_help": "最多可在所选平行光照明基础上添加8个点光源。距离单位为mm,最小距离不得大于参考距离。",
|
||||
"render.cpu_primary_samples": "每像素边缘采样",
|
||||
"render.cpu_progressive": "CPU渐进渲染",
|
||||
"render.cpu_progressive_help": "使用现有CPU积分器,每轮累积一个主采样。所选反射需要单采样;面光源、电介质和各向异性需要固定图像模式。",
|
||||
"render.cpu_progressive_help": "累积新的CPU相机样本并显示每个完整的渲染轮次。选定反射在每个相机样本中尝试一次;经认证的玻璃和平面各向异性保留原有限制。自适应先导样本和正式样本共享CPU配置预算。",
|
||||
"render.cpu_progressive_limits": "最多1,048,576像素,像素×采样总数不超过16,777,216。更改采样数不会自动调整图像尺寸。",
|
||||
"render.cpu_progressive_seed": "CPU采样种子",
|
||||
"render.cpu_progressive_spp": "每像素采样数",
|
||||
@@ -3238,7 +3256,7 @@
|
||||
"render.export_display": "导出:显示 PNG",
|
||||
"render.export_image_label": "导出图像",
|
||||
"render.export_linear": "导出:原始线性 EXR",
|
||||
"render.exr_pending": "GPU 可保留线性 EXR;压缩、多层和辅助通道仍未实现。",
|
||||
"render.exr_pending": "CPU 光线追踪和 GPU 路径追踪可保留原始线性 EXR;压缩、多层和辅助通道仍未实现。",
|
||||
"render.film_grain": "摄影颗粒",
|
||||
"render.fit": "适配产品视图",
|
||||
"render.fixed_camera": "相机",
|
||||
@@ -3278,9 +3296,11 @@
|
||||
"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": "适配并保存地面",
|
||||
@@ -3599,7 +3619,7 @@
|
||||
"render.method_cpu": "CPU 光线追踪",
|
||||
"render.method_gpu": "GPU 路径追踪",
|
||||
"render.method_limit_raster": "光栅化使用固定的不透明工作室预览;要使用受支持的光学控件,请明确选择光线追踪方式。",
|
||||
"render.method_raster": "CPU 光栅",
|
||||
"render.method_raster": "CPU 光栅(示意图)",
|
||||
"render.navigation_help": "相机的操作与设计中相同(首选项 › 导航)。保存设置会记录当前相机。",
|
||||
"render.nested_enable": "经验证的嵌套介质",
|
||||
"render.nested_help": "最多16层包含关系。父体必须凸,子体必须严格位于内部。拒绝相交、接触、薄片和直线透射阴影。内部相机使用经验证的层次结构。不会创建液面或合并接触的CAD边界。",
|
||||
@@ -3627,7 +3647,7 @@
|
||||
"render.output_exr_unavailable": "此处无法设置 EXR 输出。线性 EXR 导出需要保留线性母版的已完成 GPU 图像。",
|
||||
"render.output_fit": "适合窗口",
|
||||
"render.output_format": "格式",
|
||||
"render.output_format_status": "PNG 是完成的显示图像。可选 GPU EXR 保留显示滤镜前的原始线性 FLOAT32 辐亮度;导出不会替换成预览缓存或其他任务。",
|
||||
"render.output_format_status": "PNG 是完成的显示图像。可选 CPU/GPU EXR 保留显示滤镜前的原始线性 FLOAT32 辐亮度;导出不会替换成预览缓存或其他任务。",
|
||||
"render.output_grading": "调色",
|
||||
"render.output_image": "图像",
|
||||
"render.output_largest": "{width} × {height} 最大",
|
||||
@@ -3712,7 +3732,7 @@
|
||||
"render.quality_custom": "自定义",
|
||||
"render.quality_draft": "草稿",
|
||||
"render.quality_high": "高",
|
||||
"render.quality_projection_help": "Q 预设包含未来需求。此操作仅映射受支持的固定样本 PNG 预算,明确省略自适应停止、原始线性输出和独立透射限制。",
|
||||
"render.quality_projection_help": "此检查仅更改分辨率、采样预算、路径深度、种子和降噪。其他设置保持不变,预算不保证收敛。",
|
||||
"render.quality_review": "审阅采样预算",
|
||||
"render.queue_pending": "此界面没有自动生产队列或动画渲染器;已完成的静止图像仍可单独导出。",
|
||||
"render.radial_assign": "指定外观",
|
||||
@@ -3743,7 +3763,7 @@
|
||||
"render.result_navigation": "平移和缩放遵循导航设置。按住空格键并拖动可平移。",
|
||||
"render.result_open": "在主画布中打开已完成的图像。",
|
||||
"render.result_preview": "实时预览",
|
||||
"render.result_provisional": "CPU临时图像",
|
||||
"render.result_provisional": "临时图像",
|
||||
"render.result_provisional_help": "此中间结果无法导出。导出始终使用最后完成的结果;取消后会返回该结果。",
|
||||
"render.result_reduced_display": "显示预览已缩小到视口设备或缓存限制。保留的 PNG 和导出仍为完整分辨率;此缩小视图不能进行原生 100% 检查。",
|
||||
"render.result_retained": "正在显示最后完成的图像;较新的渲染尚未替换它。",
|
||||
@@ -3907,7 +3927,7 @@
|
||||
"render.stage_panels.prepare_plan": "准备创建计划",
|
||||
"render.stage_panels.projects": "投影",
|
||||
"render.stage_panels.quality_ack": "我确认此固定预算及其省略内容",
|
||||
"render.stage_panels.quality_omissions": "自适应停止和误差目标、独立透射深度、俄罗斯轮盘规则、原始线性输出、EXR 母版及收敛认证。",
|
||||
"render.stage_panels.quality_omissions": "此预算不设置自适应误差目标、独立透射限制、俄罗斯轮盘规则或线性母版保留,也不保证收敛。",
|
||||
"render.stage_panels.reference": "参考",
|
||||
"render.stage_panels.references": "参考",
|
||||
"render.stage_panels.remove_optics": "移除光学设置",
|
||||
@@ -3951,7 +3971,7 @@
|
||||
"render.stage_panels.subtitle_environment": "原创 HDR 环境 · 整个场景",
|
||||
"render.stage_panels.subtitle_maps": "创作的空间贴图 · 临时预览",
|
||||
"render.stage_panels.subtitle_physical": "只读计划 · 未创建或分配材料",
|
||||
"render.stage_panels.subtitle_quality": "固定 GPU 预算 · 省略未来要求",
|
||||
"render.stage_panels.subtitle_quality": "GPU 采样预算 · 仅更改列出的设置",
|
||||
"render.stage_panels.subtitle_rig": "创作的灯光装置 · 发光体和被动卡片",
|
||||
"render.stage_panels.subtitle_saved_maps": "创作的贴图 · 保存在此镜头中",
|
||||
"render.stage_panels.subtitle_stage": "物理地面和舞台 · 适配产品",
|
||||
@@ -3976,7 +3996,7 @@
|
||||
"render.studio_area_help": "最多四个单面矩形。正交半边 U 和 V 定义尺寸;U × V 指向发光侧。坐标采用世界空间毫米。",
|
||||
"render.studio_center": "中心 X, Y, Z(mm)",
|
||||
"render.studio_denoise": "降低最终图像噪点",
|
||||
"render.studio_denoise_help": "最终滤波保留边缘,但可能柔化细节。玻璃与锐利镜面不参与滤波。",
|
||||
"render.studio_denoise_help": "渐进图像和最终图像使用保留边缘的滤波,但可能柔化细节。玻璃与锐利镜面不参与滤波。",
|
||||
"render.studio_direction": "朝向太阳的方向 (X, Y, Z)",
|
||||
"render.studio_environment": "环境",
|
||||
"render.studio_environment_bounds": "环境旋转必须为±1,000,000弧度以内的有限值,强度必须在0至100之间。",
|
||||
@@ -4425,6 +4445,7 @@
|
||||
"ui.3d_sketch": "3D 草图",
|
||||
"ui.activate": "激活",
|
||||
"ui.active_component": "活动组件",
|
||||
"ui.addToQuickAccess": "添加到快速访问",
|
||||
"ui.add_configuration": "添加配置",
|
||||
"ui.add_parameter": "添加参数",
|
||||
"ui.agent_chat": "智能体聊天",
|
||||
@@ -5340,6 +5361,7 @@
|
||||
"ui.quality": "质量",
|
||||
"ui.quantity": "数量",
|
||||
"ui.quantity_2": "数量 2",
|
||||
"ui.quick_access_full": "快速访问栏最多容纳 {count} 个命令;请先移除一个再添加",
|
||||
"ui.quit": "退出",
|
||||
"ui.radial_context_menu": "环形上下文菜单",
|
||||
"ui.radius": "半径",
|
||||
@@ -5357,6 +5379,7 @@
|
||||
"ui.relink_not_linked": "此组件未链接到源设计。",
|
||||
"ui.relink_select_one": "请先选择一个链接组件或其实例。",
|
||||
"ui.relink_source_all": "重新链接源文件(所有实例)…",
|
||||
"ui.removeFromQuickAccess": "从快速访问中移除",
|
||||
"ui.removeFromToolbar": "从工具栏移除",
|
||||
"ui.removeSection": "移除剖面",
|
||||
"ui.render": "渲染",
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| assets/locales/pending/ribbon-panel-hover.json | SolidCraft contributors | Original ribbon panel menu preference labels and translations | MIT OR Apache-2.0 |
|
||||
@@ -452,8 +452,14 @@ 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.
|
||||
Line { origin: Position, dir: Dir },
|
||||
/// 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,
|
||||
},
|
||||
/// 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 },
|
||||
@@ -1044,6 +1050,8 @@ 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
|
||||
|
||||
+169
-57
@@ -659,7 +659,7 @@ impl ModelState {
|
||||
}
|
||||
|
||||
/// A digest of everything later features can read: bodies (by content identity), sketches,
|
||||
/// the body counter, threads and sheet bodies.
|
||||
/// the body counter, threads, sheet bodies and construction geometry.
|
||||
fn digest(&self) -> u64 {
|
||||
let mut h = std::collections::hash_map::DefaultHasher::new();
|
||||
for b in &self.bodies {
|
||||
@@ -701,12 +701,19 @@ 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;
|
||||
@@ -1084,8 +1091,8 @@ pub struct Model {
|
||||
pub no_cache: bool,
|
||||
/// Results kept besides the cache ([`Model::keep`]).
|
||||
kept: KeptSlot,
|
||||
/// The imported texts' digests the last `evaluate` fingerprinted the features with.
|
||||
step_digests: StepDigests,
|
||||
/// Embedded imports' content digests from the last evaluation.
|
||||
import_digests: ImportDigests,
|
||||
/// 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.
|
||||
@@ -1124,7 +1131,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: &StepDigests) -> u64 {
|
||||
fn fingerprint(doc: &Document, prev: u64, f: &Feature, vals: &BTreeMap<String, Value>, rolled_back: bool, steps: &ImportDigests) -> u64 {
|
||||
let mut h = std::collections::hash_map::DefaultHasher::new();
|
||||
prev.hash(&mut h);
|
||||
rolled_back.hash(&mut h);
|
||||
@@ -1145,34 +1152,73 @@ fn fingerprint(doc: &Document, prev: u64, f: &Feature, vals: &BTreeMap<String, V
|
||||
h.finish()
|
||||
}
|
||||
|
||||
/// 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.
|
||||
/// 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.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
struct StepDigests(std::collections::HashMap<u64, (Arc<str>, u64)>);
|
||||
struct ImportDigests {
|
||||
steps: std::collections::HashMap<u64, (Arc<str>, u64)>,
|
||||
meshes: std::collections::HashMap<u64, Vec<MeshDigest>>,
|
||||
}
|
||||
|
||||
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(),
|
||||
)
|
||||
#[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
|
||||
}
|
||||
|
||||
/// 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.0.get(&id).filter(|(text, _)| Arc::ptr_eq(text, step)).map(|(_, digest)| *digest)
|
||||
self.steps.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 {
|
||||
@@ -1208,12 +1254,12 @@ fn quantize(sk: &mut solidcraft_sketch::Sketch) {
|
||||
}
|
||||
|
||||
/// A feature as fingerprinted: its definition, a sketch's stored solve quantized, an imported
|
||||
/// file's text by its digest.
|
||||
/// file's text or mesh payload by its content 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. An Import's text also depends on its STEP digest, so it is written each time
|
||||
/// as before.
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
@@ -1221,10 +1267,10 @@ fn quantize(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: &StepDigests, h: &mut impl Hasher) {
|
||||
fn hash_feature_json(f: &Feature, steps: &ImportDigests, 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 { .. }) {
|
||||
if matches!(f.kind, FeatureKind::Import { .. } | FeatureKind::MeshImport { .. }) {
|
||||
feature_json(f, steps).hash(h);
|
||||
return;
|
||||
}
|
||||
@@ -1247,7 +1293,21 @@ fn hash_feature_json(f: &Feature, steps: &StepDigests, h: &mut impl Hasher) {
|
||||
written.insert(f.id, entry);
|
||||
}
|
||||
|
||||
fn feature_json(f: &Feature, steps: &StepDigests) -> String {
|
||||
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();
|
||||
}
|
||||
if let FeatureKind::Import { step, .. } = &f.kind {
|
||||
let mut g = f.clone();
|
||||
if let FeatureKind::Import { step: text, .. } = &mut g.kind {
|
||||
@@ -1322,6 +1382,12 @@ 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.
|
||||
@@ -1344,7 +1410,7 @@ fn chain_fingerprint(
|
||||
f: &Feature,
|
||||
prev: u64,
|
||||
rolled_back: bool,
|
||||
steps: &StepDigests,
|
||||
steps: &ImportDigests,
|
||||
st: Option<&ModelState>,
|
||||
) -> u64 {
|
||||
let mut fp = fingerprint(doc, prev, f, vals, rolled_back, steps) ^ placement_digest(doc, f, st);
|
||||
@@ -1422,7 +1488,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, &StepDigests::default()).hash(&mut h);
|
||||
fingerprint(doc, 0, f, vals, false, &ImportDigests::default()).hash(&mut h);
|
||||
}
|
||||
doc.units.hash(&mut h);
|
||||
serde_json::to_string(&doc.sheet).unwrap_or_default().hash(&mut h);
|
||||
@@ -1922,7 +1988,7 @@ impl Model {
|
||||
}
|
||||
// The fingerprints from the first stored sketch on.
|
||||
let vals = evaluation_values(doc).0;
|
||||
let steps = StepDigests::of(doc, &self.step_digests);
|
||||
let steps = ImportDigests::of(doc, &self.import_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) {
|
||||
@@ -1972,7 +2038,7 @@ impl Model {
|
||||
return false;
|
||||
}
|
||||
let vals = evaluation_values(doc).0;
|
||||
let steps = StepDigests::of(doc, &self.step_digests);
|
||||
let steps = ImportDigests::of(doc, &self.import_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).
|
||||
@@ -2037,7 +2103,7 @@ impl Model {
|
||||
let previous_context = self.context;
|
||||
let mut rolled_results = std::mem::take(&mut self.rolled_results);
|
||||
self.context = ctx;
|
||||
self.step_digests = StepDigests::of(doc, &self.step_digests);
|
||||
self.import_digests = ImportDigests::of(doc, &self.import_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).
|
||||
@@ -2072,7 +2138,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.step_digests, Some(&state));
|
||||
let fp = chain_fingerprint(doc, &vals, f, prev_fp, rolled_back, &self.import_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
|
||||
@@ -2148,7 +2214,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.step_digests) ^ placement_digest(doc, f, Some(&state)), ctx, &state);
|
||||
cache_key(f, fp, fingerprint(doc, 0, f, &vals, false, &self.import_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
|
||||
@@ -2283,7 +2349,9 @@ impl Model {
|
||||
}
|
||||
_ => mats,
|
||||
};
|
||||
next.stamp(doc, &state, f, key, 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);
|
||||
// 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));
|
||||
@@ -2502,7 +2570,7 @@ impl Model {
|
||||
pub(crate) fn refingerprint_from(&mut self, doc: &Document, start: usize) {
|
||||
self.placement_inputs = None;
|
||||
self.fingerprinted = None;
|
||||
self.step_digests = StepDigests::of(doc, &self.step_digests);
|
||||
self.import_digests = ImportDigests::of(doc, &self.import_digests);
|
||||
let start = start.min(self.results.len()).min(doc.features.len());
|
||||
if start == self.results.len().min(doc.features.len()) {
|
||||
return;
|
||||
@@ -2514,7 +2582,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.step_digests, Some(&before));
|
||||
prev = chain_fingerprint(doc, &vals, f, prev, i >= marker, &self.import_digests, Some(&before));
|
||||
r.fingerprint = prev;
|
||||
before = r.state.clone();
|
||||
}
|
||||
@@ -3600,10 +3668,11 @@ 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.
|
||||
fn faces_through(st: &ModelState, p: Vec3, reach: f64) -> Vec<(f64, Vec3, Option<f64>)> {
|
||||
/// 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>)> {
|
||||
let mut out: Vec<(f64, Vec3, Option<f64>)> = Vec::new();
|
||||
for b in st.bodies.iter().filter(|b| !b.body.is_mesh()) {
|
||||
for b in st.bodies.iter().filter(|b| !b.body.is_mesh() && in_hole_scope(scope, b)) {
|
||||
let m = b.mesh();
|
||||
// The nearest facet of each face of this body.
|
||||
let mut near: BTreeMap<u32, (f64, Vec3)> = BTreeMap::new();
|
||||
@@ -3649,13 +3718,29 @@ fn faces_through(st: &ModelState, p: Vec3, reach: f64) -> Vec<(f64, Vec3, Option
|
||||
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.
|
||||
pub fn hole_direction_at(st: &ModelState, p: Vec3) -> Option<Vec3> {
|
||||
/// 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> {
|
||||
let size = st.bodies.iter().map(|b| b.body.size()).fold(1.0, f64::max);
|
||||
let faces = faces_through(st, p, f64::INFINITY);
|
||||
let faces = hole_faces_through(st, p, f64::INFINITY, size * 1e-4, scope);
|
||||
if let Some((d, n, _)) = faces.first()
|
||||
&& *d <= size * 1e-4
|
||||
{
|
||||
@@ -3672,10 +3757,13 @@ pub fn hole_direction_at(st: &ModelState, p: Vec3) -> Option<Vec3> {
|
||||
/// 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.
|
||||
fn hole_dir_into_face(st: &ModelState, p: Vec3, dir: Vec3) -> Vec3 {
|
||||
/// 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 {
|
||||
let size = st.bodies.iter().map(|b| b.body.size()).fold(1.0, f64::max);
|
||||
let faces = faces_through(st, p, size * 1e-5);
|
||||
let faces = hole_faces_through(st, p, size * 1e-5, size * 1e-5, scope);
|
||||
if faces.is_empty() || faces.iter().any(|(_, n, _)| n.dot(dir) < -1e-9) {
|
||||
return dir;
|
||||
}
|
||||
@@ -4147,10 +4235,26 @@ 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.
|
||||
/// the sketch's 3D frame; `vals` are the parameter values an explicit axis's origin is read with.
|
||||
pub(crate) fn revolve_axis(
|
||||
vals: &BTreeMap<String, Value>,
|
||||
ss: &SolvedSketch,
|
||||
axis: &AxisRef,
|
||||
st: &ModelState,
|
||||
@@ -4185,7 +4289,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, origin.0, dir.0),
|
||||
AxisRef::Line { origin, dir } => line_in_sketch_plane(ss, point(vals, origin)?, dir.0),
|
||||
AxisRef::Model { geo } => {
|
||||
let (o, d) = crate::construct::model_axis(st, geo)?;
|
||||
line_in_sketch_plane(ss, o, d)
|
||||
@@ -4294,6 +4398,13 @@ 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)
|
||||
}
|
||||
@@ -4319,7 +4430,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);
|
||||
let dir = hole_dir_into_face(st, at, dir, hole_drill_scope(f));
|
||||
return Ok((vec![hole_on_surface(st, at, dir, &[])], dir));
|
||||
}
|
||||
};
|
||||
@@ -4367,7 +4478,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)))
|
||||
Ok((vec![p], hole_dir_into_face(st, hole_on_surface(st, p, dir, &[]), dir, hole_drill_scope(f))))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5291,8 +5402,9 @@ fn feature_tools_with_constructor(
|
||||
f,
|
||||
)?;
|
||||
let regions = solidcraft_sketch::merge_regions(&select_profiles(&ss, profiles)?);
|
||||
let (o, d) =
|
||||
revolve_axis(&ss, axis, &*axis_state(doc, st, f.component, axis)?, &|name| construction_axis_in(Some(doc), st, name, f.component))?;
|
||||
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)
|
||||
})?;
|
||||
// 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() {
|
||||
|
||||
@@ -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 texts digested, joint faces and bodies
|
||||
/// Work counted on this thread: bodies moved, STEP/mesh contents 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,6 +26,7 @@ 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,
|
||||
@@ -42,6 +43,7 @@ thread_local! {
|
||||
Cell::new(Counts {
|
||||
moved: 0,
|
||||
digested: 0,
|
||||
mesh_digested: 0,
|
||||
joint_faces: 0,
|
||||
measures: 0,
|
||||
body_searches: 0,
|
||||
@@ -1637,3 +1639,123 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,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(&ss, axis, &*super::axis_state(doc, st, f.component, axis)?, &|name| {
|
||||
let (o, d) = revolve_axis(vals, &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)?;
|
||||
|
||||
@@ -55,7 +55,8 @@ 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): its face points pick faces of that body.
|
||||
/// conversion, ruled surface, untrim, Split Body's tool face): its face points pick faces of
|
||||
/// that body.
|
||||
pub fn face_body(&self) -> Option<&str> {
|
||||
match self {
|
||||
FeatureKind::Shell { body, .. }
|
||||
@@ -69,7 +70,7 @@ impl FeatureKind {
|
||||
| FeatureKind::SnapFit { body, .. }
|
||||
| FeatureKind::Rest { body, .. } => body.as_deref(),
|
||||
FeatureKind::SheetConvert { body, .. } | FeatureKind::SurfaceRuled { body, .. } => Some(body.as_ref()),
|
||||
FeatureKind::SurfaceUntrim { face, .. } => Some(face.body.as_ref()),
|
||||
FeatureKind::SurfaceUntrim { face, .. } | FeatureKind::Split { tool: Some(face), .. } => Some(face.body.as_ref()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ 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
|
||||
@@ -86,6 +87,7 @@ 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
|
||||
@@ -166,6 +168,7 @@ 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
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
//! CPU render jobs can save optional `options.output` presentation: tone map, finishing,
|
||||
//! backdrop and raw linear EXR retention. Older designs omit it and retain the exact previous
|
||||
//! f64 PNG output; exposure remains owned by RenderSetup. The last released format refuses a
|
||||
//! design containing these values instead of dropping authored output effects or master intent.
|
||||
//! CPU jobs also save optional `options.lens` using the shared physical thin-lens
|
||||
//! aperture radius and axial focus distance. Positive aperture requires perspective
|
||||
//! plus explicit progressive camera sampling; absent/zero aperture keeps old pixels.
|
||||
//! CPU raytrace jobs also retain default-false `transparent_background` beside options.
|
||||
//! It exports straight-alpha primary geometry coverage; absent fields keep opaque PNGs.
|
||||
//! CPU jobs also save opt-in `options.denoise`; omission/false preserves the prior
|
||||
//! raw PNG calculation. Every complete published pass is filtered without changing
|
||||
//! raw film or the final unfiltered EXR. Older files need no rewrite for this flag.
|
||||
//! CPU jobs also preserve optional `options.path: {max_depth: 1..16}` for explicit
|
||||
//! progressive diffuse/specular transport and certified Glass boundaries. The depth
|
||||
//! counts shaded surfaces, optical boundaries and active scattering events. Traced shadows are required;
|
||||
//! selected reflection/anisotropy overrides and unsupported closed-Glass
|
||||
//! shadow connections refuse with authored intent retained. Omission keeps the legacy producer.
|
||||
//!
|
||||
//! CPU raytrace jobs save optional `options.aging` using the existing ordered
|
||||
//! SavedAgingStack schema and stable definition/feature/component/occurrence targets.
|
||||
//! Empty/absent stacks preserve prior saved JSON, CPU pixel arithmetic and work.
|
||||
//! Check and Start resolve stable targets against the captured scene; stale/hidden
|
||||
//! targets are refused rather than made global. Captured indices/names remain
|
||||
//! runtime-only. Aging changes the opaque BRDF before lighting and denoising guides;
|
||||
//! it does not change geometry, emission, physical materials or mass. Certified
|
||||
//! glass targets and passive stages remain excluded; independently authored anisotropic axes
|
||||
//! cannot be replaced by scalar aging roughness and are refused explicitly.
|
||||
//!
|
||||
//! Saves up to eight hard GPU directional sources alongside the existing optional
|
||||
//! finite Sun (eight combined). Older designs omit the new list and retain their
|
||||
//! exact implicit studio or finite-Sun lighting. The last released reader asks for
|
||||
//! an update rather than silently discarding these sources.
|
||||
//! Also saves up to eight GPU point/spot sources with exact world-mm positions,
|
||||
//! reference/minimum distances and optional world-axis/radian half cones. Missing
|
||||
//! punctual lists stay empty. CPU cone intent retains its wider f64 domain; GPU
|
||||
//! cone feathers below the documented precision bound refuse without rewriting.
|
||||
//!
|
||||
//! CPU jobs may also consume the existing portable saved `surfaces` bindings for
|
||||
//! opaque built-in base color, roughness, metallic and normal maps. No new map
|
||||
//! schema is added; raster and unsupported CPU optical combinations refuse the
|
||||
//! authored bindings instead of dropping them. Old files without maps keep the
|
||||
//! old CPU allocation/work/pixel path.
|
||||
//! CPU jobs also save optional `options.adaptive` using the existing independent-pilot
|
||||
//! policy. Explicit progressive production sampling is required; the unchanged CPU
|
||||
//! profile budgets pilots plus the production cap. Exact per-pixel counts and pilot
|
||||
//! statistics stay runtime-only; final SamplingReport and PreviewInfo.adaptive reuse
|
||||
//! the existing metadata contract without changing linear-master schema/channels.
|
||||
|
||||
//! CPU `options.path` may consume the existing saved ClosedMesh optical boundary
|
||||
//! after exact f64 edge, vertex-link, embedding/contact, outward and conservative
|
||||
//! nested-parent certification. Runtime-only ClosedMesh and thin-shadow lowering
|
||||
//! preserve stable authored optics. No new saved field or geometry repair is added.
|
||||
//! Absent-path sheet/box transport and default serialized bytes remain unchanged.
|
||||
//! Closed-shadow connections, Glass combined with external volume and selected
|
||||
//! reflection/anisotropy combinations refuse explicitly with authored values retained.
|
||||
//! Perspective CPU Path captures classify each physical eye/pupil cooperatively
|
||||
//! against the certified boundaries and initialize the nested Beer medium stack.
|
||||
//! Exact origin/near-clip boundary contacts refuse without changing saved cameras
|
||||
//! or optics. This runtime-only extension adds no serialized field.
|
||||
//! Existing saved OpticalMaterial.subsurface may also lower to optional captured
|
||||
//! CPU dielectric subsurface parameters with explicit progressive Path. Selected
|
||||
//! certified closed media use scalar free flight, HG directions and separate Beer
|
||||
//! absorption, including physical eye/pupil starts and nested current media. No
|
||||
//! refracting-boundary next-event approximation is added. Active scattering and
|
||||
//! surface denoising refuse together; unsupported thin/legacy routes retain intent.
|
||||
//! Some(rate0) remains serialized but adds no collision work/RNG or pixel change.
|
||||
//! CPU jobs may also preserve optional options.volume using the same bounded
|
||||
//! HomogeneousVolume world-box/extinction/RGB albedo/HG contract as GPU Atmosphere.
|
||||
//! Positive extinction requires explicit progressive Path and disables no existing
|
||||
//! option implicitly: Glass/SSS and surface denoising refuse with intent retained.
|
||||
//! Absent/zero volume keeps the original transport work/RNG/heap owner count/pixels.
|
||||
//! Inline intent's actual fixed retained-request size is prepaid even when absent;
|
||||
//! regrade owns its separate header reservation until its last status handle drops.
|
||||
//! Physical eye/pupil prefixes and the orthographic signed line/box union do not
|
||||
//! alter saved camera/framing/model bounds or its model near interval. Existing
|
||||
//! ray-distance/profile/task/frame/codec/host caps remain unchanged.
|
||||
|
||||
//! CPU jobs also retain optional `sun` and `sky` intent. `sun` reuses the shared
|
||||
//! finite-cap direction/angular-radius/radiance domain; `sky` reuses the portable
|
||||
//! gradient/rotation/intensity schema. Both require explicit CPU Path transport.
|
||||
//! Omitted fields preserve old designs and the absent producer allocation/work/RNG
|
||||
//! path. Constant, Sky and HDR sources are exclusive; finite Sun is additive.
|
||||
//! No generated sky image or runtime resource is serialized.
|
||||
//!
|
||||
//! CPU and GPU jobs also save `coats`, up to the existing 64 runtime coat target
|
||||
//! bound, with stable definition/feature/component/occurrence identities and exact
|
||||
//! weight, roughness and dielectric IOR. Empty/absent lists keep prior JSON and
|
||||
//! capture behavior. Coats require opaque targets; even a zero-weight authored coat
|
||||
//! cannot share a target with Glass. Capture resolves targets without changing
|
||||
//! appearances, engineering materials or geometry. Unsupported CPU selected
|
||||
//! reflection/anisotropy overrides refuse instead of dropping the coat.
|
||||
@@ -0,0 +1,12 @@
|
||||
//! 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.
|
||||
@@ -0,0 +1,5 @@
|
||||
//! 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.
|
||||
@@ -72,6 +72,7 @@ pub use print_face::PrintFace;
|
||||
pub mod project;
|
||||
mod project3d;
|
||||
pub mod render_aging;
|
||||
pub mod render_coat;
|
||||
pub mod render_job;
|
||||
pub mod render_optics;
|
||||
pub mod render_resources;
|
||||
|
||||
@@ -760,7 +760,7 @@ impl Model {
|
||||
return Err(bad("saved model: features"));
|
||||
}
|
||||
let (vals, param_errors) = evaluation_values(doc);
|
||||
let step_digests = StepDigests::of(doc, &StepDigests::default());
|
||||
let import_digests = ImportDigests::of(doc, &ImportDigests::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, &step_digests, Some(&before)) } else { saved };
|
||||
prev = if exact { chain_fingerprint(doc, &vals, f, prev, i >= marker, &import_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, step_digests, context: ctx, frame_bodies, validation, ..Model::default() };
|
||||
let mut model = Model { results, param_errors, import_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.step_digests) ^ placement_digest(doc, f, Some(&before));
|
||||
let local = fingerprint(doc, 0, f, &vals, false, &model.import_digests) ^ placement_digest(doc, f, Some(&before));
|
||||
cache.put(
|
||||
cache_key(f, r.fingerprint, local, ctx, &before),
|
||||
CachedEval {
|
||||
|
||||
@@ -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`.
|
||||
/// The name of a face new to `f` (a feature that went through `eval::naming_feature`).
|
||||
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,7 +858,10 @@ 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}") };
|
||||
let Ok((o2, d2)) = crate::eval::revolve_axis(ss, axis, before, &|name| crate::eval::construction_axis_in(None, before, name, 0)) else {
|
||||
// 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 {
|
||||
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));
|
||||
|
||||
@@ -278,7 +278,7 @@ fn selection_indices(ss: &SolvedSketch, selection: &ProfileSel, mut notes: Optio
|
||||
.profiles
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, profile)| profile.region.contains(*point))
|
||||
.filter(|(_, profile)| profile.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);
|
||||
|
||||
@@ -1619,7 +1619,36 @@ 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(..)));
|
||||
if plain(&close) && close.len() <= lossy.len() { close } else { lossy }
|
||||
// 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,
|
||||
}
|
||||
}
|
||||
|
||||
/// The segments where the plane crosses the mesh's triangles (in plane coordinates, each with
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
//! Portable opaque clear-coat assignments. Targets are stable definition/feature/
|
||||
//! component/occurrence identities; captured mesh ordinals never enter a design.
|
||||
use crate::{
|
||||
DocError, Result,
|
||||
render_surface::{RenderBodyTarget, bounded_sequence},
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solidcraft_render::clear_coat::ClearCoat;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
/// Matches the existing runtime clear-coat override bound for either executor.
|
||||
pub const MAX_COAT_BINDINGS: usize = 64;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct CoatMaterial {
|
||||
pub weight: f64,
|
||||
pub roughness: f64,
|
||||
pub ior: f64,
|
||||
}
|
||||
impl PartialEq for CoatMaterial {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.weight.to_bits() == other.weight.to_bits()
|
||||
&& self.roughness.to_bits() == other.roughness.to_bits()
|
||||
&& self.ior.to_bits() == other.ior.to_bits()
|
||||
}
|
||||
}
|
||||
impl Default for CoatMaterial {
|
||||
fn default() -> Self {
|
||||
Self { weight: 1.0, roughness: 0.12, ior: 1.5 }
|
||||
}
|
||||
}
|
||||
impl CoatMaterial {
|
||||
pub fn validate(self) -> Result<()> {
|
||||
self.to_runtime().map(|_| ())
|
||||
}
|
||||
pub fn to_runtime(self) -> Result<ClearCoat> {
|
||||
ClearCoat::new(self.weight, self.roughness, self.ior).map_err(|e| DocError::Invalid(e.to_string()))
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct SavedCoat {
|
||||
pub target: RenderBodyTarget,
|
||||
pub coat: CoatMaterial,
|
||||
}
|
||||
impl SavedCoat {
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
self.target.validate()?;
|
||||
self.coat.validate()
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct CoatBindings(Vec<SavedCoat>);
|
||||
impl CoatBindings {
|
||||
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 = &SavedCoat> {
|
||||
self.0.iter()
|
||||
}
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
if self.len() > MAX_COAT_BINDINGS || self.0.capacity() > MAX_COAT_BINDINGS {
|
||||
return Err(DocError::Invalid("at most 64 saved clear-coat targets".into()));
|
||||
}
|
||||
let mut seen = BTreeSet::new();
|
||||
for binding in self.iter() {
|
||||
binding.validate()?;
|
||||
if !seen.insert(&binding.target) {
|
||||
return Err(DocError::Invalid("duplicate saved clear-coat target".into()));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
/// Validate before mutation; replacement is explicit and stays on the same target.
|
||||
pub fn set(&mut self, binding: SavedCoat, replace: bool) -> Result<()> {
|
||||
binding.validate()?;
|
||||
if let Some(old) = self.0.iter_mut().find(|old| old.target == binding.target) {
|
||||
if old == &binding {
|
||||
return Ok(());
|
||||
}
|
||||
if !replace {
|
||||
return Err(DocError::Invalid("clear-coat target already has a binding; explicit replacement required".into()));
|
||||
}
|
||||
*old = binding;
|
||||
} else {
|
||||
if self.len() >= MAX_COAT_BINDINGS {
|
||||
return Err(DocError::Invalid("at most 64 saved clear-coat targets".into()));
|
||||
}
|
||||
self.0.try_reserve_exact(1).map_err(|_| DocError::Invalid("could not reserve saved clear-coat binding".into()))?;
|
||||
if self.0.capacity() > MAX_COAT_BINDINGS {
|
||||
return Err(DocError::Invalid("saved clear-coat capacity exceeds admission".into()));
|
||||
}
|
||||
self.0.push(binding);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub fn remove(&mut self, target: &RenderBodyTarget) -> bool {
|
||||
let before = self.len();
|
||||
self.0.retain(|binding| &binding.target != target);
|
||||
self.len() != before
|
||||
}
|
||||
}
|
||||
impl<'de> Deserialize<'de> for CoatBindings {
|
||||
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> std::result::Result<Self, D::Error> {
|
||||
let result = Self(bounded_sequence::<D, SavedCoat, MAX_COAT_BINDINGS>(d)?);
|
||||
result.validate().map_err(serde::de::Error::custom)?;
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ use solidcraft_render::{
|
||||
Camera,
|
||||
job::{
|
||||
CpuBudget, CpuProgressiveOptions, DirectionalLightOptions, JobOptions, LightingPreset, PunctualLightOptions, RaytraceEnvironmentOptions,
|
||||
RaytraceOptions, RectangleLightOptions, StudioLighting, ThinLens, ToneMap,
|
||||
RaytraceOptions, RectangleLightOptions, StudioLighting, Sun, ThinLens, ToneMap,
|
||||
},
|
||||
lighting::environment::SkyGradient,
|
||||
};
|
||||
@@ -28,12 +28,15 @@ pub enum RenderJob {
|
||||
},
|
||||
CpuRaytrace {
|
||||
#[serde(default)]
|
||||
options: CpuJob,
|
||||
transparent_background: bool,
|
||||
// Keep numerical CPU intent out of every raster/GPU enum value too.
|
||||
#[serde(default)]
|
||||
options: Box<CpuJob>,
|
||||
},
|
||||
GpuPath {
|
||||
#[serde(default)]
|
||||
transparent_background: bool,
|
||||
// StudioLighting is a bounded four-light value; boxing keeps the other variants small.
|
||||
// StudioLighting contains bounded inline area/directional sources; boxing keeps the other variants small.
|
||||
#[serde(default)]
|
||||
options: Box<GpuJob>,
|
||||
},
|
||||
@@ -44,7 +47,19 @@ impl RenderJob {
|
||||
match self {
|
||||
Self::Raster { .. } if exposure_ev != 0.0 => Err(DocError::Invalid("saved raster rendering requires exposure_ev: 0".into())),
|
||||
Self::Raster { .. } => Ok(()),
|
||||
Self::CpuRaytrace { options } => options.to_runtime(exposure_ev).map(|_| ()),
|
||||
Self::CpuRaytrace { options, transparent_background } => {
|
||||
options.validate(exposure_ev)?;
|
||||
if let Some(output) = &options.output {
|
||||
output
|
||||
.presentation(exposure_ev, [0; 3], *transparent_background)
|
||||
.validate()
|
||||
.map_err(|error| DocError::Invalid(error.to_string()))?;
|
||||
}
|
||||
if let Some(lens) = options.lens {
|
||||
lens.validate_camera(camera).map_err(|error| DocError::Invalid(error.to_string()))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Self::GpuPath { options, transparent_background } => {
|
||||
if *transparent_background && options.backdrop.is_some() {
|
||||
return Err(DocError::Invalid("choose a camera backdrop or transparent PNG, not both".into()));
|
||||
@@ -67,6 +82,24 @@ impl RenderJob {
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct CpuJob {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub volume: Option<solidcraft_render::job::volume::HomogeneousVolume>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sun: Option<Sun>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sky: Option<SkyEnvironment>,
|
||||
#[serde(skip_serializing_if = "crate::render_aging::SavedAgingStack::is_empty")]
|
||||
pub aging: crate::render_aging::SavedAgingStack,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub adaptive: Option<solidcraft_render::job::adaptive::AdaptiveSampling>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub path: Option<solidcraft_render::job::CpuPathOptions>,
|
||||
#[serde(skip_serializing_if = "std::ops::Not::not")]
|
||||
pub denoise: bool,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub lens: Option<ThinLens>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub output: Option<Box<solidcraft_render::job::OutputOptions>>,
|
||||
#[serde(skip_serializing_if = "CpuBudget::is_compact")]
|
||||
pub budget: CpuBudget,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@@ -94,6 +127,15 @@ pub struct CpuJob {
|
||||
impl Default for CpuJob {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
volume: None,
|
||||
sun: None,
|
||||
sky: None,
|
||||
aging: Default::default(),
|
||||
adaptive: None,
|
||||
denoise: false,
|
||||
path: None,
|
||||
lens: None,
|
||||
output: None,
|
||||
budget: CpuBudget::Compact,
|
||||
progressive: None,
|
||||
primary_samples: 1,
|
||||
@@ -111,12 +153,28 @@ impl Default for CpuJob {
|
||||
}
|
||||
|
||||
impl CpuJob {
|
||||
/// Validate saved parameters without inventing captured targets.
|
||||
pub fn validate(&self, exposure_ev: f64) -> Result<()> {
|
||||
self.validated_parameters(exposure_ev).map(|_| ())
|
||||
}
|
||||
/// Validate portable map compatibility without claiming that stable aging
|
||||
/// identities have been resolved into captured runtime body indices.
|
||||
pub fn validate_surface_maps(&self, exposure_ev: f64) -> Result<()> {
|
||||
let options = self.validated_parameters(exposure_ev)?;
|
||||
solidcraft_render::job::textures::validate_cpu_options(&options).map_err(|e| DocError::Invalid(e.to_string()))
|
||||
}
|
||||
/// Pure lowering, valid on hosts without a CPU raytracer. Checks bounds before cloning lists.
|
||||
pub fn to_runtime(&self, exposure_ev: f64) -> Result<RaytraceOptions> {
|
||||
if self.aging.iter().any(|layer| layer.target.is_some()) {
|
||||
return Err(DocError::Invalid("targeted CPU aging requires stable occurrence resolution against the current scene".into()));
|
||||
}
|
||||
self.validated_parameters(exposure_ev)
|
||||
}
|
||||
fn validated_parameters(&self, exposure_ev: f64) -> Result<RaytraceOptions> {
|
||||
if let Some(hdr) = self.hdr {
|
||||
hdr.validate()?;
|
||||
if self.environment.is_some() {
|
||||
return Err(DocError::Invalid("choose either saved CPU HDR or constant environment".into()));
|
||||
if self.environment.is_some() || self.sky.is_some() {
|
||||
return Err(DocError::Invalid("choose either saved CPU HDR, gradient Sky or constant environment".into()));
|
||||
}
|
||||
}
|
||||
bounded(&self.lights, 8, "directional lights")?;
|
||||
@@ -128,7 +186,26 @@ impl CpuJob {
|
||||
// Preserve hidden editable intent in CpuJob, but do not submit tuning for
|
||||
// a light family that is explicitly absent. This does not rewrite the file.
|
||||
let active_area = self.area_lights.as_ref().is_some_and(|lights| !lights.is_empty());
|
||||
let aging = self.aging.parameters_only()?;
|
||||
let sky = self
|
||||
.sky
|
||||
.as_ref()
|
||||
.map(|sky| -> Result<_> {
|
||||
sky.validate()?;
|
||||
let SkyEnvironment::Sky { gradient, rotation_rad, intensity } = *sky;
|
||||
Ok(Box::new(solidcraft_render::job::CpuSky { gradient, rotation_rad, intensity }))
|
||||
})
|
||||
.transpose()?;
|
||||
let options = RaytraceOptions {
|
||||
volume: self.volume,
|
||||
sun: self.sun.map(Box::new),
|
||||
sky,
|
||||
aging: (!aging.is_empty()).then(|| Box::new(aging)),
|
||||
adaptive: self.adaptive.map(Box::new),
|
||||
denoise: self.denoise,
|
||||
path: self.path,
|
||||
lens: self.lens,
|
||||
output: self.output.clone(),
|
||||
budget: self.budget,
|
||||
progressive: self.progressive,
|
||||
primary_samples: self.primary_samples,
|
||||
@@ -346,3 +423,50 @@ fn punctual_lights<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Resul
|
||||
fn area_lights<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result<Option<Vec<RectangleLightOptions>>, D::Error> {
|
||||
optional_lights::<D, RectangleLightOptions, 4>(d)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod cpu_volume_portable_tests {
|
||||
use super::*;
|
||||
use solidcraft_render::job::{CpuPathOptions, CpuProgressiveOptions, volume::HomogeneousVolume};
|
||||
#[test]
|
||||
fn cpu_volume_saved_parameters_roundtrip_lower_without_default_adoption_or_hidden_repairs() {
|
||||
let v = HomogeneousVolume {
|
||||
min_mm: [-2.0, -3.0, -4.0],
|
||||
max_mm: [5.0, 6.0, 7.0],
|
||||
extinction_per_mm: 0.3,
|
||||
scattering_albedo: [0.2, 0.4, 0.6],
|
||||
anisotropy: -0.37,
|
||||
};
|
||||
let old = serde_json::to_value(CpuJob::default()).unwrap();
|
||||
assert!(old.get("volume").is_none());
|
||||
let mut job = CpuJob {
|
||||
volume: Some(v),
|
||||
path: Some(CpuPathOptions { max_depth: 8 }),
|
||||
progressive: Some(CpuProgressiveOptions { samples_per_pixel: 4, seed: 9 }),
|
||||
..Default::default()
|
||||
};
|
||||
let json = serde_json::to_value(&job).unwrap();
|
||||
let reopened: CpuJob = serde_json::from_value(json.clone()).unwrap();
|
||||
assert_eq!(reopened, job);
|
||||
assert_eq!(reopened.to_runtime(0.0).unwrap().volume, Some(v));
|
||||
job.denoise = true;
|
||||
let before = job.clone();
|
||||
assert!(job.validate(0.0).is_err());
|
||||
assert_eq!(job, before);
|
||||
job.denoise = false;
|
||||
job.path = None;
|
||||
let before = job.clone();
|
||||
assert!(job.validate(0.0).is_err());
|
||||
assert_eq!(job, before);
|
||||
job.volume.as_mut().unwrap().extinction_per_mm = 0.0;
|
||||
job.denoise = true;
|
||||
job.validate(0.0).unwrap();
|
||||
let inactive = serde_json::to_value(&job).unwrap();
|
||||
assert_eq!(inactive["volume"]["anisotropy"], -0.37);
|
||||
assert_eq!(serde_json::from_value::<CpuJob>(inactive).unwrap(), job);
|
||||
job.volume = None;
|
||||
job.denoise = false;
|
||||
job.progressive = None;
|
||||
assert_eq!(serde_json::to_value(job).unwrap(), old);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,55 @@ impl Default for OpticalMaterial {
|
||||
}
|
||||
}
|
||||
impl OpticalMaterial {
|
||||
/// The CPU consumer is a certified subset of the existing saved optical contract.
|
||||
/// Keep authored unsupported values intact and refuse them, never drop effects.
|
||||
pub fn validate_for_cpu(self) -> Result<()> {
|
||||
self.validate_for_cpu_path(false)
|
||||
}
|
||||
/// General closed boundaries require the explicit finite progressive path.
|
||||
pub fn validate_for_cpu_path(self, path: bool) -> Result<()> {
|
||||
self.validate()?;
|
||||
if self.shadow_transmission && (!path || self.boundary != OpticalBoundary::ThinSheet) {
|
||||
return Err(DocError::Invalid(
|
||||
"CPU transmissive shadows require Indirect lighting and a thin sheet; closed refractive light connections remain unsupported".into(),
|
||||
));
|
||||
}
|
||||
if self.subsurface.is_some() && !path {
|
||||
return Err(DocError::Invalid("CPU subsurface scattering requires Indirect lighting and a certified closed medium".into()));
|
||||
}
|
||||
if self.absorption_per_mm.into_iter().any(|v| !(0.0..=100.0).contains(&v)) || !(0.0..=10000.0).contains(&self.thickness_mm) {
|
||||
return Err(DocError::Invalid("CPU glass absorption must be 0..100 per mm and virtual sheet thickness 0..10000 mm".into()));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// A closed optical boundary is accepted only if the CPU producer subsequently
|
||||
/// certifies the captured mesh as its exact axis-aligned-box subset. The saved
|
||||
/// boundary is not rewritten and no arbitrary closed-mesh support is implied.
|
||||
pub fn to_cpu(self, body_index: usize, body_name: &str) -> Result<solidcraft_render::job::DielectricOptions> {
|
||||
self.to_cpu_for_path(body_index, body_name, false)
|
||||
}
|
||||
pub fn to_cpu_for_path(self, body_index: usize, body_name: &str, path: bool) -> Result<solidcraft_render::job::DielectricOptions> {
|
||||
self.validate_for_cpu_path(path)?;
|
||||
if body_name.is_empty() || body_name.len() > 1024 || body_name.chars().any(char::is_control) {
|
||||
return Err(DocError::Invalid("CPU optical target requires a bounded captured body name".into()));
|
||||
}
|
||||
Ok(solidcraft_render::job::DielectricOptions {
|
||||
subsurface: self.subsurface,
|
||||
shadow_transmission: self.shadow_transmission,
|
||||
body_index,
|
||||
body_name: body_name.into(),
|
||||
boundary: match self.boundary {
|
||||
OpticalBoundary::ThinSheet => solidcraft_render::job::DielectricBoundary::ThinSheet,
|
||||
OpticalBoundary::ClosedMesh if path => solidcraft_render::job::DielectricBoundary::ClosedMesh,
|
||||
OpticalBoundary::ClosedBox | OpticalBoundary::ClosedMesh => solidcraft_render::job::DielectricBoundary::ClosedBox,
|
||||
},
|
||||
ior: self.ior,
|
||||
absorption_per_mm: self.absorption_per_mm,
|
||||
thickness_mm: self.thickness_mm,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn validate(self) -> Result<()> {
|
||||
let error = |message: String| DocError::Invalid(message);
|
||||
OpaqueSurface::new(Vec3::ZERO, 0.0, 0.5, self.ior).map_err(|e| error(e.to_string()))?;
|
||||
@@ -90,6 +139,19 @@ impl OpticalBindings {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub fn validate_for_cpu(&self) -> Result<()> {
|
||||
self.validate_for_cpu_path(false)
|
||||
}
|
||||
pub fn validate_for_cpu_path(&self, path: bool) -> Result<()> {
|
||||
self.validate()?;
|
||||
if self.len() > 8 {
|
||||
return Err(DocError::Invalid("CPU supports at most eight certified optical targets".into()));
|
||||
}
|
||||
for binding in self.iter() {
|
||||
binding.optics.validate_for_cpu_path(path)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub fn set(&mut self, binding: SavedOptics, replace: bool) -> Result<()> {
|
||||
binding.validate()?;
|
||||
if let Some(old) = self.0.iter_mut().find(|old| old.target == binding.target) {
|
||||
@@ -166,4 +228,86 @@ mod tests {
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_optical_consumer_preserves_saved_boundary_and_refuses_unrepresented_effects() {
|
||||
let closed = OpticalMaterial { ior: 1.51, absorption_per_mm: [0.1, 0.02, 0.0], ..Default::default() };
|
||||
let original = serde_json::to_value(closed).unwrap();
|
||||
let cpu = closed.to_cpu(3, "Glass@part-2").unwrap();
|
||||
assert_eq!(cpu.boundary, solidcraft_render::job::DielectricBoundary::ClosedBox);
|
||||
assert_eq!((cpu.body_index, cpu.body_name.as_str()), (3, "Glass@part-2"));
|
||||
assert_eq!((cpu.ior, cpu.absorption_per_mm), (1.51, [0.1, 0.02, 0.0]));
|
||||
assert_eq!(serde_json::to_value(closed).unwrap(), original, "CPU specialization never rewrites the authored closed boundary");
|
||||
let thin = OpticalMaterial { boundary: OpticalBoundary::ThinSheet, thickness_mm: 2.0, ..closed };
|
||||
assert_eq!(thin.to_cpu(0, "Sheet").unwrap().boundary, solidcraft_render::job::DielectricBoundary::ThinSheet);
|
||||
for (value, reason) in [
|
||||
(OpticalMaterial { shadow_transmission: true, ..thin }, "transmissive shadows"),
|
||||
(OpticalMaterial { subsurface: Some(Subsurface { scattering_per_mm: 0.0, anisotropy: 0.0 }), ..closed }, "subsurface"),
|
||||
(OpticalMaterial { absorption_per_mm: [101.0, 0.0, 0.0], ..closed }, "absorption"),
|
||||
(OpticalMaterial { thickness_mm: 10001.0, ..thin }, "thickness"),
|
||||
] {
|
||||
let before = serde_json::to_value(value).unwrap();
|
||||
assert!(value.to_cpu(0, "Target").unwrap_err().to_string().contains(reason));
|
||||
assert_eq!(serde_json::to_value(value).unwrap(), before);
|
||||
}
|
||||
let mut optics = OpticalBindings::default();
|
||||
for feature in 1..=9 {
|
||||
optics
|
||||
.set(
|
||||
SavedOptics {
|
||||
target: RenderBodyTarget { definition: format!("Glass{feature}"), feature, component: 0, occurrence_path: vec![] },
|
||||
optics: closed,
|
||||
},
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
optics.validate().unwrap();
|
||||
assert!(optics.validate_for_cpu().is_err());
|
||||
let target = RenderBodyTarget { definition: "Glass".into(), feature: 1, component: 0, occurrence_path: vec![] };
|
||||
let mut setup = crate::render_settings::RenderSetup {
|
||||
job: Some(crate::render_job::RenderJob::CpuRaytrace { transparent_background: false, options: Default::default() }),
|
||||
..Default::default()
|
||||
};
|
||||
setup.optics.set(SavedOptics { target, optics: closed }, false).unwrap();
|
||||
setup.validate().unwrap();
|
||||
let wire = serde_json::to_value(&setup).unwrap();
|
||||
assert_eq!(serde_json::from_value::<crate::render_settings::RenderSetup>(wire).unwrap(), setup);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod cpu_general_glass_contract_tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn saved_general_glass_requires_explicit_path_and_preserves_unsupported_choices_and_old_wire() {
|
||||
let optics = OpticalMaterial { ior: 1.51, absorption_per_mm: [0.1, 0.2, 0.3], boundary: OpticalBoundary::ClosedMesh, ..Default::default() };
|
||||
assert_eq!(optics.to_cpu(0, "Glass").unwrap().boundary, solidcraft_render::job::DielectricBoundary::ClosedBox);
|
||||
let general = optics.to_cpu_for_path(0, "Glass", true).unwrap();
|
||||
assert_eq!(general.boundary, solidcraft_render::job::DielectricBoundary::ClosedMesh);
|
||||
assert_eq!((general.ior, general.absorption_per_mm), (optics.ior, optics.absorption_per_mm));
|
||||
let scattering = OpticalMaterial { subsurface: Some(Subsurface { scattering_per_mm: 0.1, anisotropy: 0.3 }), ..optics };
|
||||
let before = serde_json::to_value(scattering).unwrap();
|
||||
assert!(scattering.to_cpu(0, "Glass").is_err(), "the legacy consumer remains explicit");
|
||||
assert_eq!(scattering.to_cpu_for_path(0, "Glass", true).unwrap().subsurface, scattering.subsurface);
|
||||
assert_eq!(serde_json::to_value(scattering).unwrap(), before);
|
||||
let encoded = serde_json::to_value(&general).unwrap();
|
||||
assert!(encoded.get("shadow_transmission").is_none());
|
||||
assert_eq!(serde_json::from_value::<solidcraft_render::job::DielectricOptions>(encoded).unwrap(), general);
|
||||
let thin = OpticalMaterial { boundary: OpticalBoundary::ThinSheet, shadow_transmission: true, ..optics };
|
||||
assert!(thin.to_cpu(0, "Glass").is_err());
|
||||
assert!(thin.to_cpu_for_path(0, "Glass", true).unwrap().shadow_transmission);
|
||||
for value in [
|
||||
OpticalMaterial { shadow_transmission: true, ..optics },
|
||||
OpticalMaterial {
|
||||
boundary: OpticalBoundary::ThinSheet,
|
||||
subsurface: Some(Subsurface { scattering_per_mm: 0.1, anisotropy: 0.0 }),
|
||||
..optics
|
||||
},
|
||||
] {
|
||||
let before = value;
|
||||
assert!(value.to_cpu_for_path(0, "Glass", true).is_err());
|
||||
assert_eq!(value, before);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ pub struct RenderSetup {
|
||||
pub surfaces: crate::render_surface::SurfaceBindings,
|
||||
#[serde(skip_serializing_if = "crate::render_optics::OpticalBindings::is_empty")]
|
||||
pub optics: crate::render_optics::OpticalBindings,
|
||||
#[serde(skip_serializing_if = "crate::render_coat::CoatBindings::is_empty")]
|
||||
pub coats: crate::render_coat::CoatBindings,
|
||||
#[serde(skip_serializing_if = "solidcraft_render::stage::Stage::is_empty")]
|
||||
pub stage: solidcraft_render::stage::Stage,
|
||||
}
|
||||
@@ -78,6 +80,7 @@ impl Default for RenderSetup {
|
||||
background: [236, 240, 245],
|
||||
job: None,
|
||||
optics: Default::default(),
|
||||
coats: Default::default(),
|
||||
surfaces: Default::default(),
|
||||
stage: Default::default(),
|
||||
}
|
||||
@@ -87,9 +90,13 @@ impl Default for RenderSetup {
|
||||
impl RenderSetup {
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
let (limits, cpu) = match &self.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => {
|
||||
(options.budget.image_limits(options.progressive.is_some()), Some(CpuSize { progressive: options.progressive }))
|
||||
}
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => (
|
||||
options.budget.image_limits(options.progressive.is_some()),
|
||||
Some(CpuSize {
|
||||
progressive: solidcraft_render::job::cpu_camera_sampling(options.progressive, options.adaptive, options.budget)
|
||||
.map_err(|e| DocError::Invalid(e.to_string()))?,
|
||||
}),
|
||||
),
|
||||
Some(RenderJob::GpuPath { .. }) => (solidcraft_render::job::GPU_PATH_LIMITS, None),
|
||||
_ => (RenderLimits::default(), None),
|
||||
};
|
||||
@@ -111,8 +118,30 @@ impl RenderSetup {
|
||||
fn validate_with_limits(&self, limits: RenderLimits, cpu: Option<CpuSize>) -> Result<()> {
|
||||
self.surfaces.validate()?;
|
||||
self.optics.validate()?;
|
||||
if !self.optics.is_empty() && !matches!(self.job, Some(RenderJob::GpuPath { .. })) {
|
||||
return Err(DocError::Invalid("saved optics require an explicit GPU job".into()));
|
||||
self.coats.validate()?;
|
||||
if !self.coats.is_empty() && !matches!(self.job, Some(RenderJob::CpuRaytrace { .. } | RenderJob::GpuPath { .. })) {
|
||||
return Err(DocError::Invalid("saved clear coats require an explicit CPU or GPU raytrace job".into()));
|
||||
}
|
||||
if self.coats.iter().any(|coat| self.optics.iter().any(|optics| coat.target == optics.target)) {
|
||||
return Err(DocError::Invalid("clear coat and Glass cannot share a target, including zero-weight authored coats".into()));
|
||||
}
|
||||
match &self.job {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
self.optics.validate_for_cpu_path(options.path.is_some())?;
|
||||
if options.volume.is_some_and(|v| v.active()) && !self.optics.is_empty() {
|
||||
return Err(DocError::Invalid(
|
||||
"CPU Atmosphere cannot combine with saved Glass or subsurface scattering; settings are kept".into(),
|
||||
));
|
||||
}
|
||||
if options.denoise && self.optics.iter().any(|binding| binding.optics.subsurface.is_some_and(|s| s.active())) {
|
||||
return Err(DocError::Invalid(
|
||||
"CPU subsurface random walks have no surface-denoiser guides; disable denoising explicitly".into(),
|
||||
));
|
||||
}
|
||||
}
|
||||
Some(RenderJob::GpuPath { .. }) => {}
|
||||
_ if !self.optics.is_empty() => return Err(DocError::Invalid("saved optics require an explicit CPU or GPU raytrace job".into())),
|
||||
_ => {}
|
||||
}
|
||||
if self.optics.iter().any(|o| self.surfaces.iter().any(|s| s.target == o.target)) {
|
||||
return Err(DocError::Invalid("saved opaque surface maps and optical boundaries cannot share a target".into()));
|
||||
@@ -121,8 +150,23 @@ 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::GpuPath { .. })) {
|
||||
return Err(DocError::Invalid("saved surfaces require an explicit GPU job; unsupported methods cannot discard bindings".into()));
|
||||
if !self.surfaces.is_empty() {
|
||||
match &self.job {
|
||||
Some(RenderJob::GpuPath { .. }) => {}
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
if !self.optics.is_empty() && options.path.is_none() {
|
||||
return Err(DocError::Invalid(
|
||||
"CPU surface maps cannot combine with saved Glass; preserve the bindings and select a compatible method".into(),
|
||||
));
|
||||
}
|
||||
options.validate_surface_maps(self.exposure_ev)?;
|
||||
}
|
||||
_ => {
|
||||
return Err(DocError::Invalid(
|
||||
"saved surfaces require CPU or GPU ray tracing; unsupported methods cannot discard bindings".into(),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
let (width, height) = (u64::from(self.width), u64::from(self.height));
|
||||
if width == 0 || height == 0 {
|
||||
@@ -168,10 +212,22 @@ impl RenderSetup {
|
||||
));
|
||||
}
|
||||
job.validate(&self.camera, self.exposure_ev)?;
|
||||
if let RenderJob::CpuRaytrace { options } = job
|
||||
&& let Some(progressive) = options.progressive
|
||||
{
|
||||
progressive.validate_image_with_budget(self.width, self.height, options.budget).map_err(|e| DocError::Invalid(e.to_string()))?;
|
||||
if let RenderJob::CpuRaytrace { options, .. } = job {
|
||||
if options.denoise {
|
||||
solidcraft_render::job::validate_cpu_denoise_image(self.width, self.height).map_err(|e| DocError::Invalid(e.to_string()))?;
|
||||
}
|
||||
options
|
||||
.budget
|
||||
.validate_image(
|
||||
self.width,
|
||||
self.height,
|
||||
solidcraft_render::job::cpu_camera_sampling(options.progressive, options.adaptive, options.budget)
|
||||
.map_err(|e| DocError::Invalid(e.to_string()))?,
|
||||
)
|
||||
.map_err(|e| DocError::Invalid(e.to_string()))?;
|
||||
if let Some(output) = &options.output {
|
||||
output.validate_image(self.width, self.height).map_err(|e| DocError::Invalid(e.to_string()))?;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Desired mode/format/backend may be unavailable on this host. Saving intent is not preflight.
|
||||
@@ -229,7 +285,7 @@ impl RenderSettings {
|
||||
|
||||
pub fn validate_resources(&self, setup: &RenderSetup) -> Result<()> {
|
||||
match &setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
if let Some(hdr) = options.hdr {
|
||||
hdr.validate_resource(&self.resources)?;
|
||||
}
|
||||
@@ -312,11 +368,12 @@ mod tests {
|
||||
RenderSetup {
|
||||
exposure_ev: 1.25,
|
||||
job: Some(RenderJob::CpuRaytrace {
|
||||
options: CpuJob {
|
||||
transparent_background: false,
|
||||
options: Box::new(CpuJob {
|
||||
lights: Some(Vec::new()),
|
||||
hdr: Some(CpuHdrEnvironment { resource: id, rotation_rad: 0.75, intensity: 2.0, samples: 64 }),
|
||||
..Default::default()
|
||||
},
|
||||
}),
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
@@ -564,7 +621,7 @@ mod tests {
|
||||
let cpu = |budget, width, height| RenderSetup {
|
||||
width,
|
||||
height,
|
||||
job: Some(RenderJob::CpuRaytrace { options: CpuJob { budget, ..Default::default() } }),
|
||||
job: Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(CpuJob { budget, ..Default::default() }) }),
|
||||
..Default::default()
|
||||
};
|
||||
let compact = cpu(CpuBudget::Compact, 3840, 2160);
|
||||
@@ -572,7 +629,7 @@ mod tests {
|
||||
assert!(message.contains("3840 × 2160 exceeds the image limits (4096 pixels per side, 4194304 pixels in all)"), "{message}");
|
||||
assert!(message.contains("the largest image at this aspect is 2730 × 1536"), "{message}");
|
||||
assert!(message.contains("choose the Studio CPU resource profile, or a smaller size"), "{message}");
|
||||
assert!(matches!(&compact.job, Some(RenderJob::CpuRaytrace { options }) if options.budget == CpuBudget::Compact));
|
||||
assert!(matches!(&compact.job, Some(RenderJob::CpuRaytrace { options, .. }) if options.budget == CpuBudget::Compact));
|
||||
let message = compact.validate_for_cpu(CpuBudget::Compact).unwrap_err().to_string();
|
||||
assert!(message.contains("choose the Studio CPU resource profile"), "{message}");
|
||||
|
||||
@@ -631,7 +688,7 @@ mod tests {
|
||||
let saved = serde_json::to_value(&reopened.render).unwrap();
|
||||
assert!(saved["setups"]["Legacy"].get("job").is_none());
|
||||
assert_eq!(saved["setups"]["Legacy"]["environment_rotation"], 0.75);
|
||||
let RenderJob::CpuRaytrace { options } = settings.setups["CPU"].job.as_ref().unwrap() else { panic!("CPU intent changed") };
|
||||
let RenderJob::CpuRaytrace { options, .. } = settings.setups["CPU"].job.as_ref().unwrap() else { panic!("CPU intent changed") };
|
||||
let runtime = options.to_runtime(settings.setups["CPU"].exposure_ev).unwrap();
|
||||
assert_eq!(runtime.exposure_ev, 1.25);
|
||||
assert_eq!(runtime.area_samples, Some(64));
|
||||
@@ -655,11 +712,11 @@ mod tests {
|
||||
for options in [json!({}), json!({"lights":null,"punctual_lights":null,"area_lights":null,"environment":null})] {
|
||||
let setup: RenderSetup = serde_json::from_value(json!({"job":{"method":"cpu_raytrace","options":options}})).unwrap();
|
||||
setup.validate().unwrap();
|
||||
assert_eq!(setup.job, Some(RenderJob::CpuRaytrace { options: CpuJob::default() }));
|
||||
assert_eq!(setup.job, Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::default() }));
|
||||
}
|
||||
let empty: RenderSetup = serde_json::from_value(json!({"job":{"method":"cpu_raytrace","options":{"lights":[]}}})).unwrap();
|
||||
empty.validate().unwrap();
|
||||
assert_ne!(empty.job, Some(RenderJob::CpuRaytrace { options: CpuJob::default() }));
|
||||
assert_ne!(empty.job, Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::default() }));
|
||||
for (lighting, explicit) in [(serde_json::Value::Null, false), (json!({"environment":[0,0,0],"area_lights":[]}), true)] {
|
||||
let setup: RenderSetup = serde_json::from_value(json!({"job":{"method":"gpu_path","options":{"lighting":lighting}}})).unwrap();
|
||||
setup.validate().unwrap();
|
||||
@@ -681,7 +738,7 @@ mod tests {
|
||||
let document = Document { render: Arc::new(settings), ..Default::default() };
|
||||
let reopened = Document::from_json(&document.to_json()).unwrap();
|
||||
assert_eq!(document, reopened);
|
||||
let RenderJob::CpuRaytrace { options } = reopened.render.setups["Film"].job.as_ref().unwrap() else { panic!("method changed") };
|
||||
let RenderJob::CpuRaytrace { options, .. } = reopened.render.setups["Film"].job.as_ref().unwrap() else { panic!("method changed") };
|
||||
let runtime = options.to_runtime(1.5).unwrap();
|
||||
assert_eq!(runtime.progressive.unwrap().seed, u32::MAX);
|
||||
assert_eq!(runtime.exposure_ev, 1.5);
|
||||
@@ -698,6 +755,104 @@ mod tests {
|
||||
assert!(serde_json::from_value::<RenderSettings>(incompatible).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_transparent_intent_roundtrips_offline_and_keeps_opaque_defaults() {
|
||||
use serde_json::json;
|
||||
let opaque: RenderSetup = serde_json::from_value(json!({"job":{"method":"cpu_raytrace"}})).unwrap();
|
||||
assert!(matches!(opaque.job, Some(RenderJob::CpuRaytrace { transparent_background: false, .. })));
|
||||
let setup: RenderSetup =
|
||||
serde_json::from_value(json!({"width":8,"height":8,"job":{"method":"cpu_raytrace","transparent_background":true,"options":{
|
||||
"primary_samples":4,"output":{"linear_exr":true}}}}))
|
||||
.unwrap();
|
||||
setup.validate().unwrap();
|
||||
let document = Document {
|
||||
render: Arc::new(RenderSettings { setups: std::collections::BTreeMap::from([("Cutout".into(), setup)]), ..Default::default() }),
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(document, Document::from_json(&document.to_json()).unwrap());
|
||||
for output in [json!({"backdrop":{}}), json!({"finishing":{"bloom":{"strength":1}}}), json!({"finishing":{"photographic":{"grain":0.03}}})] {
|
||||
let settings = json!({"setups":{"Cutout":{"job":{"method":"cpu_raytrace","transparent_background":true,"options":{"output":output}}}}});
|
||||
let error = serde_json::from_value::<RenderSettings>(settings.clone()).unwrap_err();
|
||||
assert!(error.to_string().contains("opaque"), "valid opaque-only effects remain authored and refused");
|
||||
let mut saved: serde_json::Value = serde_json::from_str(&Document::default().to_json()).unwrap();
|
||||
saved["render"] = settings;
|
||||
let error = Document::from_json(&saved.to_string()).unwrap_err();
|
||||
assert!(error.to_string().contains("opaque"), "the full document loader must enforce the same saved output contract");
|
||||
}
|
||||
assert!(
|
||||
serde_json::from_value::<RenderSetup>(json!({"job":{"method":"cpu_raytrace","options":{"transparent_background":true}}})).is_err(),
|
||||
"one alpha authority beside the numerical job"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_physical_lens_roundtrips_offline_and_keeps_disabled_legacy_intent() {
|
||||
use serde_json::json;
|
||||
let camera = Camera { fov: 0.7, distance: 20.0, ..Default::default() };
|
||||
let saved = json!({"setups":{"Focus":{"width":64,"height":32,"camera":camera,
|
||||
"job":{"method":"cpu_raytrace","options":{"progressive":{"samples_per_pixel":8,"seed":81},
|
||||
"lens":{"aperture_radius_mm":0.5,"focus_distance_mm":20.0}}}}}});
|
||||
let settings: RenderSettings = serde_json::from_value(saved.clone()).unwrap();
|
||||
let document = Document { render: Arc::new(settings), ..Default::default() };
|
||||
assert_eq!(document, Document::from_json(&document.to_json()).unwrap());
|
||||
let RenderJob::CpuRaytrace { options, .. } = document.render.setups["Focus"].job.as_ref().unwrap() else { panic!("CPU method changed") };
|
||||
assert_eq!(options.to_runtime(1.5).unwrap().lens, options.lens);
|
||||
let mut fixed = saved.clone();
|
||||
fixed["setups"]["Focus"]["job"]["options"].as_object_mut().unwrap().remove("progressive");
|
||||
assert!(serde_json::from_value::<RenderSettings>(fixed.clone()).is_err());
|
||||
fixed["setups"]["Focus"]["job"]["options"]["lens"]["aperture_radius_mm"] = json!(0);
|
||||
fixed["setups"]["Focus"]["camera"]["fov"] = json!(0);
|
||||
let zero: RenderSettings = serde_json::from_value(fixed).unwrap();
|
||||
assert_eq!(serde_json::to_value(&zero).unwrap()["setups"]["Focus"]["job"]["options"]["lens"]["aperture_radius_mm"].as_f64(), Some(0.0));
|
||||
for lens in [
|
||||
json!({"aperture_radius_mm":-1,"focus_distance_mm":20}),
|
||||
json!({"aperture_radius_mm":0.5,"focus_distance_mm":0}),
|
||||
json!({"aperture_radius_mm":0.5,"focus_distance_mm":20,"f_stop":2}),
|
||||
] {
|
||||
let mut invalid = saved.clone();
|
||||
invalid["setups"]["Focus"]["job"]["options"]["lens"] = lens;
|
||||
assert!(serde_json::from_value::<RenderSettings>(invalid).is_err());
|
||||
}
|
||||
let mut ortho = saved;
|
||||
ortho["setups"]["Focus"]["camera"]["fov"] = json!(0);
|
||||
assert!(serde_json::from_value::<RenderSettings>(ortho).is_err());
|
||||
assert!(serde_json::to_value(CpuJob::default()).unwrap().get("lens").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_output_presentation_roundtrips_offline_without_another_exposure_authority() {
|
||||
use serde_json::json;
|
||||
assert!(serde_json::to_value(CpuJob::default()).unwrap().get("output").is_none());
|
||||
let saved = json!({"setups":{"CPU output":{"width":64,"height":32,"exposure_ev":1.5,
|
||||
"job":{"method":"cpu_raytrace","options":{"progressive":{"samples_per_pixel":7,"seed":81},
|
||||
"output":{"tone_map":"aces_fitted","finishing":{"rgb_gain":[1.2,0.8,1.1],"photographic":{"grain":0.03,"seed":42},
|
||||
"bloom":{"strength":0.2,"threshold":0.5,"radius":2}},"backdrop":{"mode":"radial"},"linear_exr":true}}}}}});
|
||||
let settings: RenderSettings = serde_json::from_value(saved).unwrap();
|
||||
let setup = &settings.setups["CPU output"];
|
||||
let RenderJob::CpuRaytrace { options, .. } = setup.job.as_ref().unwrap() else { panic!("CPU job expected") };
|
||||
let runtime = options.to_runtime(setup.exposure_ev).unwrap();
|
||||
assert_eq!(runtime.exposure_ev, 1.5);
|
||||
assert_eq!(runtime.output, options.output);
|
||||
let encoded = serde_json::to_value(&settings).unwrap();
|
||||
assert!(encoded["setups"]["CPU output"]["job"]["options"]["output"].get("exposure_ev").is_none());
|
||||
assert_eq!(settings, serde_json::from_value::<RenderSettings>(encoded.clone()).unwrap());
|
||||
for bad in [json!({"exposure_ev":1}), json!({"samples":4}), json!({"linear_exr":"yes"}), json!({"finishing":{"rgb_gain":[-1,1,1]}})] {
|
||||
let mut invalid = encoded.clone();
|
||||
invalid["setups"]["CPU output"]["job"]["options"]["output"] = bad;
|
||||
assert!(serde_json::from_value::<RenderSettings>(invalid).is_err());
|
||||
}
|
||||
let wide = json!({"width":16384,"height":1,"job":{"method":"cpu_raytrace","options":{"budget":"workstation"}}});
|
||||
serde_json::from_value::<RenderSetup>(wide.clone()).unwrap().validate().unwrap();
|
||||
for output in [json!({"tone_map":"aces_fitted"}), json!({"linear_exr":true})] {
|
||||
let mut invalid = wide.clone();
|
||||
invalid["job"]["options"]["output"] = output;
|
||||
assert!(
|
||||
serde_json::from_value::<RenderSetup>(invalid).unwrap().validate().is_err(),
|
||||
"active output must respect its existing shared envelope"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn portable_jobs_reject_unbounded_invalid_and_nonportable_inputs() {
|
||||
use serde_json::json;
|
||||
@@ -801,6 +956,7 @@ mod tests {
|
||||
#[cfg(test)]
|
||||
mod cpu_budget_tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
use solidcraft_render::job::{CpuBudget, CpuProgressiveOptions};
|
||||
|
||||
#[test]
|
||||
@@ -821,11 +977,12 @@ mod cpu_budget_tests {
|
||||
width: 3840,
|
||||
height: 2160,
|
||||
job: Some(RenderJob::CpuRaytrace {
|
||||
options: CpuJob {
|
||||
transparent_background: false,
|
||||
options: Box::new(CpuJob {
|
||||
budget: CpuBudget::Studio,
|
||||
progressive: Some(CpuProgressiveOptions { samples_per_pixel: 128, seed: 82 }),
|
||||
..Default::default()
|
||||
},
|
||||
}),
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
@@ -833,7 +990,7 @@ mod cpu_budget_tests {
|
||||
let text = serde_json::to_string(&setup).unwrap();
|
||||
let reopened: RenderSetup = serde_json::from_str(&text).unwrap();
|
||||
assert_eq!(setup, reopened);
|
||||
let Some(RenderJob::CpuRaytrace { options }) = &mut setup.job else {
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else {
|
||||
panic!("CPU fixture");
|
||||
};
|
||||
options.budget = CpuBudget::Compact;
|
||||
@@ -845,4 +1002,372 @@ mod cpu_budget_tests {
|
||||
let legacy_large = RenderSetup { width: 3840, height: 2160, ..Default::default() };
|
||||
assert!(legacy_large.validate().is_err(), "large intent must name an explicit CPU job profile");
|
||||
}
|
||||
#[test]
|
||||
fn cpu_path_is_explicit_bounded_offline_intent_and_roundtrips_without_changing_legacy_jobs() {
|
||||
let old = CpuJob::default();
|
||||
assert!(old.path.is_none());
|
||||
assert!(serde_json::to_value(&old).unwrap().get("path").is_none());
|
||||
for depth in [1, 8, 16] {
|
||||
let setup:RenderSetup=serde_json::from_value(json!({"width":8,"height":8,"job":{"method":"cpu_raytrace","options":{"path":{"max_depth":depth},"progressive":{"samples_per_pixel":7,"seed":9}}}})).unwrap();
|
||||
setup.validate().unwrap();
|
||||
let mut document = crate::Document::default();
|
||||
std::sync::Arc::make_mut(&mut document.render).setups.insert("GI".into(), setup);
|
||||
let bytes = serde_json::to_vec(&document).unwrap();
|
||||
let reopened: crate::Document = serde_json::from_slice(&bytes).unwrap();
|
||||
assert_eq!(document, reopened);
|
||||
}
|
||||
for raw in [
|
||||
json!({"path":{"max_depth":0},"progressive":{"samples_per_pixel":7,"seed":9}}),
|
||||
json!({"path":{"max_depth":17},"progressive":{"samples_per_pixel":7,"seed":9}}),
|
||||
json!({"path":{"max_depth":8}}),
|
||||
json!({"path":{"max_depth":8},"progressive":{"samples_per_pixel":7,"seed":9},"shadows":false}),
|
||||
] {
|
||||
let options: CpuJob = serde_json::from_value(raw).unwrap();
|
||||
assert!(options.to_runtime(0.0).is_err());
|
||||
}
|
||||
assert!(serde_json::from_value::<CpuJob>(json!({"path":{"max_depth":8,"unknown":true}})).is_err());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[test]
|
||||
fn cpu_denoise_saved_flag_roundtrips_offline_and_keeps_false_omitted() {
|
||||
use solidcraft_render::job::CpuBudget;
|
||||
let mut setup = RenderSetup {
|
||||
width: 16,
|
||||
height: 8,
|
||||
job: Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(CpuJob { denoise: true, ..Default::default() }) }),
|
||||
..Default::default()
|
||||
};
|
||||
setup.validate().unwrap();
|
||||
let wire = serde_json::to_value(&setup).unwrap();
|
||||
assert_eq!(wire["job"]["options"]["denoise"], true);
|
||||
assert_eq!(serde_json::from_value::<RenderSetup>(wire).unwrap(), setup);
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else { panic!("CPU job expected") };
|
||||
assert!(options.to_runtime(1.5).unwrap().denoise);
|
||||
options.denoise = false;
|
||||
assert!(serde_json::to_value(&setup).unwrap()["job"]["options"].get("denoise").is_none());
|
||||
let default: CpuJob = serde_json::from_value(serde_json::json!({})).unwrap();
|
||||
let explicit: CpuJob = serde_json::from_value(serde_json::json!({"denoise":false})).unwrap();
|
||||
assert_eq!(default, explicit);
|
||||
assert!(!default.to_runtime(0.0).unwrap().denoise);
|
||||
assert!(serde_json::from_value::<CpuJob>(serde_json::json!({"denoise":"true"})).is_err());
|
||||
setup.width = 8193;
|
||||
setup.height = 1;
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else { panic!("CPU job expected") };
|
||||
options.budget = CpuBudget::Workstation;
|
||||
setup.validate().unwrap();
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else { panic!("CPU job expected") };
|
||||
options.denoise = true;
|
||||
assert!(setup.validate().unwrap_err().to_string().contains("CPU denoising"));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[test]
|
||||
fn composed_cpu_path_preserves_saved_optics_alpha_filter_lens_and_master_intent() {
|
||||
use crate::render_optics::{OpticalMaterial, SavedOptics};
|
||||
use crate::render_surface::RenderBodyTarget;
|
||||
use solidcraft_render::job::{CpuPathOptions, CpuProgressiveOptions, OutputOptions, ThinLens};
|
||||
let mut setup = RenderSetup {
|
||||
camera: Camera { fov: 0.6, distance: 123.0, ..Default::default() },
|
||||
width: 8,
|
||||
height: 8,
|
||||
job: Some(RenderJob::CpuRaytrace {
|
||||
transparent_background: true,
|
||||
options: Box::new(CpuJob {
|
||||
denoise: true,
|
||||
path: Some(CpuPathOptions { max_depth: 3 }),
|
||||
progressive: Some(CpuProgressiveOptions { samples_per_pixel: 3, seed: 81 }),
|
||||
lens: Some(ThinLens { aperture_radius_mm: 1.0, focus_distance_mm: 123.0 }),
|
||||
output: Some(Box::new(OutputOptions { linear_exr: true, ..Default::default() })),
|
||||
..Default::default()
|
||||
}),
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
setup.validate().unwrap();
|
||||
setup
|
||||
.optics
|
||||
.set(
|
||||
SavedOptics {
|
||||
target: RenderBodyTarget { definition: "Glass".into(), feature: 1, component: 0, occurrence_path: Vec::new() },
|
||||
optics: OpticalMaterial::default(),
|
||||
},
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let before = setup.clone();
|
||||
setup.validate().unwrap();
|
||||
assert_eq!(setup, before, "validation must not lower or rewrite authored optics");
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else { panic!("CPU fixture") };
|
||||
options.path = None;
|
||||
setup.validate().unwrap();
|
||||
assert!(matches!(&setup.job, Some(RenderJob::CpuRaytrace { transparent_background:true, options })
|
||||
if options.denoise && options.output.as_ref().unwrap().linear_exr && options.lens.is_some()));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[test]
|
||||
fn gpu_hard_directional_intent_roundtrips_and_hostile_lists_refuse_at_document_load() {
|
||||
use serde_json::json;
|
||||
let light = json!({"direction":[0.0,0.0,2.0],"color":[0.25,0.5,1.0],"intensity":0.0});
|
||||
let settings = json!({"setups":{"Lights":{"job":{"method":"gpu_path","options":{"lighting":{"directional_lights":vec![light.clone();8]}}}}}});
|
||||
let saved: RenderSettings = serde_json::from_value(settings.clone()).unwrap();
|
||||
let doc = crate::Document { render: std::sync::Arc::new(saved.clone()), ..Default::default() };
|
||||
assert_eq!(crate::Document::from_json(&doc.to_json()).unwrap(), doc);
|
||||
let encoded = serde_json::to_value(&saved).unwrap();
|
||||
assert_eq!(encoded["setups"]["Lights"]["job"]["options"]["lighting"]["directional_lights"], json!(vec![light.clone(); 8]));
|
||||
for list in [
|
||||
json!(vec![light.clone(); 9]),
|
||||
json!([{"direction":[0,0,0],"color":[1,1,1],"intensity":1}]),
|
||||
json!([{"direction":[0,0,1],"color":[1,1,1],"intensity":65}]),
|
||||
] {
|
||||
let mut bad = settings.clone();
|
||||
bad["setups"]["Lights"]["job"]["options"]["lighting"]["directional_lights"] = list;
|
||||
assert!(serde_json::from_value::<RenderSettings>(bad).is_err());
|
||||
}
|
||||
let mut over_combined = settings;
|
||||
over_combined["setups"]["Lights"]["job"]["options"]["lighting"]["sun"] =
|
||||
json!({"direction":[0,0,1],"angular_radius_rad":0.02,"radiance":[1,1,1]});
|
||||
assert!(serde_json::from_value::<RenderSettings>(over_combined.clone()).is_err());
|
||||
let mut document = serde_json::to_value(crate::Document::default()).unwrap();
|
||||
document["render"] = over_combined;
|
||||
assert!(crate::Document::from_json(&serde_json::to_string(&document).unwrap()).is_err());
|
||||
let old: RenderSettings = serde_json::from_value(json!({"setups":{"Old":{"job":{"method":"gpu_path","options":{}}}}})).unwrap();
|
||||
let Some(RenderJob::GpuPath { options, .. }) = &old.setups["Old"].job else { panic!("gpu job") };
|
||||
assert!(options.lighting.is_none());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[test]
|
||||
fn saved_cpu_aging_is_optional_bounded_and_preserves_stable_targets_without_runtime_ordinals() {
|
||||
use crate::render_aging::SavedAgingStack;
|
||||
use crate::render_surface::RenderBodyTarget;
|
||||
use solidcraft_render::job::aging::{AgingKind, AgingLayer};
|
||||
let old = CpuJob::default();
|
||||
assert!(serde_json::to_value(&old).unwrap().get("aging").is_none());
|
||||
let mut layers = SavedAgingStack::default();
|
||||
layers.push(AgingLayer::preset(AgingKind::Dust)).unwrap();
|
||||
let target = RenderBodyTarget { definition: "Aged panel".into(), feature: 19, component: 0, occurrence_path: Vec::new() };
|
||||
layers.get_mut(0).unwrap().target = Some(target.clone());
|
||||
let job = CpuJob { aging: layers.clone(), progressive: Some(Default::default()), denoise: true, ..Default::default() };
|
||||
job.validate(0.5).unwrap();
|
||||
assert!(job.to_runtime(0.5).unwrap_err().to_string().contains("stable occurrence"));
|
||||
let setup = RenderSetup {
|
||||
width: 8,
|
||||
height: 8,
|
||||
exposure_ev: 0.5,
|
||||
job: Some(RenderJob::CpuRaytrace { transparent_background: true, options: Box::new(job) }),
|
||||
..Default::default()
|
||||
};
|
||||
setup.validate().unwrap();
|
||||
let wire = serde_json::to_value(&setup).unwrap();
|
||||
assert_eq!(wire["job"]["options"]["aging"][0]["target"]["definition"], "Aged panel");
|
||||
assert!(wire["job"]["options"]["aging"][0]["target"].get("body_index").is_none());
|
||||
assert_eq!(serde_json::from_value::<RenderSetup>(wire.clone()).unwrap(), setup);
|
||||
let mut legacy = wire.clone();
|
||||
legacy["job"]["options"]["aging"][0]["target"] = serde_json::json!({"body_index":0,"body_name":"Aged panel"});
|
||||
assert!(serde_json::from_value::<RenderSetup>(legacy).unwrap_err().to_string().contains("explicit rebinding"));
|
||||
let mut nine = wire;
|
||||
nine["job"]["options"]["aging"] = serde_json::json!(vec![serde_json::json!({}); 9]);
|
||||
assert!(serde_json::from_value::<RenderSetup>(nine).is_err());
|
||||
layers.get_mut(0).unwrap().target = None;
|
||||
let runtime = CpuJob { aging: layers, ..Default::default() }.to_runtime(0.5).unwrap();
|
||||
assert!(runtime.aging.unwrap().active());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod cpu_adaptive_saved_tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
use solidcraft_render::job::{CpuBudget, CpuProgressiveOptions};
|
||||
#[test]
|
||||
fn saved_cpu_adaptive_intent_roundtrips_offline_and_pays_pilots_inside_the_existing_profile() {
|
||||
let setup: RenderSetup = serde_json::from_value(json!({"width":128,"height":64,
|
||||
"job":{"method":"cpu_raytrace","transparent_background":true,"options":{
|
||||
"progressive":{"samples_per_pixel":48,"seed":81},"adaptive":{"pilot_samples":16,"min_samples":16},
|
||||
"denoise":true,"path":{"max_depth":3},"output":{"linear_exr":true}}}}))
|
||||
.unwrap();
|
||||
setup.validate().unwrap();
|
||||
let value = serde_json::to_value(&setup).unwrap();
|
||||
assert_eq!(serde_json::from_value::<RenderSetup>(value.clone()).unwrap(), setup);
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = setup.job.as_ref() else { panic!("CPU job expected") };
|
||||
let runtime = options.to_runtime(0.0).unwrap();
|
||||
assert_eq!(runtime.adaptive.as_deref().copied(), options.adaptive);
|
||||
assert_eq!(runtime.preview_target().unwrap(), 64);
|
||||
assert_eq!(runtime.camera_sampling().unwrap(), Some(CpuProgressiveOptions { samples_per_pixel: 64, seed: 81 }));
|
||||
let mut too_large = setup.clone();
|
||||
too_large.width = 1024;
|
||||
too_large.height = 1024;
|
||||
assert!(too_large.validate().is_err(), "64 total passes exceed Compact's existing camera-sample bound");
|
||||
let mut cap = value.clone();
|
||||
cap["job"]["options"]["progressive"]["samples_per_pixel"] = json!(64);
|
||||
assert!(
|
||||
serde_json::from_value::<RenderSetup>(cap).unwrap().validate().is_err(),
|
||||
"16 pilots cannot be hidden outside Compact's 64-sample cap"
|
||||
);
|
||||
for (budget, maximum) in [(CpuBudget::Compact, 64), (CpuBudget::Studio, 1024), (CpuBudget::Workstation, 4096)] {
|
||||
let mut runtime = runtime.clone();
|
||||
runtime.budget = budget;
|
||||
runtime.progressive = Some(CpuProgressiveOptions { samples_per_pixel: maximum - 16, seed: 81 });
|
||||
assert_eq!(runtime.preview_target().unwrap(), maximum);
|
||||
runtime.progressive.as_mut().unwrap().samples_per_pixel += 1;
|
||||
assert!(runtime.validate().is_err(), "{budget:?} must include the pilot stage in its unchanged cap");
|
||||
}
|
||||
let mut fixed = value.clone();
|
||||
fixed["job"]["options"].as_object_mut().unwrap().remove("progressive");
|
||||
assert!(serde_json::from_value::<RenderSetup>(fixed).unwrap().validate().is_err());
|
||||
let mut hostile = value;
|
||||
hostile["job"]["options"]["adaptive"]["certified_convergence"] = json!(true);
|
||||
assert!(serde_json::from_value::<RenderSetup>(hostile).is_err());
|
||||
let old = serde_json::to_value(CpuJob::default()).unwrap();
|
||||
assert!(old.get("adaptive").is_none(), "default-absent saved jobs keep their prior schema bytes");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod saved_coat_tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
Document,
|
||||
render_coat::{CoatMaterial, SavedCoat},
|
||||
render_surface::RenderBodyTarget,
|
||||
};
|
||||
use serde_json::{Value, json};
|
||||
use std::sync::Arc;
|
||||
|
||||
fn target(feature: u64) -> RenderBodyTarget {
|
||||
RenderBodyTarget { definition: format!("Coated{feature}"), feature, component: 0, occurrence_path: vec![] }
|
||||
}
|
||||
fn document(gpu: bool) -> Document {
|
||||
let mut doc = Document::default();
|
||||
let job = if gpu {
|
||||
RenderJob::GpuPath { transparent_background: false, options: Default::default() }
|
||||
} else {
|
||||
RenderJob::CpuRaytrace { transparent_background: false, options: Default::default() }
|
||||
};
|
||||
Arc::make_mut(&mut doc.render).setups.insert("Coated".into(), RenderSetup { width: 8, height: 8, job: Some(job), ..Default::default() });
|
||||
doc
|
||||
}
|
||||
#[test]
|
||||
fn saved_coat_document_roundtrip_preserves_every_number_and_old_omission_for_both_methods() {
|
||||
for gpu in [false, true] {
|
||||
let mut doc = document(gpu);
|
||||
let old = doc.to_json();
|
||||
let old_value: Value = serde_json::from_str(&old).unwrap();
|
||||
assert!(old_value["render"]["setups"]["Coated"].get("coats").is_none());
|
||||
assert_eq!(Document::from_json(&old).unwrap().to_json(), old);
|
||||
let coat = CoatMaterial { weight: -0.0, roughness: 0.22, ior: 1.74 };
|
||||
Arc::make_mut(&mut doc.render).setups.get_mut("Coated").unwrap().coats.set(SavedCoat { target: target(1), coat }, false).unwrap();
|
||||
let encoded = doc.to_json();
|
||||
let loaded = Document::from_json(&encoded).unwrap();
|
||||
assert_eq!(loaded.render, doc.render);
|
||||
let saved = loaded.render.setups["Coated"].coats.iter().next().unwrap();
|
||||
assert_eq!(saved.coat, coat);
|
||||
assert_eq!(saved.coat.weight.to_bits(), (-0.0_f64).to_bits());
|
||||
let wire = serde_json::to_value(saved).unwrap();
|
||||
assert!(wire.get("body_index").is_none() && wire.get("body_name").is_none());
|
||||
assert!(wire["target"].get("feature").is_some());
|
||||
let setup = Arc::make_mut(&mut doc.render).setups.get_mut("Coated").unwrap();
|
||||
let changed = SavedCoat { target: target(1), coat: CoatMaterial { weight: 0.0, ..coat } };
|
||||
assert!(setup.coats.set(changed.clone(), false).is_err(), "authored signed zero is not silently replaced");
|
||||
setup.coats.set(changed, true).unwrap();
|
||||
assert_eq!(setup.coats.iter().next().unwrap().coat.weight.to_bits(), 0.0_f64.to_bits());
|
||||
assert!(setup.coats.remove(&target(1)));
|
||||
assert_eq!(doc.to_json(), old, "removing the only coat restores exact legacy document bytes");
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn malformed_saved_coats_refuse_through_the_full_document_loader() {
|
||||
let mut doc = document(false);
|
||||
Arc::make_mut(&mut doc.render)
|
||||
.setups
|
||||
.get_mut("Coated")
|
||||
.unwrap()
|
||||
.coats
|
||||
.set(SavedCoat { target: target(1), coat: Default::default() }, false)
|
||||
.unwrap();
|
||||
let base: Value = serde_json::from_str(&doc.to_json()).unwrap();
|
||||
for (key, value) in
|
||||
[("weight", json!(-0.01)), ("weight", json!(1.01)), ("roughness", json!(0.02)), ("ior", json!(3.01)), ("unknown", json!(true))]
|
||||
{
|
||||
let mut bad = base.clone();
|
||||
bad["render"]["setups"]["Coated"]["coats"][0]["coat"][key] = value;
|
||||
assert!(Document::from_json(&bad.to_string()).is_err(), "invalid coat {key}");
|
||||
}
|
||||
let mut duplicate = base.clone();
|
||||
let row = duplicate["render"]["setups"]["Coated"]["coats"][0].clone();
|
||||
duplicate["render"]["setups"]["Coated"]["coats"] = json!([row, row]);
|
||||
assert!(Document::from_json(&duplicate.to_string()).is_err());
|
||||
for key in ["body_index", "runtime_path"] {
|
||||
let mut bad = base.clone();
|
||||
bad["render"]["setups"]["Coated"]["coats"][0][key] = json!(0);
|
||||
assert!(Document::from_json(&bad.to_string()).is_err());
|
||||
}
|
||||
let mut too_many = base;
|
||||
too_many["render"]["setups"]["Coated"]["coats"] =
|
||||
json!((1..=65).map(|feature| SavedCoat { target: target(feature), coat: Default::default() }).collect::<Vec<_>>());
|
||||
assert!(Document::from_json(&too_many.to_string()).is_err());
|
||||
}
|
||||
#[test]
|
||||
fn saved_coat_uses_existing_sixty_four_target_bound_and_rejects_glass_even_at_zero_weight() {
|
||||
use crate::render_optics::{OpticalMaterial, SavedOptics};
|
||||
for gpu in [false, true] {
|
||||
let mut doc = document(gpu);
|
||||
let setup = Arc::make_mut(&mut doc.render).setups.get_mut("Coated").unwrap();
|
||||
for feature in 1..=64 {
|
||||
setup.coats.set(SavedCoat { target: target(feature), coat: CoatMaterial { weight: 0.0, ..Default::default() } }, false).unwrap();
|
||||
}
|
||||
setup.validate().unwrap();
|
||||
assert_eq!(setup.coats.len(), 64);
|
||||
let before = setup.coats.clone();
|
||||
assert!(setup.coats.set(SavedCoat { target: target(65), coat: Default::default() }, false).is_err());
|
||||
assert_eq!(setup.coats, before);
|
||||
setup.optics.set(SavedOptics { target: target(1), optics: OpticalMaterial::default() }, false).unwrap();
|
||||
assert!(setup.validate().unwrap_err().to_string().contains("cannot share"));
|
||||
setup.optics.remove(&target(1));
|
||||
setup.job = Some(RenderJob::Raster { transparent_background: false });
|
||||
assert!(setup.validate().unwrap_err().to_string().contains("raytrace"));
|
||||
assert_eq!(setup.coats, before, "unsupported method retains all authored rows");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod cpu_celestial_saved_tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
#[test]
|
||||
fn saved_cpu_finite_sun_and_sky_roundtrip_exactly_and_require_explicit_path() {
|
||||
let value = json!({"width":16,"height":12,"job":{"method":"cpu_raytrace","transparent_background":true,"options":{
|
||||
"path":{"max_depth":4},"progressive":{"samples_per_pixel":32,"seed":81},"adaptive":{"pilot_samples":16,"min_samples":16},
|
||||
"sun":{"direction":[0.2,-0.3,0.9],"angular_radius_rad":0.02,"radiance":[301.25,202.5,103.75]},
|
||||
"sky":{"kind":"sky","gradient":{"zenith":[0.25,0.5,1.0],"horizon":[0.75,0.5,0.25],"ground":[0.125,0.25,0.5]},"rotation_rad":0.731,"intensity":75},
|
||||
"denoise":true,"output":{"linear_exr":true},"lights":[]}}});
|
||||
let setup: RenderSetup = serde_json::from_value(value.clone()).unwrap();
|
||||
setup.validate().unwrap();
|
||||
let wire = serde_json::to_value(&setup).unwrap();
|
||||
assert_eq!(serde_json::from_value::<RenderSetup>(wire.clone()).unwrap(), setup);
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &setup.job else { panic!("CPU expected") };
|
||||
let runtime = options.to_runtime(0.0).unwrap();
|
||||
assert_eq!(runtime.sun.as_deref().copied(), options.sun);
|
||||
assert_eq!(runtime.sky.as_deref().unwrap().intensity, 75.0);
|
||||
assert_eq!(runtime.sky.as_deref().unwrap().rotation_rad, 0.731);
|
||||
for (field, replacement) in [
|
||||
("path", serde_json::Value::Null),
|
||||
("sun", json!({"direction":[0,0,1],"angular_radius_rad":0,"radiance":[1,1,1]})),
|
||||
("environment", json!({"color":[1,1,1],"intensity":1})),
|
||||
] {
|
||||
let mut invalid = wire.clone();
|
||||
invalid["job"]["options"][field] = replacement;
|
||||
assert!(serde_json::from_value::<RenderSetup>(invalid).unwrap().validate().is_err(), "{field} must not be silently replaced");
|
||||
}
|
||||
for (field, value) in [("intensity", json!(100.001)), ("rotation_rad", json!(1e6 + 1.0))] {
|
||||
let mut invalid = wire.clone();
|
||||
invalid["job"]["options"]["sky"][field] = value;
|
||||
assert!(serde_json::from_value::<RenderSetup>(invalid).unwrap().validate().is_err());
|
||||
}
|
||||
let defaults = serde_json::to_value(CpuJob::default()).unwrap();
|
||||
assert!(defaults.get("sun").is_none() && defaults.get("sky").is_none());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,4 +250,66 @@ mod tests {
|
||||
target.occurrence_path = vec![2, 2];
|
||||
assert!(target.validate().is_err());
|
||||
}
|
||||
#[test]
|
||||
fn saved_cpu_surface_maps_roundtrip_for_opaque_direct_and_path_and_preserve_unsupported_intent() {
|
||||
use crate::render_settings::{CpuJob, RenderJob, RenderSetup};
|
||||
let mut options = CpuJob::default();
|
||||
let mut setup = RenderSetup {
|
||||
job: Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(options.clone()) }),
|
||||
..Default::default()
|
||||
};
|
||||
setup.surfaces.set(fixture(), false).unwrap();
|
||||
setup.validate().unwrap();
|
||||
let mut direct_document = crate::Document::default();
|
||||
std::sync::Arc::make_mut(&mut direct_document.render).setups.insert("Maps".into(), setup.clone());
|
||||
assert_eq!(crate::Document::from_json(&direct_document.to_json()).unwrap(), direct_document);
|
||||
options.progressive = Some(solidcraft_render::job::CpuProgressiveOptions { samples_per_pixel: 16, seed: 9 });
|
||||
options.shadows = true;
|
||||
options.path = Some(solidcraft_render::job::CpuPathOptions { max_depth: 3 });
|
||||
setup.job = Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(options.clone()) });
|
||||
setup.validate().unwrap();
|
||||
let mut document = crate::Document::default();
|
||||
std::sync::Arc::make_mut(&mut document.render).setups.insert("Maps".into(), setup.clone());
|
||||
assert_eq!(crate::Document::from_json(&document.to_json()).unwrap(), document);
|
||||
options.path = None;
|
||||
let saved_options_wire = serde_json::to_value(&options).unwrap();
|
||||
let mut runtime = options.to_runtime(0.0).unwrap();
|
||||
runtime.reflections = Some(solidcraft_render::job::ReflectionOptions {
|
||||
bodies: vec![solidcraft_render::job::ReflectionBody { body: "Panel".into(), mode: solidcraft_render::job::ReflectionMode::Mirror }],
|
||||
samples: 1,
|
||||
max_bounces: 2,
|
||||
});
|
||||
runtime.validate().unwrap();
|
||||
let runtime_wire = serde_json::to_value(&runtime).unwrap();
|
||||
let error = solidcraft_render::job::textures::validate_cpu_options(&runtime).unwrap_err();
|
||||
assert!(error.message.contains("selected reflections"));
|
||||
assert_eq!(serde_json::to_value(&runtime).unwrap(), runtime_wire, "map refusal preserves the exact runtime selected override");
|
||||
assert_eq!(serde_json::to_value(&options).unwrap(), saved_options_wire, "runtime overrides do not rewrite saved CPU fields");
|
||||
setup.job = Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(options.clone()) });
|
||||
setup.validate().unwrap();
|
||||
let mut unknown = serde_json::to_value(&setup).unwrap();
|
||||
unknown["job"]["options"]["reflections"] = serde_json::to_value(&runtime.reflections).unwrap();
|
||||
let error = serde_json::from_value::<RenderSetup>(unknown).unwrap_err();
|
||||
assert!(error.to_string().contains("reflections"), "saved CPU intent must not silently discard runtime-only selected overrides");
|
||||
// Prove the saved field is supported in fixed mode before checking
|
||||
// its incompatibility with still-authored progressive sampling.
|
||||
let mut fixed = options.clone();
|
||||
fixed.progressive = None;
|
||||
fixed.primary_samples = 4;
|
||||
fixed.validate_surface_maps(0.0).unwrap();
|
||||
let surfaces = setup.surfaces.clone();
|
||||
options.primary_samples = 4;
|
||||
setup.job = Some(RenderJob::CpuRaytrace { transparent_background: false, options: Box::new(options) });
|
||||
let wire = serde_json::to_value(&setup).unwrap();
|
||||
assert!(setup.validate().unwrap_err().to_string().contains("CPU progressive requires"));
|
||||
assert_eq!(serde_json::to_value(&setup).unwrap(), wire);
|
||||
assert_eq!(setup.surfaces, surfaces);
|
||||
assert_eq!(setup.surfaces.len(), 1);
|
||||
for job in [None, Some(RenderJob::Raster { transparent_background: false })] {
|
||||
setup.job = job;
|
||||
assert!(setup.validate().is_err());
|
||||
assert_eq!(setup.surfaces, surfaces);
|
||||
assert_eq!(setup.surfaces.len(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[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 }
|
||||
@@ -0,0 +1,203 @@
|
||||
//! 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 })
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
//! 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;
|
||||
@@ -0,0 +1,107 @@
|
||||
//! 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))
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
//! 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)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
//! 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(())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,594 @@
|
||||
//! 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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,540 @@
|
||||
//! Analytic checks: free fall, pendulum periods, spring-mass oscillation, energy and momentum
|
||||
//! conservation, slider-crank kinematics, joint reactions, Jacobians against finite
|
||||
//! differences, and hostile input.
|
||||
|
||||
use std::f64::consts::{PI, TAU};
|
||||
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
use crate::system::{System, testing};
|
||||
use crate::*;
|
||||
|
||||
const G: f64 = STANDARD_GRAVITY;
|
||||
|
||||
fn down() -> Vec3 {
|
||||
Vec3::new(0.0, 0.0, -G)
|
||||
}
|
||||
|
||||
fn ok<T>(r: Result<T>) -> T {
|
||||
match r {
|
||||
Ok(v) => v,
|
||||
Err(e) => panic!("simulation failed: {e}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// A body hanging `len` mm under a hinge at the origin turning about Y, at angle `theta` from
|
||||
/// straight down (towards +X) and turning at `omega`.
|
||||
fn pendulum(len: f64, theta: f64, omega: f64, inertia: f64) -> Model {
|
||||
let dir = Vec3::new(theta.sin(), 0.0, -theta.cos());
|
||||
// Turning about +Y takes −Z towards −X; the hinge's own Y axis is the world's.
|
||||
let rot = Quat::from_axis_angle(Vec3::Y, -theta);
|
||||
let mut body = Body::at_rest(1.0, Vec3::new(inertia, inertia, inertia), dir * len);
|
||||
body.orientation = rot;
|
||||
body.angular_velocity = Vec3::Y * -omega;
|
||||
body.velocity = (Vec3::Y * -omega).cross(dir * len);
|
||||
let joint = Joint {
|
||||
kind: JointKind::Revolute,
|
||||
a: Marker::ground(Vec3::ZERO, Vec3::Y, Vec3::X),
|
||||
b: Marker::new(Some(0), Vec3::new(0.0, 0.0, len), Vec3::Y, Vec3::X),
|
||||
};
|
||||
Model { bodies: vec![body], joints: vec![joint], forces: vec![], gravity: down() }
|
||||
}
|
||||
|
||||
/// Times where `f` crosses zero upwards, linearly interpolated between samples.
|
||||
fn upward_crossings(traj: &Trajectory, f: impl Fn(&Sample) -> f64) -> Vec<f64> {
|
||||
traj.samples
|
||||
.windows(2)
|
||||
.filter_map(|w| {
|
||||
let (a, b) = (w.first()?, w.get(1)?);
|
||||
let (fa, fb) = (f(a), f(b));
|
||||
(fa < 0.0 && fb >= 0.0).then(|| a.time + (b.time - a.time) * fa / (fa - fb))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn mean_period(crossings: &[f64]) -> f64 {
|
||||
assert!(crossings.len() >= 3, "too few crossings: {crossings:?}");
|
||||
let (first, last) = (crossings.first().copied().unwrap_or(0.0), crossings.last().copied().unwrap_or(0.0));
|
||||
(last - first) / (crossings.len() - 1) as f64
|
||||
}
|
||||
|
||||
fn angle_of(s: &Sample) -> f64 {
|
||||
s.joints.first().and_then(|j| j.values.first()).copied().unwrap_or(f64::NAN)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn free_fall_follows_the_parabola() {
|
||||
let mut body = Body::at_rest(2.5, Vec3::new(10.0, 20.0, 30.0), Vec3::new(1.0, 2.0, 3.0));
|
||||
body.velocity = Vec3::new(10.0, -5.0, 50.0);
|
||||
body.angular_velocity = Vec3::new(0.0, 0.0, 1.0);
|
||||
let model = Model { bodies: vec![body.clone()], joints: vec![], forces: vec![], gravity: down() };
|
||||
let traj = ok(simulate(&model, &Settings::rk4(1.0, 0.01, 0.1)));
|
||||
assert_eq!(traj.samples.len(), 11);
|
||||
for s in &traj.samples {
|
||||
let t = s.time;
|
||||
let expect = body.position + body.velocity * t + down() * (0.5 * t * t);
|
||||
let got = s.bodies.first().map(|b| b.position).unwrap_or(Vec3::ZERO);
|
||||
assert!(got.dist(expect) < 1e-7, "t={t}: {got:?} vs {expect:?}");
|
||||
// A symmetric body spinning about z keeps spinning.
|
||||
let w = s.bodies.first().map(|b| b.angular_velocity).unwrap_or(Vec3::ZERO);
|
||||
assert!(w.dist(Vec3::Z) < 1e-12);
|
||||
// Energy is conserved exactly enough.
|
||||
let e0 = traj.samples.first().map(|s| s.energy.total()).unwrap_or(0.0);
|
||||
assert!((s.energy.total() - e0).abs() < 1e-6 * e0.abs().max(1.0));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pendulum_small_angle_period() {
|
||||
let (len, inertia) = (100.0, 40.0);
|
||||
let i_pivot = inertia + len * len;
|
||||
let period = TAU * (i_pivot / (G * len)).sqrt();
|
||||
let amplitude = 0.01;
|
||||
let model = pendulum(len, 0.0, amplitude * TAU / period, inertia);
|
||||
let traj = ok(simulate(&model, &Settings::rk4(3.0, 1e-3, 1e-3)));
|
||||
let measured = mean_period(&upward_crossings(&traj, angle_of));
|
||||
// The finite amplitude lengthens the period by about θ²/16 (6e-6 here).
|
||||
assert!((measured - period).abs() < 1e-4 * period, "period {measured} vs {period}");
|
||||
assert!(traj.stats.max_constraint_error < 1e-9, "{:?}", traj.stats);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn adaptive_integration_matches_the_pendulum_period() {
|
||||
let (len, inertia) = (100.0, 40.0);
|
||||
let period = TAU * ((inertia + len * len) / (G * len)).sqrt();
|
||||
let model = pendulum(len, 0.0, 0.01 * TAU / period, inertia);
|
||||
let traj = ok(simulate(&model, &Settings::adaptive(3.0, 1e-3, 1e-9, 1e-9)));
|
||||
let measured = mean_period(&upward_crossings(&traj, angle_of));
|
||||
assert!((measured - period).abs() < 1e-4 * period, "period {measured} vs {period}");
|
||||
// Larger tolerances take fewer steps than samples (the output still lands on each).
|
||||
let coarse = Settings {
|
||||
integrator: Integrator::Adaptive { rel_tol: 1e-6, abs_tol: 1e-6, min_step: 1e-9, max_step: 0.05 },
|
||||
..Settings::rk4(3.0, 1.0, 0.05)
|
||||
};
|
||||
let traj = ok(simulate(&model, &coarse));
|
||||
assert_eq!(traj.samples.len(), 61);
|
||||
let measured = mean_period(&upward_crossings(&traj, angle_of));
|
||||
assert!((measured - period).abs() < 2e-3 * period, "coarse period {measured} vs {period}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hanging_body_pin_carries_its_weight() {
|
||||
let model = pendulum(100.0, 0.0, 0.0, 40.0);
|
||||
let traj = ok(simulate(&model, &Settings::rk4(0.1, 1e-3, 0.05)));
|
||||
for s in &traj.samples {
|
||||
let j = s.joints.first().map(|j| (j.force, j.torque)).unwrap_or_default();
|
||||
assert!(j.0.dist(Vec3::new(0.0, 0.0, G)) < 1e-6 * G, "force {:?}", j.0);
|
||||
assert!(j.1.len() < 1e-6 * G, "torque {:?}", j.1);
|
||||
assert!(angle_of(s).abs() < 1e-12);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn large_swing_conserves_energy() {
|
||||
// Released from horizontal: a compound pendulum swinging through ±90°.
|
||||
let model = pendulum(100.0, PI / 2.0, 0.0, 400.0);
|
||||
let traj = ok(simulate(&model, &Settings::rk4(2.0, 1e-3, 1e-2)));
|
||||
let e0 = traj.samples.first().map(|s| s.energy.total()).unwrap_or(0.0);
|
||||
let scale = G * 100.0;
|
||||
for s in &traj.samples {
|
||||
assert!((s.energy.total() - e0).abs() < 1e-6 * scale, "t={} drift {}", s.time, s.energy.total() - e0);
|
||||
}
|
||||
}
|
||||
|
||||
/// Two links hinged about Y, released from horizontal.
|
||||
fn double_pendulum() -> Model {
|
||||
let link = |x: f64| Body::at_rest(1.0, Vec3::new(100.0, 900.0, 900.0), Vec3::new(x, 0.0, 0.0));
|
||||
let hinge = |a: Option<usize>, pa: Vec3, b: usize, pb: Vec3| Joint {
|
||||
kind: JointKind::Revolute,
|
||||
a: Marker::new(a, pa, Vec3::Y, Vec3::X),
|
||||
b: Marker::new(Some(b), pb, Vec3::Y, Vec3::X),
|
||||
};
|
||||
Model {
|
||||
bodies: vec![link(50.0), link(150.0)],
|
||||
joints: vec![
|
||||
hinge(None, Vec3::ZERO, 0, Vec3::new(-50.0, 0.0, 0.0)),
|
||||
hinge(Some(0), Vec3::new(50.0, 0.0, 0.0), 1, Vec3::new(-50.0, 0.0, 0.0)),
|
||||
],
|
||||
forces: vec![],
|
||||
gravity: down(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn double_pendulum_conserves_energy() {
|
||||
let traj = ok(simulate(&double_pendulum(), &Settings::rk4(5.0, 5e-4, 1e-2)));
|
||||
let e0 = traj.samples.first().map(|s| s.energy.total()).unwrap_or(0.0);
|
||||
let scale = 2.0 * G * 150.0;
|
||||
let worst = traj.samples.iter().map(|s| (s.energy.total() - e0).abs()).fold(0.0, f64::max);
|
||||
assert!(worst < 1e-5 * scale, "energy drift {worst} of {scale}");
|
||||
// It did swing hard: the lower link went well past vertical.
|
||||
let lowest = traj.samples.iter().filter_map(|s| s.bodies.get(1)).map(|b| b.position.z).fold(0.0, f64::min);
|
||||
assert!(lowest < -100.0, "{lowest}");
|
||||
assert_eq!(traj.stats.redundant_equations, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn constraint_drift_stays_bounded_over_long_runs() {
|
||||
// Projection holds the joints to its tolerance (1e-10) however long the run.
|
||||
let traj = ok(simulate(&double_pendulum(), &Settings::rk4(20.0, 1e-3, 0.1)));
|
||||
assert!(traj.stats.max_constraint_error <= 1e-10, "{:?}", traj.stats);
|
||||
// Without projection, Baumgarte terms keep the drift bounded too, if less tightly.
|
||||
let settings = Settings { projection: false, baumgarte: Some((20.0, 20.0)), ..Settings::rk4(20.0, 1e-3, 0.1) };
|
||||
let traj = ok(simulate(&double_pendulum(), &settings));
|
||||
assert!(traj.stats.max_constraint_error < 1e-3, "{:?}", traj.stats);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slider_crank_follows_its_closed_form() {
|
||||
let (r, l) = (50.0, 150.0);
|
||||
let theta0 = PI / 3.0;
|
||||
let pin = Vec3::new(r * theta0.cos(), 0.0, -r * theta0.sin());
|
||||
let s0 = r * theta0.cos() + (l * l - (r * theta0.sin()).powi(2)).sqrt();
|
||||
let slide = Vec3::new(s0, 0.0, 0.0);
|
||||
let u = (slide - pin) * (1.0 / l);
|
||||
let mut crank = Body::at_rest(1.0, Vec3::new(100.0, 2000.0, 2000.0), pin * 0.5);
|
||||
crank.orientation = Quat::from_axis_angle(Vec3::Y, theta0);
|
||||
crank.angular_velocity = Vec3::Y * TAU;
|
||||
crank.velocity = (Vec3::Y * TAU).cross(pin * 0.5);
|
||||
let mut rod = Body::at_rest(0.5, Vec3::new(50.0, 1000.0, 1000.0), (pin + slide) * 0.5);
|
||||
rod.orientation = Quat::from_axis_angle(Vec3::Y, (-u.z).atan2(u.x));
|
||||
let slider = Body::at_rest(0.3, Vec3::new(50.0, 50.0, 50.0), slide);
|
||||
let hinge = |a: Option<usize>, pa: Vec3, b: usize, pb: Vec3| Joint {
|
||||
kind: JointKind::Revolute,
|
||||
a: Marker::new(a, pa, Vec3::Y, Vec3::X),
|
||||
b: Marker::new(Some(b), pb, Vec3::Y, Vec3::X),
|
||||
};
|
||||
let model = Model {
|
||||
bodies: vec![crank, rod, slider],
|
||||
joints: vec![
|
||||
hinge(None, Vec3::ZERO, 0, Vec3::new(-r / 2.0, 0.0, 0.0)),
|
||||
hinge(Some(0), Vec3::new(r / 2.0, 0.0, 0.0), 1, Vec3::new(-l / 2.0, 0.0, 0.0)),
|
||||
hinge(Some(1), Vec3::new(l / 2.0, 0.0, 0.0), 2, Vec3::ZERO),
|
||||
Joint { kind: JointKind::Slider, a: Marker::ground(Vec3::ZERO, Vec3::X, Vec3::Y), b: Marker::new(Some(2), Vec3::ZERO, Vec3::X, Vec3::Y) },
|
||||
],
|
||||
forces: vec![],
|
||||
gravity: Vec3::ZERO,
|
||||
};
|
||||
let traj = ok(simulate(&model, &Settings::rk4(2.0, 1e-3, 1e-2)));
|
||||
// A planar linkage built from 3D joints repeats three equations; they are solved, not refused.
|
||||
assert_eq!(traj.stats.redundant_equations, 3);
|
||||
let mut turned = 0.0_f64;
|
||||
let mut last = theta0;
|
||||
for s in &traj.samples {
|
||||
let theta = angle_of(s);
|
||||
let x = s.joints.get(3).and_then(|j| j.values.first()).copied().unwrap_or(f64::NAN);
|
||||
let expect = r * theta.cos() + (l * l - (r * theta.sin()).powi(2)).sqrt();
|
||||
assert!((x - expect).abs() < 1e-6, "t={}: slider {x} vs {expect}", s.time);
|
||||
let step = (theta - last + PI).rem_euclid(TAU) - PI;
|
||||
turned += step;
|
||||
last = theta;
|
||||
}
|
||||
assert!(turned.abs() > TAU, "the crank turned {turned} rad");
|
||||
assert!(traj.stats.max_constraint_error < 1e-9, "{:?}", traj.stats);
|
||||
// No forces: kinetic energy is conserved.
|
||||
let e0 = traj.samples.first().map(|s| s.energy.kinetic).unwrap_or(0.0);
|
||||
assert!(traj.samples.iter().all(|s| (s.energy.kinetic - e0).abs() < 1e-6 * e0), "kinetic energy drifted");
|
||||
}
|
||||
|
||||
/// A body on a slider along X, pulled toward the origin by a spring of free length 40 mm,
|
||||
/// starting 10 mm stretched, with gravity across the slide.
|
||||
fn spring_mass(damping: f64) -> Model {
|
||||
Model {
|
||||
bodies: vec![Body::at_rest(2.0, Vec3::new(500.0, 500.0, 500.0), Vec3::new(50.0, 0.0, 0.0))],
|
||||
joints: vec![Joint {
|
||||
kind: JointKind::Slider,
|
||||
a: Marker::ground(Vec3::ZERO, Vec3::X, Vec3::Y),
|
||||
b: Marker::new(Some(0), Vec3::ZERO, Vec3::X, Vec3::Y),
|
||||
}],
|
||||
forces: vec![Force::Spring {
|
||||
a: Anchor { body: None, point: Vec3::ZERO },
|
||||
b: Anchor { body: Some(0), point: Vec3::ZERO },
|
||||
stiffness: 800.0,
|
||||
damping,
|
||||
free_length: 40.0,
|
||||
preload: 0.0,
|
||||
}],
|
||||
gravity: down(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spring_mass_oscillates_at_its_natural_frequency() {
|
||||
// ω = √(k/m) = 20 rad/s.
|
||||
let traj = ok(simulate(&spring_mass(0.0), &Settings::rk4(1.0, 1e-4, 1e-3)));
|
||||
for s in &traj.samples {
|
||||
let x = s.bodies.first().map(|b| b.position.x).unwrap_or(f64::NAN);
|
||||
let expect = 40.0 + 10.0 * (20.0 * s.time).cos();
|
||||
assert!((x - expect).abs() < 1e-6, "t={}: {x} vs {expect}", s.time);
|
||||
// The slide holds the body up against gravity.
|
||||
let f = s.joints.first().map(|j| j.force).unwrap_or_default();
|
||||
assert!((f.z - 2.0 * G).abs() < 1e-6 * G && f.x.abs() < 1e-6 * G, "reaction {f:?}");
|
||||
}
|
||||
let e0 = traj.samples.first().map(|s| s.energy.total()).unwrap_or(0.0);
|
||||
assert!(traj.samples.iter().all(|s| (s.energy.total() - e0).abs() < 1e-8 * 800.0 * 100.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spring_damper_decays_as_the_closed_form() {
|
||||
// c = 8 kg/s: ζ = c / (2√(km)) = 0.1.
|
||||
let (wn, zeta) = (20.0_f64, 0.1_f64);
|
||||
let wd = wn * (1.0 - zeta * zeta).sqrt();
|
||||
let traj = ok(simulate(&spring_mass(8.0), &Settings::rk4(1.0, 1e-4, 1e-3)));
|
||||
for s in &traj.samples {
|
||||
let t = s.time;
|
||||
let x = s.bodies.first().map(|b| b.position.x).unwrap_or(f64::NAN);
|
||||
let expect = 40.0 + (-zeta * wn * t).exp() * 10.0 * ((wd * t).cos() + zeta * wn / wd * (wd * t).sin());
|
||||
assert!((x - expect).abs() < 1e-6, "t={t}: {x} vs {expect}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn torque_free_body_keeps_energy_and_momentum() {
|
||||
let mut body = Body::at_rest(1.0, Vec3::new(1000.0, 2000.0, 3000.0), Vec3::ZERO);
|
||||
body.orientation = Quat::from_axis_angle(Vec3::new(1.0, 2.0, 3.0), 0.7);
|
||||
body.angular_velocity = Vec3::new(1.0, 0.3, 5.0);
|
||||
let model = Model { bodies: vec![body], joints: vec![], forces: vec![], gravity: Vec3::ZERO };
|
||||
let traj = ok(simulate(&model, &Settings::rk4(2.0, 1e-4, 1e-2)));
|
||||
let momentum = |s: &Sample| {
|
||||
let b = s.bodies.first().copied();
|
||||
b.map_or(Vec3::ZERO, |b| {
|
||||
let r = b.orientation.to_mat3();
|
||||
r.mul(&Mat3::diagonal(Vec3::new(1000.0, 2000.0, 3000.0))).mul(&r.transpose()).mul_vec(b.angular_velocity)
|
||||
})
|
||||
};
|
||||
let (l0, e0) = traj.samples.first().map(|s| (momentum(s), s.energy.kinetic)).unwrap_or_default();
|
||||
let mut tumbled = false;
|
||||
for s in &traj.samples {
|
||||
assert!(momentum(s).dist(l0) < 1e-7 * l0.len(), "t={} momentum {:?} vs {l0:?}", s.time, momentum(s));
|
||||
assert!((s.energy.kinetic - e0).abs() < 1e-7 * e0);
|
||||
let w = s.bodies.first().map(|b| b.angular_velocity).unwrap_or_default();
|
||||
tumbled |= w.dist(Vec3::new(1.0, 0.3, 5.0)) > 0.1;
|
||||
}
|
||||
assert!(tumbled, "the angular velocity should precess");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spherical_pendulum_keeps_energy_and_vertical_momentum() {
|
||||
// A body on a ball joint, tilted and pushed sideways: it swings round the vertical.
|
||||
let com = Vec3::new(60.0, 0.0, -80.0);
|
||||
let mut body = Body::at_rest(1.5, Vec3::new(300.0, 500.0, 700.0), com);
|
||||
body.velocity = Vec3::new(0.0, 400.0, 0.0);
|
||||
let model = Model {
|
||||
bodies: vec![body],
|
||||
joints: vec![Joint {
|
||||
kind: JointKind::Ball,
|
||||
a: Marker::ground(Vec3::ZERO, Vec3::Z, Vec3::X),
|
||||
b: Marker::new(Some(0), -com, Vec3::Z, Vec3::X),
|
||||
}],
|
||||
forces: vec![],
|
||||
gravity: down(),
|
||||
};
|
||||
let traj = ok(simulate(&model, &Settings::rk4(3.0, 5e-4, 1e-2)));
|
||||
let lz = |s: &Sample| {
|
||||
s.bodies.first().map_or(0.0, |b| {
|
||||
let r = b.orientation.to_mat3();
|
||||
let iw = r.mul(&Mat3::diagonal(Vec3::new(300.0, 500.0, 700.0))).mul(&r.transpose());
|
||||
(b.position.cross(b.velocity * 1.5) + iw.mul_vec(b.angular_velocity)).z
|
||||
})
|
||||
};
|
||||
let (l0, e0) = traj.samples.first().map(|s| (lz(s), s.energy.total())).unwrap_or_default();
|
||||
assert!(l0.abs() > 1e3);
|
||||
for s in &traj.samples {
|
||||
assert!((lz(s) - l0).abs() < 1e-6 * l0.abs(), "t={}: Lz {} vs {l0}", s.time, lz(s));
|
||||
assert!((s.energy.total() - e0).abs() < 1e-6 * G * 100.0, "t={}: energy drift {}", s.time, s.energy.total() - e0);
|
||||
// The joint holds the body's pivot at the origin.
|
||||
let pivot = s.bodies.first().map(|b| b.position + b.orientation.rotate(-com)).unwrap_or_default();
|
||||
assert!(pivot.len() < 1e-9, "{pivot:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Every joint kind between two moving bodies and between the ground and a body: the
|
||||
/// Jacobian and `J̇u` agree with finite differences of `Φ` along the motion.
|
||||
#[test]
|
||||
fn jacobians_match_finite_differences() {
|
||||
let kinds = [JointKind::Rigid, JointKind::Revolute, JointKind::Slider, JointKind::Cylindrical, JointKind::Planar, JointKind::Ball];
|
||||
let mut a = Body::at_rest(1.0, Vec3::new(1.0, 2.0, 3.0), Vec3::new(10.0, -20.0, 5.0));
|
||||
a.orientation = Quat::from_axis_angle(Vec3::new(0.3, -1.0, 0.4), 0.9);
|
||||
a.velocity = Vec3::new(3.0, -1.0, 2.0);
|
||||
a.angular_velocity = Vec3::new(0.7, -0.4, 1.1);
|
||||
let mut b = Body::at_rest(2.0, Vec3::new(3.0, 2.0, 1.0), Vec3::new(-5.0, 15.0, 30.0));
|
||||
b.orientation = Quat::from_axis_angle(Vec3::new(1.0, 0.2, -0.5), -1.3);
|
||||
b.velocity = Vec3::new(-2.0, 4.0, 1.0);
|
||||
b.angular_velocity = Vec3::new(-0.5, 1.3, 0.2);
|
||||
for kind in kinds {
|
||||
for a_body in [Some(0), None] {
|
||||
let joint = Joint {
|
||||
kind,
|
||||
a: Marker::new(a_body, Vec3::new(4.0, -3.0, 7.0), Vec3::new(0.2, 0.5, 1.0), Vec3::new(1.0, 0.0, 0.3)),
|
||||
b: Marker::new(Some(1), Vec3::new(-6.0, 2.0, 1.0), Vec3::new(-0.4, 1.0, 0.1), Vec3::new(0.0, 0.3, 1.0)),
|
||||
};
|
||||
let model = Model { bodies: vec![a.clone(), b.clone()], joints: vec![joint], forces: vec![], gravity: Vec3::ZERO };
|
||||
let sys = ok(System::new(&model, None));
|
||||
let y = ok(System::initial_state(&model));
|
||||
let h = 1e-4;
|
||||
let (now, plus, minus) = (
|
||||
testing::rows_at(&sys, &y),
|
||||
testing::rows_at(&sys, &testing::drift(&sys, &y, h)),
|
||||
testing::rows_at(&sys, &testing::drift(&sys, &y, -h)),
|
||||
);
|
||||
assert_eq!(now.len(), kind.equations());
|
||||
for ((phi, ju, jdu), ((p, _, _), (m, _, _))) in now.iter().zip(plus.iter().zip(&minus)) {
|
||||
let rate = (p - m) / (2.0 * h);
|
||||
let accel = (p - 2.0 * phi + m) / (h * h);
|
||||
assert!((rate - ju).abs() < 1e-5 * (1.0 + ju.abs()), "{kind:?} {a_body:?}: J u {ju} vs {rate}");
|
||||
assert!((accel - jdu).abs() < 1e-3 * (1.0 + jdu.abs()), "{kind:?} {a_body:?}: J̇ u {jdu} vs {accel}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn joint_values_read_the_relative_motion() {
|
||||
// A body on each joint kind, displaced along its free directions, reads them back.
|
||||
let place = |kind: JointKind, offset: Vec3, turn: f64| {
|
||||
let mut body = Body::at_rest(1.0, Vec3::new(1.0, 1.0, 1.0), offset);
|
||||
body.orientation = Quat::from_axis_angle(Vec3::Z, turn);
|
||||
let model = Model {
|
||||
bodies: vec![body],
|
||||
joints: vec![Joint { kind, a: Marker::ground(Vec3::ZERO, Vec3::Z, Vec3::X), b: Marker::new(Some(0), Vec3::ZERO, Vec3::Z, Vec3::X) }],
|
||||
forces: vec![],
|
||||
gravity: Vec3::ZERO,
|
||||
};
|
||||
let traj = ok(simulate(&model, &Settings::rk4(0.01, 0.01, 0.01)));
|
||||
traj.samples.first().and_then(|s| s.joints.first()).map(|j| j.values.clone()).unwrap_or_default()
|
||||
};
|
||||
let close = |a: &[f64], b: &[f64]| a.len() == b.len() && a.iter().zip(b).all(|(x, y)| (x - y).abs() < 1e-9);
|
||||
assert!(close(&place(JointKind::Revolute, Vec3::ZERO, 0.4), &[0.4]));
|
||||
assert!(close(&place(JointKind::Slider, Vec3::new(0.0, 0.0, 12.0), 0.0), &[12.0]));
|
||||
assert!(close(&place(JointKind::Cylindrical, Vec3::new(0.0, 0.0, -3.0), -1.0), &[-1.0, -3.0]));
|
||||
assert!(close(&place(JointKind::Planar, Vec3::new(5.0, -7.0, 0.0), 2.0), &[5.0, -7.0, 2.0]));
|
||||
assert!(close(&place(JointKind::Ball, Vec3::ZERO, 0.5), &[0.0, 0.0, 0.5]));
|
||||
assert!(close(&place(JointKind::Rigid, Vec3::ZERO, 0.0), &[]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inconsistent_start_is_projected_onto_the_joints() {
|
||||
// The pendulum's body starts 2 mm off its hinge and moving across it.
|
||||
let mut model = pendulum(100.0, 0.3, 0.0, 40.0);
|
||||
if let Some(b) = model.bodies.first_mut() {
|
||||
b.position += Vec3::new(1.0, 2.0, -1.0);
|
||||
b.velocity = Vec3::new(0.0, 50.0, 0.0);
|
||||
}
|
||||
let traj = ok(simulate(&model, &Settings::rk4(0.5, 1e-3, 0.05)));
|
||||
assert!(traj.stats.max_constraint_error < 1e-9, "{:?}", traj.stats);
|
||||
let y = traj.samples.first().and_then(|s| s.bodies.first()).map(|b| b.velocity.y).unwrap_or(f64::NAN);
|
||||
assert!(y.abs() < 1e-9, "velocity along the hinge is removed: {y}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_input_is_an_error_not_a_panic() {
|
||||
let good = pendulum(100.0, 0.2, 0.0, 40.0);
|
||||
let settings = Settings::rk4(0.1, 1e-3, 1e-2);
|
||||
let mut cases: Vec<(Model, Settings)> = Vec::new();
|
||||
let mut with = |f: &dyn Fn(&mut Model)| {
|
||||
let mut m = good.clone();
|
||||
f(&mut m);
|
||||
cases.push((m, settings));
|
||||
};
|
||||
with(&|m| m.bodies.clear());
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.mass = f64::NAN));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.mass = 0.0));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.mass = -1.0));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.inertia = Mat3::diagonal(Vec3::new(1.0, -1.0, 1.0))));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.inertia = Mat3([[1.0, 5.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.inertia = Mat3::ZERO));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.position.x = f64::INFINITY));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.orientation = Quat { w: 0.0, x: 0.0, y: 0.0, z: 0.0 }));
|
||||
with(&|m| m.bodies.iter_mut().for_each(|b| b.velocity.z = 1e300));
|
||||
with(&|m| m.gravity = Vec3::new(f64::NAN, 0.0, 0.0));
|
||||
with(&|m| m.joints.iter_mut().for_each(|j| j.b.body = Some(7)));
|
||||
with(&|m| m.joints.iter_mut().for_each(|j| j.a.body = j.b.body));
|
||||
with(&|m| m.joints.iter_mut().for_each(|j| j.a.z = Vec3::ZERO));
|
||||
with(&|m| m.joints.iter_mut().for_each(|j| j.b.x = j.b.z));
|
||||
with(&|m| m.forces.push(Force::Load { body: 3, point: Vec3::ZERO, force: Vec3::X, torque: Vec3::ZERO }));
|
||||
with(&|m| {
|
||||
m.forces.push(Force::Spring {
|
||||
a: Anchor { body: None, point: Vec3::ZERO },
|
||||
b: Anchor { body: Some(0), point: Vec3::ZERO },
|
||||
stiffness: -1.0,
|
||||
damping: 0.0,
|
||||
free_length: 0.0,
|
||||
preload: 0.0,
|
||||
})
|
||||
});
|
||||
with(&|m| {
|
||||
m.forces.push(Force::Spring {
|
||||
a: Anchor { body: Some(9), point: Vec3::ZERO },
|
||||
b: Anchor { body: Some(0), point: Vec3::ZERO },
|
||||
stiffness: 1.0,
|
||||
damping: 0.0,
|
||||
free_length: 0.0,
|
||||
preload: 0.0,
|
||||
})
|
||||
});
|
||||
with(&|m| m.bodies = vec![Body::at_rest(1.0, Vec3::new(1.0, 1.0, 1.0), Vec3::ZERO); MAX_BODIES + 1]);
|
||||
with(&|m| {
|
||||
m.joints = vec![
|
||||
m.joints.first().copied().unwrap_or(Joint {
|
||||
kind: JointKind::Ball,
|
||||
a: Marker::ground(Vec3::ZERO, Vec3::Z, Vec3::X),
|
||||
b: Marker::new(Some(0), Vec3::ZERO, Vec3::Z, Vec3::X)
|
||||
});
|
||||
MAX_JOINTS + 1
|
||||
]
|
||||
});
|
||||
let bad_settings = [
|
||||
Settings::rk4(0.0, 1e-3, 1e-2),
|
||||
Settings::rk4(-1.0, 1e-3, 1e-2),
|
||||
Settings::rk4(f64::NAN, 1e-3, 1e-2),
|
||||
Settings::rk4(1.0, 0.0, 1e-2),
|
||||
Settings::rk4(1.0, f64::INFINITY, 1e-2),
|
||||
Settings::rk4(1.0, 1e-3, 0.0),
|
||||
Settings::rk4(1e6, 1e-6, 1e-2),
|
||||
Settings::rk4(1e3, 1e-3, 1e-6),
|
||||
Settings { projection_tol: -1.0, ..settings },
|
||||
Settings { baumgarte: Some((f64::NAN, 1.0)), ..settings },
|
||||
Settings { integrator: Integrator::Adaptive { rel_tol: 1e-6, abs_tol: 1e-6, min_step: 1.0, max_step: 0.1 }, ..settings },
|
||||
Settings { integrator: Integrator::Adaptive { rel_tol: 0.0, abs_tol: 1e-6, min_step: 1e-9, max_step: 0.1 }, ..settings },
|
||||
];
|
||||
cases.extend(bad_settings.into_iter().map(|s| (good.clone(), s)));
|
||||
for (i, (m, s)) in cases.iter().enumerate() {
|
||||
assert!(simulate(m, s).is_err(), "case {i} should be refused");
|
||||
}
|
||||
// Inputs that are valid but extreme stop with an error or finish; they never panic.
|
||||
let stiff = Model {
|
||||
forces: vec![Force::Spring {
|
||||
a: Anchor { body: None, point: Vec3::ZERO },
|
||||
b: Anchor { body: Some(0), point: Vec3::ZERO },
|
||||
stiffness: 1e11,
|
||||
damping: 0.0,
|
||||
free_length: 0.0,
|
||||
preload: 0.0,
|
||||
}],
|
||||
..good.clone()
|
||||
};
|
||||
let _ = simulate(&stiff, &Settings::rk4(0.1, 1e-2, 1e-2));
|
||||
let tight = Settings { integrator: Integrator::Adaptive { rel_tol: 1e-14, abs_tol: 1e-14, min_step: 1e-3, max_step: 1e-3 }, ..settings };
|
||||
let _ = simulate(&stiff, &tight);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn models_round_trip_through_json() {
|
||||
let mut model = spring_mass(1.5);
|
||||
model.forces.push(Force::Load { body: 0, point: Vec3::new(1.0, 0.0, 0.0), force: Vec3::new(0.0, 5.0, 0.0), torque: Vec3::ZERO });
|
||||
let text = match serde_json::to_string(&model) {
|
||||
Ok(t) => t,
|
||||
Err(e) => panic!("{e}"),
|
||||
};
|
||||
let back: Model = match serde_json::from_str(&text) {
|
||||
Ok(m) => m,
|
||||
Err(e) => panic!("{e}"),
|
||||
};
|
||||
assert_eq!(back, model);
|
||||
let settings: Settings = match serde_json::from_str(r#"{"duration":1.0,"output_interval":0.1,"integrator":{"type":"rk4","step":0.001}}"#) {
|
||||
Ok(s) => s,
|
||||
Err(e) => panic!("{e}"),
|
||||
};
|
||||
assert!(settings.projection && settings.validate().is_ok());
|
||||
}
|
||||
@@ -43,7 +43,7 @@ pub static COMMANDS: &[CommandSpec] = &[
|
||||
CommandSpec::new("solid.revolve", "Revolve", revolve)
|
||||
.at("SOLID", "CREATE")
|
||||
.icon("revolve")
|
||||
.params("axis: sketch line id | x | y (sketch axes) | X|Y|Z (world) | {type: world, axis: X|Y|Z} (as returned by timeline.inspect) | construction axis name (followed when edited) | {origin, dir} | {edge|face: [x,y,z]} (a straight or circular edge, or a cylinder, cone or torus face: about its axis, followed as the model changes); angle?: expr (default 360 deg); angle2?: expr (Two Sides: the other side's angle); direction?: symmetric (angle split either side, independent of axis direction); convention?: sketch_normal|legacy_axis_start (default sketch_normal; legacy retains older angular starts); to?: [x,y,z] (To Object: turn until that face, vertex or point); sketch?, profiles? | face: [x,y,z] (a planar body face as the profile) and face_body?: name (whose face, where faces of several bodies meet), operation?, touching?, targets?, name?, body_name?"),
|
||||
.params("axis: sketch line id | x | y (sketch axes) | X|Y|Z (world) | {type: world, axis: X|Y|Z} (as returned by timeline.inspect) | construction axis name (followed when edited) | {origin, dir} (origin: numbers or length expressions, followed when parameters change) | {edge|face: [x,y,z]} (a straight or circular edge, or a cylinder, cone or torus face: about its axis, followed as the model changes); angle?: expr (default 360 deg); angle2?: expr (Two Sides: the other side's angle); direction?: symmetric (angle split either side, independent of axis direction); convention?: sketch_normal|legacy_axis_start (default sketch_normal; legacy retains older angular starts); to?: [x,y,z] (To Object: turn until that face, vertex or point); sketch?, profiles? | face: [x,y,z] (a planar body face as the profile) and face_body?: name (whose face, where faces of several bodies meet), operation?, touching?, targets?, name?, body_name?"),
|
||||
CommandSpec::new("solid.sweep", "Sweep", sweep)
|
||||
.at("SOLID", "CREATE")
|
||||
.icon("sweep")
|
||||
@@ -105,7 +105,7 @@ pub static COMMANDS: &[CommandSpec] = &[
|
||||
.at("SOLID", "CREATE")
|
||||
.icon("hole")
|
||||
.key("H")
|
||||
.params("position: [x,y,z] on a face (numbers, or length expressions the hole follows) | sketch + points: [sketch point ids] (one hole each, perpendicular to the sketch, into the material on whichever side of the sketch plane it is) | sketch alone (every sketch point: standalone points and circle centres); flip?: bool (sketch points: drill to the other side); single?: bool (with one sketch point: a Single hole that follows the point, drilled into the face there); direction?: [x,y,z] (default: into the face, against its outward normal; one that leaves the face is mirrored into it; ignored with sketch points unless single); diameter | thread (a tapped hole, drilled with the tap maker's tabulated drill: ISO metric (a custom metric size: major minus pitch), UNC/UNF, G, Rp, Rc 1/16 to 4, NPT 1/16 to 3; a `diameter` given with it chooses another drill, from the thread's minor diameter to 5% over the tap maker's) | clearance: \"M6\" with fit?: close|normal|loose (ISO 273); depth? (default through all) | to?: [x,y,z] (To Object: drill to that face or point); references?: [{edge: [x,y,z] on a straight edge of the face, distance: expr}] (at most two; the centre goes that far from each edge's line, in the face's plane, and follows the edges; with a numeric position only); type?: simple|drilled|counterbore|countersink; tip_angle?; cb_diameter?, cb_depth?, bridge?: length (counterbore: two 3D-printing bridge layers this thick below its floor, a slot along X then a square; e.g. 0.2 mm); cs_diameter?, cs_angle?; thread?: \"M6\", \"1/4-20 UNC\", \"G 1/4\", \"Rp 1/4\", \"Rc 1/4\" or \"1/4-18 NPT\" (cosmetic unless modeled); hand?: right|left (the tapped thread's hand; default right; needs thread); thread_depth?: positive length independent of drill depth (default: full useful cylindrical wall; must fit that wall); modeled?: bool (needs thread: the tapped thread cut into the wall, the groove between its teeth, as solid.thread's modelled one; default false: listed only); ease_out?: expr|standard|short (modelled tapped threads: the inner end, towards the bottom, fades out over this length, ISO 3508's runout, standard 2.5 P, short 1.25 P; without it the groove stops square at thread_depth, or clear of a blind hole's bottom); targets?: [body] (the bodies to drill; holes at the points of a sketch on a body's face default to that body, found along the holes' direction on it alone; explicit targets or participants override, [\"*\"] every body)"),
|
||||
.params("position: [x,y,z] on a face (numbers, or length expressions the hole follows) | sketch + points: [sketch point ids] (one hole each, perpendicular to the sketch, into the material on whichever side of the sketch plane it is) | sketch alone (every sketch point: standalone points and circle centres); flip?: bool (sketch points: drill to the other side); single?: bool (with one sketch point: a Single hole that follows the point, drilled into the face there); direction?: [x,y,z] (default: into the face, against its outward normal; where faces of several bodies meet there, the face of a body in `targets`; one that leaves the face is mirrored into it; ignored with sketch points unless single); diameter | thread (a tapped hole, drilled with the tap maker's tabulated drill: ISO metric (a custom metric size: major minus pitch), UNC/UNF, G, Rp, Rc 1/16 to 4, NPT 1/16 to 3; a `diameter` given with it chooses another drill, from the thread's minor diameter to 5% over the tap maker's) | clearance: \"M6\" with fit?: close|normal|loose (ISO 273); depth? (default through all) | to?: [x,y,z] (To Object: drill to that face or point); references?: [{edge: [x,y,z] on a straight edge of the face, distance: expr}] (at most two; the centre goes that far from each edge's line, in the face's plane, and follows the edges; with a numeric position only); type?: simple|drilled|counterbore|countersink; tip_angle?; cb_diameter?, cb_depth?, bridge?: length (counterbore: two 3D-printing bridge layers this thick below its floor, a slot along X then a square; e.g. 0.2 mm); cs_diameter?, cs_angle?; thread?: \"M6\", \"1/4-20 UNC\", \"G 1/4\", \"Rp 1/4\", \"Rc 1/4\" or \"1/4-18 NPT\" (cosmetic unless modeled); hand?: right|left (the tapped thread's hand; default right; needs thread); thread_depth?: positive length independent of drill depth (default: full useful cylindrical wall; must fit that wall); modeled?: bool (needs thread: the tapped thread cut into the wall, the groove between its teeth, as solid.thread's modelled one; default false: listed only); ease_out?: expr|standard|short (modelled tapped threads: the inner end, towards the bottom, fades out over this length, ISO 3508's runout, standard 2.5 P, short 1.25 P; without it the groove stops square at thread_depth, or clear of a blind hole's bottom); targets?: [body] (the bodies to drill; holes at the points of a sketch on a body's face default to that body, found along the holes' direction on it alone; explicit targets or participants override, [\"*\"] every body)"),
|
||||
CommandSpec::new("solid.pipe", "Pipe", crate::checked!("solid.pipe", pipe))
|
||||
.at("SOLID", "CREATE")
|
||||
.icon("pipe")
|
||||
@@ -1335,7 +1335,8 @@ fn revolve(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
|
||||
/// A revolve axis of `sketch` from its parameter: a sketch line id, the sketch's x or y axis, a
|
||||
/// world axis (also as saved: {type: world, axis: X|Y|Z}), a construction axis by name
|
||||
/// (followed when it is edited), {origin, dir}, or an edge
|
||||
/// (followed when it is edited), {origin, dir} (each origin coordinate a number or an expression over
|
||||
/// the parameters, which the axis follows), or an edge
|
||||
/// or round face of the model ({edge|face: [x,y,z]}), which the revolve follows as the model
|
||||
/// changes. A line of the sketch wins over a construction axis of the same name.
|
||||
pub(super) fn axis_param(s: &Session, sketch: u64, p: &Value, cmd: &str) -> Result<AxisRef> {
|
||||
@@ -1348,9 +1349,12 @@ pub(super) fn axis_param(s: &Session, sketch: u64, p: &Value, cmd: &str) -> Resu
|
||||
str_(o, "axis").filter(|a| matches!(*a, "X" | "Y" | "Z")).ok_or_else(|| bad(cmd, "world axis requires `axis` to be X, Y or Z"))?;
|
||||
return Ok(AxisRef::World { axis: axis.into() });
|
||||
}
|
||||
let origin = o.get("origin").and_then(vec3).unwrap_or(Vec3::ZERO);
|
||||
let dir = o.get("dir").and_then(vec3).ok_or_else(|| bad(cmd, "axis needs `dir`"))?;
|
||||
return Ok(AxisRef::Line { origin: Position(origin), dir: Dir(dir) });
|
||||
let origin = point_param(s, o, "origin", cmd)?.unwrap_or_else(|| solidcraft_doc::point_expr(Vec3::ZERO));
|
||||
let dir = match o.get("dir") {
|
||||
None => return Err(bad(cmd, "axis needs `dir`")),
|
||||
Some(v) => vec3(v).ok_or_else(|| bad(cmd, "axis `dir` must be a direction [x, y, z] of numbers"))?,
|
||||
};
|
||||
return Ok(AxisRef::Line { origin, dir: Dir(dir) });
|
||||
}
|
||||
match str_(p, "axis") {
|
||||
Some(a @ ("X" | "Y" | "Z")) => Ok(AxisRef::World { axis: a.into() }),
|
||||
@@ -2827,9 +2831,16 @@ fn hole(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Some(d) => d.normalized().ok_or_else(|| bad(cmd, "`direction` must be non-zero"))?,
|
||||
None => {
|
||||
// Into the face the position lies on: against the outward normal of the face
|
||||
// nearest it (planar or curved), as it faces out of its own body.
|
||||
// nearest it (planar or curved), as it faces out of its own body. A hole that
|
||||
// names the bodies it drills goes by the face of one of them where one passes
|
||||
// through the position, never that of a body touching it there (#12066).
|
||||
let named = match string_list(cmd, p, "participants")? {
|
||||
v if v.is_empty() => string_list(cmd, p, "targets")?,
|
||||
v => v,
|
||||
};
|
||||
let scope: &[String] = if named.iter().any(|b| b == "*") { &[] } else { &named };
|
||||
let st = s.model.state();
|
||||
solidcraft_doc::hole_direction_at(&st, position).ok_or_else(|| bad(cmd, "no face at `position`; give `direction`"))?
|
||||
solidcraft_doc::hole_direction_at(&st, position, scope).ok_or_else(|| bad(cmd, "no face at `position`; give `direction`"))?
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@ pub use sketch_construction::{
|
||||
};
|
||||
pub use sketch_create::{tangent_arc_preview, tangent_arc_starts_at};
|
||||
pub use sketch_import::drawing_import_command;
|
||||
pub use sketch_modify::{extend_arc_preview, extend_preview, trim_piece};
|
||||
pub use sketch_modify::{TrimHover, extend_arc_preview, extend_end_at, extend_preview, trim_hover, trim_piece};
|
||||
pub use view_dxf::sketch::exportable as view_dxf_exportable;
|
||||
pub(crate) use view_navigation::camera_form;
|
||||
pub use view_navigation::standard_view;
|
||||
@@ -95,6 +95,8 @@ mod parameters;
|
||||
mod plastic;
|
||||
mod print_face;
|
||||
mod render;
|
||||
pub(crate) use render::{PreparedCapture, prepare_capture_with_metadata, render_cancel_params};
|
||||
pub(crate) use render_ui::batch_request;
|
||||
mod render_ui;
|
||||
#[cfg(test)]
|
||||
mod script_tests;
|
||||
|
||||
@@ -14,7 +14,10 @@ use solidcraft_kernel::Body;
|
||||
use super::CommandSpec;
|
||||
use super::joints::{cannot_move, effective_values, joint_id, occurrence_id, place_holding, value};
|
||||
use crate::params::{bad, bool_, str_, vec3};
|
||||
use crate::schema::motion::{FindLimitsParams, FindLimitsResult};
|
||||
use crate::schema::motion::{
|
||||
ContactCheck, ContactCollision, ContactCreateParams, ContactEditParams, ContactEnableParams, ContactNoParams, ContactSetChange,
|
||||
ContactSetCreated, ContactSetEdited, ContactSetInfo, ContactSets, ContactSwitch, FindLimitsParams, FindLimitsResult,
|
||||
};
|
||||
use crate::schema::{TypedContract, output_schema_for};
|
||||
use crate::{EngineError, Result, Session};
|
||||
|
||||
@@ -39,26 +42,55 @@ macro_rules! trace_doc {
|
||||
};
|
||||
}
|
||||
|
||||
const CONTACT_ENABLE_CONTRACT: TypedContract<ContactEnableParams> = TypedContract::new();
|
||||
const CONTACT_NONE_CONTRACT: TypedContract<ContactNoParams> = TypedContract::new();
|
||||
const CONTACT_CREATE_CONTRACT: TypedContract<ContactCreateParams> = TypedContract::new();
|
||||
const CONTACT_EDIT_CONTRACT: TypedContract<ContactEditParams> = TypedContract::new();
|
||||
|
||||
pub static COMMANDS: &[CommandSpec] = &[
|
||||
CommandSpec::new("contact.enable_sets", "Enable Contact Sets", enable_sets).at("SOLID", "ASSEMBLE").icon("contact_sets").params(
|
||||
"enabled?: bool (default true) — driving joints and motion studies stop where bodies in one contact set would pass through each other",
|
||||
),
|
||||
CommandSpec::new("contact.enable_all", "Enable All Contact", enable_all)
|
||||
CommandSpec::new("contact.enable_sets", "Enable Contact Sets", crate::checked!("contact.enable_sets", enable_sets))
|
||||
.at("SOLID", "ASSEMBLE")
|
||||
.icon("contact_sets")
|
||||
.contract(&CONTACT_ENABLE_CONTRACT)
|
||||
.output(output_schema_for::<ContactSwitch>)
|
||||
.params(
|
||||
"enabled?: bool (default true) — driving joints and motion studies stop where bodies in one contact set would pass through each other",
|
||||
),
|
||||
CommandSpec::new("contact.enable_all", "Enable All Contact", crate::checked!("contact.enable_all", enable_all))
|
||||
.at("SOLID", "ASSEMBLE")
|
||||
.icon("contact_all")
|
||||
.contract(&CONTACT_NONE_CONTRACT)
|
||||
.output(output_schema_for::<ContactSwitch>)
|
||||
.params("every occurrence takes part in contact (one set of all)"),
|
||||
CommandSpec::new("contact.disable_all", "Disable Contact", disable_all).at("SOLID", "ASSEMBLE").icon("contact_off").params("contact off"),
|
||||
CommandSpec::new("contact.create", "New Contact Set", new_set)
|
||||
CommandSpec::new("contact.disable_all", "Disable Contact", crate::checked!("contact.disable_all", disable_all))
|
||||
.at("SOLID", "ASSEMBLE")
|
||||
.icon("contact_off")
|
||||
.contract(&CONTACT_NONE_CONTRACT)
|
||||
.output(output_schema_for::<ContactSwitch>)
|
||||
.params("contact off"),
|
||||
CommandSpec::new("contact.create", "New Contact Set", crate::checked!("contact.create", new_set))
|
||||
.at("SOLID", "ASSEMBLE")
|
||||
.icon("contact_new")
|
||||
.contract(&CONTACT_CREATE_CONTRACT)
|
||||
.output(output_schema_for::<ContactSetCreated>)
|
||||
.params("occurrences: [ids or names] (two or more); name?"),
|
||||
CommandSpec::new("contact.edit", "Edit Contact Set", edit_set)
|
||||
CommandSpec::new("contact.edit", "Edit Contact Set", crate::checked!("contact.edit", edit_set))
|
||||
.icon("edit")
|
||||
.contract(&CONTACT_EDIT_CONTRACT)
|
||||
.output(output_schema_for::<ContactSetEdited>)
|
||||
.params("set: id|name; occurrences?; name?; suppressed?: bool; delete?: bool"),
|
||||
CommandSpec::new("contact.list", "List Contact Sets", list_sets).icon("list").noundo().doc_only().params("→ sets, enabled, all"),
|
||||
CommandSpec::new("contact.check", "Check Contact", check)
|
||||
CommandSpec::new("contact.list", "List Contact Sets", crate::checked!("contact.list", list_sets))
|
||||
.icon("list")
|
||||
.noundo()
|
||||
.doc_only()
|
||||
.contract(&CONTACT_NONE_CONTRACT)
|
||||
.output(output_schema_for::<ContactSets>)
|
||||
.params("→ sets, enabled, all"),
|
||||
CommandSpec::new("contact.check", "Check Contact", crate::checked!("contact.check", check))
|
||||
.icon("interference")
|
||||
.noundo()
|
||||
.contract(&CONTACT_NONE_CONTRACT)
|
||||
.output(output_schema_for::<ContactCheck>)
|
||||
.params("→ pairs in contact sets that pass through each other now"),
|
||||
CommandSpec::new("motion.study", "Motion Study", study).at("SOLID", "ASSEMBLE").icon("play").params(
|
||||
"name?; study? (edit an existing one); steps? (timeline length, default 100); keys: [{joint, index?, points: [[step, value], …]}] \
|
||||
@@ -525,24 +557,30 @@ pub fn drive_joint_index(s: &mut Session, id: u64, q: Vec<f64>, index: usize) ->
|
||||
Ok(drive_with_contact(s, &[(id, q)], &[(id, index)].into_iter().collect())?.0)
|
||||
}
|
||||
|
||||
/// A contact command's reply as JSON: they build their replies from the types their output
|
||||
/// schemas describe, so the two can't drift apart.
|
||||
fn contact_reply(cmd: &str, reply: impl serde::Serialize) -> Result<Value> {
|
||||
serde_json::to_value(reply).map_err(|e| bad(cmd, e.to_string()))
|
||||
}
|
||||
|
||||
fn enable_sets(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let on = bool_(p, "enabled").unwrap_or(true);
|
||||
s.doc_mut().assembly.contact_enabled = on;
|
||||
Ok(json!({"enabled": on}))
|
||||
let enabled = bool_(p, "enabled").unwrap_or(true);
|
||||
s.doc_mut().assembly.contact_enabled = enabled;
|
||||
contact_reply("contact.enable_sets", ContactSwitch { enabled, all: None, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn enable_all(s: &mut Session, _p: &Value) -> Result<Value> {
|
||||
let a = &mut s.doc_mut().assembly;
|
||||
a.contact_enabled = true;
|
||||
a.contact_all = true;
|
||||
Ok(json!({"enabled": true, "all": true}))
|
||||
contact_reply("contact.enable_all", ContactSwitch { enabled: true, all: Some(true), param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn disable_all(s: &mut Session, _p: &Value) -> Result<Value> {
|
||||
let a = &mut s.doc_mut().assembly;
|
||||
a.contact_enabled = false;
|
||||
a.contact_all = false;
|
||||
Ok(json!({"enabled": false}))
|
||||
contact_reply("contact.disable_all", ContactSwitch { enabled: false, all: None, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn new_set(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
@@ -560,7 +598,7 @@ fn new_set(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let a = &mut s.doc_mut().assembly;
|
||||
a.contact_sets.push(ContactSet { id, name: name.clone(), occurrences: occ, suppressed: false });
|
||||
a.contact_enabled = true;
|
||||
Ok(json!({"set": id, "name": name}))
|
||||
contact_reply(cmd, ContactSetCreated { set: id, name, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn set_index(s: &Session, p: &Value, cmd: &str) -> Result<usize> {
|
||||
@@ -582,7 +620,7 @@ fn edit_set(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let i = set_index(s, p, cmd)?;
|
||||
if bool_(p, "delete").unwrap_or(false) {
|
||||
s.doc_mut().assembly.contact_sets.remove(i);
|
||||
return Ok(json!({"deleted": true}));
|
||||
return contact_reply(cmd, ContactSetEdited { change: ContactSetChange::Deleted { deleted: true }, param_warnings: Vec::new() });
|
||||
}
|
||||
let occ = if p.get("occurrences").is_some() { Some(occurrences(s, p, cmd)?) } else { None };
|
||||
if occ.as_ref().is_some_and(|o| o.len() < 2) {
|
||||
@@ -598,17 +636,19 @@ fn edit_set(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if let Some(x) = bool_(p, "suppressed") {
|
||||
c.suppressed = x;
|
||||
}
|
||||
Ok(json!({"set": c.id}))
|
||||
let set = c.id;
|
||||
contact_reply(cmd, ContactSetEdited { change: ContactSetChange::Changed { set }, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn list_sets(s: &mut Session, _p: &Value) -> Result<Value> {
|
||||
let a = &s.doc.assembly;
|
||||
Ok(json!({"enabled": a.contact_enabled, "all": a.contact_all, "sets": a.contact_sets}))
|
||||
let sets = a.contact_sets.iter().map(ContactSetInfo::from).collect();
|
||||
contact_reply("contact.list", ContactSets { enabled: a.contact_enabled, all: a.contact_all, sets, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
fn check(s: &mut Session, _p: &Value) -> Result<Value> {
|
||||
let c = collisions(s);
|
||||
Ok(json!({"collisions": c.iter().map(|(a, b, d)| json!({"a": a, "b": b, "depth_mm": d})).collect::<Vec<_>>()}))
|
||||
let collisions = collisions(s).into_iter().map(|(a, b, depth_mm)| ContactCollision { a, b, depth_mm }).collect();
|
||||
contact_reply("contact.check", ContactCheck { collisions, param_warnings: Vec::new() })
|
||||
}
|
||||
|
||||
// ---- Motion studies ----
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -18,7 +18,7 @@ pub(super) struct Override {
|
||||
ior: f64,
|
||||
}
|
||||
pub(super) fn apply(scene: &mut ProductScene, overrides: &[Override], command: &str) -> Result<()> {
|
||||
if overrides.len() > 64 {
|
||||
if overrides.len() > solidcraft_doc::render_coat::MAX_COAT_BINDINGS {
|
||||
return Err(bad(command, "at most 64 runtime clear-coat overrides are supported"));
|
||||
}
|
||||
let mut ordinals = std::collections::BTreeSet::new();
|
||||
@@ -31,28 +31,33 @@ pub(super) fn apply(scene: &mut ProductScene, overrides: &[Override], command: &
|
||||
return Err(bad(command, "clear coats require bounded names and distinct captured body ordinals"));
|
||||
}
|
||||
let coat = ClearCoat::new(input.weight, input.roughness, input.ior).map_err(|e| bad(command, e.to_string()))?;
|
||||
let body = scene
|
||||
.meshes
|
||||
.get_mut(input.body_index)
|
||||
.filter(|m| m.name == input.body_name)
|
||||
.ok_or_else(|| bad(command, "clear-coat body ordinal and exact name must both match render.scene"))?;
|
||||
// A zero-weight override is a true no-op, including legacy appearances.
|
||||
if coat.weight() == 0.0 {
|
||||
continue;
|
||||
}
|
||||
if body.transmission.is_some() || body.faces.iter().any(|f| f.transmission.is_some()) {
|
||||
return Err(bad(command, "clear coat and transmission cannot share a body"));
|
||||
}
|
||||
let surface = |color: [u8; 3], existing: Option<OpaqueSurface>| -> Result<OpaqueSurface> {
|
||||
let [r, g, b] = color.map(srgb8_to_linear);
|
||||
let base =
|
||||
existing.map(Ok).unwrap_or_else(|| OpaqueSurface::new(Vec3::new(r, g, b), 0.0, 0.5, 1.5)).map_err(|e| bad(command, e.to_string()))?;
|
||||
Ok(base.with_clear_coat(coat))
|
||||
};
|
||||
body.surface = Some(surface(body.color, body.surface)?);
|
||||
for face in &mut body.faces {
|
||||
face.surface = Some(surface(face.color, face.surface)?);
|
||||
}
|
||||
apply_one(scene, input.body_index, &input.body_name, coat, command)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) fn apply_one(scene: &mut ProductScene, body_index: usize, body_name: &str, coat: ClearCoat, command: &str) -> Result<()> {
|
||||
let body = scene
|
||||
.meshes
|
||||
.get_mut(body_index)
|
||||
.filter(|m| m.name == body_name)
|
||||
.ok_or_else(|| bad(command, "clear-coat body ordinal and exact name must both match render.scene"))?;
|
||||
// A zero-weight override is a true no-op, including legacy appearances.
|
||||
if coat.weight() == 0.0 {
|
||||
return Ok(());
|
||||
}
|
||||
if body.transmission.is_some() || body.faces.iter().any(|f| f.transmission.is_some()) {
|
||||
return Err(bad(command, "clear coat and transmission cannot share a body"));
|
||||
}
|
||||
let surface = |color: [u8; 3], existing: Option<OpaqueSurface>| -> Result<OpaqueSurface> {
|
||||
let [r, g, b] = color.map(srgb8_to_linear);
|
||||
let base =
|
||||
existing.map(Ok).unwrap_or_else(|| OpaqueSurface::new(Vec3::new(r, g, b), 0.0, 0.5, 1.5)).map_err(|e| bad(command, e.to_string()))?;
|
||||
Ok(base.with_clear_coat(coat))
|
||||
};
|
||||
body.surface = Some(surface(body.color, body.surface)?);
|
||||
for face in &mut body.faces {
|
||||
face.surface = Some(surface(face.color, face.surface)?);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -85,3 +90,149 @@ mod tests {
|
||||
assert!(apply(&mut original.clone(), &duplicate, "render.start").is_err());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod stable_tests {
|
||||
use super::*;
|
||||
use crate::Session;
|
||||
use serde_json::json;
|
||||
use solidcraft_doc::render_coat::{CoatBindings, CoatMaterial, SavedCoat};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[test]
|
||||
fn stable_coats_save_reopen_replace_and_undo_offline_for_cpu_and_gpu_without_changing_sources() {
|
||||
for method in ["cpu_raytrace", "gpu_path"] {
|
||||
let mut s = Session::default();
|
||||
s.execute("solid.box", &json!({"length":10,"width":10,"height":3,"body_name":"Housing"})).unwrap();
|
||||
s.execute("material.assign", &json!({"bodies":["Housing"],"material":"Steel"})).unwrap();
|
||||
s.execute("render.settings.set", &json!({"name":"Coat","set":{"width":8,"height":8,"job":{"method":method}}})).unwrap();
|
||||
let physical = s.execute("component.properties", &json!({})).unwrap();
|
||||
let model = s.model.state();
|
||||
let before = s.doc.clone();
|
||||
let undo = s.undo.len();
|
||||
let evaluations = s.evaluations;
|
||||
let coat = json!({"weight":0.63,"roughness":0.61,"ior":1.7});
|
||||
s.execute("render.coat.bind", &json!({"name":"Coat","body_index":0,"body_name":"Housing","coat":coat,"expected_revision":s.revision}))
|
||||
.unwrap();
|
||||
assert_eq!(s.undo.len(), undo + 1);
|
||||
assert_eq!(s.evaluations, evaluations);
|
||||
assert!(Arc::ptr_eq(&model, &s.model.state()));
|
||||
assert_eq!(s.doc.features, before.features);
|
||||
assert_eq!(s.doc.materials, before.materials);
|
||||
assert_eq!(physical, s.execute("component.properties", &json!({})).unwrap());
|
||||
let saved = s.doc.clone();
|
||||
let loaded = solidcraft_doc::Document::from_json(&saved.to_json()).unwrap();
|
||||
assert_eq!(loaded.render, saved.render);
|
||||
let original = crate::product_scene::extract(&s).unwrap();
|
||||
let mut scene = original.clone();
|
||||
let faces_capacity = scene.meshes[0].faces.capacity();
|
||||
let cpu = solidcraft_render::job::RaytraceOptions::default();
|
||||
super::super::coat_bindings::apply(
|
||||
&s,
|
||||
&mut scene,
|
||||
&saved.render.setups["Coat"].coats,
|
||||
(method == "cpu_raytrace").then_some(&cpu),
|
||||
"check",
|
||||
)
|
||||
.unwrap();
|
||||
let actual = scene.meshes[0].surface.unwrap().clear_coat().unwrap();
|
||||
assert_eq!((actual.weight(), actual.roughness(), actual.ior()), (0.63, 0.61, 1.7));
|
||||
assert!(Arc::ptr_eq(&original.meshes[0].mesh, &scene.meshes[0].mesh));
|
||||
assert_eq!(original.meshes[0].faces.len(), scene.meshes[0].faces.len());
|
||||
assert_eq!(faces_capacity, scene.meshes[0].faces.capacity());
|
||||
assert_eq!(s.doc, saved, "captured coat never changes the source appearance");
|
||||
for face in &scene.meshes[0].faces {
|
||||
assert_eq!(face.surface.unwrap().clear_coat(), Some(actual));
|
||||
}
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, before);
|
||||
s.execute("edit.redo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, saved);
|
||||
let replacement = json!({"name":"Coat","body_index":0,"body_name":"Housing","coat":{"weight":0.4,"roughness":0.3,"ior":1.8},"expected_revision":s.revision});
|
||||
assert!(s.execute("render.coat.bind", &replacement).is_err());
|
||||
assert_eq!(s.doc, saved);
|
||||
let mut explicit = replacement;
|
||||
explicit["replace"] = json!(true);
|
||||
s.execute("render.coat.bind", &explicit).unwrap();
|
||||
assert_eq!(s.doc.render.setups["Coat"].coats.iter().next().unwrap().coat.ior, 1.8);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, saved);
|
||||
let target = saved.render.setups["Coat"].coats.iter().next().unwrap().target.clone();
|
||||
s.execute("render.coat.unbind", &json!({"name":"Coat","target":target,"expected_revision":s.revision})).unwrap();
|
||||
assert!(s.doc.render.setups["Coat"].coats.is_empty());
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, saved);
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn stable_coat_source_replacement_hidden_and_glass_guards_never_guess_or_mutate_a_binding() {
|
||||
for method in ["cpu_raytrace", "gpu_path"] {
|
||||
let mut s = Session::default();
|
||||
s.execute("solid.box", &json!({"length":4,"width":4,"height":2,"body_name":"Housing"})).unwrap();
|
||||
s.execute(
|
||||
"render.coat.bind",
|
||||
&json!({"name":"Coat","set":{"width":4,"height":4,"job":{"method":method}},
|
||||
"body_index":0,"body_name":"Housing","coat":{"weight":0},"expected_revision":s.revision}),
|
||||
)
|
||||
.unwrap();
|
||||
let saved = s.doc.render.setups["Coat"].coats.clone();
|
||||
let target = saved.iter().next().unwrap().target.clone();
|
||||
let original = crate::product_scene::extract(&s).unwrap();
|
||||
let mut zero = original.clone();
|
||||
super::super::coat_bindings::apply(&s, &mut zero, &saved, None, "check").unwrap();
|
||||
assert_eq!(zero.meshes[0].surface, original.meshes[0].surface);
|
||||
assert!(Arc::ptr_eq(&zero.meshes[0].mesh, &original.meshes[0].mesh));
|
||||
let before = s.doc.clone();
|
||||
assert!(
|
||||
s.execute(
|
||||
"render.optics.bind",
|
||||
&json!({"name":"Coat","body_index":0,"body_name":"Housing","optics":{},"expected_revision":s.revision})
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(s.doc, before, "zero weight is authored opaque intent, not permission to silently drop it on Glass");
|
||||
let mut glass = original;
|
||||
glass.meshes[0].transmission = Some(solidcraft_render::transmission::Transmission::new(Vec3::ZERO, None).unwrap());
|
||||
assert!(super::super::coat_bindings::apply(&s, &mut glass, &saved, None, "check").unwrap_err().to_string().contains("opaque"));
|
||||
s.execute("browser.visibility", &json!({"items":["Housing"],"visible":false})).unwrap();
|
||||
let mut hidden = crate::product_scene::extract(&s).unwrap();
|
||||
assert!(super::super::coat_bindings::apply(&s, &mut hidden, &saved, None, "check").unwrap_err().to_string().contains("hidden"));
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
s.execute("timeline.delete", &json!({"feature":target.feature.to_string()})).unwrap();
|
||||
s.execute("solid.box", &json!({"length":4,"width":4,"height":2,"body_name":"Housing"})).unwrap();
|
||||
let mut replaced = crate::product_scene::extract(&s).unwrap();
|
||||
assert_eq!((replaced.meshes.len(), replaced.meshes[0].name.as_str()), (1, "Housing"));
|
||||
assert!(super::super::coat_bindings::apply(&s, &mut replaced, &saved, None, "check").unwrap_err().to_string().contains("changed"));
|
||||
assert_eq!(s.doc.render.setups["Coat"].coats, saved);
|
||||
// Empty means the original capture path, even when no old target survives.
|
||||
super::super::coat_bindings::apply(&s, &mut replaced, &CoatBindings::default(), None, "check").unwrap();
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn stable_cpu_coats_refuse_selected_transport_but_leave_authored_values_and_scene_sources_intact() {
|
||||
let mut s = Session::default();
|
||||
s.execute("solid.box", &json!({"length":4,"width":4,"height":2,"body_name":"Housing"})).unwrap();
|
||||
let target = super::super::surface_bindings::targets(&s, "check").unwrap().into_keys().next().unwrap();
|
||||
let mut bindings = CoatBindings::default();
|
||||
bindings.set(SavedCoat { target, coat: CoatMaterial::default() }, false).unwrap();
|
||||
let scene = crate::product_scene::extract(&s).unwrap();
|
||||
let options = solidcraft_render::job::RaytraceOptions {
|
||||
reflections: Some(solidcraft_render::job::ReflectionOptions {
|
||||
samples: 1,
|
||||
max_bounces: 1,
|
||||
bodies: vec![solidcraft_render::job::ReflectionBody {
|
||||
body: "Housing".into(),
|
||||
mode: solidcraft_render::job::ReflectionMode::RoughSpecular,
|
||||
}],
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
let before = s.doc.clone();
|
||||
let mut captured = scene.clone();
|
||||
let error = super::super::coat_bindings::apply(&s, &mut captured, &bindings, Some(&options), "check").unwrap_err().to_string();
|
||||
assert!(error.contains("selected reflection"));
|
||||
assert_eq!(captured.meshes[0].surface, scene.meshes[0].surface);
|
||||
assert_eq!(bindings.iter().next().unwrap().coat, CoatMaterial::default());
|
||||
assert_eq!(s.doc, before);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//! Stable opaque clear-coat bindings shared by CPU and GPU scene capture.
|
||||
//! Lowering changes only already-sized captured surface fields, never render options.
|
||||
use crate::{Result, Session, params::bad};
|
||||
use serde_json::{Value, json};
|
||||
use solidcraft_doc::{
|
||||
render_coat::{CoatBindings, SavedCoat},
|
||||
render_settings::RenderJob,
|
||||
render_surface::RenderBodyTarget,
|
||||
};
|
||||
use solidcraft_render::{ProductScene, job::RaytraceOptions};
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
/// No bindings is the original zero-allocation capture path. Even zero-weight
|
||||
/// authored bindings require a current opaque target; they cannot mask Glass.
|
||||
pub(super) fn apply(s: &Session, scene: &mut ProductScene, bindings: &CoatBindings, cpu: Option<&RaytraceOptions>, command: &str) -> Result<()> {
|
||||
if bindings.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
bindings.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
let identities = super::surface_bindings::targets(s, command)?;
|
||||
// The shared resolver indexes authored source identity. This additional
|
||||
// captured-name index is bounded by the 64 requested targets, not scene size.
|
||||
let mut visible = BTreeMap::new();
|
||||
for binding in bindings.iter() {
|
||||
let name = identities.get(&binding.target).ok_or_else(|| bad(command, "saved clear-coat target changed; explicit rebinding required"))?;
|
||||
if visible.insert(name.as_str(), None).is_some() {
|
||||
return Err(bad(command, "ambiguous stable clear-coat world target"));
|
||||
}
|
||||
}
|
||||
for (index, body) in scene.meshes.iter().enumerate() {
|
||||
if let Some(slot) = visible.get_mut(body.name.as_str())
|
||||
&& slot.replace(index).is_some()
|
||||
{
|
||||
return Err(bad(command, "ambiguous captured clear-coat target"));
|
||||
}
|
||||
}
|
||||
let mut resolved = Vec::new();
|
||||
resolved.try_reserve_exact(bindings.len()).map_err(|_| bad(command, "could not reserve clear-coat capture metadata"))?;
|
||||
if resolved.capacity() != bindings.len() {
|
||||
return Err(bad(command, "clear-coat capture capacity exceeds admission"));
|
||||
}
|
||||
for binding in bindings.iter() {
|
||||
let name = identities.get(&binding.target).ok_or_else(|| bad(command, "saved clear-coat target changed; explicit rebinding required"))?;
|
||||
let index = visible.get(name.as_str()).copied().flatten().ok_or_else(|| bad(command, "saved clear-coat target is hidden or absent"))?;
|
||||
let body = scene.meshes.get(index).ok_or_else(|| bad(command, "clear-coat target disappeared"))?;
|
||||
if body.transmission.is_some() || body.faces.iter().any(|face| face.transmission.is_some()) {
|
||||
return Err(bad(command, "saved clear coat requires an opaque target, including zero-weight authored coats"));
|
||||
}
|
||||
if cpu.is_some_and(|options| {
|
||||
options.dielectrics.iter().any(|entry| entry.body_index == index)
|
||||
|| options.reflections.as_ref().is_some_and(|overrides| overrides.bodies.iter().any(|entry| entry.body == *name))
|
||||
|| options.anisotropic_faces.iter().flatten().any(|entry| entry.body_index == index)
|
||||
}) {
|
||||
return Err(bad(command, "CPU clear-coat targets cannot share Glass, selected reflection or anisotropy overrides"));
|
||||
}
|
||||
resolved.push((index, name.as_str(), binding.coat.to_runtime().map_err(|e| bad(command, e.to_string()))?));
|
||||
}
|
||||
drop(visible);
|
||||
for (index, name, coat) in resolved {
|
||||
super::clear_coat::apply_one(scene, index, name, coat, command)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) fn bind(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let command = "render.coat.bind";
|
||||
let input: crate::schema::render::CoatBindParams = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let coat = input.coat.material();
|
||||
coat.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if input.expected_revision != s.revision {
|
||||
return Err(bad(command, "clear-coat binding review is stale"));
|
||||
}
|
||||
let mut setup = super::patched_settings(s, &input.name, &input.set, command)?;
|
||||
if s.doc.render.setups.get(&input.name).is_some_and(|old| old.coats != setup.coats) {
|
||||
return Err(bad(command, "setup patch cannot replace saved clear coats; use explicit bind/unbind"));
|
||||
}
|
||||
if !matches!(setup.job, Some(RenderJob::CpuRaytrace { .. } | RenderJob::GpuPath { .. })) {
|
||||
return Err(bad(command, "saved clear coats require an explicit CPU or GPU raytrace setup"));
|
||||
}
|
||||
let mut scene = crate::product_scene::extract(s)?;
|
||||
let name = &scene
|
||||
.meshes
|
||||
.get(input.body_index)
|
||||
.filter(|body| body.name == input.body_name)
|
||||
.ok_or_else(|| bad(command, "clear-coat target ordinal and exact name do not match"))?
|
||||
.name;
|
||||
let identities = super::surface_bindings::targets(s, command)?;
|
||||
let mut candidates = identities.iter().filter(|(_, world)| *world == name);
|
||||
let target =
|
||||
candidates.next().map(|(target, _)| target.clone()).ok_or_else(|| bad(command, "clear-coat target has no stable source identity"))?;
|
||||
if candidates.next().is_some() {
|
||||
return Err(bad(command, "ambiguous clear-coat target identity"));
|
||||
}
|
||||
setup.coats.set(SavedCoat { target, coat }, input.replace).map_err(|e| bad(command, e.to_string()))?;
|
||||
setup.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
// Verify the actual opaque source even for inactive authored values. Runtime
|
||||
// options are not invented while saving an offline stable numerical setup.
|
||||
apply(s, &mut scene, &setup.coats, None, command)?;
|
||||
let mut settings = (*s.doc.render).clone();
|
||||
settings.setups.insert(input.name.clone(), setup.clone());
|
||||
settings.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if settings != *s.doc.render {
|
||||
s.doc_mut().render = Arc::new(settings);
|
||||
}
|
||||
Ok(json!({"name":input.name,"setup":setup,"geometry_and_engineering_unchanged":true}))
|
||||
}
|
||||
|
||||
pub(super) fn unbind(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let command = "render.coat.unbind";
|
||||
let input: crate::schema::render::CoatUnbindParams = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let target: RenderBodyTarget = serde_json::from_value(input.target).map_err(|e| bad(command, e.to_string()))?;
|
||||
target.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if input.expected_revision != s.revision {
|
||||
return Err(bad(command, "clear-coat removal review is stale"));
|
||||
}
|
||||
let mut settings = (*s.doc.render).clone();
|
||||
let setup = settings.setups.get_mut(&input.name).ok_or_else(|| bad(command, "unknown clear-coat setup"))?;
|
||||
let removed = setup.coats.remove(&target);
|
||||
settings.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if settings != *s.doc.render {
|
||||
s.doc_mut().render = Arc::new(settings);
|
||||
}
|
||||
Ok(json!({"name":input.name,"removed":removed}))
|
||||
}
|
||||
@@ -13,9 +13,9 @@ fn empty(p: &Value, command: &str) -> Result<()> {
|
||||
}
|
||||
pub(super) fn aging(_: &mut Session, p: &Value) -> Result<Value> {
|
||||
empty(p, "render.aging.describe")?;
|
||||
Ok(json!({"maximum_layers":8,"storage":"GPU saved job.options.aging","order":"bottom to top; later layers modify earlier surface results",
|
||||
Ok(json!({"maximum_layers":8,"storage":"CPU/GPU saved job.options.aging","order":"bottom to top; later layers modify earlier surface results",
|
||||
"presets":AgingKind::ALL.map(AgingLayer::preset),"target":"all eligible opaque bodies or stable definition/feature/component/occurrence identity; capture indices are resolved only for the runtime job; passive stages and glass are excluded",
|
||||
"coordinate_space":"world millimetres, explicit origin and 4096-cell periodic field; not object-following motion",
|
||||
"coordinate_space":"world millimetres, explicit origin; 4096-cell periodic noise with directional Scratch bands; not object-following motion",
|
||||
"preserves":["engineering geometry","mass and physical material cards","pose","source textures","visibility"],
|
||||
"limitations":["authored optical weathering, not measured corrosion or age prediction","no geometric grooves or edge-curvature detection","no aging on glass or participating-medium boundaries","stack changes transport and requires a new render"],
|
||||
"airborne":"use the separately validated finite homogeneous GPU medium; it is not deposited surface dust or a physical lunar atmosphere"}))
|
||||
|
||||
@@ -29,9 +29,11 @@ pub(super) fn set(s: &mut crate::Session, params: &serde_json::Value) -> Result<
|
||||
.transpose()?;
|
||||
let mut setup = super::patched_settings(s, &input.name, &input.set, command)?;
|
||||
let (angle, intensity, maximum) = match &mut setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
if let Some(hdr) = &mut options.hdr {
|
||||
(Some(&mut hdr.rotation_rad), &mut hdr.intensity, 64.0)
|
||||
} else if let Some(SkyEnvironment::Sky { rotation_rad, intensity, .. }) = &mut options.sky {
|
||||
(Some(rotation_rad), intensity, 100.0)
|
||||
} else if let Some(environment) = &mut options.environment {
|
||||
(None, &mut environment.intensity, 64.0)
|
||||
} else {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ use solidcraft_render::{
|
||||
#[derive(Default, Deserialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
struct Start {
|
||||
aging: solidcraft_doc::render_aging::SavedAgingStack,
|
||||
studio_weights: Option<[f64; 3]>,
|
||||
progressive: bool,
|
||||
denoise: bool,
|
||||
@@ -74,14 +75,10 @@ struct ProgressiveStart {
|
||||
denoise: bool,
|
||||
}
|
||||
|
||||
struct Prepared {
|
||||
replace: bool,
|
||||
scene: solidcraft_render::ProductScene,
|
||||
request: ImageRequest,
|
||||
reply: Value,
|
||||
executor: solidcraft_render::ExecutorId,
|
||||
options: solidcraft_render::job::JobOptions,
|
||||
environment: Option<solidcraft_render::lighting::environment_input::EnvironmentInput>,
|
||||
pub(crate) struct Prepared {
|
||||
pub(crate) replace: bool,
|
||||
pub(crate) submission: Option<solidcraft_render::job::PreparedSubmission>,
|
||||
pub(crate) reply: Value,
|
||||
}
|
||||
|
||||
fn lower_led(input: &mut Start, command: &str) -> Result<()> {
|
||||
@@ -179,12 +176,13 @@ fn normalize_saved_job(s: &Session, params: &Value, command: &str) -> Result<Opt
|
||||
let mut hdr = None;
|
||||
let mut lowered = match job {
|
||||
RenderJob::Raster { transparent_background } => json!({"transparent_background":transparent_background}),
|
||||
RenderJob::CpuRaytrace { options } => {
|
||||
RenderJob::CpuRaytrace { mut options, transparent_background } => {
|
||||
hdr = options.hdr.map(SavedHdr::Cpu);
|
||||
let aging = std::mem::take(&mut options.aging);
|
||||
let raytrace = options.to_runtime(settings.exposure_ev).map_err(|e| bad(command, e.to_string()))?;
|
||||
// The legacy CPU path reads EV from RaytraceOptions. There is one saved authority.
|
||||
settings.exposure_ev = 0.0;
|
||||
json!({"integrator":"raytrace","raytrace":raytrace})
|
||||
json!({"integrator":"raytrace","raytrace":raytrace,"aging":aging,"transparent_background":transparent_background})
|
||||
}
|
||||
RenderJob::GpuPath { transparent_background, options } => {
|
||||
hdr = options.hdr.map(SavedHdr::Gpu);
|
||||
@@ -209,14 +207,26 @@ fn normalize_saved_job(s: &Session, params: &Value, command: &str) -> Result<Opt
|
||||
Ok(Some(Normalized { params: lowered, hdr, surfaces, optics }))
|
||||
}
|
||||
|
||||
fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
pub(crate) fn prepare(s: &Session, params: &Value, command: &str, cancel: &solidcraft_render::job::CancelToken) -> Result<Prepared> {
|
||||
prepare_with_metadata(s, params, command, cancel, None)
|
||||
}
|
||||
pub(crate) fn prepare_with_metadata(
|
||||
s: &Session,
|
||||
params: &Value,
|
||||
command: &str,
|
||||
cancel: &solidcraft_render::job::CancelToken,
|
||||
retained: Option<&solidcraft_render::job::RetainedMetadata>,
|
||||
) -> Result<Prepared> {
|
||||
cancel.check().map_err(job_error)?;
|
||||
let normalized = normalize_saved_job(s, params, command)?;
|
||||
let saved_hdr = normalized.as_ref().and_then(|normalized| normalized.hdr.as_ref());
|
||||
let params = normalized.as_ref().map_or(params, |normalized| &normalized.params);
|
||||
if params.get("progressive").and_then(Value::as_bool) == Some(true) {
|
||||
let hdr = match saved_hdr {
|
||||
Some(SavedHdr::Gpu(hdr)) => Some(*hdr),
|
||||
Some(SavedHdr::Cpu(_)) => return Err(bad(command, "saved CPU HDR cannot enter a GPU request")),
|
||||
Some(SavedHdr::Cpu(_)) => {
|
||||
return Err(bad(command, "saved CPU HDR cannot enter a GPU request"));
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
return prepare_progressive(
|
||||
@@ -227,6 +237,8 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
hdr,
|
||||
normalized.as_ref().map(|n| &n.surfaces),
|
||||
normalized.as_ref().map(|n| &n.optics),
|
||||
cancel,
|
||||
retained,
|
||||
);
|
||||
}
|
||||
let gpu_raytrace =
|
||||
@@ -242,12 +254,42 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
));
|
||||
}
|
||||
let mut input: Start = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let coats = input.settings.as_mut().map_or_else(Default::default, |settings| std::mem::take(&mut settings.coats));
|
||||
// A checked file HDR uses the runtime request lane, but its optical targets
|
||||
// remain stable authored identities. Extract them before validating job:null
|
||||
// settings, just as for stable coats; never discard or turn them into ordinals
|
||||
// in the UI. Exact visible identities are resolved from the captured scene.
|
||||
let inline_optics = input.settings.as_mut().map_or_else(Default::default, |settings| std::mem::take(&mut settings.optics));
|
||||
let normalized_optics = normalized.as_ref().map(|n| &n.optics).filter(|bindings| !bindings.is_empty());
|
||||
if normalized_optics.is_some() && !inline_optics.is_empty() {
|
||||
return Err(bad(command, "choose normalized or inline stable optics, not both"));
|
||||
}
|
||||
let saved_optics = normalized_optics.or((!inline_optics.is_empty()).then_some(&inline_optics));
|
||||
if let Some(bindings) = saved_optics {
|
||||
if input.integrator != Integrator::Raytrace {
|
||||
return Err(bad(command, "stable optics require CPU or GPU ray tracing"));
|
||||
}
|
||||
let options = input.raytrace.get_or_insert_default();
|
||||
bindings.validate_for_cpu_path(options.path.is_some()).map_err(|e| bad(command, e.to_string()))?;
|
||||
if options.volume.is_some_and(|volume| volume.active()) {
|
||||
return Err(bad(command, "CPU Atmosphere cannot combine with saved Glass or subsurface scattering; settings are kept"));
|
||||
}
|
||||
if options.denoise && bindings.iter().any(|binding| binding.optics.subsurface.is_some_and(|scatter| scatter.active())) {
|
||||
return Err(bad(command, "CPU subsurface random walks have no surface-denoiser guides; disable denoising explicitly"));
|
||||
}
|
||||
if !options.dielectrics.is_empty() {
|
||||
return Err(bad(command, "saved optics cannot combine with runtime dielectric overrides"));
|
||||
}
|
||||
}
|
||||
if !coats.is_empty() && input.integrator != Integrator::Raytrace {
|
||||
return Err(bad(command, "stable clear coats require CPU or GPU ray tracing"));
|
||||
}
|
||||
validate_studio_weights(input.studio_weights, command)?;
|
||||
if input.integrator == Integrator::Raytrace && input.studio_weights.is_some() {
|
||||
return Err(bad(command, "studio_weights apply to raster or the implicit GPU studio; use explicit CPU light intensities"));
|
||||
}
|
||||
if input.progressive {
|
||||
return prepare_progressive(s, params, command, false, None, None, None);
|
||||
return prepare_progressive(s, params, command, false, None, None, None, cancel, retained);
|
||||
}
|
||||
if input.denoise {
|
||||
return Err(bad(command, "denoise requires GPU progressive rendering"));
|
||||
@@ -266,14 +308,36 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
}
|
||||
host.validate_integrator(input.integrator).map_err(job_error)?;
|
||||
lower_led(&mut input, command)?;
|
||||
if !input.aging.is_empty() {
|
||||
if input.integrator != Integrator::Raytrace {
|
||||
return Err(bad(command, "stable CPU aging requires the CPU raytrace integrator"));
|
||||
}
|
||||
input.aging.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
input.raytrace.get_or_insert_with(RaytraceOptions::default);
|
||||
}
|
||||
let saved_surfaces = normalized.as_ref().map(|n| &n.surfaces).filter(|bindings| !bindings.is_empty());
|
||||
if saved_surfaces.is_some() {
|
||||
if input.integrator != Integrator::Raytrace {
|
||||
return Err(bad(command, "saved opaque surfaces require CPU or GPU ray tracing"));
|
||||
}
|
||||
solidcraft_render::job::textures::validate_cpu_options(input.raytrace.as_ref().unwrap_or(&RaytraceOptions::default())).map_err(job_error)?;
|
||||
if normalized.as_ref().is_some_and(|n| !n.optics.is_empty()) && input.raytrace.as_ref().is_none_or(|options| options.path.is_none()) {
|
||||
return Err(bad(command, "CPU maps with Glass require Indirect lighting and separate targets"));
|
||||
}
|
||||
}
|
||||
if input.integrator == Integrator::Raster && input.raytrace.is_some() {
|
||||
return Err(bad(command, "raytrace options require integrator: raytrace"));
|
||||
}
|
||||
if input.integrator == Integrator::Raytrace && input.transparent_background {
|
||||
return Err(bad(command, "raytrace supports opaque backgrounds only"));
|
||||
}
|
||||
if let Some(options) = &input.raytrace {
|
||||
options.retained_bytes().map_err(job_error)?;
|
||||
if !input.aging.is_empty() {
|
||||
if options.aging.as_ref().is_some_and(|stack| !stack.is_empty()) {
|
||||
return Err(bad(command, "choose stable authored aging or captured runtime aging, not both"));
|
||||
}
|
||||
if input.aging.iter().any(|layer| layer.active()) && options.anisotropic_faces.iter().any(Option::is_some) {
|
||||
return Err(bad(command, "CPU aging cannot replace independently authored anisotropic roughness axes"));
|
||||
}
|
||||
}
|
||||
options.budget.validate_execution().map_err(job_error)?;
|
||||
// Check the complete image envelope before any source file is read.
|
||||
let dimensions = if let Some(name) = &input.setup {
|
||||
@@ -285,7 +349,29 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
let defaults = RenderSetup::default();
|
||||
(defaults.width, defaults.height)
|
||||
};
|
||||
options.budget.validate_image(dimensions.0, dimensions.1, options.progressive).map_err(job_error)?;
|
||||
options.budget.validate_image(dimensions.0, dimensions.1, options.camera_sampling().map_err(job_error)?).map_err(job_error)?;
|
||||
if let Some(lens) = options.lens {
|
||||
let camera = input
|
||||
.setup
|
||||
.as_ref()
|
||||
.and_then(|name| s.doc.render.setups.get(name))
|
||||
.map(|setup| setup.camera)
|
||||
.or_else(|| input.settings.as_ref().map(|setup| setup.camera))
|
||||
.or(s.camera)
|
||||
.unwrap_or_default();
|
||||
lens.validate_camera(&camera).map_err(job_error)?;
|
||||
}
|
||||
if let Some(output) = &options.output {
|
||||
output.validate_image(dimensions.0, dimensions.1).map_err(job_error)?;
|
||||
output.presentation(options.exposure_ev, [0; 3], input.transparent_background).validate().map_err(job_error)?;
|
||||
}
|
||||
}
|
||||
// Refuse conflicting sources before VFS/resource access. Sky is a direct
|
||||
// radiance consumer and never a substitute for unread HDR bytes.
|
||||
if (saved_hdr.is_some() || input.environment.is_some())
|
||||
&& input.raytrace.as_ref().is_some_and(|options| options.sky.is_some() || options.environment.is_some())
|
||||
{
|
||||
return Err(bad(command, "choose either CPU HDR input, gradient Sky or constant environment"));
|
||||
}
|
||||
let environment = if let Some(saved_hdr) = saved_hdr {
|
||||
let SavedHdr::Cpu(hdr) = saved_hdr else {
|
||||
@@ -336,6 +422,23 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
None
|
||||
};
|
||||
let mut scene = crate::product_scene::extract(s)?;
|
||||
if let Some(bindings) = saved_optics {
|
||||
let options = input.raytrace.as_mut().ok_or_else(|| bad(command, "saved CPU optics require a CPU raytrace request"))?;
|
||||
if !options.dielectrics.is_empty() {
|
||||
return Err(bad(command, "saved optics cannot combine with runtime dielectric overrides"));
|
||||
}
|
||||
options.dielectrics = super::optical_bindings::resolve_cpu_path(s, &scene, bindings, options.path.is_some(), command)?;
|
||||
options.validate().map_err(job_error)?;
|
||||
}
|
||||
super::coat_bindings::apply(s, &mut scene, &coats, input.raytrace.as_ref(), command)?;
|
||||
if !input.aging.is_empty() {
|
||||
let options = input.raytrace.as_mut().ok_or_else(|| bad(command, "CPU aging requires a CPU raytrace request"))?;
|
||||
if options.aging.as_ref().is_some_and(|stack| !stack.is_empty()) {
|
||||
return Err(bad(command, "choose stable authored aging or captured runtime aging, not both"));
|
||||
}
|
||||
options.aging = Some(Box::new(super::effects::resolve_aging(s, &scene, &input.aging, command)?));
|
||||
options.validate().map_err(job_error)?;
|
||||
}
|
||||
if environment.is_some() {
|
||||
input.raytrace.as_ref().unwrap_or(&RaytraceOptions::default()).validate_environment_reflections(&scene).map_err(job_error)?;
|
||||
}
|
||||
@@ -360,7 +463,13 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
if input.integrator == Integrator::Raytrace {
|
||||
settings.validate_for_cpu(budget).map_err(|e| bad(command, e.to_string()))?;
|
||||
budget.validate_execution().map_err(job_error)?;
|
||||
budget.validate_image(settings.width, settings.height, input.raytrace.as_ref().and_then(|o| o.progressive)).map_err(job_error)?;
|
||||
budget
|
||||
.validate_image(
|
||||
settings.width,
|
||||
settings.height,
|
||||
input.raytrace.as_ref().map(|o| o.camera_sampling()).transpose().map_err(job_error)?.flatten(),
|
||||
)
|
||||
.map_err(job_error)?;
|
||||
} else {
|
||||
settings.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
}
|
||||
@@ -407,10 +516,16 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
if resolved.executor != expected_executor {
|
||||
return Err(bad(command, "resolved executor is not installed as an image job host"));
|
||||
}
|
||||
let textures = if let Some(bindings) = saved_surfaces {
|
||||
let overrides = super::surface_bindings::resolve(s, &scene, bindings, command)?;
|
||||
super::textures::capture(&scene, &overrides, command)?
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let request = ImageRequest {
|
||||
studio_weights: validate_studio_weights(input.studio_weights, command)?,
|
||||
environment: None,
|
||||
textures: None,
|
||||
textures,
|
||||
integrator: input.integrator,
|
||||
raytrace: input.raytrace.take(),
|
||||
camera: settings.camera,
|
||||
@@ -419,12 +534,18 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
background: settings.background,
|
||||
transparent_background: input.transparent_background,
|
||||
};
|
||||
let mut admission = solidcraft_render::job::admit(&scene, &request).map_err(job_error)?;
|
||||
let environment_bytes = environment.as_ref().map_or(Ok(0), |e| e.required_bytes()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let submission =
|
||||
host.prepare_submission_with_metadata(scene, request, Default::default(), environment, cancel.clone(), retained).map_err(job_error)?;
|
||||
let request = submission.request();
|
||||
let mut admission = submission.admission();
|
||||
let retained_lights = request.raytrace.as_ref().map_or(Ok(0), |o| o.retained_bytes()).map_err(job_error)?;
|
||||
let retained_environment =
|
||||
if environment_info.is_some() { std::mem::size_of::<solidcraft_render::lighting::environment_input::EnvironmentInfo>() as u64 } else { 0 };
|
||||
let retained_request_bytes = retained_lights.checked_add(retained_environment).ok_or_else(|| bad(command, "request metadata overflow"))?;
|
||||
let retained_request_bytes = retained_lights
|
||||
.checked_add(retained_environment)
|
||||
.and_then(|bytes| bytes.checked_add(request.retained_resource_metadata_bytes()))
|
||||
.ok_or_else(|| bad(command, "request metadata overflow"))?;
|
||||
|
||||
admission.estimated_total_bytes = admission
|
||||
.estimated_total_bytes
|
||||
@@ -437,10 +558,38 @@ fn prepare(s: &Session, params: &Value, command: &str) -> Result<Prepared> {
|
||||
let transparency = match input.integrator {
|
||||
Integrator::Raster => "sorted_alpha_approximation",
|
||||
Integrator::Raytrace if refraction => "physical_transmission",
|
||||
Integrator::Raytrace if input.transparent_background => "coverage_alpha",
|
||||
Integrator::Raytrace => "opaque_only",
|
||||
};
|
||||
let reply = json!({"ignored_controls":ignored,"stage_panels":settings.stage.len(),"stage_transport":"CPU direct/specular only; no diffuse interreflection", "cpu_budget":budget,"cpu_limits":budget.limits(),"environment":environment_info,"retained_request_bytes":retained_request_bytes,"resolved":resolved,"admission":admission,"request":request,"scene_generation":s.revision,"host":host.kind(),"transparency":transparency,"refraction":refraction,"dielectric_boundaries":if refraction {vec!["thin_sheet","closed_box"]} else {Vec::<&str>::new()}});
|
||||
Ok(Prepared { replace: input.replace, scene, request, reply, environment, executor: resolved.executor, options: Default::default() })
|
||||
let path = request.raytrace.as_ref().is_some_and(|options| options.path.is_some());
|
||||
let stage_transport = if path && refraction {
|
||||
"CPU finite-depth diffuse/specular and dielectric path lighting"
|
||||
} else if path {
|
||||
"CPU finite-depth opaque diffuse/specular path lighting"
|
||||
} else {
|
||||
"CPU direct/specular only; no diffuse interreflection"
|
||||
};
|
||||
let dielectric_boundaries = match (refraction, path) {
|
||||
(true, true) => vec!["thin_sheet", "closed_box", "closed_mesh"],
|
||||
(true, false) => vec!["thin_sheet", "closed_box"],
|
||||
(false, _) => Vec::new(),
|
||||
};
|
||||
let mut reply = json!({"ignored_controls":ignored,"stage_panels":settings.stage.len(),"stage_transport":stage_transport, "cpu_budget":budget,"cpu_limits":budget.limits(),"environment":environment_info,"textures":request.textures.as_ref().map(|maps|maps.summary()),"retained_request_bytes":retained_request_bytes,"resolved":resolved,"admission":admission,"request":request,"scene_generation":s.revision,"host":host.kind(),"transparency":transparency,"refraction":refraction,"dielectric_boundaries":dielectric_boundaries});
|
||||
if !coats.is_empty() {
|
||||
reply["coats"] = json!(coats);
|
||||
}
|
||||
if request.raytrace.as_ref().is_some_and(|options| options.denoise) {
|
||||
reply["denoising"] = json!({
|
||||
"method":"edge_aware_atrous", "backend":"native_cpu", "passes":3, "steps":[1,2,4],
|
||||
"guides":"deterministic_center_ray_albedo_normal_camera_relative_position_depth",
|
||||
"bypass":"glass, sharp CPU mirror overrides, smooth metal/coat, emitter, background and partial coverage first hits",
|
||||
"limitation":"biased spatial filter; first-hit guides do not reconstruct reflection/refraction or depth-of-field correspondences",
|
||||
"raw_linear_accumulator_preserved":true,"raw_linear_exr_preserved":true,
|
||||
"output_stage":"linear_before_tone_map", "work_units":"one pixel visit per pass, each with at most 25 taps",
|
||||
"checkpoints":"every complete published pass uses the same filter"
|
||||
});
|
||||
}
|
||||
Ok(Prepared { replace: input.replace, submission: Some(submission), reply })
|
||||
}
|
||||
|
||||
fn prepare_progressive(
|
||||
@@ -451,6 +600,8 @@ fn prepare_progressive(
|
||||
saved_hdr: Option<GpuHdrEnvironment>,
|
||||
saved_surfaces: Option<&solidcraft_doc::render_surface::SurfaceBindings>,
|
||||
saved_optics: Option<&solidcraft_doc::render_optics::OpticalBindings>,
|
||||
cancel: &solidcraft_render::job::CancelToken,
|
||||
retained: Option<&solidcraft_render::job::RetainedMetadata>,
|
||||
) -> Result<Prepared> {
|
||||
let cpu_raytrace = params
|
||||
.get("raytrace")
|
||||
@@ -465,6 +616,19 @@ fn prepare_progressive(
|
||||
return Err(bad(command, "progressive rendering does not accept CPU raytrace, environment or LED options"));
|
||||
}
|
||||
let mut input: ProgressiveStart = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let coats = input.settings.as_mut().map_or_else(Default::default, |settings| std::mem::take(&mut settings.coats));
|
||||
let inline_optics = input.settings.as_mut().map_or_else(Default::default, |settings| std::mem::take(&mut settings.optics));
|
||||
let normalized_optics = saved_optics.filter(|bindings| !bindings.is_empty());
|
||||
if normalized_optics.is_some() && !inline_optics.is_empty() {
|
||||
return Err(bad(command, "choose normalized or inline stable optics, not both"));
|
||||
}
|
||||
let saved_optics = normalized_optics.or((!inline_optics.is_empty()).then_some(&inline_optics));
|
||||
if let Some(bindings) = saved_optics {
|
||||
bindings.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if !input.raytrace.dielectrics.is_empty() || !input.raytrace.clear_coats.is_empty() {
|
||||
return Err(bad(command, "saved optical bindings cannot be mixed with transient optical overrides"));
|
||||
}
|
||||
}
|
||||
validate_studio_weights(input.studio_weights, command)?;
|
||||
if input.studio_weights.is_some() && (input.lighting.is_some() || input.environment.is_some() || saved_hdr.is_some()) {
|
||||
return Err(bad(command, "studio_weights require the implicit GPU studio without environment lighting"));
|
||||
@@ -503,7 +667,11 @@ fn prepare_progressive(
|
||||
}
|
||||
input.raytrace.dielectrics = super::optical_bindings::resolve(s, &scene, bindings, command)?;
|
||||
}
|
||||
if !coats.is_empty() && !input.raytrace.clear_coats.is_empty() {
|
||||
return Err(bad(command, "stable clear coats cannot combine with runtime clear-coat overrides"));
|
||||
}
|
||||
super::transmission::apply(&mut scene, &input.raytrace.dielectrics, command)?;
|
||||
super::coat_bindings::apply(s, &mut scene, &coats, None, command)?;
|
||||
super::clear_coat::apply(&mut scene, &input.raytrace.clear_coats, command)?;
|
||||
let settings = if let Some(name) = &input.setup {
|
||||
s.doc.render.setups.get(name).cloned().ok_or_else(|| bad(command, "no saved render setup with that name"))?
|
||||
@@ -626,15 +794,22 @@ fn prepare_progressive(
|
||||
transparent_background: input.transparent_background,
|
||||
textures: super::textures::capture(&scene, &input.raytrace.textures, command)?,
|
||||
};
|
||||
let mut admission = host.admit(&scene, &request, options).map_err(job_error)?;
|
||||
let refraction = input.progressive && scene.has_transmission();
|
||||
let submission = host.prepare_submission_with_metadata(scene, request, options, None, cancel.clone(), retained).map_err(job_error)?;
|
||||
let request = submission.request();
|
||||
let mut admission = submission.admission();
|
||||
let retained_options_bytes = options.retained_bytes().map_err(job_error)?;
|
||||
admission.estimated_total_bytes = admission
|
||||
.estimated_total_bytes
|
||||
.checked_add(request.retained_resource_metadata_bytes())
|
||||
.and_then(|bytes| bytes.checked_add(retained_options_bytes))
|
||||
.filter(|bytes| *bytes <= host.job_limit_bytes())
|
||||
.ok_or_else(|| bad(command, "GPU work and retained metadata exceed the per-job limit"))?;
|
||||
let refraction = input.progressive && scene.has_transmission();
|
||||
let reply = json!({"stage_panels":settings.stage.len(),"resolved":resolved,"admission":admission,"request":request,"textures":request.textures.as_ref().map(|resources|resources.summary()),"scene_generation":s.revision,"host":host.kind(),"transparency":if refraction {"physical_transmission"} else if input.progressive {"opaque_only"} else {"sorted_alpha_approximation"},"options":options,"environment":request.environment.as_ref().map(|source|source.info()),"refraction":refraction,"dielectric_boundaries": if resolved.executor.as_str() == "gpu-path" {vec!["thin_sheet","closed_box","closed_mesh"]} else {Vec::<&str>::new()}});
|
||||
let reply = json!({"stage_panels":settings.stage.len(),"resolved":resolved,"admission":admission,"request":request,"textures":request.textures.as_ref().map(|resources|resources.summary()),"scene_generation":s.revision,"host":host.kind(),"transparency":if refraction {"physical_transmission"} else if input.transparent_background {"coverage_alpha"} else if input.progressive {"opaque_only"} else {"sorted_alpha_approximation"},"options":options,"retained_options_bytes":retained_options_bytes,"environment":request.environment.as_ref().map(|source|source.info()),"refraction":refraction,"dielectric_boundaries": if resolved.executor.as_str() == "gpu-path" {vec!["thin_sheet","closed_box","closed_mesh"]} else {Vec::<&str>::new()}});
|
||||
let mut reply = reply;
|
||||
if !coats.is_empty() {
|
||||
reply["coats"] = json!(coats);
|
||||
}
|
||||
if options.denoise {
|
||||
reply["denoising"] = json!({
|
||||
"method":"edge_aware_atrous", "passes":3, "steps":[1,2,4],
|
||||
@@ -644,7 +819,7 @@ fn prepare_progressive(
|
||||
"raw_linear_accumulator_preserved":true, "output_stage":"linear_before_tone_map"
|
||||
});
|
||||
}
|
||||
Ok(Prepared { replace: input.replace, scene, request, reply, executor: resolved.executor, options, environment: None })
|
||||
Ok(Prepared { replace: input.replace, submission: Some(submission), reply })
|
||||
}
|
||||
|
||||
/// The setup's controls the raster image executor doesn't apply: those not at their neutral value.
|
||||
@@ -663,24 +838,18 @@ fn ignored_controls(settings: &RenderSetup) -> Vec<&'static str> {
|
||||
}
|
||||
|
||||
pub(super) fn preflight(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
prepare(s, params, "render.preflight").map(|p| p.reply)
|
||||
prepare(s, params, "render.preflight", &solidcraft_render::job::CancelToken::default()).map(|p| p.reply)
|
||||
}
|
||||
|
||||
pub(super) fn start(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let p = prepare(s, params, "render.start")?;
|
||||
let p = prepare(s, params, "render.start", &solidcraft_render::job::CancelToken::default())?;
|
||||
let status = s
|
||||
.render_jobs
|
||||
.start_with_environment(
|
||||
.start_prepared(
|
||||
s.revision,
|
||||
p.scene,
|
||||
p.request,
|
||||
p.submission.ok_or_else(|| bad("render.start", "missing prepared submission"))?,
|
||||
p.replace,
|
||||
crate::render_jobs::Execution {
|
||||
executor: p.executor,
|
||||
options: p.options,
|
||||
environment: p.environment,
|
||||
shot: params.get("setup").and_then(Value::as_str).map(str::to_owned),
|
||||
},
|
||||
params.get("setup").and_then(Value::as_str).map(str::to_owned),
|
||||
)
|
||||
.map_err(job_error)?;
|
||||
let mut status = json!(status);
|
||||
@@ -755,9 +924,18 @@ pub(super) fn copy(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
Ok(json!({"frame":frame.info}))
|
||||
}
|
||||
|
||||
pub(super) fn cancel(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
pub(crate) fn cancel_params(params: &Value) -> Result<Option<JobId>> {
|
||||
let empty = Value::Object(Default::default());
|
||||
let params = if params.is_null() { &empty } else { params };
|
||||
let input: ResultJob = serde_json::from_value(params.clone()).map_err(|e| bad("render.cancel", e.to_string()))?;
|
||||
let job = input.job.or(s.render_queue_state().job).ok_or_else(|| bad("render.cancel", "job is required without an active shot queue"))?;
|
||||
Ok(input.job)
|
||||
}
|
||||
pub(super) fn cancel(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let requested = cancel_params(params)?;
|
||||
if requested.is_none() && s.cancel_native_preparation() {
|
||||
return Ok(json!({"preparing":true,"cancel_requested":true,"queue":s.render_queue_state()}));
|
||||
}
|
||||
let job = requested.or(s.render_queue_state().job).ok_or_else(|| bad("render.cancel", "job is required without an active shot queue"))?;
|
||||
let status = s.render_jobs.status(job).map_err(job_error)?;
|
||||
s.cancel_render_batch(job);
|
||||
if status.progress.phase.terminal() {
|
||||
|
||||
@@ -9,17 +9,17 @@ use serde::Deserialize;
|
||||
use serde_json::{Value, json};
|
||||
use solidcraft_doc::{
|
||||
render_resources::{CpuHdrEnvironment, GpuHdrEnvironment, HdrId, HdrResource},
|
||||
render_settings::RenderJob,
|
||||
render_settings::{CpuJob, RenderJob, RenderSetup},
|
||||
};
|
||||
use solidcraft_render::{
|
||||
job::{AreaLight, AreaLights, StudioLighting, Sun},
|
||||
job::{AreaLight, AreaLights, RectangleLightOptions, StudioLighting, Sun},
|
||||
texture_input::MapRole,
|
||||
};
|
||||
|
||||
use crate::schema::TypedContract;
|
||||
use crate::schema::render_library::{
|
||||
LibraryDescribeParams, LibraryListParams, LibraryPage, LibraryPreview, LibraryPreviewParams, LibraryResource, LibraryTargets,
|
||||
LibraryTargetsParams, Pbr, RenderTarget, ResourceSummary, SceneBounds,
|
||||
LibraryTargetsParams, Pbr, RenderTarget, ResourceSummary, SceneBounds, StableRenderTarget,
|
||||
};
|
||||
use crate::{Result, Session, params::bad};
|
||||
|
||||
@@ -98,7 +98,7 @@ fn projection(kind: &str, value: &Value) -> Value {
|
||||
"native_scenes" => json!({"status":"native_composition","executor":"gpu-path","variants":["review_then_apply"],
|
||||
"preserves":["camera","materials","geometry","engineering_properties"],"requires_subject_and_explicit_replacement_consent":true}),
|
||||
"surfaces" => {
|
||||
json!({"status":"implemented_pending_batch_validation","variants":if cfg!(feature="bundled-render-library") {vec!["uniform_opaque","gpu_planar_maps"]} else {vec!["uniform_opaque"]},
|
||||
json!({"status":"implemented_pending_batch_validation","variants":if cfg!(feature="bundled-render-library") {vec!["uniform_opaque","gpu_planar_maps","cpu_saved_planar_maps"]} else {vec!["uniform_opaque"]},
|
||||
"omitted":["height_displacement","true_anisotropic_brdf","manufacturing_geometry"],"maps_portability":"version_and_digest_pinned_builtin_setup_bindings"})
|
||||
}
|
||||
"selene_appearances" => json!({"status":"implemented_pending_batch_validation","variants":["uniform_opaque"],
|
||||
@@ -227,6 +227,12 @@ pub(super) fn targets(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
}
|
||||
let query = input.query.to_lowercase();
|
||||
let scene = crate::product_scene::extract(s)?;
|
||||
let mut stable = BTreeMap::new();
|
||||
for (target, name) in super::surface_bindings::targets(s, command)? {
|
||||
if stable.insert(name, target).is_some() {
|
||||
return Err(bad(command, "ambiguous stable occurrence name"));
|
||||
}
|
||||
}
|
||||
let count = scene.meshes.iter().filter(|body| body.name.to_lowercase().contains(&query)).count();
|
||||
let items: Vec<_> = scene
|
||||
.meshes
|
||||
@@ -238,6 +244,7 @@ pub(super) fn targets(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
.map(|(ordinal, body)| RenderTarget {
|
||||
ordinal,
|
||||
name: body.name.clone(),
|
||||
stable_target: stable.get(&body.name).map(StableRenderTarget::from),
|
||||
color: body.color,
|
||||
opacity: body.opacity,
|
||||
pbr: body.surface.map(|v| Pbr { metallic: v.metallic(), roughness: v.roughness(), dielectric_ior: v.dielectric_ior() }),
|
||||
@@ -435,7 +442,7 @@ struct EnvironmentApply {
|
||||
|
||||
fn has_environment(setup: &solidcraft_doc::render_settings::RenderSetup) -> bool {
|
||||
match &setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => options.hdr.is_some() || options.environment.is_some(),
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => options.hdr.is_some() || options.environment.is_some() || options.sky.is_some(),
|
||||
Some(RenderJob::GpuPath { options, .. }) => options.hdr.is_some() || options.environment.is_some(),
|
||||
_ => false,
|
||||
}
|
||||
@@ -452,10 +459,13 @@ pub(super) fn apply_environment(s: &mut Session, params: &Value) -> Result<Value
|
||||
let rotation = hdr_rotation(input.rotation_rad, command)?;
|
||||
let mut setup = super::patched_settings(s, &input.name, &input.set, command)?;
|
||||
match &setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => {
|
||||
if !input.replace_environment && (options.hdr.is_some() || options.environment.is_some()) {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
if !input.replace_environment && (options.hdr.is_some() || options.environment.is_some() || options.sky.is_some()) {
|
||||
return Err(bad(command, "existing environment requires replace_environment: true"));
|
||||
}
|
||||
if metadata["solar_disk"] == true && options.sun.is_some() {
|
||||
return Err(bad(command, "the selected HDR already owns the sun; remove the analytic sun explicitly"));
|
||||
}
|
||||
CpuHdrEnvironment::check_controls(rotation, input.intensity, input.samples).map_err(|e| bad(command, e.to_string()))?;
|
||||
}
|
||||
Some(RenderJob::GpuPath { options, .. }) => {
|
||||
@@ -474,8 +484,9 @@ pub(super) fn apply_environment(s: &mut Session, params: &Value) -> Result<Value
|
||||
let digest = resource.id();
|
||||
settings.resources.insert(resource).map_err(|e| bad(command, e.to_string()))?;
|
||||
match &mut setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options }) => {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => {
|
||||
options.environment = None;
|
||||
options.sky = None;
|
||||
options.hdr = Some(CpuHdrEnvironment { resource: digest, rotation_rad: rotation, intensity: input.intensity, samples: input.samples });
|
||||
}
|
||||
Some(RenderJob::GpuPath { options, .. }) => {
|
||||
@@ -548,7 +559,9 @@ pub(super) fn prepare_surface(s: &mut Session, params: &Value) -> Result<Value>
|
||||
"base_color_srgb":format!("builtin://{}/base_color",input.id),"normal_opengl":format!("builtin://{}/normal_open_gl",input.id),
|
||||
"roughness_linear":format!("builtin://{}/roughness",input.id),"metallic_linear":format!("builtin://{}/metallic",input.id)},
|
||||
"source_maps":manifest["maps"],"omitted":["height_displacement","true_anisotropic_brdf","manufacturing_geometry"],
|
||||
"dielectric_ior":"captured_body_value","persistence":"transient_request_binding; authored source bytes are built in"}))
|
||||
"dielectric_ior":"captured_body_value","persistence":"transient_request_binding; authored source bytes are built in",
|
||||
"compatible_saved_methods":if cfg!(feature="bundled-render-library") {vec!["cpu_raytrace","gpu_path"]} else {Vec::<&str>::new()},
|
||||
"cpu_maps":"saved_builtin_opaque_only; direct_or_indirect_lighting; level_zero_bilinear; incompatible_optics_refuse"}))
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@@ -612,7 +625,13 @@ pub(super) fn rig_lighting(input: &RigInput, command: &str) -> Result<(StudioLig
|
||||
_ => return Err(bad(command, "authored light has no exact runtime adapter")),
|
||||
}
|
||||
}
|
||||
let lighting = StudioLighting { environment: [0.0; 3], sun, area_lights: AreaLights::new(&areas).map_err(|e| bad(command, e.to_string()))? };
|
||||
let lighting = StudioLighting {
|
||||
punctual_lights: Default::default(),
|
||||
directional_lights: Default::default(),
|
||||
environment: [0.0; 3],
|
||||
sun,
|
||||
area_lights: AreaLights::new(&areas).map_err(|e| bad(command, e.to_string()))?,
|
||||
};
|
||||
lighting.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
Ok((
|
||||
lighting,
|
||||
@@ -676,12 +695,106 @@ pub(super) fn rig_clearance(scene: &solidcraft_render::ProductScene, lighting: &
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub(super) fn prepare_studio(_s: &mut Session, params: &Value) -> Result<Value> {
|
||||
/// Exact typed bridge for the currently authored achromatic area/Sun rigs.
|
||||
/// This changes lighting authority only, retaining dormant CPU sampling fields.
|
||||
pub(super) fn cpu_studio_lighting(options: &mut CpuJob, lighting: &StudioLighting, command: &str) -> Result<bool> {
|
||||
lighting.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
if lighting.environment != [0.0; 3] || !lighting.directional_lights.is_empty() || !lighting.punctual_lights.is_empty() {
|
||||
return Err(bad(command, "authored CPU studio projection requires its explicit area/Sun rig and separate environment authority"));
|
||||
}
|
||||
let mut areas = Vec::new();
|
||||
areas.try_reserve_exact(lighting.area_lights.iter().count()).map_err(|_| bad(command, "could not reserve CPU studio lights"))?;
|
||||
for (index, light) in lighting.area_lights.iter().enumerate() {
|
||||
let [r, g, b] = light.radiance;
|
||||
if r.to_bits() != g.to_bits() || r.to_bits() != b.to_bits() {
|
||||
return Err(bad(
|
||||
command,
|
||||
format!("authored rectangle {index} needs a lossless CPU colour/intensity projection; this rig is not supported"),
|
||||
));
|
||||
}
|
||||
if !(0.0..=64.0).contains(&r) {
|
||||
return Err(bad(
|
||||
command,
|
||||
format!(
|
||||
"authored rectangle {index} radiance {r} exceeds CPU area intensity 0..64; this rig is unavailable without changing its authored light"
|
||||
),
|
||||
));
|
||||
}
|
||||
areas.push(RectangleLightOptions {
|
||||
center_mm: light.center,
|
||||
edge_u_mm: light.u.map(|value| value * 2.0),
|
||||
edge_v_mm: light.v.map(|value| value * 2.0),
|
||||
color: [1.0; 3],
|
||||
intensity: r,
|
||||
});
|
||||
}
|
||||
let needs_indirect = lighting.sun.is_some() && options.path.is_none();
|
||||
options.preset = None;
|
||||
options.lights = Some(Vec::new());
|
||||
options.punctual_lights = Some(Vec::new());
|
||||
options.area_lights = Some(areas);
|
||||
options.sun = lighting.sun;
|
||||
options.environment = None;
|
||||
options.sky = None;
|
||||
options.hdr = None;
|
||||
Ok(needs_indirect)
|
||||
}
|
||||
fn adopt_studio_indirect(setup: &mut RenderSetup) {
|
||||
if let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job {
|
||||
options.path.get_or_insert_default();
|
||||
options.progressive.get_or_insert_default();
|
||||
options.primary_samples = 1;
|
||||
options.shadows = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct StudioPrepare {
|
||||
id: String,
|
||||
variant: String,
|
||||
center_mm: [f64; 3],
|
||||
subject_extent_mm: f64,
|
||||
#[serde(default)]
|
||||
name: Option<String>,
|
||||
#[serde(default = "empty_patch")]
|
||||
set: Value,
|
||||
#[serde(default)]
|
||||
enable_indirect: bool,
|
||||
}
|
||||
pub(super) fn prepare_studio(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let command = "render.library.studio.prepare";
|
||||
let input: RigInput = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let (lighting, projection) = rig_lighting(&input, command)?;
|
||||
let stage = rig_stage(&input, command)?;
|
||||
Ok(json!({"lighting":lighting,"stage":stage,"projection":projection,"requires_geometry_clearance_review":true,"document_changed":false}))
|
||||
let input: StudioPrepare = serde_json::from_value(params.clone()).map_err(|e| bad(command, e.to_string()))?;
|
||||
let rig = RigInput { id: input.id, variant: input.variant, center_mm: input.center_mm, subject_extent_mm: input.subject_extent_mm };
|
||||
let (lighting, projection) = rig_lighting(&rig, command)?;
|
||||
let stage = rig_stage(&rig, command)?;
|
||||
let mut report =
|
||||
json!({"lighting":lighting,"stage":stage,"projection":projection,"requires_geometry_clearance_review":true,"document_changed":false});
|
||||
if let Some(name) = input.name {
|
||||
let mut setup = super::patched_settings(s, &name, &input.set, command)?;
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &mut setup.job else {
|
||||
return Err(bad(command, "typed rig context requires a selected CPU raytrace setup"));
|
||||
};
|
||||
let needs_indirect = cpu_studio_lighting(options, &lighting, command)?;
|
||||
// Resolve the complete prospective adoption without publishing it. Apply
|
||||
// still requires the separate explicit action below, at current revision.
|
||||
if needs_indirect {
|
||||
adopt_studio_indirect(&mut setup);
|
||||
}
|
||||
setup.stage = stage;
|
||||
setup.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
report["setup"] = json!(setup);
|
||||
report["executor"] = json!("cpu-raytrace");
|
||||
report["revision"] = json!(s.revision);
|
||||
report["requires_indirect"] = json!(needs_indirect);
|
||||
report["indirect_adoption"] = json!(
|
||||
needs_indirect
|
||||
.then_some(json!({"path_depth":8,"progressive_if_absent":{"samples_per_pixel":16,"seed":0},"primary_samples":1,"shadows":true}))
|
||||
);
|
||||
} else if input.enable_indirect || input.set != json!({}) {
|
||||
return Err(bad(command, "CPU rig context needs name and typed set"));
|
||||
}
|
||||
Ok(report)
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@@ -694,6 +807,10 @@ struct StudioApply {
|
||||
replace_lighting_and_environment: bool,
|
||||
#[serde(default)]
|
||||
replace_stage: bool,
|
||||
#[serde(default)]
|
||||
enable_indirect: bool,
|
||||
#[serde(default)]
|
||||
expected_revision: Option<u64>,
|
||||
}
|
||||
pub(super) fn apply_studio(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let command = "render.library.studio.apply";
|
||||
@@ -701,22 +818,35 @@ pub(super) fn apply_studio(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
if !input.replace_lighting_and_environment {
|
||||
return Err(bad(command, "confirm replacing lighting and environment explicitly to preserve a single energy owner"));
|
||||
}
|
||||
if input.expected_revision.is_some_and(|revision| revision != s.revision) {
|
||||
return Err(bad(command, "scene or saved settings changed after rig review"));
|
||||
}
|
||||
if !input.replace_stage && s.doc.render.setups.get(&input.name).is_some_and(|setup| !setup.stage.is_empty()) {
|
||||
return Err(bad(command, "existing stage requires replace_stage: true"));
|
||||
}
|
||||
let (lighting, projection) = rig_lighting(&input.rig, command)?;
|
||||
let mut setup = super::patched_settings(s, &input.name, &input.set, command)?;
|
||||
let Some(RenderJob::GpuPath { options, .. }) = &mut setup.job else {
|
||||
return Err(bad(command, "authored area/sun rigs require an explicit GPU job"));
|
||||
};
|
||||
let stage = rig_stage(&input.rig, command)?;
|
||||
if !setup.stage.is_empty() && !input.replace_stage {
|
||||
return Err(bad(command, "existing stage requires replace_stage: true"));
|
||||
}
|
||||
setup.stage = stage;
|
||||
options.lighting = Some(lighting);
|
||||
options.environment = None;
|
||||
options.hdr = None;
|
||||
let needs_indirect = match &mut setup.job {
|
||||
Some(RenderJob::CpuRaytrace { options, .. }) => cpu_studio_lighting(options, &lighting, command)?,
|
||||
Some(RenderJob::GpuPath { options, .. }) => {
|
||||
options.lighting = Some(lighting);
|
||||
options.environment = None;
|
||||
options.hdr = None;
|
||||
false
|
||||
}
|
||||
_ => return Err(bad(command, "authored rigs require an explicit CPU or GPU raytrace setup")),
|
||||
};
|
||||
if needs_indirect {
|
||||
if !input.enable_indirect {
|
||||
return Err(bad(command, "this CPU Sun rig requires explicit Enable indirect lighting and apply consent"));
|
||||
}
|
||||
adopt_studio_indirect(&mut setup);
|
||||
}
|
||||
setup.validate().map_err(|e| bad(command, e.to_string()))?;
|
||||
let mut scene = crate::product_scene::extract(s)?;
|
||||
super::staging::apply(&mut scene, &setup, command)?;
|
||||
|
||||
@@ -74,7 +74,7 @@ fn builtin_hdr_capture_is_atomic_undoable_deduplicated_and_path_independent() {
|
||||
assert_eq!(reply["source_sha256"], reply["resource"]);
|
||||
assert_eq!(reply["native_rotation_rad"], std::f64::consts::PI);
|
||||
assert_eq!(reply["self_contained"], true);
|
||||
let Some(RenderJob::CpuRaytrace { options }) = &s.doc.render.setups["Library CPU"].job else {
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &s.doc.render.setups["Library CPU"].job else {
|
||||
panic!("CPU intent");
|
||||
};
|
||||
let id = options.hdr.unwrap().resource;
|
||||
@@ -290,8 +290,12 @@ fn saved_surface_rejects_changed_feature_and_hidden_target_and_can_be_removed_of
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, previous);
|
||||
let before = s.doc.to_json();
|
||||
assert!(s.execute("render.settings.set", &json!({"name":"P","set":{"job":{"method":"cpu_raytrace","options":{}}}})).is_err());
|
||||
assert!(s.execute("render.settings.set", &json!({"name":"P","set":{"job":{"method":"raster"}}})).is_err());
|
||||
assert_eq!(s.doc.to_json(), before);
|
||||
let bindings = s.doc.render.setups["P"].surfaces.clone();
|
||||
s.execute("render.settings.set", &json!({"name":"P","set":{"job":{"method":"cpu_raytrace","options":{}}}})).unwrap();
|
||||
assert_eq!(s.doc.render.setups["P"].surfaces, bindings, "supported CPU method changes preserve saved bindings, even offline");
|
||||
assert!(s.render_job_host().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -399,3 +403,265 @@ fn omitted_optional_pack_keeps_discovery_but_refuses_resource_mutation() {
|
||||
assert_eq!(session.doc, before);
|
||||
assert_eq!((session.revision, session.undo.len()), history);
|
||||
}
|
||||
|
||||
#[cfg(feature = "bundled-render-library")]
|
||||
#[test]
|
||||
fn cpu_saved_surface_binding_is_offline_undoable_portable_and_preserves_geometry_and_unsupported_intent() {
|
||||
let mut s = Session::default();
|
||||
s.execute("solid.box", &json!({"length":10,"width":20,"height":5,"body_name":"Coupon"})).unwrap();
|
||||
let before = s.doc.clone();
|
||||
let undo = s.undo.len();
|
||||
let camera = solidcraft_render::Camera::default();
|
||||
let set = json!({"camera":camera,"width":8,"height":8,"job":{"method":"cpu_raytrace","options":{"progressive":{"samples_per_pixel":3,"seed":9},"output":{"linear_exr":true}}}});
|
||||
let input = json!({"name":"CPU maps","set":set,"surface":{"id":"SURF-001","body_index":0,"body_name":"Coupon"}});
|
||||
assert!(s.render_job_host().is_none());
|
||||
s.execute("render.library.surface.bind", &input).unwrap();
|
||||
assert_eq!(s.undo.len(), undo + 1);
|
||||
assert_eq!(s.doc.features, before.features);
|
||||
assert_eq!(s.doc.materials, before.materials);
|
||||
assert_eq!(s.doc.appearances, before.appearances);
|
||||
let setup = s.doc.render.setups["CPU maps"].clone();
|
||||
assert_eq!(setup.surfaces.len(), 1);
|
||||
assert_eq!(setup.camera, camera);
|
||||
let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap();
|
||||
assert_eq!(reopened, *s.doc);
|
||||
let snapshot = s.doc.clone();
|
||||
let history = (s.revision, s.undo.len(), s.redo.len());
|
||||
for options in [
|
||||
json!({"reflections":{"bodies":[{"body":"Coupon","mode":"mirror"}],"samples":1,"max_bounces":2}}),
|
||||
json!({"budget":"studio","progressive":{"samples_per_pixel":3,"seed":9},"path":{"max_depth":2},"shadows":false}),
|
||||
] {
|
||||
let mut hostile = input.clone();
|
||||
hostile["name"] = json!("Unsupported");
|
||||
hostile["set"]["job"]["options"] = options;
|
||||
assert!(s.execute("render.library.surface.bind", &hostile).is_err());
|
||||
assert!(Arc::ptr_eq(&s.doc, &snapshot));
|
||||
assert_eq!((s.revision, s.undo.len(), s.redo.len()), history);
|
||||
}
|
||||
let mut stale = setup.clone();
|
||||
let mut binding = stale.surfaces.iter().next().unwrap().clone();
|
||||
binding.source.normal_sha256 = HdrId::of(b"changed");
|
||||
stale.surfaces.set(binding, true).unwrap();
|
||||
assert!(super::super::surface_bindings::resolve(&s, &crate::product_scene::extract(&s).unwrap(), &stale.surfaces, "test").is_err());
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, before);
|
||||
s.execute("edit.redo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc.render.setups["CPU maps"], setup);
|
||||
s.execute("render.library.surface.unbind", &json!({"name":"CPU maps","target":setup.surfaces.iter().next().unwrap().target})).unwrap();
|
||||
assert!(s.doc.render.setups["CPU maps"].surfaces.is_empty());
|
||||
assert!(s.render_job_host().is_none());
|
||||
}
|
||||
|
||||
#[cfg(feature = "bundled-render-library")]
|
||||
#[test]
|
||||
fn cpu_path_maps_bind_beside_saved_glass_and_targeted_aging_without_weakening_target_or_legacy_guards() {
|
||||
let mut s = Session::default();
|
||||
for (name, corner) in [("Glass", [0, 0, 0]), ("Panel", [20, 0, 0])] {
|
||||
s.execute("solid.box", &json!({"body_name":name,"length":10,"width":10,"height":5,"corner":corner,"operation":"new"})).unwrap();
|
||||
}
|
||||
let targets = s.execute("render.library.targets", &json!({})).unwrap();
|
||||
let glass = targets["items"].as_array().unwrap().iter().find(|target| target["name"] == "Glass").unwrap().clone();
|
||||
let panel = targets["items"].as_array().unwrap().iter().find(|target| target["name"] == "Panel").unwrap().clone();
|
||||
assert_eq!(panel["stable_target"]["definition"], "Panel");
|
||||
assert_ne!(glass["stable_target"], panel["stable_target"]);
|
||||
s.execute(
|
||||
"render.settings.set",
|
||||
&json!({"name":"Mixed","set":{"width":8,"height":8,"job":{"method":"cpu_raytrace","options":{
|
||||
"progressive":{"samples_per_pixel":4,"seed":9},"path":{"max_depth":4},
|
||||
"aging":[{"kind":"dust","target":panel["stable_target"]}]
|
||||
}}}}),
|
||||
)
|
||||
.unwrap();
|
||||
s.execute(
|
||||
"render.optics.bind",
|
||||
&json!({"name":"Mixed","body_index":glass["ordinal"],"body_name":"Glass","expected_revision":s.revision,
|
||||
"optics":{"ior":1.5,"boundary":"closed_mesh"}}),
|
||||
)
|
||||
.unwrap();
|
||||
let before = s.doc.clone();
|
||||
let history = (s.revision, s.undo.len(), s.redo.len());
|
||||
assert!(s.render_job_host().is_none(), "authoring does not require an image producer");
|
||||
let input = |target: &Value| json!({"name":"Mixed","surface":{"id":"SURF-001","body_index":target["ordinal"],"body_name":target["name"]}});
|
||||
let error = s.execute("render.library.surface.bind", &input(&glass)).unwrap_err().to_string();
|
||||
assert!(error.contains("cannot share a target"), "{error}");
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
assert_eq!((s.revision, s.undo.len(), s.redo.len()), history);
|
||||
let mut legacy = input(&panel);
|
||||
legacy["set"] = json!({"job":{"method":"cpu_raytrace","options":{"progressive":{"samples_per_pixel":4,"seed":9}}}});
|
||||
assert!(s.execute("render.library.surface.bind", &legacy).unwrap_err().to_string().contains("require Indirect lighting"));
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
assert_eq!((s.revision, s.undo.len(), s.redo.len()), history);
|
||||
s.execute("render.library.surface.bind", &input(&panel)).unwrap();
|
||||
assert_eq!(s.undo.len(), history.1 + 1);
|
||||
let saved = s.doc.clone();
|
||||
let setup = &saved.render.setups["Mixed"];
|
||||
assert_eq!(setup.surfaces.len(), 1);
|
||||
assert_eq!(setup.optics, before.render.setups["Mixed"].optics);
|
||||
let solidcraft_doc::render_settings::RenderJob::CpuRaytrace { options, .. } = setup.job.as_ref().unwrap() else { panic!("CPU intent changed") };
|
||||
assert!(options.path.is_some());
|
||||
assert_eq!(options.aging.iter().next().unwrap().target.as_ref().unwrap(), &setup.surfaces.iter().next().unwrap().target);
|
||||
assert_eq!(saved.features, before.features);
|
||||
assert_eq!(saved.materials, before.materials);
|
||||
assert_eq!(saved.appearances, before.appearances);
|
||||
assert_eq!(solidcraft_doc::Document::from_json(&saved.to_json()).unwrap(), *saved);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, before);
|
||||
s.execute("edit.redo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, saved);
|
||||
assert!(s.render_job_host().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_authored_rig_domain_is_exact_and_preserves_dormant_sampling_without_implicit_lights() {
|
||||
use solidcraft_doc::render_settings::CpuJob;
|
||||
let mut s = Session::default();
|
||||
let mut accepted = Vec::new();
|
||||
let mut over_domain = Vec::new();
|
||||
for index in 1..=24 {
|
||||
let id = format!("RIG-{index:03}");
|
||||
let rig = json!({"id":id,"variant":"complete","center_mm":[0,0,0],"subject_extent_mm":100});
|
||||
if s.execute("render.library.studio.prepare", &rig).is_err() {
|
||||
continue;
|
||||
}
|
||||
let mut prepare = rig.clone();
|
||||
prepare["name"] = json!("Rig");
|
||||
prepare["set"] = json!({"width":8,"height":8,"job":{"method":"cpu_raytrace","options":{"area_samples":64,"seed":731}}});
|
||||
let before = s.doc.clone();
|
||||
let history = s.undo.len();
|
||||
let result = s.execute("render.library.studio.prepare", &prepare);
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
assert_eq!(history, s.undo.len());
|
||||
match result {
|
||||
Ok(plan) => {
|
||||
accepted.push(id.clone());
|
||||
let options: CpuJob = serde_json::from_value(plan["setup"]["job"]["options"].clone()).unwrap();
|
||||
assert_eq!(options.lights, Some(vec![]));
|
||||
assert_eq!(options.punctual_lights, Some(vec![]));
|
||||
assert_eq!((options.area_samples, options.seed), (Some(64), Some(731)));
|
||||
assert!(options.environment.is_none() && options.sky.is_none() && options.hdr.is_none());
|
||||
assert_eq!(plan["requires_indirect"], id == "RIG-020");
|
||||
}
|
||||
Err(error) => {
|
||||
assert!(error.to_string().contains("exceeds CPU area intensity 0..64"), "{id}: {error}");
|
||||
over_domain.push(id);
|
||||
let err = s
|
||||
.execute(
|
||||
"render.library.studio.apply",
|
||||
&json!({"rig":rig,"name":"Rig","set":prepare["set"],"replace_lighting_and_environment":true}),
|
||||
)
|
||||
.unwrap_err();
|
||||
assert!(err.to_string().contains("exceeds CPU area intensity 0..64"));
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
assert_eq!(history, s.undo.len());
|
||||
}
|
||||
}
|
||||
}
|
||||
assert_eq!(accepted, vec!["RIG-007", "RIG-020", "RIG-022"]);
|
||||
assert_eq!(over_domain.len(), 16);
|
||||
let mut options = CpuJob { area_samples: Some(64), seed: Some(731), ..Default::default() };
|
||||
let before = options.clone();
|
||||
let light = AreaLight { center: [0., 0., 10.], u: [1., 0., 0.], v: [0., -1., 0.], radiance: [1., 0.5, 0.25] };
|
||||
let lighting = StudioLighting { area_lights: AreaLights::new(&[light]).unwrap(), ..Default::default() };
|
||||
assert!(cpu_studio_lighting(&mut options, &lighting, "test").unwrap_err().to_string().contains("lossless CPU colour/intensity projection"));
|
||||
assert_eq!(options, before, "no lossy colour decomposition");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_sun_rig_adoption_is_explicit_complete_atomic_and_one_undo() {
|
||||
let mut s = Session::default();
|
||||
s.execute("render.settings.set",&json!({"name":"Rig","set":{"width":8,"height":8,"job":{"method":"cpu_raytrace","options":{"primary_samples":4,"shadows":false,"area_samples":64,"seed":731}}}})).unwrap();
|
||||
let rig = json!({"id":"RIG-020","variant":"complete","center_mm":[0,0,0],"subject_extent_mm":100});
|
||||
let mut prepare = rig.clone();
|
||||
prepare["name"] = json!("Rig");
|
||||
let before = s.doc.clone();
|
||||
let undo = s.undo.len();
|
||||
let plan = s.execute("render.library.studio.prepare", &prepare).unwrap();
|
||||
assert_eq!(plan["requires_indirect"], true);
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
let mut apply = json!({"name":"Rig","rig":rig,"replace_lighting_and_environment":true,"expected_revision":s.revision});
|
||||
assert!(s.execute("render.library.studio.apply", &apply).unwrap_err().to_string().contains("Enable indirect lighting"));
|
||||
assert_eq!(s.doc, before);
|
||||
assert_eq!(s.undo.len(), undo);
|
||||
apply["enable_indirect"] = json!(true);
|
||||
s.execute("render.library.studio.apply", &apply).unwrap();
|
||||
assert_eq!(s.undo.len(), undo + 1);
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &s.doc.render.setups["Rig"].job else { panic!() };
|
||||
assert_eq!(options.path.unwrap().max_depth, 8);
|
||||
assert_eq!(options.progressive.unwrap().samples_per_pixel, 16);
|
||||
assert_eq!((options.primary_samples, options.shadows, options.area_samples, options.seed), (1, true, Some(64), Some(731)));
|
||||
assert!(options.sun.is_some());
|
||||
assert_eq!(options.area_lights, Some(vec![]));
|
||||
let saved = s.doc.to_json();
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc, before);
|
||||
s.execute("edit.redo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc.to_json(), saved);
|
||||
let before = s.doc.clone();
|
||||
assert!(s.execute("render.library.studio.apply", &apply).is_err());
|
||||
assert!(Arc::ptr_eq(&before, &s.doc));
|
||||
let mut large = Session::default();
|
||||
let fixed = json!({"width":2048,"height":2048,"job":{"method":"cpu_raytrace","options":{}}});
|
||||
// This is an admitted fixed Compact image. Only explicit adoption of the
|
||||
// complete progressive16 Sun request crosses Compact's1,048,576-pixel bound.
|
||||
// Upstream's shared setup refusal names the admitting Studio profile rather
|
||||
// than repeating the current Compact name, so assert the actual size proof.
|
||||
use solidcraft_render::job::{CpuBudget, CpuProgressiveOptions};
|
||||
let adopted = Some(CpuProgressiveOptions { samples_per_pixel: 16, seed: 0 });
|
||||
assert!(CpuBudget::Compact.validate_image(2048, 2048, None).is_ok());
|
||||
assert_eq!(CpuBudget::Compact.limits().max_progressive_pixels, 1_048_576);
|
||||
assert!(CpuBudget::Compact.validate_image(2048, 2048, adopted).is_err());
|
||||
assert!(CpuBudget::Studio.validate_image(2048, 2048, adopted).is_ok());
|
||||
let authored = super::super::patched_settings(&large, "Rig", &fixed, "render.library.studio.prepare").unwrap();
|
||||
assert_eq!((authored.width, authored.height), (2048, 2048));
|
||||
let Some(RenderJob::CpuRaytrace { options, .. }) = &authored.job else { panic!("typed fixed CPU setup") };
|
||||
assert_eq!(options.budget, CpuBudget::Compact);
|
||||
assert!(options.progressive.is_none() && options.path.is_none());
|
||||
let mut oversized = prepare;
|
||||
oversized["set"] = fixed.clone();
|
||||
let before = large.doc.clone();
|
||||
let state = (large.revision, large.evaluations, large.is_dirty(), large.undo.len(), large.redo.len(), large.camera);
|
||||
let check_size_error = |error: String| {
|
||||
assert!(error.contains("render output 2048 × 2048 exceeds the image limits"), "{error}");
|
||||
assert!(error.contains("1048576 pixels in all"), "{error}");
|
||||
assert!(error.contains("largest image at this aspect is 1024 × 1024"), "{error}");
|
||||
assert!(error.contains("choose the Studio CPU resource profile, or a smaller size"), "{error}");
|
||||
eprintln!("complete CPU Sun adoption refused without mutation: {error}");
|
||||
};
|
||||
check_size_error(large.execute("render.library.studio.prepare", &oversized).unwrap_err().to_string());
|
||||
assert!(Arc::ptr_eq(&before, &large.doc));
|
||||
assert_eq!((large.revision, large.evaluations, large.is_dirty(), large.undo.len(), large.redo.len(), large.camera), state);
|
||||
let mut oversized = apply;
|
||||
oversized.as_object_mut().unwrap().remove("expected_revision");
|
||||
oversized["set"] = fixed;
|
||||
check_size_error(large.execute("render.library.studio.apply", &oversized).unwrap_err().to_string());
|
||||
assert!(Arc::ptr_eq(&before, &large.doc));
|
||||
assert_eq!((large.revision, large.evaluations, large.is_dirty(), large.undo.len(), large.redo.len(), large.camera), state);
|
||||
assert!(large.undo.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_sun_rig_keeps_existing_path_adaptive_seed_and_profile_and_rejects_unknown_context() {
|
||||
let mut s = Session::default();
|
||||
let options = json!({"budget":"studio","progressive":{"samples_per_pixel":64,"seed":947},"adaptive":{"pilot_samples":32,"min_samples":32},"path":{"max_depth":5},"area_samples":4,"seed":731});
|
||||
s.execute("render.settings.set", &json!({"name":"Rig","set":{"width":96,"height":64,"job":{"method":"cpu_raytrace","options":options}}}))
|
||||
.unwrap();
|
||||
let rig = json!({"id":"RIG-020","variant":"complete","center_mm":[0,0,0],"subject_extent_mm":100});
|
||||
let mut prepare = rig.clone();
|
||||
prepare["name"] = json!("Rig");
|
||||
let plan = s.execute("render.library.studio.prepare", &prepare).unwrap();
|
||||
assert_eq!(plan["requires_indirect"], false);
|
||||
let old = s.doc.render.setups["Rig"].clone();
|
||||
s.execute("render.library.studio.apply", &json!({"name":"Rig","rig":rig,"replace_lighting_and_environment":true})).unwrap();
|
||||
let Some(RenderJob::CpuRaytrace { options: before, .. }) = old.job else { panic!() };
|
||||
let Some(RenderJob::CpuRaytrace { options: after, .. }) = &s.doc.render.setups["Rig"].job else { panic!() };
|
||||
assert_eq!(
|
||||
(after.budget, after.progressive, after.adaptive, after.path, after.area_samples, after.seed),
|
||||
(before.budget, before.progressive, before.adaptive, before.path, before.area_samples, before.seed)
|
||||
);
|
||||
let doc = s.doc.clone();
|
||||
let undo = s.undo.len();
|
||||
prepare["extra"] = json!(true);
|
||||
assert!(s.execute("render.library.studio.prepare", &prepare).is_err());
|
||||
assert!(Arc::ptr_eq(&doc, &s.doc));
|
||||
assert_eq!(s.undo.len(), undo);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,15 @@ fn normalized_twenty_source_preflight_has_one_metadata_authority_and_no_reservat
|
||||
assert_eq!(options.primary_samples, 16);
|
||||
assert_eq!(options.area_lights.as_ref().unwrap().len(), 4);
|
||||
assert_eq!(options.punctual_lights.as_ref().unwrap().len(), 8);
|
||||
assert_eq!(reply["retained_request_bytes"], json!(options.retained_bytes().unwrap()));
|
||||
assert_eq!(
|
||||
reply["retained_request_bytes"],
|
||||
json!(
|
||||
options.retained_bytes().unwrap()
|
||||
+ serde_json::from_value::<solidcraft_render::job::ImageRequest>(reply["request"].clone())
|
||||
.unwrap()
|
||||
.retained_resource_metadata_bytes()
|
||||
)
|
||||
);
|
||||
assert_eq!(host.admitted_bytes(), 0);
|
||||
assert_eq!(input, unchanged);
|
||||
assert!(std::sync::Arc::ptr_eq(&doc, &s.doc));
|
||||
@@ -76,3 +84,63 @@ fn invalid_or_unavailable_union_preserves_stale_scene_before_capture_or_replacem
|
||||
assert_eq!(host.admitted_bytes(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_finite_sun_common_edit_keeps_raw_radiance_identity_and_undo() {
|
||||
let mut s = Session::default();
|
||||
let sun = json!({"direction":[0.2,-0.3,0.9],"angular_radius_rad":0.02,"radiance":[301.25,202.5,103.75]});
|
||||
s.execute("render.settings.set",&json!({"name":"CPU Sun","set":{"width":16,"height":12,"job":{"method":"cpu_raytrace","options":{
|
||||
"path":{"max_depth":4},"progressive":{"samples_per_pixel":3,"seed":81},"sun":sun,"punctual_lights":[],"area_lights":[],"lights":[{"direction":[0,0,1],"color":[1,0.5,0.25],"intensity":2}]}}}})).unwrap();
|
||||
let before = s.doc.render.setups["CPU Sun"].clone();
|
||||
let rows = crate::render_lights::inspect(&before).unwrap();
|
||||
assert_eq!(rows.len(), 2);
|
||||
assert_eq!(rows[0].id, "directional:0");
|
||||
assert_eq!(rows[1].id, "directional:1");
|
||||
let mut exact = before.clone();
|
||||
crate::render_lights::write(&mut exact, &rows).unwrap();
|
||||
assert_eq!(exact, before);
|
||||
let undo = s.undo.len();
|
||||
s.execute("render.lights.set", &json!({"name":"CPU Sun","id":"directional:1","set":{"intensity_ev":2.0}})).unwrap();
|
||||
let changed = s.doc.render.setups["CPU Sun"].clone();
|
||||
assert_eq!(serde_json::to_value(&changed).unwrap()["job"]["options"]["sun"], sun);
|
||||
let edited = crate::render_lights::inspect(&changed).unwrap();
|
||||
assert_eq!((edited[1].intensity, edited[1].colour), (4.0, [1.0, 0.5, 0.25]));
|
||||
assert_eq!(edited[1].geometry, rows[1].geometry);
|
||||
assert_eq!(s.undo.len(), undo + 1);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc.render.setups["CPU Sun"], before);
|
||||
s.execute("edit.redo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc.render.setups["CPU Sun"], changed);
|
||||
let document = s.doc.clone();
|
||||
let history = (s.undo.len(), s.redo.len(), s.revision);
|
||||
let mut without_path = serde_json::to_value(&changed).unwrap();
|
||||
without_path["job"]["options"]["path"] = Value::Null;
|
||||
assert!(s.execute("render.settings.set", &json!({"name":"CPU Sun","set":without_path})).is_err());
|
||||
assert!(std::sync::Arc::ptr_eq(&document, &s.doc));
|
||||
assert_eq!(history, (s.undo.len(), s.redo.len(), s.revision));
|
||||
// Radius zero retains the pre-existing hard-source representation without Path.
|
||||
s.execute("render.settings.set",&json!({"name":"CPU hard","set":{"job":{"method":"cpu_raytrace","options":{"lights":[{"direction":[0,0,1],"color":[1,1,1],"intensity":1}]}}}})).unwrap();
|
||||
let hard = crate::render_lights::inspect(&s.doc.render.setups["CPU hard"]).unwrap();
|
||||
assert!(matches!(hard[0].geometry, crate::schema::render_lights::Geometry::Directional { angular_radius_rad: None, .. }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cpu_sun_add_remove_returns_actual_canonical_addresses_and_preserves_other_sources() {
|
||||
let mut s = Session::default();
|
||||
s.execute("render.settings.set",&json!({"name":"CPU rig","set":{"width":16,"height":12,"job":{"method":"cpu_raytrace","options":{
|
||||
"path":{"max_depth":4},"progressive":{"samples_per_pixel":3,"seed":81},"punctual_lights":[],"area_lights":[],"lights":[{"direction":[0,0,1],"color":[1,0.5,0.25],"intensity":2}]}}}})).unwrap();
|
||||
let before = s.doc.render.setups["CPU rig"].clone();
|
||||
let reply = s.execute("render.lights.add", &json!({"name":"CPU rig","set":{"kind":"directional","softness":0.1}})).unwrap();
|
||||
assert_eq!(reply["id"], "directional:0");
|
||||
let rows = crate::render_lights::inspect(&s.doc.render.setups["CPU rig"]).unwrap();
|
||||
assert_eq!(rows[1].id, "directional:1");
|
||||
assert_eq!(reply["id_remap"][0]["after_id"], "directional:1");
|
||||
let mut filtered = s.doc.render.setups["CPU rig"].clone();
|
||||
let visibility: crate::schema::render_lights::Visibility = serde_json::from_value(json!({"muted":["directional:0"]})).unwrap();
|
||||
crate::render_lights::filter(&mut filtered, &visibility).unwrap();
|
||||
let Some(solidcraft_doc::render_settings::RenderJob::CpuRaytrace { options, .. }) = filtered.job else { panic!("CPU expected") };
|
||||
assert_eq!(options.sun.unwrap().radiance, [0.0; 3]);
|
||||
assert_eq!(options.lights.as_ref().unwrap()[0].intensity, 2.0);
|
||||
s.execute("render.lights.remove", &json!({"name":"CPU rig","id":"directional:0"})).unwrap();
|
||||
assert_eq!(s.doc.render.setups["CPU rig"], before);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user